* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #050505; color: #e8dcc0; font-family: 'VT323', monospace; font-size: 20px; }
canvas#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; image-rendering: pixelated; }
.hidden { display: none !important; }
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 20; }
#menu { background: radial-gradient(ellipse at 50% 30%, rgba(60,26,8,0.55), rgba(0,0,0,0.92) 70%); }
.menu-inner { width: min(940px, 96vw); text-align: center; margin: auto; padding: 16px 0; }
#menu { overflow-y: auto; align-items: flex-start; }
@media (max-height: 760px) { .logo h1 { font-size: 60px; } .logo-box { font-size: 36px; } .sub { margin: 4px 0 10px; } }
.logo h1 { font-size: 86px; margin: 0; letter-spacing: 4px; color: #ff7a2a; text-shadow: 4px 4px 0 #2a0e02, 0 0 30px rgba(255,100,30,0.35); line-height: 0.9; }
.logo-box { font-size: 54px; filter: drop-shadow(0 0 12px rgba(255,120,40,0.5)); animation: wob 3s ease-in-out infinite; }
@keyframes wob { 50% { transform: rotate(-8deg) translateY(-4px); } }
.sub { color: #b8a080; margin: 6px 0 18px; font-size: 22px; }
.panel { background: rgba(14,10,6,0.88); border: 2px solid #5a2a0e; padding: 18px; text-align: left; box-shadow: 0 0 0 4px rgba(0,0,0,0.6); }
.panel.small { width: min(440px, 92vw); text-align: center; }
.panel label { display: block; margin: 8px 0; color: #c8b090; }
input, select { font-family: inherit; font-size: 22px; background: #0a0806; color: #ffd8a0; border: 2px solid #5a2a0e; padding: 4px 8px; width: 100%; }
input[type=range] { padding: 0; }
.row { display: flex; gap: 10px; margin: 10px 0; }
.row > * { flex: 1; }
button.big { font-family: inherit; font-size: 26px; padding: 8px 12px; background: #d8641e; color: #1a0a02; border: none; cursor: pointer; box-shadow: 3px 3px 0 #3a1404; letter-spacing: 1px; }
button.big:hover { background: #ff8a3a; }
button.big.alt { background: #3a2a1a; color: #ffd8a0; }
button.big.alt:hover { background: #5a4028; }
button:disabled { opacity: 0.5; cursor: wait; }
input.code { text-transform: uppercase; letter-spacing: 6px; text-align: center; }
.colors { display: flex; gap: 8px; margin: 8px 0; }
.colors div { width: 38px; height: 38px; border: 3px solid #000; cursor: pointer; border-radius: 50%; }
.colors div.on { border-color: #fff; box-shadow: 0 0 10px #fff8; }
.msg { min-height: 24px; color: #ff9a6a; }
details { margin-top: 8px; color: #c8b090; }
summary { cursor: pointer; color: #ff9a4a; }
.controls { font-size: 18px; line-height: 1.35; padding: 6px 0; color: #d8c8a8; }
.controls b { color: #ffd8a0; }
.foot { color: #6a5a48; font-size: 16px; }
#loading { background: #000; }
.loadtxt { color: #ff7a2a; font-size: 34px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.3; } }
#pause { background: rgba(0,0,0,0.6); }
#pause button { width: 100%; margin-top: 10px; }
#pauseCode { font-size: 30px; color: #6aff8a; margin: 10px 0; }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; text-shadow: 2px 2px 0 #000; }
#vitals { position: absolute; left: 14px; top: 10px; }
#clock { position: absolute; right: 18px; top: 10px; font-size: 34px; color: #ffb060; text-align: right; }
#quota { position: absolute; right: 18px; top: 46px; font-size: 22px; color: #6aff8a; text-align: right; white-space: pre; }
#cross { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; background: #ffe8c0; box-shadow: 0 0 0 1px #000; opacity: 0.8; }
#prompt { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); font-size: 22px; color: #fff0d0; white-space: nowrap; }
#slots { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; gap: 6px; }
#slots .s { width: 60px; height: 60px; border: 2px solid rgba(120,160,255,0.55); background: rgba(10,14,30,0.35); position: relative; display: flex; align-items: center; justify-content: center; font-size: 30px; }
#slots .s.on { border-color: #ffd890; background: rgba(60,40,10,0.45); }
#slots .s.link { border-style: dashed; opacity: 0.6; }
#slots .s i { position: absolute; left: 3px; top: 0; font-size: 15px; font-style: normal; color: #9ab0ff; }
#slots .s em { position: absolute; right: 3px; bottom: 0; font-size: 15px; font-style: normal; color: #ffd890; }
#slotName { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); font-size: 20px; color: #c8d0ff; }
#toasts { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); text-align: center; }
#toasts div { font-size: 26px; color: #ffd060; margin: 4px; animation: tin 0.2s; }
@keyframes tin { from { transform: scale(1.3); opacity: 0; } }
#chatlog { position: absolute; left: 14px; bottom: 100px; width: 520px; font-size: 19px; }
#chatlog div { margin: 2px 0; }
#vehHud { position: absolute; right: 18px; bottom: 18px; font-size: 22px; text-align: right; color: #d8e0ff; white-space: pre; }
#bigmsg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); }
#bigmsg h1 { font-size: 90px; margin: 0; color: #ff7a2a; }
#bigmsg h1.bad { color: #ff3030; }
#bigmsg p { font-size: 30px; margin: 6px; }
#deathmsg { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); text-align: center; }
#deathmsg h2 { font-size: 64px; color: #ff3030; margin: 0; }
#deathmsg p { font-size: 24px; margin: 4px; }
#popups div { position: absolute; font-size: 30px; color: #6aff8a; transform: translate(-50%, -50%); transition: none; }
#hud.tab #quota, #hud.tab #clock, #hud.tab #slots, #hud.tab #slotName, #hud.tab #chatlog, #hud.tab #prompt, #hud.tab #vehHud, #hud.tab #cross, #hud.tab #vitals { display: none; }
#hud.drive #slots, #hud.drive #slotName { display: none; }
#prompt { max-width: 92vw; white-space: normal; text-align: center; }

.menu-row { display: flex; gap: 16px; align-items: stretch; justify-content: center; }
.menu-row > .panel:first-child { flex: 1 1 480px; max-width: 560px; }
.face-panel { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; text-align: center; }
@media (max-width: 860px) { .menu-row { flex-direction: column; align-items: center; } .menu-row > .panel:first-child { width: 100%; } }
.fe-title { color: #ff9a4a; font-size: 26px; margin-bottom: 6px; }
.fe-box { position: relative; width: 256px; height: 256px; box-shadow: 0 0 0 3px #3a1a06, 6px 6px 0 rgba(0,0,0,0.5); }
.fe-box canvas { position: absolute; inset: 0; width: 256px; height: 256px; }
.fe-draw { cursor: crosshair; touch-action: none; }
.fe-colors { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin: 10px 0 6px; max-width: 260px; }
.fe-colors div { width: 24px; height: 24px; border: 2px solid #000; cursor: pointer; }
.fe-colors div.on { outline: 2px solid #fff; }
.fe-tools { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; max-width: 270px; }
.fe-tools button { font-family: inherit; font-size: 18px; background: #2a1c10; color: #ffd8a0; border: 2px solid #5a2a0e; padding: 2px 8px; cursor: pointer; min-width: 34px; }
.fe-tools button.on { background: #d8641e; color: #1a0a02; }
.fe-hint { color: #8a7a60; font-size: 16px; margin-top: 6px; }
