* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #05060c; overflow: hidden; }
body { display: flex; align-items: center; justify-content: center; font-family: "Alegreya Sans", "Trebuchet MS", Arial, sans-serif; color: #eee; -webkit-user-select: none; user-select: none; }
#game { position: relative; width: 960px; height: 540px; background: #000; box-shadow: 0 0 60px #000; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* overlay screens: laid out at 960x540 then scaled with the game */
#ui { position: absolute; left: 0; top: 0; width: 960px; height: 540px; transform-origin: 0 0; transform: scale(var(--s, 1)); display: none; overflow: auto; }
#ui.on { display: block; }
#ui.dark { background: #05060c; }
#ui button { font: 15px "Russo One", Impact, "Arial Black", sans-serif; letter-spacing: .04em; color: #1b1406; background: linear-gradient(#ffe08a, #c9902c); border: 2px solid #fff1c4; border-radius: 3px; padding: 9px 18px; cursor: pointer; box-shadow: 0 3px 0 #6b4a10; }
#ui button:hover { filter: brightness(1.1); }
#ui button:not(.primary):not(.opt):not(.pin) { background: #1b1f36; color: #ffd66e; border-color: #8a7346; box-shadow: 0 3px 0 #000; }
#ui button:focus-visible { outline: 3px solid #3ff0d0; outline-offset: 2px; }
.center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.loadtitle { font: 46px "Russo One", Impact, sans-serif; color: #ffd66e; text-shadow: 3px 3px 0 #a31e14; }
.loadbar { width: 360px; height: 14px; border: 2px solid #ffd66e; } .loadbar i { display: block; height: 100%; background: #ffd66e; }
.dim { color: #a9acc0; font-size: 15px; }

.titlescr { position: absolute; inset: 0; background-size: cover; background-position: center 70%; display: flex; flex-direction: column; align-items: center; padding-top: 6px; }
.titlescr .logo { width: 470px; filter: drop-shadow(0 8px 10px #000); }
.titlescr .tag { margin: -6px 0 0; font: italic 18px "Alegreya Sans", sans-serif; color: #fff; text-shadow: 0 2px 4px #000, 0 0 12px #000; max-width: 620px; text-align: center; }
.titlescr .menu { position: absolute; bottom: 52px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.titlescr .press { position: absolute; bottom: 14px; font: 13px "Russo One", sans-serif; color: #ffd66e; animation: blink 1.2s steps(2) infinite; text-shadow: 0 0 6px #000; margin: 0; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .titlescr .press { animation: none; } }

.sheet { min-height: 540px; padding: 26px 40px 30px; background: radial-gradient(ellipse at top, #1d2450, #090b18 70%); }
.sheet.narrow { padding: 40px 280px; }
.sheet h2, .brief h2, .mapside h2 { font: 30px "Russo One", Impact, sans-serif; color: #ffd66e; margin: 2px 0 12px; text-shadow: 2px 2px 0 #7a1a10; letter-spacing: .02em; }
.sheet h3, .brief h3 { font: 15px "Russo One", sans-serif; color: #ff8a62; letter-spacing: .08em; margin: 14px 0 4px; text-transform: uppercase; }
.sheet p, .brief p { font-size: 17px; line-height: 1.45; margin: 6px 0; }
.sheet b, .brief b { color: #ffe9a8; }
.eyebrow { font: 12px "Russo One", sans-serif !important; letter-spacing: .14em; color: #8fd8ff; margin: 0 !important; }
.big { font-size: 19px !important; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.row { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.diagram { background: #0b0e20; border: 1px solid #8a7346; padding: 12px; }
.diagram svg { width: 100%; height: auto; font-family: "Russo One", sans-serif; }
.keys { border-collapse: collapse; } .keys td { padding: 4px 12px 4px 0; font-size: 16px; } .keys td:first-child { font: 14px "Russo One", sans-serif; color: #ffd66e; white-space: nowrap; }
label.opt { display: flex; gap: 10px; align-items: center; font-size: 18px; margin: 10px 0; cursor: pointer; } label.opt input { width: 20px; height: 20px; accent-color: #ffd66e; }

.mapscr { position: absolute; inset: 0; display: grid; grid-template-columns: 610px 1fr; background: #090b18; }
.mapimg { position: relative; background-size: cover; background-position: center; border-right: 3px solid #8a7346; }
.pin { position: absolute; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50% !important; padding: 0 !important; font: 18px "Russo One", sans-serif !important; background: linear-gradient(#ffe08a, #c9902c) !important; color: #1b1406 !important; border: 3px solid #fff !important; box-shadow: 0 0 0 3px #000, 0 4px 10px #000 !important; }
.pin.locked { background: #444 !important; color: #999 !important; border-color: #777 !important; }
.pin.sel { transform: translate(-50%, -50%) scale(1.25); box-shadow: 0 0 0 3px #000, 0 0 18px 6px #ffd66e !important; }
.pin.done::after { content: "\2713"; position: absolute; right: -10px; top: -10px; background: #3fc04a; color: #fff; border-radius: 50%; width: 20px; height: 20px; font-size: 13px; line-height: 20px; border: 2px solid #000; }
.mapside { padding: 22px 24px; overflow: auto; }
.concept { font: 16px "Russo One", sans-serif !important; color: #3ff0d0; margin: -6px 0 10px !important; }
.q { font-style: italic; color: #fff; font-size: 18px !important; }
.nem { display: flex; gap: 12px; align-items: center; background: #13172e; border: 1px solid #8a7346; padding: 8px; margin: 10px 0; font-size: 15px; }
.nem img { width: 64px; height: 64px; border: 2px solid #ffd66e; } .nem i { color: #ffd0a0; }

.brief { min-height: 540px; background: #090b18; }
.bimg { height: 150px; background-size: cover; background-position: center 65%; position: relative; border-bottom: 3px solid #8a7346; }
.bhead { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 40px; background: linear-gradient(transparent, rgba(5,6,12,.9)); }
.bhead h2 { margin: 0 !important; }
.bbody { padding: 10px 40px 26px; }
.bbody p { font-size: 16px; }
.ctl { font-size: 15px !important; }

.res { border-collapse: collapse; width: 100%; } .res td { padding: 3px 8px; font-size: 17px; border-bottom: 1px solid #252a4a; } .res img { width: 34px; height: 34px; vertical-align: middle; border: 1px solid #8a7346; }
.res tr.me td { color: #3ff0d0; font-weight: 700; }
.mcq { border: 1px solid #39406a; padding: 10px 14px; margin: 10px 0; } .mcq legend { font-size: 17px; padding: 0 6px; color: #fff; }
.opts { display: flex; gap: 8px; flex-wrap: wrap; }
#ui .opt { background: #13172e !important; color: #eee !important; border: 1px solid #8a7346 !important; font: 16px "Alegreya Sans", sans-serif !important; letter-spacing: 0 !important; box-shadow: none !important; }
#ui .opt.ok { background: #0f4a3c !important; border-color: #3ff0d0 !important; } #ui .opt.no { background: #4a1a12 !important; border-color: #ff6a50 !important; }
.why { font-size: 15px !important; } .why.good b { color: #3ff0d0; } .why.bad b { color: #ff8a62; }
.verdict { font-size: 18px !important; min-height: 24px; } .verdict.good { color: #3ff0d0; } .verdict.bad { color: #ff8a62; }
.outs li { font-size: 17px; margin: 4px 0; } .outs li::marker { color: #ffd66e; font-family: "Russo One"; }

/* touch controls */
#touch { position: absolute; inset: 0; pointer-events: none; display: none; }
#touch.on { display: block; }
.tgroup { position: absolute; bottom: 12px; display: flex; gap: 10px; pointer-events: auto; }
.tgroup.left { left: 14px; } .tgroup.right { right: 14px; flex-wrap: wrap; justify-content: flex-end; width: 330px; } .tgroup.mid { left: 50%; transform: translateX(-50%); bottom: auto; top: 12px; }
.tb { width: 74px; height: 74px; border-radius: 50%; border: 3px solid rgba(255,214,110,.8); background: rgba(10,12,30,.55); color: #ffd66e; font: 17px "Russo One", sans-serif; touch-action: none; }
.tb.small { width: 50px; height: 50px; font-size: 13px; } .tb.gas { background: rgba(40,120,50,.55); } .tb.down { background: rgba(255,214,110,.5); color: #000; }

/* kicks, cheats, toasts */
.tgroup.kick { left: 14px; bottom: 100px; } .tgroup.kick .tb { width: 62px; height: 62px; font-size: 12px; background: rgba(120,40,30,.55); }
#toast { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 20; pointer-events: none; font: 15px "Russo One", sans-serif; color: #1b1406; background: linear-gradient(#ffb3f0, #e46ad0); border: 2px solid #fff; padding: 8px 16px; border-radius: 3px; box-shadow: 0 3px 0 #5a1050; opacity: 0; transition: opacity .25s; max-width: 90%; text-align: center; }
#toast.on { opacity: 1; }
.cheatin { display: flex; gap: 10px; align-items: center; margin: 4px 0 10px; }
.cheatin input { font: 20px "Russo One", monospace; letter-spacing: .14em; text-transform: uppercase; width: 260px; padding: 8px 10px; background: #0a0c1c; color: #ff9ff0; border: 2px solid #ff9ff0; border-radius: 3px; }
.cheats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.cheat { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: start; padding: 8px 10px; background: rgba(10,12,30,.6); border: 1px solid #3a3f66; border-radius: 3px; cursor: pointer; }
.cheat.on { border-color: #ff9ff0; background: rgba(80,20,70,.45); }
.cheat input { margin-top: 4px; width: 18px; height: 18px; accent-color: #ff6ad5; grid-row: span 3; }
.cheat .cn { font: 14px "Russo One", sans-serif; color: #ffd66e; } .cheat .cn i { font-style: normal; color: #ff9ff0; margin-left: 6px; font-size: 12px; }
.cheat .cd { font-size: 14px; line-height: 1.3; } .cheat .cr { font-size: 13px; line-height: 1.3; color: #9fd8ff; }
.tag-fair { color: #9dff8a !important; } .tag-unfair { color: #ff9f7a !important; }
.funstats { display: grid; grid-template-columns: repeat(4, auto); gap: 4px 18px; margin: 8px 0; font-size: 15px; }
.funstats b { font: 18px "Russo One", sans-serif; color: #9dff8a !important; display: block; }
.tb.hit { background: rgba(160,30,30,.6); }
