/* ============================================================
   Minecraft der Toten — global styles
   Theme: aged theater dark-wood + parchment UI, Minecraft block
   chrome (hard edges, chunky inset borders, pixel fonts).
   ============================================================ */
:root {
    --bg: #16130f;
    --bg-panel: #241e17;
    --bg-panel-2: #2e261d;
    --stone: #6f6f6f;
    --wood: #9c7f4e;
    --wood-dark: #5f4526;
    --parchment: #e8ddc0;
    --text: #efe8d6;
    --text-dim: #c9bda1;
    --accent: #ffd94a;
    --danger: #e74c3c;
    --green: #69f069;
    --blue: #79b8ff;
    --font-head: 'Press Start 2P', monospace;
    --font-body: 'VT323', monospace;
    --border-block: 3px solid #0c0a07;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    overflow-x: hidden;
    font-family: var(--font-body);
    font-size: 19px;
    color: var(--text);
    background: var(--bg);
    background-image:
        linear-gradient(rgba(10,8,6,0.86), rgba(10,8,6,0.92)),
        url('./images/hero-menu.jpg');
    background-size: cover;
    background-attachment: fixed;
    line-height: 1.45;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }
.mt { margin-top: 22px; }

/* ---------------- Header ---------------- */
.app-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; row-gap: 4px;
    padding: 10px 18px;
    background: linear-gradient(#221b13, #191411);
    border-bottom: var(--border-block);
    position: sticky; top: 0; z-index: 50;
    transition: transform 0.25s ease;
}
.app-header.nav-hidden { transform: translateY(-110%); }
@media (prefers-reduced-motion: reduce) { .app-header { transition: none; } }
.nav-brand {
    font-family: var(--font-head);
    font-size: 14px; letter-spacing: 1px; color: var(--parchment);
    display: flex; align-items: center; gap: 10px;
    text-shadow: 2px 2px 0 #000;
}
.nav-brand em { font-style: normal; color: #ff7d70; }
.brand-block {
    width: 18px; height: 18px; flex: none;
    background:
        linear-gradient(135deg, #7fbf4d 0 50%, #5a9138 50% 100%);
    box-shadow: inset -3px -3px 0 rgba(0,0,0,0.35), inset 3px 3px 0 rgba(255,255,255,0.25);
}
.top-links { display: flex; gap: 6px; flex-wrap: wrap; }
.top-links a {
    color: var(--text); text-decoration: none; font-size: 20px;
    padding: 4px 12px; border: 2px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}
.top-links a:hover { background: #37301f; border-color: #0c0a07; color: var(--accent); }
.top-links a:active { transform: translateY(1px); }

/* ---------------- Game stage ---------------- */
main { max-width: 1240px; margin: 0 auto; padding: 14px; }
.game-stage {
    position: relative;
    height: min(84dvh, 820px);
    min-height: 480px;
    border: var(--border-block);
    box-shadow: 0 0 0 3px #3a3126, 0 18px 50px rgba(0,0,0,0.6);
    background: #0b0a09 url('./images/hero-menu.jpg') center/cover no-repeat;
    overflow: hidden;
}
.game-stage.in-game { background-image: none; }
#gameCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }

/* HUD generic */
.hud { position: absolute; z-index: 5; pointer-events: none; }
.hud-top-left { top: 14px; left: 16px; text-align: left; }
.round-tag { font-family: var(--font-head); font-size: 10px; color: #d8a0a0; text-shadow: 1px 1px 0 #000; }
.round-num {
    font-family: var(--font-head); font-size: 44px; color: var(--danger);
    text-shadow: 3px 3px 0 #300, 0 0 22px rgba(231,60,60,0.55);
    line-height: 1;
}
@media (prefers-reduced-motion: no-preference) {
    .round-num.round-change { animation: roundPulse 2.2s ease; }
    @keyframes roundPulse { 0% { transform: scale(1); filter: brightness(3); } 30% { transform: scale(1.4); } 100% { transform: scale(1); } }
}
.zrow { font-size: 17px; color: var(--text-dim); text-shadow: 1px 1px 0 #000; }
.hud-top-right { top: 14px; right: 16px; display: flex; gap: 8px; flex-direction: column; align-items: flex-end; }
.pu-timer {
    display: flex; align-items: center; gap: 7px;
    background: rgba(12,10,7,0.8); border: 2px solid #0c0a07; padding: 3px 9px 3px 4px;
}
.pu-timer img { width: 26px; height: 26px; }
.pu-timer b { font-size: 21px; color: var(--accent); min-width: 24px; text-align: right; }
@media (prefers-reduced-motion: no-preference) {
    .pu-timer.warn { animation: puWarn 0.5s steps(2) infinite; }
    @keyframes puWarn { 50% { border-color: var(--danger); background: rgba(90,15,10,0.85); } }
}
.pu-timer.warn b { color: var(--danger); }

.room-name {
    position: absolute; top: 16%; left: 50%; transform: translateX(-50%);
    font-family: var(--font-head); font-size: 15px; color: var(--parchment);
    text-shadow: 2px 2px 0 #000; opacity: 0; pointer-events: none; z-index: 5;
    letter-spacing: 2px;
}
@media (prefers-reduced-motion: no-preference) {
    .room-name.show { animation: roomShow 2.6s ease forwards; }
    @keyframes roomShow { 0% { opacity: 0; transform: translate(-50%, 8px); } 15% { opacity: 1; transform: translate(-50%, 0); } 80% { opacity: 1; } 100% { opacity: 0; } }
}
@media (prefers-reduced-motion: reduce) { .room-name.show { opacity: 1; } }

.toasts { position: absolute; top: 24%; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; z-index: 6; pointer-events: none; width: min(92%, 560px); }
.game-toast {
    background: rgba(14,11,8,0.88); border: 2px solid #0c0a07; box-shadow: 0 0 0 2px #4a3d28;
    color: var(--parchment); padding: 5px 14px; font-size: 19px; text-align: center;
    transition: opacity 0.4s;
}
.game-toast.out { opacity: 0; }

.prompt {
    position: absolute; bottom: 27%; left: 50%; transform: translateX(-50%);
    background: rgba(14,11,8,0.9); border: 2px solid #0c0a07; box-shadow: 0 0 0 2px #6a5636;
    padding: 6px 16px; font-size: 21px; color: var(--accent); z-index: 6; pointer-events: none;
    text-align: center; max-width: 92%;
}

.crosshair { position: absolute; left: -100px; top: -100px; width: 0; height: 0; z-index: 6; pointer-events: none; }
.crosshair i { position: absolute; background: rgba(255,255,255,0.85); box-shadow: 0 0 3px #000; }
.crosshair i:nth-child(1), .crosshair i:nth-child(2) { width: 2px; height: 7px; left: -1px; }
.crosshair i:nth-child(1) { top: -11px; } .crosshair i:nth-child(2) { top: 4px; }
.crosshair i:nth-child(3), .crosshair i:nth-child(4) { height: 2px; width: 7px; top: -1px; }
.crosshair i:nth-child(3) { left: -11px; } .crosshair i:nth-child(4) { left: 4px; }
@media (prefers-reduced-motion: no-preference) {
    .crosshair.hit i { animation: hitm 0.18s ease; }
    @keyframes hitm { 0% { background: #ff5348; transform: scale(1.5); } 100% { background: rgba(255,255,255,0.85); } }
}

.fps { position: absolute; bottom: 8px; right: 10px; z-index: 6; font-size: 15px; color: var(--green); text-shadow: 1px 1px 0 #000; }

.vignette {
    position: absolute; inset: 0; z-index: 4; pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 42%, rgba(160,10,5,0.55) 82%, rgba(120,0,0,0.85) 100%);
    transition: opacity 0.3s;
}
@media (prefers-reduced-motion: no-preference) {
    .vignette.regen { animation: regenPulse 1.1s ease-in-out infinite; }
    @keyframes regenPulse { 50% { filter: brightness(1.45); } }
}

/* Bottom HUD */
.hud-bottom {
    left: 0; right: 0; bottom: 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
}
.hud-left { display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.perk-row { display: flex; gap: 5px; }
.perk-chip {
    width: 34px; height: 38px; object-fit: contain;
    background: rgba(12,10,7,0.8); border: 2px solid; padding: 2px;
}
.points-plate {
    background: rgba(12,10,7,0.85); border: 2px solid #0c0a07; box-shadow: 0 0 0 2px #4a3d28;
    padding: 4px 12px; font-size: 17px; color: var(--text-dim); width: max-content;
}
.points-plate b { font-size: 25px; color: var(--accent); margin-left: 6px; }

.hud-center { display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: auto; }
.hearts { display: flex; gap: 3px; }
.heart {
    width: 18px; height: 17px;
    clip-path: polygon(50% 100%, 0 45%, 0 18%, 18% 0, 40% 0, 50% 14%, 60% 0, 82% 0, 100% 18%, 100% 45%);
    background: #3a3129; box-shadow: inset 0 -3px 0 rgba(0,0,0,0.4);
    transition: background 0.2s;
}
.heart.full { background: #e02c22; }
.heart.half { background: linear-gradient(90deg, #e02c22 0 50%, #3a3129 50% 100%); }
.heart.full.jugg { background: #ff6b3d; }
.hotbar { display: flex; gap: 4px; background: rgba(12,10,7,0.75); padding: 4px; border: 2px solid #0c0a07; box-shadow: 0 0 0 2px #4a3d28; }
.hotslot {
    position: relative; width: 58px; height: 58px;
    background: linear-gradient(#4b4b4b, #2f2f2f);
    border: 3px solid #1a1a1a;
    box-shadow: inset 2px 2px 0 rgba(255,255,255,0.18), inset -2px -2px 0 rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.08s;
}
.hotslot:hover { filter: brightness(1.15); }
.hotslot:active { transform: translateY(1px); }
.hotslot img { width: 44px; height: 44px; object-fit: contain; image-rendering: pixelated; }
.hotslot.sel { border-color: var(--parchment); box-shadow: 0 0 0 2px #fff, inset 2px 2px 0 rgba(255,255,255,0.18); }
.hotslot b {
    position: absolute; top: 1px; left: 4px; font-size: 15px; color: #ddd;
    text-shadow: 1px 1px 0 #000; font-weight: 400;
}
.hotslot.util b { top: auto; bottom: 1px; right: 4px; left: auto; color: var(--accent); }
.hotslot.empty { opacity: 0.45; }
@media (prefers-reduced-motion: no-preference) {
    .hotslot.pap img { animation: papGlint 2.4s linear infinite; }
    @keyframes papGlint { 0%, 100% { filter: drop-shadow(0 0 3px #c66bff); } 50% { filter: drop-shadow(0 0 9px #e39bff) hue-rotate(20deg); } }
}
.ammo-plate { font-size: 20px; color: var(--text-dim); text-shadow: 1px 1px 0 #000; display: flex; gap: 8px; align-items: baseline; }
.ammo-plate .wname { color: var(--parchment); }
.ammo-plate .papname { color: #d9a1ff; }
.ammo-plate .mag { font-size: 26px; color: #fff; }
.reload-bar { position: relative; width: 190px; height: 14px; background: rgba(12,10,7,0.85); border: 2px solid #0c0a07; }
.reload-bar i { position: absolute; inset: 0; width: 0; background: var(--accent); display: block; }
.reload-bar span { position: absolute; inset: 0; font-size: 12px; text-align: center; line-height: 11px; color: #201a10; font-weight: 700; letter-spacing: 2px; }
.hud-right { width: 60px; }

.down-overlay {
    position: absolute; inset: 0; z-index: 7; pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(60,0,0,0.25), rgba(20,0,0,0.72));
    display: flex; align-items: flex-start; justify-content: center; padding-top: 18%;
}
.down-msg { font-family: var(--font-head); font-size: 17px; color: #ff8b7f; text-shadow: 3px 3px 0 #200; text-align: center; }

/* ---------------- Stage overlays (lobby / report) ---------------- */
.stage-overlay {
    position: absolute; inset: 0; z-index: 20;
    background: rgba(8,6,4,0.82);
    display: flex; align-items: center; justify-content: center;
    overflow-y: auto; padding: 18px;
}
.mc-heading { font-family: var(--font-head); font-size: 19px; color: var(--parchment); text-shadow: 3px 3px 0 #000; letter-spacing: 1px; }
.mc-heading.danger { color: var(--danger); }
.mc-btn {
    font-family: var(--font-head); font-size: 11px; padding: 11px 16px;
    color: var(--text); background: linear-gradient(#6f6f6f, #4f4f4f);
    border: 3px solid #1a1a1a;
    box-shadow: inset 2px 2px 0 rgba(255,255,255,0.28), inset -2px -2px 0 rgba(0,0,0,0.5);
    text-shadow: 2px 2px 0 rgba(0,0,0,0.6);
    transition: filter 0.12s;
}
.mc-btn:hover { filter: brightness(1.2); }
.mc-btn:active { transform: translateY(1px); box-shadow: inset -2px -2px 0 rgba(255,255,255,0.15), inset 2px 2px 0 rgba(0,0,0,0.4); }
.mc-btn.primary { background: linear-gradient(#4f8f3c, #38702a); color: #eaffdd; }
.mc-btn:disabled { opacity: 0.55; cursor: default; }

.lobby-panel {
    width: min(720px, 100%); margin: auto;
    background: var(--bg-panel); border: var(--border-block); box-shadow: 0 0 0 3px #4a3d28, 0 16px 40px rgba(0,0,0,0.6);
    padding: 22px; text-align: center;
}
.lobby-maps { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0; }
.map-card {
    background: var(--bg-panel-2); border: 3px solid #0c0a07; padding: 0 0 12px;
    color: var(--text); text-align: left; display: flex; flex-direction: column; gap: 5px;
    transition: transform 0.12s, box-shadow 0.12s;
}
.map-card img { width: 100%; height: 130px; object-fit: cover; border-bottom: 3px solid #0c0a07; filter: saturate(0.9); }
.map-card:hover { transform: translateY(-2px); box-shadow: 0 0 0 2px #6a5636; }
.map-card.sel { box-shadow: 0 0 0 3px var(--accent); }
.map-card.sel .map-name { color: var(--accent); }
.map-name { font-family: var(--font-head); font-size: 12px; padding: 8px 12px 0; }
.map-desc { font-size: 17px; color: var(--text-dim); padding: 0 12px; line-height: 1.3; }
.map-best { font-size: 16px; color: var(--blue); padding: 0 12px; }
.lobby-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.lobby-field { font-size: 17px; color: var(--text-dim); display: flex; flex-direction: column; gap: 4px; text-align: left; }
.lobby-field input, .lobby-field select, .board-controls select, .submit-row input {
    font-family: var(--font-body); font-size: 19px; color: var(--parchment);
    background: #171310; border: 2px solid #0c0a07; box-shadow: 0 0 0 2px #4a3d28;
    padding: 6px 10px; min-width: 210px;
}
.lobby-field input:focus, .lobby-field select:focus { outline: 2px solid var(--accent); }
.lobby-actions { display: flex; gap: 12px; justify-content: center; }
.lobby-hint { margin-top: 14px; font-size: 16px; color: var(--text-dim); }

/* Report */
.report-panel {
    width: min(860px, 100%); margin: auto;
    background: var(--bg-panel); border: var(--border-block); box-shadow: 0 0 0 3px #4a3d28;
    padding: 22px;
}
.report-head { text-align: center; margin-bottom: 16px; }
.death-line { font-size: 21px; margin-top: 10px; color: var(--text-dim); }
.death-line b { color: var(--parchment); }
.best-badge {
    display: inline-block; margin-top: 10px; font-family: var(--font-head); font-size: 11px;
    color: #201a10; background: var(--accent); padding: 7px 12px; box-shadow: 3px 3px 0 #000;
}
.stat-tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 18px; }
.stat-tile { background: var(--bg-panel-2); border: 2px solid #0c0a07; padding: 10px 6px; text-align: center; }
.stat-tile b { display: block; font-size: 27px; color: var(--accent); }
.stat-tile span { font-size: 15px; color: var(--text-dim); }
.report-cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; margin-bottom: 16px; }
.report-cols h3, .ai-report h3, .panel h3 { font-family: var(--font-head); font-size: 12px; color: var(--parchment); margin-bottom: 10px; }
.mc-table { width: 100%; border-collapse: collapse; font-size: 18px; }
.mc-table th { font-size: 15px; color: var(--text-dim); text-align: left; border-bottom: 2px solid #4a3d28; padding: 3px 8px; }
.mc-table td { padding: 4px 8px; border-bottom: 1px solid #352b20; }
.mc-table tr.hl td { color: var(--accent); }
.acc-bar { position: relative; background: #171310; border: 1px solid #0c0a07; height: 15px; min-width: 90px; }
.acc-bar i { position: absolute; inset: 0; width: var(--w, 0%); background: #4f8f3c; display: block; }
@media (prefers-reduced-motion: no-preference) { .acc-bar i { transition: width 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); } }
.acc-bar span { position: absolute; inset: 0; font-size: 13px; text-align: center; line-height: 14px; color: #fff; text-shadow: 1px 1px 0 #000; }
.report-list { list-style: none; font-size: 18px; color: var(--text-dim); }
.report-list li { padding: 3px 0; border-bottom: 1px solid #352b20; }
.submit-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.submit-row input { min-width: 150px; flex: 1; }
.ai-report { background: var(--bg-panel-2); border: 2px solid #0c0a07; padding: 14px; margin-bottom: 16px; }
.ai-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-body { margin-top: 10px; font-size: 19px; }
.ai-body p { margin-bottom: 8px; color: var(--text); }
.ai-title { font-family: var(--font-head); font-size: 13px; color: var(--accent); margin-bottom: 10px; }
.ai-tips h5 { font-size: 17px; color: var(--parchment); margin: 8px 0 4px; letter-spacing: 1px; }
.ai-tips ul { margin-left: 20px; color: var(--text-dim); }
.ai-loading { display: flex; align-items: center; gap: 10px; color: var(--text-dim); padding: 8px 0; }
.mc-spinner {
    width: 16px; height: 16px; flex: none; background: var(--accent);
}
@media (prefers-reduced-motion: no-preference) {
    .mc-spinner { animation: spin 0.9s steps(8) infinite; }
    @keyframes spin { to { transform: rotate(360deg); } }
}
.report-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* Perk drink animation */
@media (prefers-reduced-motion: no-preference) {
    .drink-anim { position: absolute; inset: 0; z-index: 8; pointer-events: none; display: flex; align-items: flex-end; justify-content: center; }
    .drink-anim img { width: 90px; margin-bottom: 12%; animation: drink 1.5s ease forwards; transform-origin: bottom center; }
    @keyframes drink {
        0% { transform: translateY(80px); opacity: 0; }
        25% { transform: translateY(0) rotate(0); opacity: 1; }
        55% { transform: translateY(-8px) rotate(-38deg); }
        80% { transform: translateY(-4px) rotate(-38deg); opacity: 1; }
        100% { transform: translateY(24px) rotate(0); opacity: 0; }
    }
}
@media (prefers-reduced-motion: reduce) { .drink-anim { display: none; } }

/* ---------------- Page sections ---------------- */
.page-section { padding: 44px 4px; }
.section-note { color: var(--text-dim); font-size: 19px; max-width: 760px; margin: 10px 0 20px; }
.records-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; margin-top: 20px; }
.panel { background: rgba(30,24,18,0.92); border: var(--border-block); box-shadow: 0 0 0 3px #4a3d28; padding: 18px; }
.best-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid #352b20; font-size: 19px; flex-wrap: wrap; }
.best-map { color: var(--parchment); }
.best-val b { color: var(--accent); font-size: 22px; }
.board-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.board-controls { display: flex; gap: 8px; }
.board-controls select { min-width: 0; }
.muted-note { color: #a5987c; font-size: 17px; }
.unavail { color: #a5987c; font-style: italic; }
.error { color: #ff9d94; padding: 10px; border: 2px solid #5e1812; background: rgba(90,20,12,0.25); font-size: 18px; }

/* Intel */
.featured-intel { display: grid; gap: 18px; }
.intel-card { display: grid; grid-template-columns: 320px 1fr; background: rgba(30,24,18,0.92); border: var(--border-block); box-shadow: 0 0 0 3px #4a3d28; overflow: hidden; }
.intel-media { display: flex; flex-direction: column; }
.intel-media img { width: 100%; height: 170px; object-fit: cover; border-bottom: 2px solid #0c0a07; }
.intel-media img.layout { height: 200px; object-fit: contain; background: #14100c; padding: 6px; }
.intel-body { padding: 16px 20px; }
.intel-body h3 { font-family: var(--font-head); font-size: 15px; color: var(--accent); margin-bottom: 12px; }
.intel-dl { display: grid; grid-template-columns: 170px 1fr; gap: 4px 14px; font-size: 18px; }
.intel-dl dt { color: var(--parchment); }
.intel-dl dd { color: var(--text-dim); }
.intel-src { margin-top: 12px; font-size: 15px; color: #877a5e; }
.archive-title { font-family: var(--font-head); font-size: 14px; color: var(--parchment); margin: 34px 0 6px; }
.archive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.archive-card { background: rgba(30,24,18,0.92); border: 2px solid #0c0a07; box-shadow: 0 0 0 2px #4a3d28; transition: transform 0.15s; }
.archive-card:hover { transform: translateY(-3px); }
.archive-card img { width: 100%; height: 96px; object-fit: cover; display: block; }
.archive-card figcaption, .archive-card .card-caption { display: block; padding: 6px 8px; font-size: 16px; color: var(--text-dim); text-align: center; }

/* Archive dossier (expandable honest record per map) */
.archive-toggle { display: block; width: 100%; padding: 0; margin: 0; background: none; border: none; cursor: pointer; font: inherit; color: inherit; text-align: inherit; }
.archive-toggle:hover .card-caption, .archive-toggle:focus-visible .card-caption { color: var(--parchment); }
.archive-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.dossier-meta { display: block; font-size: 13px; color: #877a5e; margin-top: 2px; }
.archive-card.open { grid-column: 1 / -1; }
.archive-card.open .archive-toggle img { height: 130px; }
.archive-card.open .dossier-meta { color: var(--accent); }
.dossier { padding: 12px 14px 14px; border-top: 2px solid #4a3d28; background: rgba(20,16,12,0.85); }
.dossier.hidden { display: none; }
.intel-dl.small { font-size: 16px; grid-template-columns: 140px 1fr; }
.dossier .intel-src { margin-top: 10px; }

/* Footer */
.app-footer { text-align: center; padding: 26px 16px calc(26px + env(safe-area-inset-bottom)); color: #877a5e; font-size: 17px; border-top: var(--border-block); background: #14100c; }
.foot-links a { color: var(--blue); }

/* Shell theming (ConjureShell overlays) */
.cshell-overlay { background: rgba(8,6,4,0.85) !important; font-family: var(--font-body) !important; overflow-y: auto; padding: 14px; }
.cshell-panel {
    background: var(--bg-panel) !important; border: 3px solid #0c0a07 !important;
    box-shadow: 0 0 0 3px #4a3d28, 0 16px 40px rgba(0,0,0,0.7) !important; border-radius: 0 !important;
}
.cshell-title { font-family: var(--font-head) !important; font-size: 18px !important; color: var(--danger) !important; text-shadow: 3px 3px 0 #000 !important; }
.cshell-btn {
    font-family: var(--font-head) !important; font-size: 11px !important; border-radius: 0 !important;
    background: linear-gradient(#6f6f6f, #4f4f4f) !important; color: var(--text) !important;
    border: 3px solid #1a1a1a !important;
    box-shadow: inset 2px 2px 0 rgba(255,255,255,0.28), inset -2px -2px 0 rgba(0,0,0,0.5) !important;
}
.cshell-btn.primary { background: linear-gradient(#4f8f3c, #38702a) !important; color: #eaffdd !important; }
.cshell-btn:hover { filter: brightness(1.2); }
.cshell-row { font-size: 19px !important; color: var(--text) !important; }
.cshell-select { background: #171310 !important; color: var(--parchment) !important; border: 2px solid #0c0a07 !important; font-family: var(--font-body) !important; font-size: 18px !important; }

/* HUD only visible while playing */
body:not([data-scene="playing"]) .hud,
body:not([data-scene="playing"]) .crosshair,
body:not([data-scene="playing"]) .prompt,
body:not([data-scene="playing"]) .vignette,
body:not([data-scene="playing"]) .room-name,
body:not([data-scene="playing"]) .toasts,
body:not([data-scene="playing"]) .fps,
body:not([data-scene="playing"]) .down-overlay { display: none !important; }
.crosshair { transform: translate(0, 0); }

/* Attract mode (menu demo): let the live demo show through the menu scrim */
body[data-scene="menu"] .cshell-overlay,
body[data-scene="boot"] .cshell-overlay {
    background: rgba(8, 6, 4, 0.52) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
.attract-tag {
    display: none;
    position: absolute; left: 14px; bottom: 12px; z-index: 6;
    align-items: center; gap: 9px;
    background: rgba(14, 11, 8, 0.85); border: 2px solid #0c0a07; box-shadow: 0 0 0 2px #4a3d28;
    padding: 5px 12px; font-size: 17px; color: var(--text-dim); letter-spacing: 1px;
    pointer-events: none;
}
.attract-tag i { width: 9px; height: 9px; flex: none; background: var(--danger); box-shadow: 0 0 6px rgba(231, 60, 60, 0.8); }
@media (prefers-reduced-motion: no-preference) {
    .attract-tag i { animation: attractBlink 1.6s steps(2) infinite; }
    @keyframes attractBlink { 50% { opacity: 0.25; } }
}
body[data-scene="menu"] .attract-tag { display: flex; }

/* Leaderboard house records (built-in demo targets) */
.house-chip {
    display: inline-block; margin-left: 7px; vertical-align: 2px;
    font-size: 12px; letter-spacing: 1px; color: #a5987c;
    border: 1px solid #4a3d28; background: rgba(12, 10, 7, 0.6);
    padding: 0 5px; line-height: 15px;
}
.board-note { margin-top: 10px; }

/* Shell control cluster: contained inside the game stage */
.cshell-contained .cshell-controls { top: 12px !important; right: 12px !important; }
.cshell-ctl { border-radius: 0 !important; background: rgba(20,16,12,0.85) !important; border: 2px solid #0c0a07 !important; color: var(--parchment) !important; }
/* Keep the pause/fullscreen cluster clear of the power-up timers while playing */
body[data-scene="playing"] .cshell-controls { top: auto !important; bottom: 12px; right: 12px !important; }

/* Compact, restrained shell menu buttons (not full-width launcher slabs) */
.cshell-panel { padding: 22px 26px !important; }
.cshell-btn {
    display: inline-block !important; width: auto !important; min-width: 200px;
    margin: 5px auto !important; padding: 9px 18px !important;
}

/* Touch controls (joystick / fire buttons) exist ONLY during live play */
body:not([data-scene="playing"]):not([data-scene="down"]) .cinput-controls { display: none !important; }

/* Playable chip on featured intel cards */
.playable-chip {
    display: inline-block; margin-left: 8px; vertical-align: 3px;
    font-family: var(--font-body); font-size: 14px; letter-spacing: 2px;
    color: #bfffbf; border: 1px solid #38702a; background: rgba(38, 82, 28, 0.35);
    padding: 1px 7px;
}
.map-best.none { color: #a5987c; font-style: italic; }

/* Scroll reveal (content is visible by default; JS adds .reveal before observing) */
@media (prefers-reduced-motion: no-preference) {
    .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.55s ease, transform 0.55s ease; }
    .reveal.in { opacity: 1; transform: none; }
}

/* Keyboard focus indicators */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
    outline: 3px solid var(--accent); outline-offset: 2px;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
    .records-grid, .report-cols { grid-template-columns: 1fr; }
    .intel-card { grid-template-columns: 1fr; }
    .intel-media { flex-direction: row; }
    .intel-media img { width: 50%; height: 140px; }
    .stat-tiles { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
    body { font-size: 18px; }
    .app-header { padding: 8px 10px; }
    .nav-brand { font-size: 10px; }
    .top-links a { font-size: 17px; padding: 3px 7px; }
    main { padding: 8px; }
    .game-stage { height: min(88dvh, 700px); min-height: 430px; }
    .round-num { font-size: 32px; }
    /* Lobby must fit / scroll fully within the stage — every control reachable */
    .stage-overlay { align-items: flex-start; padding: 10px; }
    .lobby-panel { padding: 12px; }
    .lobby-maps { grid-template-columns: 1fr; gap: 8px; margin: 10px 0; }
    /* Compact horizontal map cards on small screens */
    .map-card { display: grid; grid-template-columns: 100px 1fr; column-gap: 10px; align-items: center; padding: 0 8px 0 0; min-height: 74px; }
    .map-card img { grid-row: 1 / 4; width: 100px; height: 100%; min-height: 74px; border-bottom: none; border-right: 3px solid #0c0a07; }
    .map-name { padding: 6px 0 0; font-size: 10px; }
    .map-desc { display: none; }
    .map-best { padding: 0 0 6px; font-size: 14px; }
    .lobby-row { gap: 8px; margin-bottom: 10px; }
    .lobby-field input, .lobby-field select { min-width: 0; width: 100%; }
    .lobby-field { width: 100%; }
    .lobby-hint { display: none; } /* keyboard hints are meaningless on touch */
    .hotslot { width: 48px; height: 48px; }
    .hotslot img { width: 36px; height: 36px; }
    .hud-bottom { padding-bottom: calc(84px + env(safe-area-inset-bottom)); } /* clear on-screen stick */
    .hud-left { display: none; }
    .points-mobile { display: block; }
    .stat-tiles { grid-template-columns: repeat(2, 1fr); }
    .intel-dl { grid-template-columns: 1fr; gap: 0 0; }
    .intel-dl dt { margin-top: 8px; }
    .mc-heading { font-size: 15px; }
}
@media (max-width: 640px) {
    /* keep points + round visible on mobile, but compact */
    .hud-left { display: flex; position: absolute; left: 10px; bottom: 100%; margin-bottom: 6px; }
    .points-plate { font-size: 13px; padding: 2px 8px; }
    .points-plate b { font-size: 18px; }
}
