/* Secret Hitler: a 1930s parliament desk. Walnut desk, manila dossiers, typewritten slips, rubber stamps, and the
   game's own card art. One display face (Germania One, from the boards) and one typewriter face. */
@font-face { font-family: 'Germania One'; src: url(/fonts/germania-one.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Special Elite'; src: url(/fonts/special-elite.woff2) format('woff2'); font-display: swap; }

:root {
  --desk: #26221e;
  --desk-hi: #3a322b;
  --manila: #e9b949;
  --manila-dk: #c99a2e;
  --paper: #f3ead2;
  --paper-dk: #ddd0ad;
  --ink: #2b2522;
  --ink-soft: #5a4e45;
  --lib: #5fc3d6;
  --lib-dk: #0e4a64;
  --fas: #e5643f;
  --fas-dk: #9b1309;
  --brown: #8b5b4a;
  --brass: #c8a35a;
  --display: 'Germania One', 'Rockwell', Georgia, serif;
  --type: 'Special Elite', 'Courier New', monospace;
  --r-card: 10px;
  --shadow-card: 0 1px 0 rgba(0, 0, 0, .35), 0 10px 24px -8px rgba(0, 0, 0, .55);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background-color: var(--desk);
  /* walnut: soft lamp pool + long grain, all gradients (no images, no filters) */
  background-image:
    radial-gradient(120% 70% at 50% -10%, rgba(255, 214, 150, .16), transparent 60%),
    repeating-linear-gradient(92deg, rgba(0, 0, 0, .07) 0 2px, transparent 2px 9px, rgba(255, 255, 255, .025) 9px 10px, transparent 10px 23px),
    linear-gradient(180deg, #2c2722, #1f1b18);
  background-attachment: fixed;
  color: var(--paper);
  font-family: var(--type);
  font-size: 16px;
  line-height: 1.45;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
html.lite body { background-image: none; background-color: var(--desk); }

#app { min-height: 100dvh; display: flex; flex-direction: column; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, [tabindex]:focus-visible, input:focus-visible { outline: 3px solid var(--manila); outline-offset: 3px; }
img { display: block; max-width: 100%; -webkit-user-drag: none; user-select: none; }
.display { font-family: var(--display); letter-spacing: .01em; line-height: 1; }

/* ------------------------------------------------------------ paper + dossier */
.paper {
  background: var(--paper);
  background-image: radial-gradient(130% 90% at 30% 10%, rgba(255, 255, 255, .45), transparent 55%),
    repeating-linear-gradient(0deg, rgba(43, 37, 34, .035) 0 1px, transparent 1px 4px);
  color: var(--ink);
  box-shadow: var(--shadow-card);
  border-radius: 3px;
}
html.lite .paper { background-image: none; box-shadow: none; }

.dossier {
  position: relative;
  background: var(--manila);
  background-image: linear-gradient(160deg, rgba(255, 255, 255, .22), transparent 40%),
    repeating-linear-gradient(0deg, rgba(120, 80, 10, .06) 0 1px, transparent 1px 3px);
  color: var(--ink);
  border-radius: 4px 14px 6px 6px;
  box-shadow: 0 2px 0 var(--manila-dk), 0 24px 40px -18px rgba(0, 0, 0, .7);
}

/* ------------------------------------------------------------ rubber stamp buttons */
.stamp {
  --c: var(--paper); --gapc: var(--desk);
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 52px; padding: .55em 1.1em .45em;
  font-family: var(--display); font-size: 1.35rem; color: var(--c);
  border: 3px solid var(--c); border-radius: 6px;
  box-shadow: inset 0 0 0 2px var(--gapc), inset 0 0 0 4px var(--c);
  background: transparent;
  transform: rotate(var(--tilt, -1.2deg));
  transition: transform .12s ease, opacity .2s;
}
.stamp:active { transform: rotate(var(--tilt, -1.2deg)) scale(.95); }
.stamp[disabled] { opacity: .35; pointer-events: none; }
.paper .stamp, .dossier .stamp, .on-paper .stamp { --c: var(--ink); --gapc: var(--paper); }
.dossier .stamp { --gapc: var(--manila); }
.stamp.solid { background: var(--c); color: var(--paper); box-shadow: inset 0 0 0 2px var(--c), inset 0 0 0 4px rgba(243, 234, 210, .55); }
.stamp.solid:not(.red):not(.teal) { --c: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 2px var(--c), inset 0 0 0 4px rgba(43, 37, 34, .5); }
.paper .stamp.solid:not(.red):not(.teal), .dossier .stamp.solid:not(.red):not(.teal) { --c: var(--ink); color: var(--paper); box-shadow: inset 0 0 0 2px var(--c), inset 0 0 0 4px rgba(243, 234, 210, .55); }
.stamp.red { --c: var(--fas-dk); }
.stamp.red:not(.solid) { --c: var(--fas); }
.paper .stamp.red:not(.solid), .dossier .stamp.red:not(.solid) { --c: var(--fas-dk); }
.stamp.teal { --c: var(--lib-dk); }
.stamp.wide { display: flex; width: 100%; }
.stamp.small { min-height: 40px; font-size: 1.05rem; padding: .35em .8em .3em; border-width: 2px; box-shadow: none; }

.link { font-family: var(--type); color: inherit; text-decoration: underline; text-underline-offset: 3px; padding: .5em; }

/* ------------------------------------------------------------ cards (official art) */
.card { position: relative; border-radius: var(--r-card); overflow: hidden; box-shadow: var(--shadow-card); background: #fff; aspect-ratio: 300 / 421; }
.card img { width: 100%; height: 100%; object-fit: cover; }
.card.role { aspect-ratio: 520 / 736; }
.card.party { aspect-ratio: 420 / 594; }
.card.ballot { aspect-ratio: 420 / 297; }
html.lite .card { box-shadow: none; }

/* a card with two faces (.front, .back): .up shows the front */
.flip { position: relative; perspective: 900px; }
.flip > .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .42s cubic-bezier(.3, 1.3, .5, 1); border-radius: var(--r-card); overflow: hidden; }
.flip > .back { transform: rotateY(0deg); }
.flip > .front { transform: rotateY(180deg); }
.flip.up > .back { transform: rotateY(-180deg); }
.flip.up > .front { transform: rotateY(0deg); }

.dust { position: fixed; z-index: 60; width: 10px; height: 10px; border-radius: 50%; pointer-events: none; background: rgba(40, 30, 24, .55); }

/* ------------------------------------------------------------ placards + plaques */
.placard { display: inline-block; width: 100%; height: auto; }
.plaque {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: .45em .6em .4em; min-width: 0;
  background: linear-gradient(180deg, #d9b56b, var(--brass) 55%, #a8843f);
  color: #2a1f12; border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -2px 0 rgba(0, 0, 0, .25), 0 3px 8px -3px rgba(0, 0, 0, .7);
  font-family: var(--display); font-size: 1.05rem; line-height: 1.05; text-align: center;
}
.plaque .nm { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plaque .sub { font-family: var(--type); font-size: .72rem; opacity: .8; }
.plaque.sq .nm { color: #6b3f00; }
.plaque.off { filter: grayscale(.7); opacity: .65; }
.plaque.dead { background: linear-gradient(180deg, #8d857a, #6f675d); color: #2b2622; }
.plaque.dead::after { content: ''; position: absolute; left: 6%; right: 6%; top: 50%; height: 3px; background: var(--fas-dk); transform: rotate(-8deg); }
.plaque.me { outline: 2px solid var(--paper); outline-offset: 2px; }
html.lite .plaque { box-shadow: none; }

/* ------------------------------------------------------------ phone shell */
.phone { flex: 1; display: flex; flex-direction: column; width: 100%; max-width: 560px; margin: 0 auto; padding: 12px 14px calc(16px + var(--safe-b)); min-height: 100dvh; }
.strip { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 2px 2px 8px; }
.strip .what { flex: 1; font-size: .92rem; color: var(--paper-dk); line-height: 1.25; }
.pips { display: flex; gap: 3px; }
.pips i { width: 9px; height: 13px; border-radius: 2px; background: rgba(243, 234, 210, .13); }
.pips.l i.on { background: var(--lib); }
.pips.f i.on { background: var(--fas); }
.trk { display: flex; gap: 3px; }
.trk i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--paper-dk); }
.trk i.on { background: var(--manila); border-color: var(--manila); }
.body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.title { font-family: var(--display); font-size: clamp(2rem, 9vw, 2.8rem); line-height: .95; margin: .1em 0 .25em; }
.lead { font-size: 1.02rem; color: var(--paper-dk); margin: 0 0 1em; max-width: 34em; }
.on-paper .lead { color: var(--ink-soft); }
.spacer { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }

/* bottom sheet */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(15, 12, 10, .62); }
.sheet { position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; margin: 0 auto; width: min(100%, 560px); max-height: 88dvh; overflow: auto; padding: 22px 18px calc(22px + var(--safe-b)); border-radius: 14px 14px 0 0; }

.toast { position: fixed; z-index: 80; left: 50%; bottom: calc(22px + var(--safe-b)); transform: translateX(-50%); max-width: min(92vw, 520px); padding: .7em 1em; background: var(--paper); color: var(--ink); border-radius: 4px; box-shadow: var(--shadow-card); font-size: .95rem; transition: opacity .4s, transform .4s; }
.toast.bad { background: #f7d6c8; color: var(--fas-dk); }
.toast.out { opacity: 0; transform: translate(-50%, 8px); }

input.field { width: 100%; font: inherit; font-size: 1.15rem; padding: .55em .7em; border: 0; border-bottom: 2px solid var(--ink); background: rgba(255, 250, 235, .55); color-scheme: light; color: var(--ink); border-radius: 3px 3px 0 0; user-select: text; -webkit-user-select: text; }

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

.note { font-size: .88rem; color: var(--ink-soft); margin: .4em 0 1em; }
.sheet .title { color: var(--ink); }
.sheet p { margin: .5em 0; }
.sheet .stamp + .stamp, .sheet .stamp + .note, .sheet .row + .note { margin-top: .6em; }

/* ------------------------------------------------------------ menu: the dossier on the desk */
.desk { position: relative; padding-top: 118px; margin-top: 4px; }
.fan { position: absolute; top: 0; left: 50%; width: 260px; height: 190px; transform: translateX(-50%); pointer-events: none; }
.fan .card { position: absolute; top: 6px; width: 104px; }
.fan .fan0 { left: 14px; rotate: -14deg; }
.fan .fan1 { left: 78px; top: -6px; rotate: 2deg; z-index: 1; }
.fan .fan2 { left: 140px; rotate: 15deg; }
.dossier.front { z-index: 2; padding: 28px 20px 22px; }
.dossier .tab { position: absolute; top: -26px; left: 18px; height: 28px; padding: 5px 16px 0; border-radius: 8px 8px 0 0; background: var(--manila); font-size: .82rem; color: var(--ink-soft); }
.dossier .title { color: var(--ink); }
.dossier .title.big { font-size: clamp(2.6rem, 13vw, 3.6rem); color: var(--fas-dk); }
.dossier .lead { color: var(--ink-soft); }
.namebox { display: flex; align-items: flex-end; gap: 10px; margin: 6px 0 18px; }
.namebox .lbl { font-family: var(--display); font-size: 1.15rem; color: var(--ink); padding-bottom: .55em; }
.namebox .field { flex: 1; }
.actions { display: flex; flex-direction: column; gap: 12px; margin: 6px 0 6px; }
.dossier .link { color: var(--ink); }
.credit { margin: 18px 6px 0; font-size: .74rem; line-height: 1.4; color: rgba(243, 234, 210, .55); }
.credit a { color: inherit; }
.letters { display: flex; gap: 10px; justify-content: center; margin: 4px 0 20px; }
.letter { width: 60px; height: 74px; font-family: var(--display); font-size: 2.6rem; text-align: center; text-transform: uppercase; color: var(--ink);
  background: var(--paper); border: 0; border-bottom: 3px solid var(--ink); border-radius: 4px 4px 0 0; box-shadow: inset 0 2px 6px rgba(0, 0, 0, .12); user-select: text; -webkit-user-select: text; caret-color: var(--fas-dk); }

/* ------------------------------------------------------------ lobby */
.codeslip { display: flex; align-items: center; gap: 14px; padding: 12px 12px 12px 16px; rotate: -.6deg; }
.codeslip .lbl { font-size: .85rem; color: var(--ink-soft); }
.codeslip .code { font-size: 3.4rem; letter-spacing: .08em; color: var(--ink); margin: 2px 0 4px; }
.codeslip .note { margin: 0; font-size: .78rem; word-break: break-all; }
.qr { width: 104px; flex: none; }
.qr svg { display: block; width: 100%; height: auto; border-radius: 3px; }
.qr.big { width: min(78vw, 360px); margin: 10px auto; }
.felt { position: relative; margin: 26px 2px 8px; aspect-ratio: 1 / .92; max-height: 50dvh; border-radius: 50%;
  background: radial-gradient(60% 60% at 50% 45%, #2f5a43, #1d3a2b 75%, #15291f); box-shadow: inset 0 0 0 10px #4b3324, inset 0 0 0 13px #2a1d15, 0 18px 40px -16px rgba(0, 0, 0, .8); }
html.lite .felt { background: #24473a; box-shadow: inset 0 0 0 10px #4b3324; }
.seat, .chair { position: absolute; translate: -50% -50%; }
.seat { max-width: 31%; z-index: 1; touch-action: none; }
.seat.lifted { z-index: 5; scale: 1.12; box-shadow: 0 16px 30px -8px rgba(0, 0, 0, .8); }
.chair { width: 56px; height: 30px; border-radius: 4px; border: 2px dashed rgba(243, 234, 210, .28); }
.status { min-height: 2.9em; margin: 10px 2px 12px; font-size: .95rem; color: var(--paper-dk); }
.controls { display: flex; flex-direction: column; gap: 12px; margin-top: auto; }
.controls .minor { flex-wrap: wrap; justify-content: center; gap: 10px; }
.controls .stamp.small { box-shadow: none; }
.controls .link { color: var(--paper-dk); font-size: .9rem; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.choice { padding: .45em .9em; border: 2px solid var(--ink-soft); border-radius: 20px; color: var(--ink); font-size: .95rem; }
.choice.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ------------------------------------------------------------ tutorial */
.tutorial { padding-top: 16px; }
.tview { overflow: hidden; margin: 0 -18px; }
.ttrack { display: flex; touch-action: pan-y; }
.tpage { flex: 0 0 100%; padding: 4px 22px 0; }
.tart { display: flex; justify-content: center; align-items: flex-end; gap: 0; height: 190px; margin-bottom: 10px; }
.tart .card { width: 104px; }
.tart .card.ballot, .tart .card.party { width: 130px; }
.tart.fan3 .card:nth-child(1) { rotate: -9deg; translate: 14px 6px; }
.tart.fan3 .card:nth-child(2) { z-index: 1; }
.tart.fan3 .card:nth-child(3) { rotate: 9deg; translate: -14px 6px; }
.tart.pair { gap: 12px; align-items: center; }
.tart .board { width: 100%; height: auto; border-radius: 6px; align-self: center; }
.ttitle { font-family: var(--display); font-weight: normal; font-size: 1.9rem; margin: .2em 0 .3em; color: var(--ink); }
.tpage p { margin: 0 0 .6em; color: var(--ink-soft); }
.tdots { display: flex; gap: 6px; justify-content: center; margin: 10px 0 12px; }
.tdots i { width: 7px; height: 7px; border-radius: 50%; background: var(--paper-dk); }
.tdots i.on { background: var(--ink); }
.tutorial .link { color: var(--ink); }

.menu { margin: auto 0; padding: 8px 0 4px; }
input.field::placeholder { color: rgba(43, 37, 34, .45); }
