/* Platform shell styles (landing, lobby, chat, voice, controller panels, toast, touch pad). Games restyle it by
   overriding the variables below in their own style.css. */
:root {
  --bg: #04051a;
  --fg: #ffffff;
  --accent: #ffe14d;
  --accent2: #ff5cc8;
  --cyan: #4df3ff;
  --green: #7dff4d;
  --dim: #8c94c4;
  --panel: rgba(6, 8, 40, 0.84);
  --card: rgba(4, 6, 30, 0.6);
  --border: #3f55c9;
  --accent-hi: #fff2a0;   /* top of the big button gradient */
  --accent-lo: #a88a00;   /* big button drop shadow */
  --accent-ink: #221a00;  /* big button text */
  --glow-a: rgba(255, 225, 77, 0.6);
  --glow-a2: rgba(255, 160, 40, 0.4);
  --glow-b: rgba(77, 243, 255, 0.6);
  --glow-b2: rgba(77, 160, 255, 0.4);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); overflow: hidden; font-family: 'Press Start 2P', monospace; }
canvas#game { display: block; width: 100vw; height: 100vh; background: var(--bg); }

/* Overlay screens scroll as a whole; the panel is centred only when it fits, so tall content is never clipped. */
.screen { position: fixed; inset: 0; display: flex; align-items: flex-start; justify-content: center; background: rgba(2, 3, 14, 0.3); padding: 16px; overflow-y: auto; z-index: 10; -webkit-overflow-scrolling: touch; }
.screen.hidden { display: none; }
.panel { position: relative; margin: auto; background: var(--panel); border: 3px solid var(--border); box-shadow: 0 0 40px rgba(63, 85, 201, 0.55), inset 0 0 60px rgba(20, 30, 120, 0.3); padding: 22px 26px; max-width: 1100px; width: 100%; text-align: center; backdrop-filter: blur(6px); }
.panel.landing { max-width: 760px; }
.panel.lobby { max-width: 1180px; text-align: left; }
.panel.voice { max-width: 860px; text-align: left; }

.logo { font-size: clamp(26px, 6vw, 60px); line-height: 1.3; margin: 6px 0 10px; letter-spacing: 2px; word-break: keep-all; }
.logo .a { color: var(--accent); text-shadow: 0 0 10px var(--accent), 0 0 30px var(--glow-a), 0 0 60px var(--glow-a2); }
.logo .b { color: var(--cyan); text-shadow: 0 0 10px var(--cyan), 0 0 30px var(--glow-b), 0 0 60px var(--glow-b2); }
.logo.small { font-size: clamp(14px, 2.4vw, 24px); margin: 0; }
.tag { font-size: clamp(7px, 1.3vw, 10px); color: var(--dim); margin: 0 0 18px; letter-spacing: 1px; line-height: 1.8; }

h1 { font-size: clamp(16px, 3vw, 26px); line-height: 1.5; margin: 0 0 10px; color: var(--accent); text-shadow: 0 0 14px var(--accent); }
h2 { font-size: 10px; color: var(--cyan); margin: 0 0 10px; text-shadow: 0 0 8px var(--cyan); }
h2 .dim { font-size: 8px; }
.join { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.row { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; }
label { font-size: 10px; color: var(--dim); }
.row label { width: 90px; text-align: right; }
input, select { font-family: inherit; font-size: 13px; padding: 10px 12px; background: #0a0e3a; color: var(--fg); border: 2px solid var(--border); outline: none; }
.row input { width: 300px; text-transform: uppercase; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 12px var(--accent); }
input::placeholder { color: #4a5490; text-transform: none; font-size: 9px; }
input[type=password] { text-transform: none; }
button { font-family: inherit; cursor: pointer; }
button.big { margin-top: 6px; font-size: clamp(13px, 2.2vw, 20px); padding: 16px 36px; background: linear-gradient(180deg, var(--accent-hi), var(--accent)); color: var(--accent-ink); border: 0; box-shadow: 0 0 24px var(--accent), 0 5px 0 var(--accent-lo); transition: transform .08s, box-shadow .08s; }
button.big.small { font-size: 11px; padding: 12px 20px; margin: 0; }
button.big:hover { transform: scale(1.04); box-shadow: 0 0 40px var(--accent), 0 5px 0 var(--accent-lo); }
button.big:active { transform: translateY(4px); box-shadow: 0 0 24px var(--accent), 0 1px 0 var(--accent-lo); }
button.big:disabled { background: #555; box-shadow: none; color: #999; cursor: default; transform: none; }
button.big.on { background: linear-gradient(180deg, #c8ffb0, var(--green)); box-shadow: 0 0 24px var(--green), 0 5px 0 #3f8a1f; }
.btn { font-size: 9px; padding: 10px 14px; background: #1a2250; color: #fff; border: 2px solid var(--border); }
.btn:hover { border-color: var(--accent); }
.btn.ghost { background: transparent; color: var(--dim); }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.status { font-size: 9px; color: var(--dim); margin: 6px 0 0; min-height: 12px; line-height: 1.7; }

/* lobby */
.lobbyHead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.roomInfo { font-size: 9px; color: var(--accent); text-align: right; line-height: 1.8; }
.lobbyGrid { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 14px; }
.card { background: var(--card); border: 2px solid rgba(63, 85, 201, 0.6); padding: 14px; min-width: 0; }
.members { list-style: none; padding: 0; margin: 0 0 12px; max-height: 260px; overflow-y: auto; }
.members li { display: flex; align-items: center; gap: 8px; font-size: 9px; padding: 6px 4px; border-bottom: 1px solid rgba(63, 85, 201, 0.3); }
.members li .dot { width: 10px; height: 10px; border-radius: 50%; background: #333; flex: none; }
.members li .dot.ready { background: var(--green); box-shadow: 0 0 8px var(--green); }
.members li .dot.playing { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.members li .mic { font-size: 10px; opacity: .35; }
.members li .mic.on { opacity: 1; }
.members li .mic.talk { opacity: 1; text-shadow: 0 0 10px var(--green); color: var(--green); }
.members li .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.members li.me .name { color: var(--accent); }
.chatCard { display: flex; flex-direction: column; min-height: 320px; }
.chatLog { flex: 1; overflow-y: auto; font-size: 9px; line-height: 1.8; padding: 4px; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(63, 85, 201, 0.4); min-height: 220px; max-height: 360px; }
.chatLog .msg b { color: var(--accent); }
.chatLog .msg.sys { color: var(--dim); font-style: italic; }
.chatLog .msg .ts { color: #4a5490; font-size: 7px; margin-right: 4px; }
.chatForm { display: flex; gap: 6px; margin-top: 8px; }
.chatForm input { flex: 1; min-width: 0; font-size: 11px; text-transform: none; }
.standings, #leaderboard { font-size: 9px; line-height: 1.9; color: #cfd4f5; padding-left: 16px; margin: 0 0 14px; }
.standings li.me, #leaderboard li b { color: var(--accent); }
.standings li.bot { color: var(--dim); }
.hints { text-align: center; margin: 12px 0 0; line-height: 1.8; }

ul, ol { font-size: 9px; line-height: 1.9; color: #cfd4f5; padding-left: 18px; margin: 0; }
.dim { color: var(--dim); }
.small { font-size: 8px; }
.lock { color: var(--green); }
#helpList { text-align: left; list-style: none; padding: 0; font-size: 9px; line-height: 1.8; }
#helpList li { margin-bottom: 8px; }
#helpList li b { display: block; }

/* voice panel */
.vrow.top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.vgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.vcol { min-width: 0; }
.vopt { display: flex; align-items: center; gap: 8px; font-size: 9px; color: #cfd4f5; margin: 8px 0; flex-wrap: wrap; }
.vopt input[type=range] { flex: 1; min-width: 100px; accent-color: var(--accent); }
.vopt select { font-size: 9px; padding: 6px; max-width: 100%; flex: 1; }
.vopt input[type=checkbox], .vopt input[type=radio] { accent-color: var(--green); width: 16px; height: 16px; }
.meter { position: relative; height: 12px; background: #0a0e3a; border: 1px solid var(--border); margin: 4px 0 10px; }
.meter .level { height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--accent), #ff5cc8); transition: width .05s; }
.meter .mark { position: absolute; top: -3px; width: 2px; height: 18px; background: #fff; }
.vpeers { list-style: none; padding: 0; margin: 0; max-height: 260px; overflow-y: auto; }
.vpeers li { display: flex; align-items: center; gap: 8px; font-size: 9px; padding: 6px 0; border-bottom: 1px solid rgba(63, 85, 201, 0.3); }
.vpeers li .name { flex: 1; }
.vpeers li .name.talk { color: var(--green); text-shadow: 0 0 8px var(--green); }
.vpeers li input[type=range] { width: 90px; accent-color: var(--accent); }
.vpeers li .st { color: var(--dim); font-size: 7px; }

#toast { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); font-size: 12px; color: #fff; text-shadow: 0 0 10px #fff; pointer-events: none; opacity: 0; transition: opacity .3s; text-align: center; z-index: 20; line-height: 1.8; }
#toast.show { opacity: 1; }

#dpad { position: fixed; right: 14px; bottom: 14px; display: none; grid-template-columns: repeat(3, 54px); grid-template-rows: repeat(3, 54px); gap: 4px; opacity: .6; z-index: 4; }
#dpad button { font-family: inherit; font-size: 14px; background: #1a2250; color: #fff; border: 2px solid var(--border); border-radius: 10px; touch-action: manipulation; }
#dpad button.fire { background: #5a1a30; border-color: var(--accent2); font-size: 9px; }
#dpad button:active { background: var(--border); }
@media (pointer: coarse) { body.ingame #dpad { display: grid; } }
body.has-gamepad #dpad { display: none !important; }
@media (max-width: 900px) { .lobbyGrid { grid-template-columns: 1fr; } .vgrid { grid-template-columns: 1fr; } }
@media (max-width: 700px) {
  .panel { padding: 14px; }
  .row label { width: auto; text-align: center; }
  .row input { width: 100%; }
}

/* gamepad focus ring */
.gpfocus { outline: 3px solid var(--accent) !important; outline-offset: 3px; box-shadow: 0 0 18px var(--accent) !important; }
.btnrow.center { justify-content: center; }
.btn.hidden { display: none; }
/* safe areas for notched phones in fullscreen / installed mode */
.screen { padding-top: max(16px, env(safe-area-inset-top)); padding-bottom: max(16px, env(safe-area-inset-bottom)); }
