/* Cabinet Chaos — Yuge Games house style: gold / marble / navy, chunky pixels, readable sans for text. */
:root {
  --gold: #d4af37; --gold-hi: #ffe680; --gold-sh: #9c7a1c; --gold-deep: #5e4710;
  --marble: #f4f1ea; --marble2: #d9d4c7; --marble3: #b5ad9c;
  --navy: #1b2340; --night: #0b1026; --carpet: #9e1b2a; --rose: #3f7a3a; --teal: #2a8f8a; --pink: #ff7a9a;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--night); color: var(--marble); font-family: var(--ui); }
body { min-height: 100vh; min-height: 100dvh; -webkit-tap-highlight-color: transparent; }
canvas { image-rendering: pixelated; image-rendering: crisp-edges; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a { color: var(--gold-hi); }
button { font-family: var(--ui); }

/* ------------------------------------------------ buttons */
.btn {
  min-height: 44px; padding: 10px 18px; border-radius: 6px; cursor: pointer;
  background: var(--navy); color: var(--marble); border: 2px solid var(--gold-sh);
  font-weight: 700; font-size: 15px; box-shadow: 0 3px 0 var(--gold-deep); transition: transform .06s;
}
.btn:active { transform: translateY(2px) scale(.98); box-shadow: 0 1px 0 var(--gold-deep); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-gold { background: linear-gradient(var(--gold-hi), var(--gold) 45%, var(--gold-sh)); color: var(--night); border-color: var(--gold-deep); }
.btn-big { font-size: 26px; padding: 14px 44px; letter-spacing: .08em; min-height: 60px; }
.icon-btn { min-width: 44px; min-height: 44px; border-radius: 6px; border: 2px solid var(--gold-sh); background: rgba(11,16,38,.85); color: var(--marble); font-size: 18px; cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 2px; }

/* ------------------------------------------------ home */
.screen { width: 100%; }
#home { max-width: 860px; margin: 0 auto; padding: calc(10px + var(--safe-t)) calc(16px + var(--safe-r)) calc(24px + var(--safe-b)) calc(16px + var(--safe-l)); text-align: center;
  background: radial-gradient(ellipse at top, #1f2a52, var(--night) 70%); min-height: 100dvh; }
.home-top { text-align: left; }
.back-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; text-decoration: none; }
.logo { width: min(100%, 560px); height: auto; margin: 4px auto 0; display: block; }
.tagline { font-size: 17px; margin: 6px 0 10px; }
.hero { width: min(100%, 640px); height: auto; border: 3px solid var(--gold); border-radius: 6px; box-shadow: 0 0 0 3px var(--gold-deep), 0 10px 30px #0008; }
#btnPlay { margin: 16px auto; display: block; }
.panel { background: rgba(27,35,64,.75); border: 2px solid var(--gold-deep); border-radius: 8px; padding: 12px; margin: 14px 0; }
.panel h2 { margin: 0 0 10px; color: var(--gold-hi); font-size: 16px; letter-spacing: .06em; text-transform: uppercase; }
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.char { min-height: 44px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px; background: var(--night); border: 2px solid #2a3458; border-radius: 6px; color: var(--marble); cursor: pointer; }
.char canvas, .char .rand { width: 56px; height: 56px; border-radius: 4px; }
.char .rand { display: grid; place-items: center; background: var(--navy); font-size: 32px; color: var(--gold-hi); font-weight: 900; }
.char-name { font-size: 12px; line-height: 1.2; }
.char.on { border-color: var(--gold-hi); background: #2a2410; box-shadow: 0 0 0 2px var(--gold); }
.fine { font-size: 12px; color: var(--marble3); margin: 8px 0 0; }
.diff-sel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.diff { min-height: 56px; display: flex; flex-direction: column; justify-content: center; gap: 2px; border-radius: 6px; cursor: pointer; background: var(--night); color: var(--marble); border: 2px solid #2a3458; }
.diff b { font-size: 16px; } .diff small { color: var(--marble3); font-size: 12px; }
.diff.on { border-color: var(--gold-hi); background: #2a2410; box-shadow: 0 0 0 2px var(--gold); }
.diff-info { margin: 10px 0 0; font-size: 13px; }
.diff-facts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 8px; }
.fact { background: var(--night); border: 1px solid var(--gold-deep); border-radius: 4px; padding: 4px 8px; display: flex; flex-direction: column; min-width: 92px; }
.fact small { color: var(--marble3); font-size: 11px; } .fact b { color: var(--gold-hi); font-size: 15px; }
.brains { display: block; color: var(--marble2); }
.home-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 12px 0; }
.stats-line { font-size: 13px; color: var(--marble3); }
.home-foot { margin-top: 18px; font-size: 12px; color: var(--marble3); }
.home-foot a { display: inline-block; min-height: 44px; line-height: 44px; }

/* ad slots — reserved space only, hub pattern */
.adslot { margin: 18px auto 0; text-align: center; }
.ad-label { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--marble3); margin-bottom: 6px; }
.ad-box { margin: 0 auto; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--gold-sh); border-radius: 10px; overflow: hidden; background: rgba(11,16,38,.6); }
.ad-leader .ad-box { width: 100%; max-width: 320px; height: 100px; }
@media (min-width: 768px) { .ad-leader .ad-box { max-width: 728px; height: 90px; } }
.ad-rect .ad-box { width: 300px; max-width: 100%; height: 250px; }
.house { display: flex; flex-direction: column; gap: 4px; color: var(--gold); }
.house b { letter-spacing: .1em; } .house span { font-size: 12px; color: var(--marble3); }

/* ------------------------------------------------ modals */
.modal { position: fixed; inset: 0; background: rgba(5,8,20,.82); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal-box { width: min(560px, 100%); max-height: 92dvh; overflow: auto; background: var(--navy); border: 3px solid var(--gold); border-radius: 8px; padding: 14px; text-align: left; }
.ov-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ov-head h2 { margin: 0; color: var(--gold-hi); font-size: 18px; }
.slider { display: flex; align-items: center; gap: 10px; margin: 14px 0; min-height: 44px; }
.slider input { flex: 1; min-height: 32px; accent-color: var(--gold); }
.toggle { display: flex; gap: 10px; align-items: center; min-height: 44px; margin: 8px 0 14px; }
.toggle input { width: 24px; height: 24px; accent-color: var(--gold); }
.hear-out { min-height: 60px; margin-top: 10px; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.how-tile { display: flex; flex-direction: column; gap: 4px; background: var(--night); border: 1px solid var(--gold-deep); border-radius: 6px; padding: 8px; font-size: 13px; }
.how-tile canvas { width: 100%; height: auto; border-radius: 4px; }
.how-tile b { color: var(--gold-hi); }

/* ------------------------------------------------ game */
#game { position: fixed; inset: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; }
#world { -webkit-touch-callout: none; -webkit-user-select: none; }
body.playing { overflow: hidden; overscroll-behavior: none; }
.actions > * { pointer-events: auto; }
.toast, .room-label, .sab-banner { pointer-events: none !important; }
#world { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hud { position: absolute; inset: 0; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-top { position: absolute; top: calc(8px + var(--safe-t)); left: calc(8px + var(--safe-l)); right: calc(8px + var(--safe-r)); display: flex; justify-content: space-between; gap: 8px; pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.taskbar { display: flex; align-items: center; gap: 8px; background: rgba(11,16,38,.85); border: 2px solid var(--gold-deep); border-radius: 6px; padding: 6px 10px; min-width: 200px; flex: 0 1 380px; }
.tb-label { font-size: 12px; font-weight: 800; color: var(--gold-hi); letter-spacing: .08em; }
.tb-track { flex: 1; height: 14px; background: #2a3458; border: 2px solid #0b1026; border-radius: 3px; overflow: hidden; }
.tb-fill { height: 100%; width: 0; background: repeating-linear-gradient(90deg, #3fa34a 0 10px, #4fc35a 10px 20px); transition: width .4s; }
.tb-pct { font-weight: 800; font-size: 13px; min-width: 36px; text-align: right; }
.hud-right { display: flex; gap: 8px; align-items: center; }
.role-badge { font-weight: 900; letter-spacing: .1em; padding: 6px 10px; border-radius: 4px; border: 2px solid; font-size: 13px; }
.role-badge.loyal { color: #8fd0ff; border-color: #2a62c9; background: rgba(27,35,64,.9); }
.role-badge.leaker { color: var(--pink); border-color: var(--carpet); background: rgba(60,10,20,.9); }
.task-list { position: absolute; top: calc(58px + var(--safe-t)); left: calc(8px + var(--safe-l)); width: min(300px, 62vw); background: rgba(11,16,38,.82); border: 2px solid var(--gold-deep); border-radius: 6px; font-size: 13px; }
.tl-head { width: 100%; min-height: 36px; background: none; border: 0; color: var(--gold-hi); font-weight: 800; text-align: left; padding: 6px 10px; cursor: pointer; }
.task-list ul { margin: 0; padding: 0 10px 8px 28px; }
.task-list li { margin: 3px 0; } .task-list li.done { color: #6fcf6f; text-decoration: line-through; }
.task-list .fake-note, .task-list .ghost-note { list-style: none; margin-left: -18px; color: var(--pink); font-weight: 700; }
.task-list .ghost-note { color: #b8c0d8; }
.task-list.collapsed ul { display: none; }
.room-label { position: absolute; top: calc(60px + var(--safe-t)); right: calc(10px + var(--safe-r)); font-weight: 800; font-size: 13px; background: rgba(11,16,38,.75); padding: 4px 8px; border-radius: 4px; color: var(--gold-hi); pointer-events: none; }
.room-label:empty { display: none; }
.sab-banner { position: absolute; top: calc(96px + var(--safe-t)); left: 50%; transform: translateX(-50%); max-width: 92vw; background: #6a0f1a; border: 2px solid #ff4a5a; color: #fff; font-weight: 800; padding: 8px 14px; border-radius: 6px; text-align: center; font-size: 14px; animation: pulse 1s infinite; pointer-events: none; }
.sab-banner.doors { background: #4a2810; border-color: var(--gold); animation: none; }
@keyframes pulse { 50% { box-shadow: 0 0 18px #ff4a5a; } }
.reduce-flash .sab-banner { animation: none; }
.toast { position: absolute; bottom: calc(150px + var(--safe-b)); left: 50%; transform: translateX(-50%); max-width: min(560px, 92vw); background: rgba(11,16,38,.94); border: 2px solid var(--gold); border-radius: 8px; padding: 10px 14px; font-weight: 700; text-align: center; pointer-events: none; }
.trump-toast { position: absolute; top: calc(140px + var(--safe-t)); right: calc(10px + var(--safe-r)); display: flex; align-items: flex-start; gap: 6px; pointer-events: none; }
.tt-face { width: 56px; height: 56px; border: 2px solid var(--gold); border-radius: 4px; }
.pix-bubble { display: block; max-width: 100%; height: auto; }

/* drag-anywhere touch steering (minimal feedback: faint ring at the floating origin) + action buttons */
.drag-dot { position: absolute; left: 0; top: 0; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; border: 2px solid rgba(255,230,128,.35); background: rgba(244,241,234,.06); pointer-events: none !important; opacity: 0; transition: opacity .12s; }
.drag-dot.on { opacity: 1; }
.actions { pointer-events: none !important; position: absolute; right: calc(10px + var(--safe-r)); bottom: calc(12px + var(--safe-b)); display: flex; flex-wrap: wrap-reverse; justify-content: flex-end; align-items: flex-end; gap: 8px; max-width: 70vw; }
.act { min-width: 72px; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: rgba(11,16,38,.88); color: var(--marble); border: 3px solid var(--gold-sh); border-radius: 10px; font-weight: 900; font-size: 12px; cursor: pointer; transition: transform .06s; }
.act .ic { font-size: 22px; line-height: 1; }
.act:disabled { opacity: .4; }
.act.ready { border-color: var(--gold-hi); box-shadow: 0 0 12px rgba(255,230,128,.45); }
.act:active { transform: scale(.94); }
.act.small { min-height: 48px; min-width: 64px; }
.act.big { min-width: 96px; min-height: 96px; border-radius: 50%; font-size: 14px; }
.act.big .ic { font-size: 30px; }
.act.leaker.ready { border-color: var(--pink); box-shadow: 0 0 14px rgba(255,122,154,.5); }
.keys-hint { position: absolute; bottom: calc(6px + var(--safe-b)); left: calc(10px + var(--safe-l)); font-size: 12px; color: var(--marble3); background: rgba(11,16,38,.6); padding: 3px 8px; border-radius: 4px; margin: 0; pointer-events: none; }
.touch { display: none !important; }
body.touch-mode .touch { display: flex !important; }
body.touch-mode .desk { display: none !important; }

.flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.flash.go { animation: flash .5s ease-out; }
.flash.white { background: #fff; } .flash.pink { background: #ff8fb8; } .flash.dark { background: #000; }
.flash.soft.go { animation: flashSoft .5s ease-out; }
@keyframes flash { 0% { opacity: .75; } 100% { opacity: 0; } }
@keyframes flashSoft { 0% { opacity: .18; } 100% { opacity: 0; } }
.sparkle { position: absolute; left: 50%; top: 45%; width: 10px; height: 10px; pointer-events: none; opacity: 0; }
.sparkle.go { animation: sparkle .8s ease-out; }
@keyframes sparkle { 0% { opacity: 1; box-shadow: 0 0 0 0 var(--gold-hi), 20px -20px 0 0 var(--gold), -20px -10px 0 0 var(--gold-hi); } 100% { opacity: 0; box-shadow: 0 -40px 0 4px transparent, 60px -60px 0 2px transparent, -60px -40px 0 2px transparent; } }

/* ------------------------------------------------ overlays */
.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(5,8,20,.55); z-index: 20; padding: calc(8px + var(--safe-t)) calc(8px + var(--safe-r)) calc(8px + var(--safe-b)) calc(8px + var(--safe-l)); }
.ov-panel { width: min(560px, 100%); max-height: 100%; overflow: auto; background: var(--navy); border: 3px solid var(--gold); border-radius: 8px; padding: 12px; box-shadow: 0 0 0 3px var(--gold-deep); }
.overlay[data-kind="map"] .ov-panel, .overlay[data-kind="cams"] .ov-panel { width: min(900px, 100%); }
.ov-body { margin-top: 8px; text-align: center; }
.task-hint { margin: 6px 0 10px; font-size: 15px; }
.task-canvas { width: 100%; height: auto; border: 2px solid var(--gold-deep); border-radius: 4px; touch-action: none; background: #000; }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.news-wrap { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 8px; align-items: stretch; min-height: 150px; }
.bin { border-radius: 8px; font-weight: 900; font-size: 18px; min-height: 120px; cursor: pointer; border: 3px dashed; }
.bin-real { background: #12341a; color: #8fe08f; border-color: #3fa34a; } .bin-fake { background: #3a0c14; color: #ff8a9a; border-color: #c8202f; }
.news-stack { display: grid; place-items: center; }
.news-card { background: var(--marble); color: var(--night); border: 2px solid var(--gold-deep); border-radius: 6px; padding: 12px; font-weight: 800; font-family: Georgia, serif; font-size: 15px; cursor: grab; touch-action: none; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 4px 0 var(--gold-sh); }
.news-card.dragging { cursor: grabbing; z-index: 5; position: relative; }
.news-kicker { color: #c8202f; font-size: 11px; letter-spacing: .1em; font-family: var(--ui); }
.news-count { margin-top: 8px; font-weight: 700; color: var(--gold-hi); }
.coke-ticket { background: var(--marble); color: var(--night); border-radius: 6px; padding: 10px; display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: center; font-size: 14px; }
.coke-ticket .served { text-decoration: line-through; opacity: .5; }
.coke-tray { margin: 10px 0; min-height: 32px; font-size: 22px; }
.coke-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.coke-btn { font-size: 16px; min-height: 52px; }
.gold-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gold-pile, .gold-zone { min-height: 170px; border-radius: 8px; padding: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; justify-content: center; }
.gold-pile { background: #2a2a34; } .gold-zone { background: #1a1a22; border: 3px dashed var(--gold); flex-direction: column-reverse; flex-wrap: nowrap; justify-content: flex-start; align-items: center; gap: 2px; }
.gold-bar { width: 58px; height: 26px; background: linear-gradient(var(--gold-hi), var(--gold) 40%, var(--gold-sh)); border: 2px solid var(--gold-deep); border-radius: 3px; cursor: grab; touch-action: none; }
.gold-bar.placed { height: 12px; width: 70px; cursor: default; }
.roses { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.rose { position: relative; width: 76px; height: 86px; font-size: 34px; background: #1e4a1e; border: 3px solid #3f7a3a; border-radius: 10px; cursor: pointer; overflow: hidden; touch-action: none; }
.rose-meter { position: absolute; left: 0; bottom: 0; width: 100%; height: 0; background: rgba(80,160,255,.45); pointer-events: none; }
.rose.watering { border-color: #4ab0ff; } .rose.watered { border-color: var(--gold-hi); font-size: 26px; }
.upload-box { margin: 10px 0; } .upload-bar { height: 22px; background: #2a3458; border: 2px solid var(--night); border-radius: 4px; overflow: hidden; }
.upload-fill { height: 100%; width: 0; background: linear-gradient(90deg, #1d9bf0, #8fd0ff); } .upload-fill.fake { background: repeating-linear-gradient(45deg, #ff7a9a 0 10px, #c84a7a 10px 20px); }
.upload-label { margin-top: 6px; font-size: 14px; }
.seats { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.seat { width: 92px; min-height: 104px; background: #6a3a1c; border: 3px dashed var(--gold); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.seat.filled { border-style: solid; border-color: #6fcf6f; }
.seat-portrait { width: 48px; height: 48px; } .seat-icon { font-size: 16px; } .seat-name { font-size: 10px; background: var(--marble); color: var(--night); padding: 1px 4px; border-radius: 2px; }
.plates { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.plate { background: var(--marble); color: var(--night); font-weight: 800; padding: 10px 12px; border: 2px solid var(--gold-sh); border-radius: 4px; cursor: grab; touch-action: none; font-size: 13px; min-height: 44px; display: flex; align-items: center; }
.breaker { width: 120px; height: 160px; font-size: 26px; font-weight: 900; background: #2a2a30; color: #ff6060; border: 4px solid var(--gold-sh); border-radius: 10px; cursor: pointer; }
.breaker.on { color: #6fcf6f; }
.hold-btn { width: 100%; min-height: 64px; margin-bottom: 10px; touch-action: none; }
.hand-pad { width: 180px; height: 180px; border-radius: 16px; background: #3a0c14; border: 4px solid #c8202f; color: #fff; font-size: 30px; font-weight: 900; cursor: pointer; touch-action: none; }
.hand-pad.on { background: #12341a; border-color: #6fcf6f; }
.cam-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cam { position: relative; } .cam canvas { width: 100%; height: auto; border: 2px solid #2a8f8a; border-radius: 4px; display: block; }
.cam-name { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.65); font-size: 12px; padding: 2px 6px; border-radius: 3px; }
.map-wrap { position: relative; }
.map-canvas { width: 100%; height: auto; display: block; border: 2px solid var(--gold-deep); border-radius: 4px; }
.map-room { position: absolute; transform: translate(-50%, -50%); background: rgba(11,16,38,.75); color: var(--gold-hi); border: 1px solid var(--gold-deep); border-radius: 4px; font-size: 11px; font-weight: 800; padding: 4px 6px; min-height: 28px; cursor: pointer; }
.overlay[data-kind="map"] .map-room { min-height: 32px; }
.map-legend { margin-top: 8px; font-size: 13px; text-align: left; }
.sab-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sab-opt { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; background: #2a0c18; color: var(--marble); border: 2px solid var(--carpet); border-radius: 8px; padding: 10px; min-height: 96px; cursor: pointer; }
.sab-opt:disabled { opacity: .45; } .sab-opt b { color: var(--pink); } .sab-opt small { color: var(--marble2); font-size: 12px; } .sab-ic { font-size: 22px; }

/* ------------------------------------------------ intro */
.intro { position: absolute; inset: 0; z-index: 30; background: radial-gradient(circle, #1b2340, #05070f 75%); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 16px; }
.intro-shh { color: var(--marble3); font-size: 15px; }
.intro-role { font-size: clamp(48px, 14vw, 96px); font-weight: 900; letter-spacing: .12em; }
.intro-role.loyal { color: #8fd0ff; text-shadow: 0 4px 0 #2a62c9; } .intro-role.leaker { color: var(--pink); text-shadow: 0 4px 0 var(--carpet); }
.intro-text { font-size: 18px; max-width: 520px; }
.intro-line { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.intro-p { width: 52px; height: 52px; border: 2px solid var(--gold-deep); border-radius: 4px; }
.intro-p.mate { border-color: var(--pink); box-shadow: 0 0 10px var(--pink); }
.intro-note { color: var(--marble3); font-size: 13px; }

/* ------------------------------------------------ meeting */
.meeting { position: absolute; inset: 0; z-index: 25; background: linear-gradient(#18224a, #0b1026); display: flex; flex-direction: column; padding: calc(6px + var(--safe-t)) calc(8px + var(--safe-r)) calc(6px + var(--safe-b)) calc(8px + var(--safe-l)); overflow: hidden; }
.mt-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-bottom: 2px solid var(--gold-deep); padding-bottom: 4px; }
.mt-title { font-weight: 900; color: var(--gold-hi); letter-spacing: .08em; font-size: 18px; }
.mt-clock { font-weight: 800; } .mt-clock b { color: var(--gold-hi); font-size: 20px; }
/* FIX ROUND 4: fixed height — a taller (2-3 line) Trump bubble used to grow this row and shove the whole meeting down/up */
.mt-trumprow { display: flex; align-items: center; gap: 8px; height: 64px; flex: none; margin: 4px 0; overflow: hidden; }
.mt-trump { width: 60px; height: 60px; border: 3px solid var(--gold); border-radius: 6px; flex: none; }
.mt-trump-bubble { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; }
.mt-trump-bubble .pix-bubble { max-height: 60px; max-width: 100%; width: auto; height: auto; }
.pop { animation: pop .25s ease-out; } @keyframes pop { 0% { transform: scale(.6); } 80% { transform: scale(1.05); } 100% { transform: scale(1); } }
.mt-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.15fr 1fr; gap: 8px; }
.mt-left, .mt-right { min-height: 0; display: flex; flex-direction: column; }
.mt-left { overflow: auto; }
.mt-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.card { position: relative; display: grid; grid-template-columns: 48px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 8px; text-align: left; background: #20305f; color: var(--marble); border: 2px solid #3a4a8a; border-radius: 6px; padding: 5px; min-height: 60px; cursor: pointer; }
.card-portrait { width: 48px; height: 48px; grid-row: span 2; border-radius: 3px; }
.card-name { font-weight: 800; font-size: 13px; line-height: 1.15; }
.card-badges { font-size: 11px; display: flex; gap: 4px; flex-wrap: wrap; }
.card.me { border-color: #4ab0ff; }
.card.dead { opacity: .5; filter: grayscale(1); cursor: default; }
.card.selected, .skip-btn.selected { border-color: var(--gold-hi); box-shadow: 0 0 0 3px var(--gold); }
.b-slip { background: #ff8fb8; color: #3a0c14; padding: 0 4px; border-radius: 2px; font-weight: 800; }
.b-mate { background: var(--carpet); color: #fff; padding: 0 4px; border-radius: 2px; font-weight: 800; }
.typing { position: absolute; right: 6px; top: 4px; background: var(--marble); color: var(--night); font-weight: 900; border-radius: 10px; padding: 0 8px; font-size: 18px; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .35; } }
.voted { position: absolute; right: 6px; bottom: 4px; font-size: 10px; font-weight: 800; color: var(--gold-hi); }
.card-votes { position: absolute; left: 58px; bottom: 2px; display: flex; gap: 2px; }
.vote-chip { width: 22px; height: 22px; border: 1px solid var(--gold); border-radius: 2px; }
.mt-voterow { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.skip-votes { display: flex; gap: 2px; flex-wrap: wrap; }
.confirm-row { display: flex; gap: 8px; align-items: center; margin-top: 6px; font-weight: 800; flex-wrap: wrap; }
.vote-hint { font-size: 13px; color: var(--marble3); margin: 6px 0; }
.mt-reveal { font-weight: 900; color: var(--gold-hi); font-size: 18px; margin: 4px 0; }
.mt-chat { flex: 1; min-height: 80px; overflow-y: auto; overflow-anchor: none; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; background: rgba(5,8,20,.6); border: 2px solid var(--gold-deep); border-radius: 6px; padding: 6px; font-size: 14px; }
.msg { display: flex; align-items: flex-start; gap: 6px; margin: 4px 0; line-height: 1.3; }
.msg b { white-space: nowrap; color: var(--gold-hi); }
.msg.me b { color: #8fd0ff; } .msg.trump b { color: #ff9a6a; } .msg.abe span { font-size: 22px; font-weight: 900; }
.msg-face { width: 22px; height: 22px; flex: none; border-radius: 2px; }
.mt-qc { margin-top: 6px; }
.mt-qc.blocked .qc-list, .mt-qc.blocked .qc-tabs { opacity: .35; pointer-events: none; }
.qc-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.qc-tab { min-height: 40px; background: var(--night); color: var(--marble); border: 2px solid #2a3458; border-radius: 6px 6px 0 0; font-weight: 800; font-size: 13px; cursor: pointer; }
.qc-tab.on { border-color: var(--gold); color: var(--gold-hi); }
.qc-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 4px; }
.qc-sent { min-height: 44px; background: #20305f; color: var(--marble); border: 2px solid #3a4a8a; border-radius: 6px; font-size: 13px; text-align: left; padding: 4px 8px; cursor: pointer; }
.qc-picker { margin-top: 6px; background: var(--night); border: 2px solid var(--gold); border-radius: 6px; padding: 6px; }
.qc-preview { font-weight: 800; color: var(--gold-hi); margin-bottom: 6px; font-size: 14px; }
.qc-chips { display: flex; flex-wrap: wrap; gap: 4px; max-height: 160px; overflow: auto; }
.chip { min-height: 44px; display: inline-flex; align-items: center; gap: 4px; background: #20305f; color: var(--marble); border: 2px solid #3a4a8a; border-radius: 22px; padding: 2px 10px 2px 3px; font-size: 13px; cursor: pointer; }
.chip.room { padding-left: 10px; } .chip.cancel { padding-left: 10px; border-color: var(--carpet); }
.chip-face { width: 32px; height: 32px; border-radius: 50%; }
.qc-notice { min-height: 18px; margin: 4px 0 0; font-size: 13px; color: var(--pink); font-weight: 700; }
.mt-splash { position: absolute; inset: 0; background: rgba(5,8,20,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; z-index: 2; padding: 16px; }
.splash-title { width: min(90vw, 640px); height: auto; }
.splash-sprite { width: 156px; height: auto; }
.splash-sub { font-size: 18px; font-weight: 700; max-width: 560px; }

/* ------------------------------------------------ ejection */
.eject { position: absolute; inset: 0; z-index: 40; background: #05070f; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px; }
.eject-scene { width: min(96vw, 960px, calc((100dvh - 150px) * 16 / 9)); height: auto; border: 3px solid var(--gold); border-radius: 6px; }
.eject-bubble { position: absolute; top: calc(10px + var(--safe-t)); left: 50%; transform: translateX(-50%); width: min(92vw, 640px); display: flex; justify-content: center; }
.eject-bubble .pix-bubble { max-width: 100%; }
.eject-card { margin-top: 10px; text-align: center; background: var(--navy); border: 3px solid var(--gold); border-radius: 8px; padding: 12px 18px; }
.card-title { font-size: clamp(20px, 5vw, 34px); font-weight: 900; }
.card-title.good { color: #6fcf6f; } .card-title.bad { color: #ff8a9a; }
.card-sub { color: var(--marble2); font-weight: 700; margin-top: 4px; }
.ticker { position: absolute; left: 0; right: 0; bottom: 0; background: #c8202f; color: #fff; font-weight: 900; overflow: hidden; white-space: nowrap; padding: 8px 0 calc(8px + var(--safe-b)); border-top: 3px solid var(--gold); }
.ticker span { display: inline-block; padding-left: 100%; animation: ticker 18s linear infinite; }
@keyframes ticker { to { transform: translateX(-100%); } }

/* ------------------------------------------------ end */
.end { position: absolute; inset: 0; z-index: 45; background: radial-gradient(ellipse at top, #1f2a52, #05070f 75%); overflow: auto; padding: calc(12px + var(--safe-t)) 16px 60px; text-align: center; }
.end-inner { max-width: 720px; margin: 0 auto; }
.end-result { font-size: clamp(36px, 10vw, 64px); font-weight: 900; letter-spacing: .1em; }
.end-result.win { color: var(--gold-hi); text-shadow: 0 4px 0 var(--gold-deep); } .end-result.lose { color: #ff8a9a; text-shadow: 0 4px 0 var(--carpet); }
.end-title { color: var(--marble); font-size: clamp(18px, 4.5vw, 26px); margin: 6px 0; }
.end-why { color: var(--marble3); }
.end-trumprow { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 110px; }
.end-trump { width: 84px; height: 104px; }
.end-bubble { min-width: 120px; }
.end-roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin: 10px 0; }
.end-p { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto auto; column-gap: 6px; align-items: center; text-align: left; background: var(--navy); border: 2px solid #2a3458; border-radius: 6px; padding: 4px; font-size: 12px; }
.end-p canvas { width: 40px; height: 40px; grid-row: span 3; }
.end-p.leaker { border-color: var(--carpet); } .end-p.leaker b { color: var(--pink); }
.pause { position: absolute; inset: 0; z-index: 60; background: rgba(5,8,20,.85); display: grid; place-items: center; }
.pause-box { background: var(--navy); border: 3px solid var(--gold); border-radius: 8px; padding: 20px; text-align: center; display: flex; flex-direction: column; gap: 10px; max-width: 90vw; }
.pause-box h2 { color: var(--gold-hi); margin: 0; letter-spacing: .1em; }
.noscript { padding: 20px; text-align: center; }

/* ------------------------------------------------ small screens */
@media (max-width: 700px) {
  .mt-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; overflow: auto; }
  .mt-grid { grid-template-columns: repeat(4, 1fr); }
  .card { grid-template-columns: 1fr; grid-template-rows: auto; justify-items: center; text-align: center; padding: 3px; min-height: 0; }
  .card-portrait { width: 40px; height: 40px; grid-row: auto; }
  .card-name { font-size: 10px; }
  .card-votes { position: static; flex-wrap: wrap; justify-content: center; }
  .mt-chat { min-height: 110px; max-height: 26dvh; }
  .qc-list { grid-template-columns: 1fr; }
  .mt-left { overflow: visible; }
  .news-wrap { grid-template-columns: 1fr 1fr; } .news-stack { grid-column: span 2; grid-row: 1; }
  .task-list { font-size: 12px; }
  .taskbar { min-width: 0; }
  .sab-grid { grid-template-columns: 1fr; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .mt-trumprow { height: 44px; } .mt-trump { width: 40px; height: 40px; } .mt-trump-bubble .pix-bubble { max-height: 40px; }
  .task-list { top: calc(52px + var(--safe-t)); max-height: 40vh; overflow: auto; }
  .act.big { min-width: 84px; min-height: 84px; }
}
@media (prefers-reduced-motion: reduce) { .ticker span { animation-duration: 40s; } .pop { animation: none; } }
