/* Silences d'Or: the Catalogue kit (core.css + catalogue.css) with a gold signal colour, plus the site's own parts. */

/* ---------- gold ---------- */
:root[data-site=sdo] { --accent: #946800; --on-accent: #ffffff; --gold-soft: #f6ecd2; --danger: #c4231d; }
:root[data-site=sdo][data-scheme=dark] { --accent: #f0b93a; --on-accent: #0d0d0d; --gold-soft: #2a2210; --danger: #ff6a5c; }
@media (prefers-color-scheme: dark) {
  :root[data-site=sdo]:not([data-scheme]) { --accent: #f0b93a; --on-accent: #0d0d0d; --gold-soft: #2a2210; --danger: #ff6a5c; }
}
/* destructive actions and errors are red, not the gold signal colour */
.danger, .link-btn.danger { color: var(--danger); }
.flash.error { border-color: var(--danger); color: var(--danger); }
.field .error, .error { color: var(--danger); }
.btn-danger, button.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover, button.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

/* ---------- masthead ---------- */
.wordmark { display: inline-flex; align-items: baseline; gap: .1em; }
.medal { display: inline-block; width: .55em; height: .55em; background: var(--accent); margin-right: .4em; align-self: center; }
.avatar.initial { display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .9rem;
  background: var(--accent); color: var(--on-accent); }
@media (max-width: 44rem) { .nav-login { margin-left: auto; } }

.site-foot { align-items: center; }
.site-foot .scheme { margin-left: auto; font-size: .8rem; color: var(--muted); text-decoration: none; }
.site-foot .scheme:hover { color: var(--accent); }
/* the Chiktoverse's mark (its favicon without the black square), a small link at the far right */
/* At rest: three clearly different greys (back to front, lighter to darker); on hover: the real colours.
   The cards' thin edges take the page colour. */
.verse-mark { display: inline-flex; position: relative; top: -2px; }
.verse-mark svg { width: 1rem; height: 1rem; }
.verse-mark rect { transition: fill .15s; }
.verse-mark .edge { fill: var(--paper); }
.verse-mark .v1 { fill: color-mix(in srgb, var(--ink) 25%, var(--paper)); }
.verse-mark .v2 { fill: color-mix(in srgb, var(--ink) 50%, var(--paper)); }
.verse-mark .v3 { fill: color-mix(in srgb, var(--ink) 80%, var(--paper)); }
.verse-mark:hover .v1, .verse-mark:focus-visible .v1 { fill: #00916b; }
.verse-mark:hover .v2, .verse-mark:focus-visible .v2 { fill: #e86100; }
.verse-mark:hover .v3, .verse-mark:focus-visible .v3 { fill: #d4127a; }

.flash.success { border-color: var(--accent); }
.crumbs { margin-bottom: .75rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a::before { content: "← "; }
.crumbs a:hover { color: var(--accent); }

/* ---------- home ---------- */
.hero { margin-bottom: 3rem; }
.hero h1 { font-size: clamp(2.8rem, 9vw, 6.2rem); }
.countdown { border-top: 3px solid var(--ink); margin-top: 1.75rem; padding-top: 1rem; }
.countdown-lead { font-size: 1.15rem; font-weight: 600; margin: 0; }
.countdown-time { font-size: clamp(3rem, 13vw, 8.5rem); line-height: 1; color: var(--accent); margin: .2rem 0 .4rem;
  white-space: nowrap; }
.countdown-time small { font-size: .32em; color: var(--ink); font-stretch: 100%; font-weight: 700; margin-left: .06em; margin-right: .3em;
  letter-spacing: 0; }
.countdown-end { margin: 0; }

.prose { max-width: 46rem; }
.prose p, .prose li { font-size: 1.05rem; }
.prose h2 { margin: 1.5rem 0 .6rem; }
.prose blockquote { margin: 1rem 0; padding-left: 1rem; border-left: 3px solid var(--accent); color: var(--ink-2); }
.lede p { margin: 0 0 .6rem; }

/* ---------- categories ---------- */
.page-head .big-count small { font-size: .45em; color: var(--muted); }
.legend { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-bottom: .6rem; }
.legend .state + .state, .legend .state:not(:first-child) { margin-left: 1rem; }
.state { display: inline-flex; align-items: center; justify-content: center; }
.state .icon { width: 1.35em; height: 1.35em; }
.state.done { color: var(--accent); }
.state.todo { color: var(--muted); }
.cat-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); max-width: 52rem; }
.cat-list > li { border-bottom: 1px solid var(--rule); }
.cat-list a { display: flex; align-items: center; gap: 1.1rem; padding: .95rem 0; text-decoration: none; }
.cat-list a:hover .cat-title { color: var(--accent); }
.cat-num { font-size: 1.9rem; line-height: 1; color: var(--muted); min-width: 2.2ch; }
.cat-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.cat-title { font-weight: 700; font-size: 1.12rem; line-height: 1.3; }
.cat-list .state .icon { width: 1.6em; height: 1.6em; }

/* ---------- one category ---------- */
.cat-head h1 { font-size: clamp(2rem, 5.5vw, 3.6rem); }
.cat-intro { display: grid; grid-template-columns: minmax(0, 1fr) 18rem; gap: 2.5rem; margin-bottom: 2.75rem; align-items: start; }
.rules { border-top: 3px solid var(--ink); padding-top: .55rem; }
.rules dl { margin: .7rem 0 0; display: grid; grid-template-columns: auto 1fr; gap: .35rem .9rem; }
.rules dt { font-weight: 700; color: var(--muted); text-transform: uppercase; font-size: .7rem; letter-spacing: .07em; padding-top: .15rem; }
.rules dd { margin: 0; }
@media (max-width: 52rem) { .cat-intro { grid-template-columns: 1fr; gap: 1.5rem; } }

.vote-status { margin-left: auto; display: inline-flex; align-items: center; gap: .35rem; font-size: .95rem; }
.ballot-section { max-width: 52rem; }

.slots { list-style: none; margin: 0; padding: 0; }
.slot { display: flex; align-items: center; gap: .9rem; padding: .55rem 0; border-bottom: 1px solid var(--rule); position: relative; }
.slot .rank { width: 3.2rem; flex: none; display: flex; flex-direction: column; align-items: flex-start; line-height: 1; }
.slot .rank .num { font-size: 2rem; }
.slot .rank small { font-size: .68rem; color: var(--muted); font-weight: 600; margin-top: .15rem; white-space: nowrap; }
.slot:not(.empty) .rank .num { color: var(--accent); }
.slot-body { flex: 1; min-width: 0; position: relative; }
.slot-tools { display: flex; gap: 0; flex: none; }
.slot-tools .btn-quiet { padding: .4rem; }
.slot.empty .slot-tools { display: none; }
.picked { display: flex; align-items: center; gap: .8rem; min-height: 3.4rem; }
.picked-text { display: flex; flex-direction: column; min-width: 0; }
.picked-name { font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.cover { width: 2.5rem; height: 3.35rem; flex: none; background: var(--paper-2); overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover:empty::after { content: ""; display: block; width: 100%; height: 100%;
  background: linear-gradient(135deg, transparent 47%, var(--rule) 47% 53%, transparent 53%); }
.finder input { padding-block: .75rem; }

.options { position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 30; list-style: none; margin: 0; padding: 0;
  background: var(--paper); border: 1px solid var(--ink); max-height: 23rem; overflow-y: auto;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .12); }
.options [role=option] { display: flex; align-items: center; gap: .7rem; padding: .45rem .7rem; cursor: pointer; border-bottom: 1px solid var(--rule); }
.options [role=option]:last-child { border-bottom: 0; }
.options [role=option][aria-selected=true], .options [role=option]:hover { background: var(--gold-soft); }
.options .cover { width: 2rem; height: 2.65rem; }
.opt-text { display: flex; flex-direction: column; min-width: 0; }
.opt-name { font-weight: 600; line-height: 1.25; }
.option-suggest { color: var(--accent); }
.option-suggest .opt-name { font-weight: 700; }
.option-suggest .opt-detail { color: var(--ink-2); }
.option-note { padding: .55rem .7rem; border-bottom: 1px solid var(--rule); }

.ballot-submit { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1.1rem 0; }
.ballot-submit button { padding: .8rem 1.5rem; font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 800; }
.ballot.dirty .ballot-submit { position: sticky; bottom: 0; background: var(--paper); border-top: 1px solid var(--ink); z-index: 5; }
.ballot.readonly .slot { padding: .45rem 0; }

.cat-nav { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--ink); padding-top: .8rem; margin-top: 2rem; max-width: 52rem; }
.cat-nav a { display: flex; flex-direction: column; text-decoration: none; font-weight: 700; max-width: 48%; }
.cat-nav .next { text-align: right; margin-left: auto; }
.cat-nav a:hover { color: var(--accent); }

@media (max-width: 44rem) {
  .slot { gap: .6rem; align-items: flex-start; }
  .slot .rank { width: 2.3rem; padding-top: .55rem; }
  .slot .rank .num { font-size: 1.6rem; }
  .slot-tools { flex-direction: column; }
  .slot-tools .btn-quiet { padding: .25rem; }
  .slot.empty .slot-tools { display: none; }
  .picked { min-height: 3rem; }
  .ballot-submit { position: sticky; bottom: 0; background: var(--paper); border-top: 1px solid var(--ink); z-index: 5; }
  .ballot-submit button { flex: 1; }
}

/* ---------- login ---------- */
.btn-discord, button.btn-discord { background: #5865f2; border-color: #5865f2; color: #fff; padding: .85rem 1.2rem; font-size: 1rem; }
.btn-discord:hover, button.btn-discord:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-discord .icon { width: 1.35em; height: 1.35em; }
.discord-form { margin: 1.5rem 0 .6rem; }
.password-login { margin-top: 2.25rem; border-top: 1px solid var(--rule); padding-top: 1rem; }
.password-login summary { cursor: pointer; font-weight: 600; }
.password-login form { margin-top: 1.25rem; }
.account-head { align-items: center; }

/* ---------- results ---------- */
.podium { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem 1.5rem; }
.podium li { display: grid; grid-template-columns: auto 5.5rem minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: .9rem;
  row-gap: .25rem; align-items: start; }
.podium .place { grid-row: span 2; font-size: 2.4rem; line-height: 1; color: var(--muted); min-width: 1ch; }
.podium .place-1 .place { color: var(--accent); }
.podium .cover { grid-row: span 2; width: 5.5rem; height: auto; aspect-ratio: 3 / 4; }
.podium .place-1 .cover { border: 3px solid var(--accent); }
.podium-name { font-weight: 800; font-size: 1.05rem; line-height: 1.2; overflow-wrap: anywhere; }
.rows.rest { margin-top: 1.5rem; }
.place-small { min-width: 2ch; color: var(--muted); }
.podium .tiebreak { display: block; margin-top: .2rem; color: var(--accent); }
.tiebreak-inline { white-space: normal; }
@media (max-width: 60rem) {
  .podium { grid-template-columns: 1fr; }
  .podium li { grid-template-columns: auto 4rem minmax(0, 1fr); align-items: center; grid-template-rows: 1fr 1fr; }
  /* name and score together, centred against the cover */
  .podium .podium-name { align-self: end; }
  .podium .podium-name + .small { align-self: start; }
  .podium .cover { width: 4rem; }
  .podium .place { font-size: 2.1rem; }
}

/* ---------- organisers ---------- */
.subnav, .tabs { display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; margin: -1rem 0 2rem; padding-bottom: .6rem; border-bottom: 1px solid var(--rule); }
.subnav a, .tabs a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: .95rem; }
.subnav a:hover, .tabs a:hover { color: var(--ink); }
.subnav a[aria-current], .tabs a[aria-current] { color: var(--ink); box-shadow: 0 2px 0 var(--accent); }
.tabs { margin: 0 0 1rem; border-bottom: 0; }
.filters { display: flex; flex-wrap: wrap; gap: .75rem 2rem; align-items: center; margin-bottom: 1rem; }
.filters .tabs { margin: 0; padding: 0; }
.filters input[type=search] { max-width: 18rem; }
.figure a { text-decoration: none; }
.people { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.person { display: flex; gap: 1.5rem; padding: 1rem 0; border-bottom: 1px solid var(--rule); align-items: flex-start; }
.person-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.person-main blockquote { margin: .2rem 0; padding-left: .8rem; border-left: 3px solid var(--rule); color: var(--ink-2); }
.person-actions { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; align-items: center; max-width: 24rem; }
.note-form, .inline-form { display: flex; gap: .4rem; align-items: center; max-width: 34rem; }
.note-form input, .inline-form input { padding: .35rem .55rem; font-size: .9rem; }
.inline-form .year { max-width: 6rem; }
.resolve { width: 24rem; max-width: 100%; display: flex; flex-direction: column; gap: .6rem; }
.resolve .slot { border: 0; padding: 0; }
.resolve details summary { cursor: pointer; color: var(--muted); }
.resolve details form { margin-top: .5rem; }
.link-form { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }
.link-form .slot { width: 100%; }
.copy-field { font-family: var(--mono); font-size: .85rem; margin-top: .5rem; }
.form-wide { max-width: 44rem; }
.check-field .switch-row { text-transform: none; }
tr.far { color: var(--muted); }
@media (max-width: 44rem) {
  .person { flex-direction: column; gap: .75rem; }
  .person-actions { justify-content: flex-start; }
  .resolve { width: 100%; }
}
.person-line { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 60; top: 1rem; right: 1rem; display: flex; flex-direction: column; gap: .5rem;
  width: min(26rem, calc(100vw - 2rem)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: .7rem; padding: .75rem .6rem .75rem .9rem;
  background: var(--ink); color: var(--paper); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); font-weight: 500; line-height: 1.4;
  animation: toast-in .25s ease-out; transition: opacity .3s, transform .3s; }
.toast.leaving { opacity: 0; transform: translateX(1rem); }
.toast-mark { width: .6rem; height: .6rem; background: var(--accent); flex: none; margin-top: .4rem; }
.toast.error .toast-mark { background: var(--danger); }
.toast-text { flex: 1; }
.toast-close, button.toast-close { border: 0; padding: .15rem; background: none; color: inherit; opacity: .6; }
.toast-close:hover, button.toast-close:hover { background: none; color: inherit; opacity: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-.5rem); } }
@media (max-width: 44rem) { .toasts { top: auto; bottom: 5.5rem; right: 1rem; left: 1rem; width: auto; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; transition: none; } }

/* ---------- drag and drop ---------- */
[data-grip] { touch-action: none; -webkit-user-select: none; user-select: none; }
.slot:not(.empty) .rank[data-grip] { cursor: grab; }
.grip { display: inline-flex; align-items: center; justify-content: center; padding: .4rem; color: var(--muted); cursor: grab; }
.grip:hover { color: var(--accent); }
.slot.empty .grip { display: none; }
.slots.sorting, .slots.sorting * { cursor: grabbing !important; user-select: none; }
.slots.sorting .slot:not(.dragging) { opacity: .75; }
.slot.dragging { position: relative; z-index: 20; background: var(--paper); outline: 2px solid var(--accent); outline-offset: -2px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .28); }
.slot.dragging .grip, .slot.dragging .rank .num { color: var(--accent); }
.slot.dropped { animation: dropped .7s ease-out; }
@keyframes dropped { from { background: var(--gold-soft); } }
@media (max-width: 44rem) {
  .grip { width: 2.6rem; height: 2.6rem; padding: 0; color: var(--ink-2); }
  .grip .icon { width: 1.4em; height: 1.4em; }
}
@media (prefers-reduced-motion: reduce) { .slot.dropped { animation: none; } }
@media (max-width: 44rem) { .slot-tools [data-move] { display: none; } .slot-tools { flex-direction: row; align-items: center; } }
.cat-meta .filled { color: var(--ink-2); font-weight: 700; }
.cat-meta .filled.full { color: var(--accent); }
.figures.stats-2 { border-top-color: var(--rule); margin-bottom: .8rem; }
.figure .num small { font-size: .5em; }

/* ---------- login: how it goes with Discord ---------- */
.login-layout { display: grid; grid-template-columns: minmax(0, 30rem) minmax(0, 1fr); gap: 4rem; align-items: start; }
.login-layout .panel { max-width: none; }
.how { border-top: 3px solid var(--ink); padding-top: .6rem; }
.how h2 { margin-bottom: 1.1rem; }
.steps { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.steps > li { display: flex; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--rule); }
.steps p { margin: .2rem 0 0; }
.step-num { font-size: 1.9rem; line-height: 1; color: var(--accent); min-width: 1.2ch; }
.how-notes p { margin: 0 0 .6rem; }

/* An illustration of Discord's authorisation window (always dark, like Discord's) */
.dc-mock { margin-top: .9rem; max-width: 22rem; background: #313338; color: #dbdee1; border-radius: 8px; padding: 1.1rem 1.1rem 1rem;
  font-size: .85rem; line-height: 1.35; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); user-select: none; }
.dc-head { display: flex; align-items: center; justify-content: center; gap: .7rem; margin-bottom: .8rem; }
.dc-app, .dc-user { width: 2.6rem; height: 2.6rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.dc-app { background: #f0b93a; }
.dc-app-mark { width: .9rem; height: .9rem; background: #1e1f22; }
.dc-user { background: #5865f2; color: #fff; }
.dc-user .icon { width: 1.4rem; height: 1.4rem; }
.dc-dots { color: #949ba4; letter-spacing: .1em; }
.dc-kicker { text-align: center; color: #b5bac1; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; margin: 0; }
.dc-title { text-align: center; color: #f2f3f5; font-weight: 800; font-size: 1.15rem; margin: .1rem 0 0; }
.dc-sub { text-align: center; color: #b5bac1; margin: 0 0 .9rem; }
.dc-label { color: #b5bac1; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; margin: 0 0 .4rem;
  border-top: 1px solid #3f4147; padding-top: .8rem; }
.dc-perms { list-style: none; margin: 0 0 1rem; padding: 0; }
.dc-perms li { display: flex; gap: .55rem; align-items: flex-start; padding: .3rem 0; }
.dc-ok { width: 1.2rem; height: 1.2rem; border-radius: 50%; background: #23a55a; color: #fff; display: inline-flex; align-items: center;
  justify-content: center; flex: none; }
.dc-ok .icon { width: .8rem; height: .8rem; }
.dc-actions { display: flex; justify-content: flex-end; gap: .6rem; background: #2b2d31; margin: 0 -1.1rem -1rem; padding: .8rem 1.1rem;
  border-radius: 0 0 8px 8px; }
.dc-cancel { color: #dbdee1; padding: .45rem .8rem; }
.dc-authorize { background: #5865f2; color: #fff; padding: .45rem 1rem; border-radius: 4px; font-weight: 600;
  outline: 2px solid #f0b93a; outline-offset: 3px; }
@media (max-width: 60rem) { .login-layout { grid-template-columns: 1fr; gap: 2.5rem; } }

.votes-filters { gap: .6rem; }
.votes-filters input[type=search] { flex: 1 1 14rem; max-width: 24rem; }
.votes-filters select { flex: 0 1 15rem; width: auto; min-width: 0; }
.pager { display: flex; gap: 1.5rem; align-items: center; padding: 1rem 0; }
.game-head { align-items: center; flex-wrap: nowrap; }
.game-head .cover { width: 4.5rem; height: 6rem; }
.game-head p { margin: .3rem 0 0; }

/* confirming a suggestion */
.confirm { border: 1px solid var(--accent); background: var(--gold-soft); padding: .7rem .8rem; }
.confirm p { margin: 0 0 .6rem; font-size: .92rem; }
.confirm.refused { border-color: var(--danger); }
.confirm-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- organisers: fixing the data ---------- */
.nowrap { white-space: nowrap; }
.fix-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; }
.fix-card { border: 1px solid var(--rule); padding: .9rem 1rem 1rem; }
.fix-card h3 { margin: 0 0 .3rem; }
.fix-card p { margin: 0 0 .8rem; }
.exclude-form { display: flex; flex-wrap: wrap; gap: .5rem; }
.exclude-form select { flex: 1 1 12rem; width: auto; }
.exclude-form input { flex: 2 1 14rem; }
.excluded-note { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.excluded-note form { margin-left: auto; }
.merge-steps { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 1.5rem; align-items: start; margin-bottom: 2rem; }
.merge-arrow { font-size: 2.4rem; font-weight: 800; color: var(--accent); padding-top: 1.6rem; }
.merge-game { display: flex; gap: .8rem; align-items: flex-start; border: 1px solid var(--rule); padding: .8rem; }
.merge-game .cover { width: 3.4rem; height: 4.5rem; }
.merge-search { display: flex; gap: .5rem; margin-bottom: .6rem; }
.merge-candidates li { padding: .55rem 0; }
.effects { margin: 0 0 1rem; padding-left: 1.2rem; }
.effects li { margin-bottom: .45rem; }
.history { margin-top: .6rem; }
.history summary { cursor: pointer; color: var(--muted); }
.history-list { margin: .5rem 0 0; padding-left: 1.2rem; color: var(--ink-2); }
.history-list li { margin-bottom: .35rem; }
.compare tr.changed td { background: var(--gold-soft); }
.snapshot-form input { flex: 1 1 18rem; max-width: 28rem; }
@media (max-width: 44rem) {
  .merge-steps { grid-template-columns: 1fr; gap: .8rem; }
  .merge-arrow { padding: 0; transform: rotate(90deg); justify-self: start; }
}

/* ---------- organisers: games ---------- */
.games-table .game-cell { display: flex; gap: .7rem; align-items: flex-start; }
.games-table .game-cell > span:last-child { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.games-table .cover { width: 2.2rem; height: 2.9rem; }
.games-table .tag { align-self: flex-start; }
.look-alikes { color: var(--ink-2); }
.votes-filters .switch-row { margin: 0; white-space: nowrap; }

/* ---------- test phase ---------- */
.test-banner { background: var(--accent); color: var(--on-accent); font-size: .9rem; }
.pause-banner { background: var(--danger); color: #fff; }
.test-banner > div { max-width: var(--wide); margin: 0 auto; padding: .55rem 1.5rem; }
@media (max-width: 44rem) { .test-banner > div { padding: .5rem 1rem; } }
.test-card.on { border-left: 4px solid var(--accent); padding-left: 1rem; }
.go-live-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.5rem; margin: 1.5rem 0; }
.go-live-grid h2 { margin-bottom: .6rem; }
.go-live-form { border: 1px solid var(--accent); padding: 1rem 1.1rem; max-width: 40rem; }
.go-live-form .switch-row { margin-top: .4rem; }

/* a reason typed by the organisers, shown to voters */
.orga-reason { color: var(--ink-2); }
.orga-reason q { font-style: italic; quotes: "« " " »"; }

/* ---------- Markdown toolbar (organisers' text areas) ---------- */
.md-editor { border: 1px solid var(--rule); }
.md-editor:focus-within { border-color: var(--ink); }
.md-toolbar { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 1px solid var(--rule); background: var(--paper-2); }
.md-toolbar .md-btn { border: 0; border-right: 1px solid var(--rule); padding: .4rem .7rem; font-size: .8rem; font-weight: 600;
  background: transparent; color: var(--ink-2); }
.md-toolbar .md-btn:hover { background: var(--paper); color: var(--accent); }
.md-toolbar .md-bold { font-weight: 800; }
.md-toolbar .md-italic { font-style: italic; }
.md-toolbar .md-preview { margin-left: auto; border-right: 0; border-left: 1px solid var(--rule); }
.md-toolbar .md-preview[aria-pressed=true] { background: var(--accent); color: var(--on-accent); }
.md-toolbar.previewing .md-btn:not(.md-preview) { opacity: .35; pointer-events: none; }
.md-editor textarea { border: 0; box-shadow: none; display: block; }
.md-editor textarea:focus { box-shadow: none; }
.md-preview.prose { padding: .7rem .8rem; max-width: none; }
.md-preview.prose > :last-child { margin-bottom: 0; }

/* ---------- organisers: live filters and sortable tables ---------- */
.is-live .live-submit { display: none; }
[data-live-region][aria-busy=true] { opacity: .55; transition: opacity .15s .15s; }
/* loading feedback under live filter forms: keeps its height so nothing jumps */
.live-status { position: relative; min-height: 1.4rem; margin: -.5rem 0 .6rem; font-size: .82rem; color: var(--muted); }
.live-status .live-bar { position: absolute; top: 0; left: 0; right: 0; height: 2px; overflow: hidden; opacity: 0; }
.live-status .live-text { display: block; padding-top: .35rem; }
.live-status.on .live-bar { opacity: 1; background: var(--rule); }
.live-status.on .live-bar::before { content: ""; position: absolute; top: 0; bottom: 0; width: 35%; background: var(--accent);
  animation: live-slide 1.1s ease-in-out infinite; }
.live-status.error { color: var(--danger); font-weight: 600; }
@keyframes live-slide { from { left: -35%; } to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .live-status.on .live-bar::before { animation: none; left: 0; width: 100%; opacity: .6; } }
.ledger th.sortable { padding: 0; }
.ledger th.sortable > a, .ledger th.sortable > .sort-button { display: inline-flex; align-items: center; gap: .3rem; width: 100%;
  padding: .5rem .75rem .5rem 0; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit;
  text-decoration: none; background: none; border: 0; cursor: pointer; }
.ledger th.sortable.n > a, .ledger th.sortable.n > .sort-button { justify-content: flex-end; }
.ledger th.sortable > a:hover, .ledger th.sortable > .sort-button:hover { color: var(--ink); }
.ledger th.sortable > a::after, .ledger th.sortable > .sort-button::after { content: "↕"; opacity: .35; font-size: .85em; }
.ledger th[aria-sort=ascending] > a::after, .ledger th[aria-sort=ascending] > .sort-button::after { content: "↑"; opacity: 1; color: var(--accent); }
.ledger th[aria-sort=descending] > a::after, .ledger th[aria-sort=descending] > .sort-button::after { content: "↓"; opacity: 1; color: var(--accent); }
.ledger th[aria-sort=ascending], .ledger th[aria-sort=descending] { color: var(--ink); }
mark.hl { background: color-mix(in srgb, var(--accent) 30%, transparent); color: inherit; padding: 0; border-bottom: 2px solid var(--accent); }
.filtered-out { display: none; }

/* ---------- organisers: catalogue ---------- */
.catalogue-filters .filter-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; flex-basis: 100%; }
.catalogue-filters .inline-field { display: inline-flex; align-items: center; gap: .4rem; margin: 0; font-size: .9rem; white-space: nowrap; }
.catalogue-filters .inline-field input { width: 10.5rem; }
.catalogue-filters .platform-field { flex: 1 1 14rem; max-width: 20rem; }
.type-boxes { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; flex-basis: 100%; }
.type-boxes legend { padding: 0; margin-bottom: .35rem; }
.type-boxes .check { display: inline-flex; align-items: center; gap: .35rem; margin: 0; font-size: .9rem; white-space: nowrap; }
.catalogue-table td .tag { margin-left: .3rem; }
.catalogue-filters label { text-transform: none; letter-spacing: normal; font-weight: 400; color: var(--ink); }
.catalogue-filters select[name=depuis] { flex: 0 1 22rem; }
.catalogue-mode .check { display: inline-flex; align-items: center; gap: .35rem; margin: 0 1.1rem 0 0; font-weight: 500; }
.catalogue-filters[data-mode=tous] .only-regles, .catalogue-filters[data-mode=regles] .only-tous { display: none; }
.catalogue-summary { font-weight: 500; margin: 0 0 .35rem; }
.catalogue-filters .filter-row select { flex: 0 1 auto; width: auto; }

/* ---------- organisers: proposals and board games ---------- */
.proposals { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.proposal { padding: 1.1rem 0 1.2rem; border-bottom: 1px solid var(--rule); }
.proposal-head { margin-bottom: .7rem; }
.proposal-names { list-style: none; margin: .3rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.proposal-names .check, .proposal .check { display: inline-flex; gap: .4rem; align-items: center; margin: 0; text-transform: none;
  letter-spacing: normal; font-weight: 400; color: var(--ink); font-size: .95rem; }
.lookalikes { border-left: 3px solid var(--accent); padding: .4rem 0 .4rem .8rem; margin: 0 0 .9rem; }
.lookalikes p { margin: 0 0 .4rem; }
.lookalikes ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.proposal-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem 1.5rem; }
.proposal-action { display: flex; flex-direction: column; gap: .45rem; align-items: flex-start; }
.proposal-action p { margin: 0; }
.proposal-action .slot { border: 0; padding: 0; width: 100%; }
.proposal-action .inline-form { width: 100%; }
.proposal-action .inline-form .year { max-width: 4.5rem; flex: none; }
.proposal-action .inline-form input[name=name], .proposal-action .inline-form input[name=note] { flex: 1; min-width: 0; }
.proposals-news ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.add-games textarea { max-width: 40rem; }
.board-actions details { font-size: .9rem; }
.board-actions details[open] { display: flex; flex-direction: column; gap: .5rem; padding: .4rem 0; }
.board-actions .inline-form { flex-wrap: wrap; }
.board-table td.board-actions { width: 1%; white-space: nowrap; }
.board-table td.board-actions details[open] { white-space: normal; min-width: 22rem; }
.preview-table td:first-child { width: 2rem; }

/* ---------- a short organisers' list shown as buttons on the ballot ---------- */
.choice-list { margin-top: 1rem; }
.choice-list p { margin: 0 0 .5rem; }
.choice-list ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem; }
.choice-btn { border: 1px solid var(--rule); background: var(--paper); color: var(--ink); padding: .45rem .8rem; font-size: .92rem;
  font-weight: 500; text-align: left; transition: background .12s, border-color .12s; }
.choice-btn:hover { border-color: var(--ink); }
.choice-btn[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.choice-btn[aria-pressed=true]::before { content: "✓ "; }
.choice-btn.no-room { border-color: var(--danger); animation: no-room .3s; }
@keyframes no-room { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }


/* ---------- public page of a voter's choices (/partage/…) ---------- */
.share-mine { margin-bottom: 2rem; }
.share-hero { padding-bottom: 1.5rem; margin-bottom: 2.5rem; border-bottom: 3px solid var(--ink); }
.share-kicker { display: flex; align-items: center; margin: 0 0 1rem; font-weight: 800; font-size: .8rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.share-who { display: flex; align-items: center; gap: 1.1rem; }
.share-who h1 { margin: 0; font-size: clamp(2rem, 6.5vw, 4.4rem); line-height: 1; overflow-wrap: anywhere; }
.share-name { color: var(--accent); }
.share-avatar { width: clamp(3.2rem, 9vw, 5rem); height: clamp(3.2rem, 9vw, 5rem); border-radius: 50%; flex: none;
  object-fit: cover; box-shadow: 0 0 0 3px var(--accent); }
.share-avatar.initial { display: inline-flex; align-items: center; justify-content: center; font-weight: 800;
  font-size: clamp(1.4rem, 4vw, 2.2rem); background: var(--accent); color: var(--on-accent); }
.share-meta { margin: 1rem 0 0; color: var(--muted); }
.share-meta .num { color: var(--ink); font-weight: 800; }

.share-cat { margin-bottom: 2.75rem; }
.share-cat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  border-bottom: 1px solid var(--rule); padding-bottom: .5rem; margin-bottom: 1rem; }
.share-cat-head h2 { margin: 0; font-size: 1.15rem; }
.share-cat-head h2 a { color: inherit; text-decoration: none; }
.share-cat-head h2 a:hover { color: var(--accent); }

/* in columns, read top to bottom: 2, 3, 4… then the next column */
.share-picks { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 2.5rem; }
.share-picks li { display: flex; align-items: center; gap: .8rem; min-width: 0; break-inside: avoid; margin-bottom: .6rem; }
.share-rank { min-width: 1.6ch; text-align: right; font-weight: 800; color: var(--muted); }
.share-pick-name { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.share-picks .tag { margin-left: .3rem; vertical-align: middle; }
/* the first of a ranked list, big: the voter's pick for the category */
.share-picks li.top { column-span: all; gap: 1.1rem; padding: .9rem 1rem .9rem .6rem; margin-bottom: 1rem;
  background: var(--gold-soft); border-left: 4px solid var(--accent); }
.share-picks li.top .share-rank { font-size: 2.6rem; line-height: 1; color: var(--accent); }
.share-picks li.top .cover { width: 5.5rem; height: auto; aspect-ratio: 3 / 4; }
.share-picks li.top .share-pick-name { font-size: clamp(1.25rem, 3.2vw, 1.75rem); font-weight: 800; }
.share-picks.no-covers li.top { padding: 1.1rem 1.1rem 1.1rem .8rem; }
.share-picks.unranked { columns: 3; }
.share-empty { font-size: 1.1rem; }

.share-cta { margin-top: 3.5rem; padding: 1.75rem; border: 3px solid var(--ink); }
.share-cta h2 { margin: 0 0 .5rem; font-size: 1.6rem; }
.share-cta p { margin: 0 0 1.1rem; }
@media (max-width: 44rem) {
  .share-picks, .share-picks.unranked { columns: 1; }
  .share-picks li.top .cover { width: 4.2rem; }
  .share-picks li.top .share-rank { font-size: 2.1rem; }
}

/* the voter's sharing box (categories page) */
.share-box { margin: 2.5rem 0 0; padding: 1.25rem 1.4rem; border: 1px solid var(--rule); border-left: 4px solid var(--accent); }
.share-box h2 { margin: 0 0 .35rem; font-size: 1.1rem; }
.share-box p { margin: 0 0 .9rem; }
.share-link { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.share-link input { flex: 1 1 18rem; min-width: 0; font-family: var(--mono); font-size: .9rem; }
.share-actions { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: center; }
.share-actions form { display: inline; }
.share-discord { margin: .6rem 0 1.4rem; }
.share-discord form { margin: 0 0 .5rem; }
.share-sub { margin: 0 0 .35rem; font-size: .95rem; }

/* journal */
.date-filter { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); }
.date-filter input { width: auto; }
.journal tr.by-voter td:first-child { box-shadow: inset 3px 0 0 var(--rule); }
.journal-filters .tabs { flex-basis: 100%; margin: 0 0 .3rem; }
.date-filter { text-transform: none; letter-spacing: 0; font-weight: 400; }

/* ---------- dashboard ---------- */
.stage { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.25rem 2rem;
  padding: 1.4rem 1.5rem; margin-bottom: 2.5rem; border: 1px solid var(--rule); border-left: 6px solid var(--muted); }
.stage-open, .stage-test { border-left-color: var(--accent); background: var(--gold-soft); }
.stage-closed { border-left-color: var(--ink); }
.stage-paused { border-left-color: var(--danger, #b3261e); }
.discord-bot { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem; margin: .5rem 0; }
.discord-bot .check { display: inline-flex; align-items: center; gap: .3rem; text-transform: none; letter-spacing: normal; font-weight: 400; font-size: .9rem; color: var(--ink); }
.discord-publish { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: .75rem 0; }
.stage-published { border-left-color: var(--accent); }
.stage-main { flex: 1 1 22rem; min-width: 0; }
.stage-main p { margin: 0; }
.stage-kicker { font-weight: 800; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.stage-title { font-size: clamp(1.7rem, 4.5vw, 2.6rem); font-weight: 800; line-height: 1.05; margin: .2rem 0 .45rem !important; }
.stage-dates { color: var(--ink-2); }
.stage-main .small + .small { margin-top: .5rem; }
.stage-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.stage-actions form { display: inline; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 0 2.5rem; }
@media (max-width: 60rem) { .dash-grid { grid-template-columns: 1fr; } }
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-list li { padding: .55rem 0 .55rem .9rem; border-bottom: 1px solid var(--rule); position: relative; }
.todo-list li::before { content: ""; position: absolute; left: 0; top: .95rem; width: .4rem; height: .4rem; background: var(--rule); }
.todo-list li.todo-urgent::before { background: var(--accent); }
.todo-list a { text-decoration: none; color: var(--ink); }
.todo-list a:hover { color: var(--accent); }
.todo-list .todo-info a { color: var(--ink-2); }
.all-clear { display: flex; align-items: center; gap: .5rem; color: var(--ink-2); }
.all-clear .icon, .all-clear svg { width: 1.1rem; height: 1.1rem; color: var(--accent); }
.figures-compact .num { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }

/* votes per day: one series, bars from a shared baseline, 2px gaps, rounded data end */
.day-chart { margin: 1.5rem 0 0; }
.day-chart figcaption { margin-bottom: .6rem; }
.day-bars { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 2px; height: 7.5rem; align-items: end; border-bottom: 1px solid var(--ink); }
.day-bars li { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch;
  position: relative; cursor: default; }
.day-bar { display: block; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.day-bar.zero { background: var(--rule); min-height: 2px; border-radius: 0; }
.day-bars li:hover .day-bar { filter: brightness(1.15); }
.day-label { position: absolute; bottom: -1.35rem; left: 0; right: 0; text-align: center; font-size: .7rem; color: var(--muted); }
.day-chart { padding-bottom: 1.4rem; }

.cat-progress .bar-cell { width: 34%; white-space: nowrap; }
.meter { display: inline-block; vertical-align: middle; width: calc(100% - 3.5rem); height: .5rem; background: var(--paper-2);
  margin-right: .5rem; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }

/* ---------- organisers: forms in groups ---------- */
.form-group { border: 0; border-top: 3px solid var(--ink); padding: 1rem 0 0; margin: 1rem 0 0; min-width: 0; }
.form-group > legend, .form-group > summary { font-weight: 800; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase;
  padding: 0 .6rem 0 0; }
.form-group > .stack { margin-top: .9rem; }
details.form-group > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: .5rem; }
details.form-group > summary::before { content: "+"; font-size: 1.1rem; line-height: 1; color: var(--accent); width: 1ch; }
details.form-group[open] > summary::before { content: "–"; }
.field[hidden] { display: none !important; }
.field .type-boxes { margin-top: .2rem; }
.field .type-boxes legend { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .5rem; }
.field .type-boxes .check { text-transform: none; letter-spacing: 0; font-weight: 400; }

/* reorder buttons */
.order-cell { width: 4.2rem; white-space: nowrap; }
.order-cell form { display: inline-flex; gap: 2px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem; padding: 0;
  background: transparent; border: 1px solid var(--rule); color: var(--ink); cursor: pointer; }
.icon-btn:hover:not(:disabled) { border-color: var(--ink); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn .icon { width: 1rem; height: 1rem; }

/* ---------- consistency pass ---------- */
.intro { margin: 0 0 1.75rem; max-width: 52rem; }
.intro p { margin: 0 0 .5rem; }
/* proposals: three roomy action cards, side by side when there is room */
.proposal-actions { grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: .75rem; }
.proposal-action { padding: .9rem 1rem 1rem; border: 1px solid var(--rule); background: var(--paper); }
.proposal-action .help { margin: 0; }
/* Gestion menu: one line that scrolls sideways on a phone */
@media (max-width: 44rem) {
  .subnav { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: none; gap: 1.1rem;
 }
  .edition-cats .opt { display: none; }
  .subnav::-webkit-scrollbar { display: none; }
  .stage { padding: 1.1rem; }
  .cat-progress .bar-cell { width: auto; }
  .meter { width: 4rem; }
}
/* on a phone, a table too wide for the screen scrolls by itself instead of the page */
@media (max-width: 44rem) {
  main .ledger { display: block; overflow-x: auto; max-width: 100%; }
}

/* Discord (the Yaourtière): the thread and sharing one's vote, under the ballot */
.discord-share { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--rule, currentColor); }
.discord-share h3 { margin: 0 0 .4rem; }
.discord-share form { margin: .5rem 0; }

/* ---------- confirmation dialog (sdo.js, [data-confirm]) ---------- */
.dialog { width: min(30rem, calc(100vw - 2rem)); max-width: none; padding: 0; border: 1px solid var(--ink);
  border-top: 6px solid var(--accent); background: var(--paper); color: var(--ink); box-shadow: 0 18px 50px rgba(0, 0, 0, .35); }
.dialog.danger { border-top-color: var(--danger); }
.dialog::backdrop { background: rgba(0, 0, 0, .55); }
.dialog form { padding: 1.3rem 1.4rem 1.2rem; }
.dialog-title { margin: 0 0 .45rem; font-size: 1.5rem; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; font-stretch: 85%;
  overflow-wrap: anywhere; text-wrap: balance; }
.dialog-text { margin: 0; color: var(--ink-2); }
.dialog-text:empty { display: none; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; margin-top: 1.4rem; }
.dialog .btn-danger { background: var(--danger); color: #fff; }
.dialog .btn-danger:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.dialog[open] { animation: dialog-in .18s ease-out; }
.dialog[open]::backdrop { animation: backdrop-in .18s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(.6rem); } }
@keyframes backdrop-in { from { opacity: 0; } }
@media (max-width: 44rem) {
  .dialog { margin: auto auto 1rem; }
  .dialog-actions button { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { .dialog[open], .dialog[open]::backdrop { animation: none; } }

/* Line breaks: no short last line in text, even lines in titles (browsers without it just wrap as before) */
p, li, dd, figcaption, .help, td { text-wrap: pretty; }
h1, h2, h3, .stage-title, .cat-title, .lede { text-wrap: balance; }
