/* Release Manager: art-deco board game on a felt table. */

:root {
  --felt-hi: #21503f;
  --felt: #14362c;
  --felt-lo: #0a1f19;
  --paper: #f3ead6;
  --paper-2: #e6d8ba;
  --ink: #2b2118;
  --ink-soft: #5c4a36;
  --gold: #c9a24a;
  --gold-hi: #f2d98c;
  --gold-lo: #8d6a24;
  --red: #a3262a;
  --green: #3f7a48;
  --manila: #d9b979;

  --font-deco: 'Limelight', Georgia, serif;
  --font-thin: 'Poiret One', 'Futura', 'Century Gothic', sans-serif;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-type: 'Special Elite', 'Courier New', monospace;

  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  color: var(--paper);
  font-family: var(--font-serif);
  background:
    var(--noise),
    radial-gradient(ellipse 90% 70% at 45% 40%, var(--felt-hi) 0%, var(--felt) 55%, var(--felt-lo) 100%);
  background-color: var(--felt);
  background-attachment: fixed;
}

button { font: inherit; color: inherit; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.icon { width: 1em; height: 1em; flex: none; }

/* ── Top bar ──────────────────────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 24px;
  border-bottom: 1px solid rgba(201, 162, 74, .35);
  background: linear-gradient(rgba(0, 0, 0, .35), rgba(0, 0, 0, .15));
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand__mark {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  font-family: var(--font-deco); font-size: 14px; color: var(--ink);
  background: linear-gradient(var(--gold-hi), var(--gold) 60%, var(--gold-lo));
  clip-path: polygon(25% 0, 75% 0, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0 75%, 0 25%);
}
.brand__name { font-family: var(--font-deco); font-size: 22px; color: var(--gold-hi); letter-spacing: .04em; }

.status {
  flex: 1;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 10px;
  font-family: var(--font-thin); font-weight: 700; font-size: 17px; letter-spacing: .06em;
  color: var(--paper);
}
.status b { font-family: var(--font-deco); font-weight: 400; color: var(--gold-hi); }
.status .sep { color: var(--gold); font-size: 9px; }
.status__phase { color: var(--gold-hi); }

.topbar__nav { display: flex; gap: 8px; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 8px 14px;
  font-family: var(--font-serif); font-weight: 700; font-size: 15px; letter-spacing: .1em; text-transform: uppercase;
  line-height: 1.15;
  color: var(--paper);
  background: linear-gradient(#26493d, #16302a);
  border: 1.5px solid var(--gold);
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 2px 0 rgba(0, 0, 0, .35);
  cursor: pointer;
  transition: transform .12s, filter .15s, opacity .15s;
}
.btn small {
  font-family: var(--font-serif); font-weight: 500; font-size: 12.5px; letter-spacing: .02em;
  text-transform: none; opacity: .85;
}
.btn:hover:not(:disabled) { filter: brightness(1.18); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .42; cursor: not-allowed; }
.btn:focus-visible, .deck:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }

.btn--primary {
  color: #241a0c;
  background: linear-gradient(var(--gold-hi), var(--gold) 55%, #a8812f);
  border-color: #6b4f1a;
}
.btn--ghost {
  padding: 6px 12px; font-size: 13px;
  background: transparent; border-color: rgba(201, 162, 74, .55); color: var(--gold-hi);
  box-shadow: none;
}
.btn--big { flex: 1; padding: 10px 14px; font-size: 18px; }
.btn--small { padding: 6px 12px; font-size: 13px; }

/* ── Table layout ─────────────────────────────────────────────────────────── */

.table {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-areas: "board side" "hand side";
  gap: 18px 22px;
  padding: 18px 22px 26px;
  max-width: 1720px;
  margin: 0 auto;
}

.board-wrap { grid-area: board; display: grid; place-items: center; min-width: 0; }
.board {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 290px);
  min-height: 320px;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, .55));
}

.side { grid-area: side; display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.panel {
  position: relative;
  padding: 12px 16px 14px;
  color: var(--ink);
  background: var(--noise), linear-gradient(160deg, var(--paper), var(--paper-2));
  border-radius: 3px;
  outline: 1px solid rgba(141, 106, 36, .7);
  outline-offset: -6px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, .45);
}
.panel__title {
  display: flex; align-items: center; gap: 10px;
  margin: 2px 0 10px;
  font-family: var(--font-thin); font-weight: 700; font-size: 15px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--ink);
}
.panel__title::before, .panel__title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-lo), transparent); }
.panel__hint { margin: -6px 0 10px; text-align: center; font-size: 14px; font-style: italic; color: var(--ink-soft); }
.panel__hint.is-warn { color: var(--red); font-weight: 700; }

/* Action points: brass coins. */
.ap { display: flex; justify-content: center; gap: 10px; margin-bottom: 10px; }
.ap__coin {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(43, 33, 24, .12);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .3);
  transition: background .25s, box-shadow .25s, transform .25s;
}
.ap__coin.is-on {
  background: radial-gradient(circle at 35% 30%, #fff3c4, var(--gold) 45%, var(--gold-lo));
  box-shadow: 0 0 0 1.5px #6b4f1a, 0 2px 3px rgba(0, 0, 0, .35);
}

.work-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }

/* Next checkpoint gate. */
.gate-next {
  margin: 0 0 12px; padding: 9px 10px 8px;
  background: rgba(141, 106, 36, .08); border: 1px solid rgba(141, 106, 36, .4); border-radius: 3px;
}
.gate-next__head { display: flex; align-items: center; gap: 10px; }
.gate-next__lock {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  font-size: 17px; color: #3b2a10;
  background: radial-gradient(circle at 35% 30%, #fff3c4, var(--gold) 55%, var(--gold-lo));
  box-shadow: 0 0 0 1.5px #6b4f1a;
}
.gate-next__name { flex: 1; display: flex; flex-direction: column; line-height: 1.1; }
.gate-next__name b { font-family: var(--font-deco); font-weight: 400; font-size: 16px; }
.gate-next__name small { font-style: italic; font-size: 13.5px; color: var(--ink-soft); }
.gate-next__done { display: flex; align-items: center; gap: 8px; margin: 0; font-style: italic; font-size: 15px; color: var(--green); }
.gate-next__done .icon { font-size: 18px; }
.gate-next__lock.is-open { background: radial-gradient(circle at 35% 30%, #d8f0d0, #6fbf73 55%, #3f7a48); box-shadow: 0 0 0 1.5px #2f5a35; }
.checks--report li { padding: 4px 0; }
.checks--report b { margin-left: 6px; }
.checks { margin: 7px 0 0; padding: 0; list-style: none; font-family: var(--font-type); font-size: 12.5px; line-height: 1.3; }
.checks li { display: flex; align-items: flex-start; gap: 6px; padding: 2px 0; color: var(--red); }
.checks li.is-ok { color: var(--green); }
.checks .icon { flex: none; margin-top: 1px; font-size: 14px; stroke-width: 2.6; }
.dossier__body .checks { margin: 0 0 10px; font-size: 14px; }

.btn--end { width: 100%; padding: 11px 14px; font-size: 19px; }
.btn--end.is-departure { background: linear-gradient(#f6d7a0, #d98f4a 55%, #a5562a); border-color: #6b2f12; }

/* ── Candidates ───────────────────────────────────────────────────────────── */

.market-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 10px; }
.market { display: grid; grid-template-columns: repeat(3, 84px); gap: 10px; }
.candidate {
  padding: 0; border: 0; border-radius: 6px; background: none;
  cursor: pointer;
  transition: transform .15s, opacity .15s;
}
.candidate:hover:not(:disabled) { transform: translateY(-4px) rotate(-1.5deg); }
.candidate:disabled { opacity: .5; cursor: not-allowed; }
.candidate:focus-visible { outline: 2px solid var(--gold-lo); outline-offset: 3px; }
.candidate.is-empty { width: 84px; aspect-ratio: 5 / 7; border: 1.5px dashed rgba(43, 33, 24, .25); }

.deck {
  position: relative;
  width: 84px; aspect-ratio: 5 / 7; padding: 0;
  color: var(--gold-hi);
  background: none; border: 0; border-radius: 6px;
  cursor: pointer;
  transition: transform .15s, opacity .15s;
}
.deck:hover:not(:disabled) { transform: translateY(-4px) rotate(1.5deg); }
.deck:disabled { opacity: .45; cursor: not-allowed; }
.deck__back {
  position: absolute; inset: 0;
  display: grid; place-items: start center; padding-top: 22px;
  border-radius: 6px;
  font-family: var(--font-deco); font-size: 22px; color: var(--gold-hi);
  background:
    repeating-linear-gradient(45deg, rgba(201, 162, 74, .3) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(-45deg, rgba(201, 162, 74, .3) 0 1px, transparent 1px 8px),
    #16302a;
  box-shadow: inset 0 0 0 4px #16302a, inset 0 0 0 5px var(--gold), 3px 3px 0 #0e221c, 4px 4px 6px rgba(0, 0, 0, .35);
}
.deck__text {
  position: absolute; left: 6px; right: 6px; bottom: 11px;
  display: flex; flex-direction: column; gap: 2px;
  font-weight: 700; font-size: 12px; line-height: 1.05; letter-spacing: .06em; text-transform: uppercase; text-align: center;
}
.deck__text small { font-weight: 500; font-style: italic; font-size: 11px; letter-spacing: 0; text-transform: none; color: #e9dcb8; }
.market-refresh { display: flex; width: 100%; max-width: 366px; margin: 12px auto 0; }

/* ── Release notes (log) ──────────────────────────────────────────────────── */

.panel--log { flex: 1; min-height: 160px; display: flex; flex-direction: column; }
.log {
  flex: 1;
  max-height: 260px; overflow-y: auto;
  margin: 0; padding: 0 4px 0 0; list-style: none;
  font-family: var(--font-type); font-size: 12.5px; line-height: 1.35; color: var(--ink);
}
.log__item { display: flex; gap: 8px; padding: 5px 0 5px 8px; border-left: 3px solid rgba(43, 33, 24, .2); border-bottom: 1px dotted rgba(43, 33, 24, .15); }
.log__item--good { border-left-color: var(--green); }
.log__item--bad { border-left-color: var(--red); }
.log__day { flex: none; min-width: 34px; padding: 0 4px; border-radius: 3px; font-size: 11px; line-height: 17px; text-align: center; color: #fbf3df; background: var(--c, var(--ink-soft)); }

/* ── Personnel files (team cards) ─────────────────────────────────────────── */

.pcard {
  --w: 84px;
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  width: var(--w); aspect-ratio: 5 / 7;
  color: var(--ink); text-align: center;
  background: var(--noise), linear-gradient(170deg, #fbf6ea, #eadcbf);
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(43, 33, 24, .35), 0 6px 12px rgba(0, 0, 0, .35);
  overflow: hidden;
}
.pcard::after {
  content: ''; position: absolute; inset: 4px;
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); border-radius: 3px;
  pointer-events: none;
}
.pcard__band {
  align-self: stretch;
  padding: 5px 4px 4px;
  font-family: var(--font-thin); font-weight: 700; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  color: #fbf3df; background: var(--c);
}
.pcard__value {
  position: absolute; top: 24px; left: 3px; z-index: 1;
  display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%;
  font-family: var(--font-deco); font-size: 15px; color: var(--ink);
  background: radial-gradient(circle at 35% 30%, #fff3c4, var(--gold) 55%, var(--gold-lo));
  box-shadow: 0 0 0 1.5px #3b2a10, 0 2px 3px rgba(0, 0, 0, .35);
}
.pcard__cameo {
  position: relative; flex: none;
  width: 48px; height: 56px; margin-top: 9px;
  border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #fffaf0, #e2d2b0);
  box-shadow: inset 0 0 0 2px var(--c);
}
.pcard__bust { position: absolute; left: 4px; bottom: -3px; width: 40px; height: 44px; fill: color-mix(in srgb, var(--c) 75%, #1b120a); }
.pcard__icon {
  position: absolute; top: 58px; right: 13px;
  display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  font-size: 12px; color: #fbf3df; background: var(--c);
  box-shadow: 0 0 0 1.5px #fbf6ea;
}
.pcard__name { margin-top: auto; padding: 0 6px 8px; font-weight: 700; font-size: 12.5px; line-height: 1.05; }
.pcard[data-role="wild"] .pcard__band { color: var(--gold-hi); background: linear-gradient(90deg, #25211d, #40382e); }
.pcard[data-role="wild"] .pcard__cameo { box-shadow: inset 0 0 0 2px var(--gold); }
.pcard[data-role="wild"] .pcard__icon { color: #25211d; background: linear-gradient(var(--gold-hi), var(--gold)); }
.pcard--slot {
  display: grid; place-items: center;
  font-size: 26px; color: rgba(242, 217, 140, .35);
  background: transparent; border: 1.5px dashed rgba(242, 217, 140, .3); box-shadow: none;
}
.pcard--slot::after { display: none; }

/* ── Hand ─────────────────────────────────────────────────────────────────── */

.hand-wrap { grid-area: hand; }
.hand__title {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 10px;
  font-family: var(--font-thin); font-weight: 700; font-size: 15px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--gold-hi);
}
.hand__count { margin-left: .8em; font-size: 13px; letter-spacing: .1em; color: var(--paper); opacity: .7; }
.hand__title::before, .hand__title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.hand { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px 28px; }

.pile { display: flex; flex-direction: column; align-items: center; gap: 9px; }
.pile__cards { display: flex; }
.hand-card { position: relative; padding: 0; border: 0; border-radius: 6px; background: none; cursor: pointer; transition: transform .15s; }
.hand-card + .hand-card { margin-left: -50px; }
.hand-card:hover:not(:disabled), .hand-card:focus-visible { z-index: 2; transform: translateY(-10px); }
.hand-card:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.hand-card:disabled { cursor: default; }
.hand-card.is-landing { visibility: hidden; }
.pile__label {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-thin); font-weight: 700; font-size: 13px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold-hi);
}
.pile__label b {
  display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px;
  font-family: var(--font-deco); font-weight: 400; font-size: 14px; letter-spacing: 0; color: var(--ink);
  background: radial-gradient(circle at 35% 30%, #fff3c4, var(--gold) 55%, var(--gold-lo));
}
.pile.is-empty .pile__label { opacity: .45; }
.pile.bump .pile__cards { animation: bump .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bump { 0% { transform: scale(1.08) translateY(-6px); } 100% { transform: none; } }

.ghost { position: fixed; z-index: 40; pointer-events: none; transform-origin: top left; }
.ghost .pcard { --w: 100%; width: 100%; height: 100%; }

/* ── SVG board text & pieces ──────────────────────────────────────────────── */

.title-main { font-family: var(--font-deco); font-size: 46px; fill: url(#g-gold); letter-spacing: 2px; }
.title-sub { font-family: var(--font-thin); font-weight: 700; font-size: 12px; letter-spacing: 2.5px; fill: #efe2c2; }
.board-label { font-family: var(--font-thin); font-weight: 700; font-size: 17px; letter-spacing: 4px; fill: var(--ink); }
.board-label--small { font-size: 13px; letter-spacing: 3px; }
.st-name { font-family: var(--font-deco); font-size: 30px; letter-spacing: 3px; fill: #fbf3df; }
.st-name--terminus { font-size: 36px; fill: #2b2118; }
.st-no { font-family: var(--font-thin); font-weight: 700; font-size: 12px; letter-spacing: 3px; fill: #fbf3df; opacity: .85; }
.board-tag { font-family: var(--font-thin); font-weight: 700; font-size: 12px; letter-spacing: 4px; fill: #e9dcb8; }
.dep-tag { font-family: var(--font-thin); font-weight: 700; font-size: 11.5px; letter-spacing: 4px; fill: #e0a93a; }
.dep-name { font-family: var(--font-deco); font-size: 24px; letter-spacing: 2px; fill: #f2c55c; }
.dep-puzzle { font-family: var(--font-serif); font-style: italic; font-weight: 500; font-size: 17px; fill: #e9dcb8; }
.dep-text { font-family: var(--font-type); font-size: 12.5px; fill: #cfc3a6; }
.dep-stamp { opacity: 0; pointer-events: none; transition: opacity .3s; }
.dep-stamp rect { fill: none; stroke-width: 4px; }
.dep-stamp text { font-family: var(--font-deco); font-size: 30px; letter-spacing: 4px; }
.dep-stamp.is-good, .dep-stamp.is-bad { opacity: .92; }
.dep-stamp.is-good rect { stroke: #6fbf73; } .dep-stamp.is-good text { fill: #6fbf73; }
.dep-stamp.is-bad rect { stroke: #e0533f; } .dep-stamp.is-bad text { fill: #e0533f; }
.panel-tag { font-family: var(--font-thin); font-weight: 700; font-size: 10px; letter-spacing: 3px; fill: #fbf3df; opacity: .85; }
.panel-num { font-family: var(--font-deco); font-size: 22px; fill: #fbf3df; }
.block-no { font-family: var(--font-deco); font-size: 13px; fill: #fbf3df; opacity: .7; }
.block-name { font-family: var(--font-deco); font-size: 17px; letter-spacing: 2px; fill: var(--ink); }
.block-check { font-family: var(--font-serif); font-style: italic; font-weight: 500; font-size: 14px; fill: var(--ink-soft); }
.block-note { font-family: var(--font-thin); font-weight: 700; font-size: 13px; letter-spacing: 1px; fill: var(--ink-soft); }
.block-note.is-here { fill: var(--red); }
.block-note.is-good { fill: var(--green); }
.block-note.is-bad { fill: var(--red); }
.block-seal { opacity: 0; transition: opacity .3s; }
.block-seal circle { stroke: #fbf3df; stroke-width: 2px; }
.block-seal path { fill: none; stroke: #fbf3df; stroke-width: 2.4px; stroke-linecap: round; stroke-linejoin: round; }
.block-seal.is-signed, .block-seal.is-missed { opacity: 1; }
.block-seal.is-signed circle { fill: #3f7a48; }
.block-seal.is-missed circle { fill: #a3262a; }
.block-seal.is-signed .block-seal__cross, .block-seal.is-missed .block-seal__tick, .block-seal:not(.is-signed):not(.is-missed) path { display: none; }
.desk-title { font-family: var(--font-deco); font-size: 22px; letter-spacing: 3px; fill: #fbf3df; }
.desk-sub { font-family: var(--font-thin); font-weight: 700; font-size: 13px; letter-spacing: 2px; fill: #fbf3df; }
.board-hint { font-family: var(--font-serif); font-style: italic; font-weight: 500; font-size: 16px; fill: #cfc3a6; }
.dep-check__mark { font-family: var(--font-deco); font-size: 16px; fill: #e0533f; }
.dep-check__text { font-family: var(--font-type); font-size: 14px; fill: #e0a99a; }
.dep-check.is-ok .dep-check__mark { fill: #6fbf73; }
.dep-check.is-ok .dep-check__text { fill: #a9d6a6; }
.dep-check.is-open .dep-check__mark { fill: #e0a93a; }
.dep-check.is-open .dep-check__text { fill: #e9dcb8; }
.blocker__name { font-family: var(--font-serif); font-weight: 700; font-size: 10px; fill: #e9dcb8; pointer-events: none; }
.ref__num { font-family: var(--font-deco); font-size: 13px; fill: var(--ink); }
.ref__title { font-family: var(--font-deco); font-size: 15px; letter-spacing: 1.5px; fill: var(--ink); }
.ref__text { font-family: var(--font-serif); font-style: italic; font-weight: 500; font-size: 15px; fill: var(--ink-soft); }
.ref__rule { font-family: var(--font-serif); font-style: italic; font-weight: 500; font-size: 16px; fill: var(--red); }
.panel-departs { font-family: var(--font-thin); font-weight: 700; font-size: 9.5px; letter-spacing: 1.5px; fill: #fff3c4; }
.panel-cut { font-family: var(--font-deco); font-size: 12px; letter-spacing: 2px; fill: #8a2a22; }
.platform-note { font-family: var(--font-thin); font-weight: 700; font-size: 14px; letter-spacing: 4px; fill: var(--ink); opacity: .7; }
.platform-note.is-good { fill: var(--green); opacity: 1; }
.platform-note.is-bad { fill: var(--red); opacity: 1; }
.terminus-text { font-family: var(--font-thin); font-weight: 700; font-size: 16px; letter-spacing: 6px; fill: var(--ink); }
.car-plate { font-family: var(--font-deco); font-size: 10px; fill: var(--ink); }
.loco-badge { font-family: var(--font-deco); font-size: 13px; fill: var(--gold-hi); }
.line-name { font-family: var(--font-serif); font-weight: 700; font-size: 15px; fill: var(--ink); }
.line-node.is-here .line-name { fill: var(--red); }
.line-sub { font-family: var(--font-serif); font-style: italic; font-weight: 500; font-size: 13.5px; fill: var(--ink-soft); }
.line-sub.is-good { fill: var(--green); }
.line-sub.is-bad { fill: var(--red); }
.issue__ring { fill: none; stroke: var(--ink); stroke-width: 1.5px; stroke-dasharray: 3 3; opacity: .45; }
.issue__mark { font-family: var(--font-deco); font-size: 16px; fill: var(--ink); opacity: .2; }
.issue.is-full .issue__ring { fill: var(--red); stroke: #5b1512; stroke-dasharray: none; opacity: 1; }
.issue.is-full .issue__mark { fill: #fbf3df; opacity: 1; }
.issue-note { font-family: var(--font-thin); font-weight: 700; font-size: 10.5px; letter-spacing: 2px; fill: var(--red); opacity: .75; }
.puff { fill: #f3ead6; opacity: .6; transform-box: fill-box; transform-origin: center; animation: puff 1.2s ease-out forwards; }
@keyframes puff { from { opacity: .7; transform: scale(.6); } to { opacity: 0; transform: translate(-50px, -46px) scale(2.2); } }
.blocker.is-abandoned .blocker__body { animation: abandon .9s ease-in forwards; }
@keyframes abandon { 0% { filter: none; } 40% { filter: sepia(1) saturate(4) hue-rotate(-30deg); transform: scale(1.15); } 100% { opacity: 0; transform: translateY(-30px) scale(.6); } }

.cup .cup__body { transition: fill .3s; }
.cup.is-full .cup__body { fill: #8a5428; }
.cup:not(.is-full) { opacity: .4; }
.cup:not(.is-full) .cup__steam { display: none; }

.gate { cursor: pointer; outline: none; }
.gate__body { transform-box: fill-box; transform-origin: center; transition: transform .15s, opacity .3s; }
.gate:hover .gate__body, .gate:focus-visible .gate__body { transform: scale(1.12); }
.gate__shackle { transform-box: fill-box; transform-origin: 100% 100%; transition: transform .5s cubic-bezier(.3, 1.6, .5, 1); }
.gate.is-open .gate__shackle { transform: translateY(-6px) rotate(30deg); }
.gate.is-open .gate__body { opacity: .8; }
.gate__seal { opacity: 0; transition: opacity .3s .25s; }
.gate.is-open .gate__seal { opacity: 1; }
/* pointer-events: all makes the whole circle clickable, not just the padlock drawn in it. */
.gate__halo { fill: none; stroke: #f3d27a; stroke-width: 3; stroke-dasharray: 5 6; opacity: 0; transform-box: fill-box; transform-origin: center; transition: opacity .2s; pointer-events: all; }
.gate.is-next .gate__halo { opacity: .55; stroke: #8a2a22; stroke-dasharray: 2 5; }
.gate.is-ready .gate__halo { opacity: 1; stroke: #f3d27a; stroke-dasharray: 5 6; animation: spin 9s linear infinite; }
.gate:focus-visible .gate__halo { opacity: 1; stroke: #fff; }
.gate.is-opening .gate__body { animation: gatePop .8s ease-out; }
.gate.is-hit .gate__body { animation: shout .12s linear 6; }
@keyframes gatePop { 0% { transform: scale(1); } 30% { transform: scale(1.4); } 100% { transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }

.blocker { cursor: pointer; outline: none; }
.blocker__body, .blocker__shake { transform-box: fill-box; transform-origin: center; transition: transform .15s; }
.blocker:hover .blocker__body, .blocker:focus-visible .blocker__body { transform: scale(1.1); }
.blocker__halo { fill: none; stroke: #f3d27a; stroke-width: 3; stroke-dasharray: 5 6; opacity: 0; transition: opacity .2s; pointer-events: all; }
.blocker.is-actionable .blocker__halo { opacity: .95; }
.blocker:focus-visible .blocker__halo { opacity: 1; stroke: #fff; }
.blocker__body.is-dropping { animation: drop .6s cubic-bezier(.2, .9, .3, 1.25) both; }
.blocker__body.is-leaving { animation: leave .45s ease-in both; }
.blocker--drain .blocker__shake { animation: grumble 2.4s ease-in-out infinite; }
.blocker.is-shouting .blocker__shake, .blocker.is-hit .blocker__shake { animation: shout .12s linear 8; }
@keyframes drop {
  0% { transform: translateY(-90px) scale(1.6); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: none; opacity: 1; }
}
@keyframes leave { to { transform: scale(.2) rotate(120deg); opacity: 0; } }
@keyframes grumble { 0%, 86%, 100% { transform: none; } 89% { transform: rotate(-8deg); } 92% { transform: rotate(7deg); } 95% { transform: rotate(-5deg); } }
@keyframes shout { 0%, 100% { transform: none; } 25% { transform: translateX(-3px) rotate(-5deg); } 75% { transform: translateX(3px) rotate(5deg); } }

/* ── Case file dialogs ────────────────────────────────────────────────────── */

.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  padding: 16px; overflow-y: auto;
  background: rgba(6, 16, 13, .72);
  backdrop-filter: blur(3px);
}
.overlay[hidden] { display: none; }
.overlay__content { width: min(470px, 100%); }

.dossier { animation: dealIn .45s cubic-bezier(.2, .8, .2, 1) both; }
.dossier__tab {
  display: inline-block; margin-left: 24px; padding: 7px 18px 5px;
  font-family: var(--font-type); font-size: 13px; letter-spacing: .08em; color: #3b2a12;
  background: var(--manila); border-radius: 9px 9px 0 0;
}
.dossier__folder { position: relative; padding: 12px; background: var(--manila); border-radius: 0 6px 6px 6px; box-shadow: 0 24px 50px rgba(0, 0, 0, .55); }
.dossier__folder:has(> .dossier__close) { border-top-right-radius: 0; }
/* The ✕ is a second folder tab, top right, so it never collides with a stamp. */
.dossier__close {
  position: absolute; right: 0; bottom: 100%;
  display: grid; place-items: center;
  width: 40px; height: 25px; padding: 0;
  font-size: 17px; color: #3b2a12;
  background: var(--manila); border: 0; border-radius: 9px 9px 0 0;
  cursor: pointer;
}
.dossier__close:hover { color: var(--red); }
.dossier__close:focus-visible { outline: 2px solid #3b2a12; outline-offset: -5px; }
.dossier__sheet {
  position: relative;
  padding: 30px 30px 24px;
  color: var(--ink);
  background: var(--noise), linear-gradient(#fbf6ea, #f1e7d1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
  transform: rotate(-.6deg);
}
.dossier__clip { position: absolute; top: -14px; left: 26px; width: 18px; height: 50px; fill: none; stroke: #868b90; stroke-width: 2.6; stroke-linecap: round; }
.dossier__stamp {
  position: absolute; top: 26px; right: 22px;
  padding: 4px 12px 2px;
  font-family: var(--font-deco); font-size: 19px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--red); border: 3px double currentColor; border-radius: 4px;
  transform: rotate(-11deg);
  mix-blend-mode: multiply; opacity: .85;
  animation: stampIn .35s .3s cubic-bezier(.3, 1.6, .5, 1) both;
}
.dossier__stamp--good { color: var(--green); }
.dossier__kicker { margin: 0 0 14px 34px; font-family: var(--font-type); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.dossier__icon {
  display: grid; place-items: center;
  width: 62px; height: 62px; margin: 6px 0 10px;
  border-radius: 50%; font-size: 32px; color: #fbf3df; background: var(--c);
  box-shadow: 0 0 0 3px #fbf6ea, 0 0 0 5px var(--c), 0 4px 8px rgba(0, 0, 0, .25);
}
.dossier__title { margin: 0 0 6px; font-family: var(--font-deco); font-weight: 400; font-size: 32px; line-height: 1.05; }
.dossier__quote { margin: 0 0 14px; font-style: italic; font-size: 21px; line-height: 1.25; color: var(--ink-soft); }
.dossier__body { padding-top: 12px; border-top: 1px solid rgba(43, 33, 24, .2); font-family: var(--font-type); font-size: 14.5px; line-height: 1.55; }
.dossier__body p { margin: 0 0 10px; }
.dossier__warn { color: var(--red); }
.dossier__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.dossier__actions .btn { flex: 1 1 160px; }

/* Your team under a case file, laid out like the hand on the table. It can be wider
   than the folder, so it centres itself on it. */
.team-strip {
  position: relative; left: 50%; translate: -50% 0;
  width: max-content; max-width: calc(100vw - 32px);
  margin-top: 20px;
}
.team-strip__title {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 12px;
  font-family: var(--font-thin); font-weight: 700; font-size: 13px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--gold-hi);
}
.team-strip__title::before, .team-strip__title::after { content: ''; flex: 1; min-width: 40px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.team-strip__piles { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 24px; }
.team-strip .pile { gap: 7px; }
/* All positioned, so a lifted card still sits under the one to its right. */
.strip-card { position: relative; border-radius: 6px; transition: transform .15s, filter .15s; }
.strip-card + .strip-card { margin-left: -50px; }
.strip-card .pcard { transition: box-shadow .15s; }
/* Pointing at a button that sends people lifts them to the front, and darkens everyone who
   stays (darkened, not faded, so overlapping cards don't show through each other). */
.dossier:has([data-sends]:is(:hover, :focus-visible)) .strip-card.is-sending { z-index: 1; transform: translateY(-12px); }
.dossier:has([data-sends]:is(:hover, :focus-visible)) .strip-card.is-sending .pcard { box-shadow: 0 0 0 3px var(--gold-hi), 0 10px 16px rgba(0, 0, 0, .5); }
.dossier:has([data-sends]:is(:hover, :focus-visible)) .strip-card:not(.is-sending) { filter: brightness(.45) saturate(.5); }
@media (prefers-reduced-motion: reduce) { .strip-card { transition: none; } }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 9px 1px 5px; margin: 1px 0;
  font-family: var(--font-serif); font-weight: 700; font-size: 14px; white-space: nowrap;
  color: #fbf3df; background: var(--c); border-radius: 999px;
}
.chip .icon { font-size: 15px; }

.dossier__seed { margin: 10px 0 0 !important; font-size: 12px; color: var(--ink-soft); text-align: right; }

.rules { margin: 0 0 10px; padding-left: 20px; }
.rules li { margin-bottom: 8px; }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 0; }
.stats div { text-align: center; padding: 8px 4px; border: 1px solid rgba(43, 33, 24, .2); }
.stats dt { font-size: 10.5px; text-transform: uppercase; color: var(--ink-soft); }
.stats dd { margin: 4px 0 0; font-family: var(--font-deco); font-size: 26px; }

@keyframes dealIn { from { transform: translateY(-40px) rotate(-4deg) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes stampIn { from { transform: rotate(-11deg) scale(2.4); opacity: 0; } to { transform: rotate(-11deg) scale(1); opacity: .85; } }

/* ── Night curtain & toasts ───────────────────────────────────────────────── */

.curtain {
  position: fixed; inset: 0; z-index: 45;
  display: grid; place-items: center; text-align: center;
  background: radial-gradient(ellipse at center, rgba(10, 25, 21, .82), rgba(3, 8, 7, .94));
  opacity: 0; transition: opacity .3s;
  pointer-events: none;
}
.curtain[hidden] { display: none; }
.curtain.is-on { opacity: 1; }
.curtain > div { display: flex; flex-direction: column; gap: 6px; }
.curtain__day { font-family: var(--font-deco); font-size: clamp(44px, 8vw, 84px); color: var(--gold-hi); letter-spacing: .06em; }
.curtain__sub { font-family: var(--font-thin); font-weight: 700; font-size: 20px; letter-spacing: .25em; text-transform: uppercase; color: var(--paper); }

.toasts { position: fixed; top: 64px; left: 50%; z-index: 60; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  padding: 9px 16px;
  font-family: var(--font-type); font-size: 14px; color: var(--ink);
  background: #fbf6ea; border-left: 4px solid var(--ink-soft); border-radius: 2px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .4);
  animation: toastIn .3s ease-out both;
  transition: opacity .4s, transform .4s;
}
.toast--bad { border-left-color: var(--red); }
.toast--good { border-left-color: var(--green); }
.toast.is-gone { opacity: 0; transform: translateY(-8px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } }

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .table { grid-template-columns: 1fr; grid-template-areas: "board" "hand" "side"; padding: 14px 16px 24px; }
  .board { max-height: none; }
  .side { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}

@media (min-width: 1101px) and (min-height: 760px) {
  body { display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-height: 0; }
  .topbar { flex: none; }
  .table {
    flex: 1 1 auto; min-height: 0; width: 100%;
    grid-template-columns: minmax(0, 1fr) clamp(360px, 22vw, 420px);
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 14px 22px; padding: 14px 22px;
  }
  .board-wrap { position: relative; min-height: 0; }
  .board { position: absolute; inset: 0; height: 100%; max-height: none; min-height: 0; }
  /* On shorter screens the side column scrolls on its own; the padding keeps panel shadows unclipped. */
  .side { min-height: 0; overflow-y: auto; scrollbar-width: thin; margin: -10px -14px -14px; padding: 10px 14px 14px; }
  .side > .panel { flex: none; }
  .side > .panel--log { flex: 1 1 0; min-height: 110px; }
  .log { flex: 1 1 0; min-height: 0; max-height: none; }
}

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; padding: 10px 16px; gap: 8px; }
  .brand__name { font-size: 18px; }
  .status { order: 3; flex-basis: 100%; justify-content: flex-start; font-size: 14px; }
  .hand { gap: 14px 20px; }
  .dossier__sheet { padding: 26px 20px 20px; }
  .stats { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ── Online play ──────────────────────────────────────────────────────────── */

a.brand { text-decoration: none; }
a.btn { text-decoration: none; }

.crew { margin: 0 0 10px; padding: 0; list-style: none; }
.crew__p { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; padding: 5px 8px; border-bottom: 1px dotted rgba(43, 33, 24, .2); }
.crew__p.is-waiting { background: rgba(201, 162, 74, .14); }
.crew__p.is-out { opacity: .55; }
.crew__name { flex: 1; min-width: 6em; font-weight: 700; font-size: 16px; }
.crew__name em { font-weight: 500; font-size: 13px; color: var(--ink-soft); }
.crew__wait { color: var(--gold-lo); font-weight: 700; }
.crew__tags { display: flex; flex-wrap: wrap; gap: 4px; }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #b9ad97; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .3); }
.dot.is-on { background: var(--green); }
.tag {
  padding: 1px 7px; border-radius: 999px;
  font-family: var(--font-thin); font-weight: 700; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-soft); background: rgba(43, 33, 24, .08);
}
.tag--gold { color: #3b2a10; background: linear-gradient(var(--gold-hi), var(--gold)); }
.tag--bad { color: #fbf3df; background: var(--red); }

.role { padding: 8px 12px; font-size: 14.5px; line-height: 1.3; border-left: 4px solid var(--green); background: rgba(63, 122, 72, .1); }
.role--bad { border-left-color: var(--red); background: rgba(163, 38, 42, .1); }

.turn-actions { display: grid; gap: 8px; }
.table-note { margin: 0 0 10px; font-size: 16px; line-height: 1.35; }
.waiting { margin: 0; font-style: italic; color: var(--ink-soft); }

.join { display: grid; gap: 12px; }
.join label { display: grid; gap: 4px; font-family: var(--font-serif); font-weight: 700; font-size: 15px; }
.join label small { font-weight: 500; font-style: italic; color: var(--ink-soft); }
.join input, .share input {
  padding: 8px 10px; font: inherit; font-family: var(--font-type); font-size: 15px; color: var(--ink);
  background: #fffaf0; border: 1.5px solid rgba(43, 33, 24, .35); border-radius: 3px;
}
.join input[name="code"] { letter-spacing: .3em; text-transform: uppercase; }
.join input:focus-visible, .share input:focus-visible { outline: 2px solid var(--gold-lo); outline-offset: 1px; }
.share { display: flex; gap: 8px; margin: 0 0 12px; }
.share input { flex: 1; min-width: 0; font-size: 13px; }
.share .btn { color: var(--paper); }
.room-code { font-family: var(--font-deco); font-weight: 400; letter-spacing: .2em; }

.pick, .reveal { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; justify-items: center; margin: 12px 0 4px; }
.pick__card { padding: 0; border: 0; background: none; border-radius: 8px; cursor: pointer; transition: transform .12s; }
.pick__card:hover { transform: translateY(-3px); }
.pick__card[aria-pressed="true"] { outline: 3px solid var(--gold-lo); outline-offset: 3px; transform: translateY(-6px); }
.pick__card:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.reveal-card { border-radius: 8px; animation: dealIn .4s both; }
.reveal-card:nth-child(2) { animation-delay: .08s; } .reveal-card:nth-child(3) { animation-delay: .16s; }
.reveal-card:nth-child(4) { animation-delay: .24s; } .reveal-card:nth-child(5) { animation-delay: .32s; }
.reveal-card:nth-child(n+6) { animation-delay: .4s; }
.reveal-card.is-good { outline: 3px solid var(--green); outline-offset: 2px; }
.reveal-card.is-bad { outline: 3px solid var(--red); outline-offset: 2px; filter: saturate(.6); }
.reveal-notes { margin: 8px 0 0; padding-left: 18px; }
.votes { margin: 0 0 10px; padding-left: 18px; }
.yes { color: var(--green); }
.no { color: var(--red); }
.dossier__good { color: var(--green); }
