/* Berlin-Est — step 2 frame: palette and type of the art direction (PLAN.md §5), sober screens. Full art comes at step 4.
   One frame for every screen (CONSTATS E3): bar, timer slot, body, actions at least 30 px above the bottom safe area. */
:root {
  --paper: #E9E1CF; --ink: #1F1F1F; --plattenbau: #6E7378; --grey-on-paper: #4D5257; --night: #1B2433;
  --amber: #E0A43A; --red-paper: #B3261E; --red-night: #E5534B; --green: #3E5641;
  --title: 'Barlow Condensed', 'Arial Narrow', 'Helvetica Neue', sans-serif;
  --text: 'Courier Prime', 'Courier New', monospace;
  --file: 'Special Elite', 'Courier New', monospace;
  --card-w: 58px; --card-h: 81px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--night); color: var(--paper); overflow: hidden; overscroll-behavior: none; }
body { font: 16px/1.35 var(--text); -webkit-text-size-adjust: 100%; }
#status { position: fixed; top: env(safe-area-inset-top); left: 0; right: 0; z-index: 30; margin: 0; padding: 6px 12px; background: var(--red-night); color: var(--ink); text-align: center; font-weight: 700; }
#toast { position: fixed; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 96px); z-index: 30; margin: 0; padding: 10px 12px; background: var(--paper); color: var(--ink); border-left: 6px solid var(--red-paper); }
.app { height: 100svh; }
.screen { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; height: 100svh; padding: calc(env(safe-area-inset-top) + 8px) 14px calc(env(safe-area-inset-bottom) + 30px); gap: 8px; }
.screen.home, .screen.lobby { grid-template-rows: minmax(0, 1fr) auto; }
.screen.dark { background: #0d121b; }
.body { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: hidden; }
.scroll { min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.actions { display: flex; flex-direction: column; gap: 8px; }
h1, h2, .bar strong, .opname, .verdict { font-family: var(--title); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin: 0; }
h1 { font-size: 34px; }
h2 { font-size: 22px; }
.lead { margin: 0; }
.hint, .label { margin: 0; font-size: 13px; color: #b9b2a2; }
.status { margin: 0; min-height: 1.35em; color: var(--amber); }
.wait { margin: 0; text-align: center; color: #b9b2a2; }
.notice { margin: 0; padding: 8px; border-left: 4px solid var(--red-night); }
.bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 8px; font-size: 13px; color: #b9b2a2; white-space: nowrap; }
.bar strong { color: var(--paper); font-size: 18px; text-align: center; overflow: hidden; text-overflow: ellipsis; }
.timer { margin: 0; height: 40px; font: 700 34px/40px var(--title); text-align: center; color: var(--paper); }
.btn { min-height: 48px; padding: 0 14px; border: 2px solid var(--paper); border-radius: 4px; background: transparent; color: var(--paper); font: 700 17px var(--text); touch-action: manipulation; }
.btn.primary { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.btn.quiet { border-color: var(--plattenbau); color: #cfc8b8; }
.btn.selected { background: var(--paper); color: var(--ink); }
.btn:disabled { opacity: .45; }
.row { display: flex; gap: 8px; } .row .btn { flex: 1; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid .btn { min-height: 44px; font-size: 15px; }
.entry { display: flex; flex-direction: column; gap: 8px; }
.entry input { min-height: 48px; padding: 0 12px; font: 18px var(--text); border: 2px solid var(--paper); background: var(--paper); color: var(--ink); border-radius: 4px; }
/* Lobby */
.qr { margin: 0 auto; width: min(222px, 60vw); text-align: center; }
.qr svg { display: block; width: 100%; height: auto; }
.qr figcaption { font-size: 13px; color: #b9b2a2; }
.seats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.seat { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-bottom: 1px solid #39414d; }
.chip { font-size: 12px; padding: 1px 6px; border: 1px solid var(--plattenbau); border-radius: 3px; color: #cfc8b8; }
.chip.away { border-color: var(--red-night); color: var(--red-night); }
/* Held elements: no magnifier, no selection, no scrolling (PLAN.md 0.4) */
[data-hold] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: none; }
.idcard { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 52px; padding: 8px 12px; border: 2px solid var(--plattenbau); border-radius: 4px; background: var(--paper); color: var(--ink); font: inherit; text-align: left; }
.idcard .role { font: 700 18px var(--title); text-transform: uppercase; }
.idcard .phrase { font-size: 14px; color: var(--grey-on-paper); }
.idcard .hint { color: var(--grey-on-paper); }
.idcard.large { min-height: 180px; justify-content: center; }
.idcard.pulse { animation: pulse .6s ease-out 1; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(224,164,58,.9); } 100% { box-shadow: 0 0 0 14px rgba(224,164,58,0); } }
.sheet { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; gap: 10px; padding: calc(env(safe-area-inset-top) + 18px) 18px calc(env(safe-area-inset-bottom) + 30px); background: var(--paper); color: var(--ink); overflow: hidden; }
.sheet[hidden] { display: none; }
.sheet p { margin: 0; }
.sheet .btn { border-color: var(--ink); color: var(--ink); }
.sheet .btn.primary { color: var(--ink); }
.stamp-text { font-family: var(--file); font-size: 18px; }
.grudge { border-left: 4px solid var(--red-paper); padding-left: 8px; }
/* Cards */
.card { position: relative; width: var(--card-w); height: var(--card-h); border-radius: 5px; flex: none; }
.card.back { background: repeating-linear-gradient(45deg, #222d40 0 6px, var(--night) 6px 12px); border: 2px solid #39414d; }
.card.face { display: grid; grid-template-rows: minmax(0, 1fr) auto auto; overflow: hidden; background: var(--paper); color: var(--ink); border: 2px solid var(--plattenbau); }
.card.face .art-frame { aspect-ratio: auto; min-height: 0; background: #d9d1bf; }
.card .tag { font: 8px/1.2 var(--file); color: var(--grey-on-paper); text-align: center; letter-spacing: .02em; }
.card .lbl { font: 700 9px/1.2 var(--text); text-align: center; padding-bottom: 2px; white-space: nowrap; overflow: hidden; }
.card.back { overflow: hidden; }
.card.back .art-frame { aspect-ratio: auto; height: 100%; }
.card.m-micro, .card.m-dossier { border-color: var(--red-paper); color: var(--red-paper); }
.card.mini { --card-w: 34px; --card-h: 46px; } .card.mini .tag, .card.mini .lbl { display: none; }
.hand, .cards { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pick { padding: 0; border: 0; background: none; border-radius: 6px; touch-action: none; -webkit-touch-callout: none; user-select: none; }
.pick.dragging { opacity: .2; }
.pick.selected .card { outline: 3px solid var(--amber); outline-offset: 2px; transform: translateY(-6px); }
.pick.flying { opacity: .35; }
.flip { position: relative; }
.flip .under { position: absolute; inset: 0; visibility: hidden; }
.flip.peek .under { visibility: visible; }
.lining .label { margin-bottom: 4px; }
.choose { gap: 10px; }
.slot { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.slot .btn { min-height: 44px; padding: 0 8px; font-size: 14px; }
.slot.chosen .card.back { outline: 3px solid var(--amber); outline-offset: 2px; }
.need { list-style: none; margin: 0; padding: 0; display: flex; gap: 14px; justify-content: center; align-items: center; }
.need li { display: flex; gap: 6px; align-items: center; }
.need .name { font-size: 14px; }
.need .count { font: 700 18px var(--title); }
.digits { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; margin: 6px 0; text-align: center; font: 700 34px/1.1 var(--text); letter-spacing: .08em; }
.opname { font-size: 26px; text-align: center; color: var(--amber); }
.reveal .card.step { visibility: hidden; } .reveal .card.step.shown { visibility: visible; }
.step:not(.shown)[data-at] { visibility: hidden; }
.stamp { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 0; padding: 6px 12px; border: 4px solid currentColor; font: 700 28px var(--file); text-transform: uppercase; transform: rotate(-4deg); align-self: center; }
.stamp svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 3; }
.stamp.ok { color: #8fbf94; } .stamp.ko { color: var(--red-night); }
.stamp[data-at]:not(.shown) { visibility: hidden; }
.verdict { font-size: 28px; color: var(--amber); }
.files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.file { display: grid; grid-template-columns: 1fr auto auto; gap: 2px 8px; padding: 6px 8px; background: var(--paper); color: var(--ink); font-family: var(--file); }
.file.im .camp { color: var(--red-paper); }
.file .titles { grid-column: 1 / -1; font-size: 13px; color: var(--grey-on-paper); }
.phase-debrief .reveal, .phase-reveal .reveal { --card-w: 46px; --card-h: 64px; }
.phase-debrief .reveal .tag, .phase-reveal .reveal .tag { display: none; }
.phase-debrief .reveal .lbl, .phase-reveal .reveal .lbl { font-size: 10px; }
/* Step 3: the flying cards (src/ui/throw.js) */
#flight { position: fixed; inset: 0; z-index: 25; pointer-events: none; overflow: hidden; }
.flyer { position: absolute; left: 0; top: 0; will-change: transform; filter: drop-shadow(0 6px 10px rgba(0,0,0,.45)); }
.card.fill { width: 100%; height: 100%; border-radius: 6px; }
/* Portrait everywhere (CONSTATS E8): the web cannot lock the orientation reliably (Safari), so a full-screen guard
   covers the game in landscape; native apps lock portrait; manifest.webmanifest says portrait. */
.orientation-advice { display: none; }
@media (orientation: landscape) {
  .orientation-advice { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--night); color: var(--paper); font: 700 22px var(--title); text-transform: uppercase; text-align: center; }
  .app, #flight, #toast { visibility: hidden; }
}
/* Step 4: art direction (PLAN.md §5) — pictures by core/art (WebP over a flat fallback) */
.art-frame { position: relative; display: block; aspect-ratio: 1; overflow: hidden; }
.art-frame > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art-fallback text { font: 700 40px var(--title); fill: var(--ink); }
.screen { position: relative; isolation: isolate; }
.ambiance { position: absolute; inset: 0; z-index: -1; opacity: .16; filter: grayscale(1) contrast(1.1); pointer-events: none; }
.ambiance .art-frame { height: 100%; aspect-ratio: auto; }
.idcard { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; }
.idcard .text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.idcard .photo { position: relative; width: 44px; height: 44px; border: 1px solid var(--plattenbau); }
.idcard .photo .art-frame { height: 100%; filter: grayscale(1) contrast(1.25) brightness(.95); }
.idcard .clock { position: absolute; right: 2px; bottom: 1px; font: 7px var(--file); color: var(--amber); text-shadow: 0 0 2px #000; display: none; }
.idcard.large { grid-template-columns: 1fr; justify-items: start; }
.idcard.large .photo { width: 100%; height: auto; aspect-ratio: 4 / 3; }
.idcard.large .clock { display: block; font-size: 11px; right: 6px; bottom: 4px; }
.btn.small { min-height: 44px; font-size: 14px; }
.stamp, .file { font-family: var(--file); }
/* Step 5: the opening of the files (src/ui/files.js) */
.film { position: relative; }
.film .scene { display: none; flex-direction: column; gap: 6px; padding: 10px 12px; background: var(--paper); color: var(--ink); font-family: var(--file); box-shadow: 0 4px 14px #0007; min-height: 0; overflow: hidden; }
.film .scene.shown:not(.off) { display: flex; }
.film .typed { margin: 0; font: 14px/1.35 var(--file); }
.film .typed.head { font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.film .verdict { color: var(--red-paper); }
.plan { width: 100%; height: auto; max-height: 190px; }
.plan .agent circle { fill: var(--ink); }
.plan text { font: 10px var(--file); fill: var(--ink); text-anchor: middle; }
.plan .pass { stroke: var(--grey-on-paper); stroke-width: 1.5; }
.plan .pl { font-size: 10px; fill: var(--grey-on-paper); }
.plan .shadow { stroke: var(--plattenbau); stroke-width: 1.2; stroke-dasharray: 3 3; }
.plan .dossier { stroke: var(--red-paper); stroke-width: 3; }
.notes, .plays, .titles, .ranking { list-style: none; margin: 0; padding: 0; font: 12px/1.3 var(--file); }
.notes .red { color: var(--red-paper); font-weight: 700; }
.plays { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.plays li, .ranking li { display: flex; justify-content: space-between; gap: 6px; border-bottom: 1px dotted #b7ad95; }
.ranking li.mine { font-weight: 700; }
.titles li { color: var(--red-paper); font-weight: 700; }
.stamp.small { font-size: 18px; padding: 2px 8px; border-width: 3px; }
.stamp.small.ok { color: var(--green); } .stamp.small.ko { color: var(--red-paper); }
.actions [data-off].off { display: none; }
.actions-after { display: flex; flex-direction: column; gap: 8px; }
.actions-after:not(.shown) { display: none; }
.film .label { color: var(--grey-on-paper); }
