:root {
  --bg: #120c1a; --panel: #1c1428; --panel2: #251a35; --line: #3a2a52;
  --text: #f3eefa; --muted: #a596bb; --accent: #ffd23f; --accent2: #3ee08f; --rune: #5ff2ff;
  --danger: #ff5a5f; --blue: #58a6ff;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: var(--bg); color: var(--text); overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-user-select: none; user-select: none; touch-action: none; overscroll-behavior: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
.h { font-weight: 900; font-style: italic; text-transform: uppercase; letter-spacing: .02em; }

/* ------------------------------------------------------------ HUD */
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud button { pointer-events: auto; }
.box { background: rgba(14, 9, 20, .86); border: 1px solid #ffffff22; border-radius: 12px; box-shadow: 0 6px 20px #0008; }
.score { position: absolute; top: calc(10px + var(--sat)); left: calc(10px + var(--sal)); padding: 5px 11px 7px; min-width: 112px; }
.score b { display: block; font-size: 24px; font-weight: 900; font-style: italic; color: var(--accent); line-height: 1; font-variant-numeric: tabular-nums; }
.score .flow { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 10px; font-weight: 900; letter-spacing: .1em; color: var(--muted); }
.score .flow i { font-style: italic; color: var(--accent2); font-size: 14px; letter-spacing: 0; }
.score .flow span { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: 0; font-size: 12px; }
.score.pw .flow i { color: var(--rune); text-shadow: 0 0 8px #5ff2ff; }
.score .fbar { height: 5px; border-radius: 3px; background: #ffffff18; margin-top: 4px; overflow: hidden; }
.score .fbar div { height: 100%; width: 0; background: linear-gradient(90deg, #1fb46d, var(--accent2)); border-radius: 3px; transition: width .15s; }
.clock { position: absolute; top: calc(10px + var(--sat)); left: 50%; transform: translateX(-50%); padding: 4px 12px 6px; text-align: center; white-space: nowrap; min-width: 96px; }
.clock > b { display: block; font-size: 18px; font-weight: 900; font-variant-numeric: tabular-nums; }
.clock > span { display: block; font-size: 10px; font-weight: 800; letter-spacing: .08em; color: var(--muted); }
.clock > span.on { color: var(--accent2); }
.clock .lvl { height: 3px; border-radius: 2px; background: #ffffff14; margin-top: 3px; overflow: hidden; }
.clock .lvl div { height: 100%; width: 0; background: var(--accent); }
.pause { position: absolute; top: calc(12px + var(--sat)); right: calc(12px + var(--sar)); width: 38px; height: 38px; border-radius: 10px; border: 1px solid #ffffff2a;
  background: rgba(14, 9, 20, .8); font-weight: 900; display: grid; place-items: center; font-size: 13px; }
.meter { position: absolute; top: calc(10px + var(--sat)); right: calc(58px + var(--sar)); width: 132px; padding: 4px 9px 6px; }
.meter .t { display: flex; justify-content: space-between; gap: 8px; font-size: 8.5px; font-weight: 900; letter-spacing: .1em; color: var(--muted); white-space: nowrap; }
.meter .t b { color: var(--rune); }
.meter .bar { position: relative; height: 7px; border-radius: 4px; background: #ffffff14; margin: 2px 0 3px; overflow: hidden; }
.meter .bar div { height: 100%; width: 0; border-radius: 4px; transition: width .25s; }
.meter .pw div { background: linear-gradient(90deg, #1aa6c4, var(--rune)); }
.meter .pw i { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: #ffffff88; }
.meter .crowd div { background: linear-gradient(90deg, var(--danger), var(--accent) 50%, var(--accent2)); }
.meter.ready { border-color: #5ff2ff99; box-shadow: 0 0 18px #5ff2ff44; }
.listen { position: absolute; top: 30%; left: 50%; transform: translate(-50%, -50%); text-align: center; width: min(92vw, 380px);
  background: rgba(14, 9, 20, .9); border: 1px solid #ffffff22; border-radius: 16px; padding: 14px 16px; box-shadow: 0 10px 30px #000a; }
.listen .big { font-size: 26px; color: var(--accent); }
.listen .small { font-size: 13px; color: var(--text); margin-top: 4px; line-height: 1.35; }
.listen .lock { height: 8px; border-radius: 4px; background: #ffffff14; margin: 10px 0 8px; overflow: hidden; }
.listen .lock div { height: 100%; width: 0; background: linear-gradient(90deg, #1fb46d, var(--accent2)); transition: width .25s; }
.listen .tipline { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.listen .tipline b { color: var(--accent); }
.listen .btn { margin-top: 10px; width: 100%; font-size: 15px; padding: 11px; pointer-events: auto; }
.banner { position: absolute; top: 28%; left: 50%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; }
.banner .big { font-size: 34px; color: var(--accent); text-shadow: 0 4px 20px #000a; white-space: nowrap; }
.banner .small { font-size: 14px; font-weight: 800; color: var(--text); text-shadow: 0 2px 8px #000; margin-top: 4px; }
.banner.bad .big { color: #fff; background: var(--danger); padding: 4px 18px; border-radius: 12px; box-shadow: 0 10px 30px #ff5a5f55; }
.banner.good .big { color: #002313; background: var(--accent2); padding: 4px 18px; border-radius: 12px; box-shadow: 0 10px 30px #3ee08f55; }
.banner.rune .big { color: #002a30; background: var(--rune); padding: 4px 18px; border-radius: 12px; box-shadow: 0 10px 30px #5ff2ff66; }
.banner.pop { animation: pop .35s ease-out; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(.6); opacity: 0; } }

/* round buttons */
.tb { position: absolute; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 900; text-align: center;
  border: 2px solid #ffffff55; box-shadow: 0 6px 16px #0008; line-height: 1.05; letter-spacing: .03em; transition: transform .08s, filter .15s; font-style: italic; text-transform: uppercase; }
.tb small { display: block; font-size: 9px; opacity: .8; margin-top: 3px; letter-spacing: .06em; }
.tb:active, .tb.down { transform: scale(.93); }
.tb .k { display: none; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); background: #120c1a; color: var(--text); border: 1px solid #ffffff44; border-radius: 5px; font-size: 10px; padding: 1px 5px; font-style: normal; }
body.desk .tb .k { display: block; }
.cy { background: radial-gradient(circle at 35% 30%, #c8fbff, #1aa6c4); color: #00262c; }
.tb.power { right: calc(12px + var(--sar)); top: calc(118px + var(--sat)); width: 74px; height: 74px; font-size: 11px; }
.tb.power.off { filter: saturate(.15) brightness(.55); }
.tb.power.ready { box-shadow: 0 0 0 5px #5ff2ff40, 0 0 24px #5ff2ffaa, 0 6px 16px #0008; animation: throb 1s ease-in-out infinite; }
@keyframes throb { 50% { transform: scale(1.06); } }
.keys { position: absolute; left: 50%; bottom: calc(8px + var(--sab)); transform: translateX(-50%); display: flex; gap: 6px; white-space: nowrap; }
.keys div { background: rgba(14, 9, 20, .86); border: 1px solid #ffffff22; border-radius: 8px; padding: 4px 9px; font-size: 11px; font-weight: 700; color: var(--muted); }
.keys b { color: var(--text); background: #ffffff14; border-radius: 4px; padding: 0 5px; margin-right: 4px; }
@media (max-width: 560px) and (orientation: portrait) {
  .meter { top: calc(58px + var(--sat)); right: calc(10px + var(--sar)); }
  .clock { left: auto; right: calc(56px + var(--sar)); transform: none; min-width: 84px; }
  .tb.power { top: calc(150px + var(--sat)); width: 66px; height: 66px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .tb.power { top: auto; bottom: calc(40% + var(--sab)); }
  .listen { top: 40%; }
}

/* ------------------------------------------------------------ menu */
.screen { position: fixed; inset: 0; overflow-y: auto; }
#menu { background: radial-gradient(120% 60% at 50% 0%, #4a1f5c 0%, var(--bg) 62%); touch-action: pan-y; }
.wrap { padding: calc(16px + var(--sat)) 16px calc(24px + var(--sab)); max-width: 540px; margin: 0 auto; }
.logo { text-align: center; margin: 0 0 12px; }
.logo .t1, .logo .t2 { font-size: 40px; line-height: .9; }
.logo .t2 { color: var(--accent); }
.logo .stripe { display: block; width: 200px; height: 10px; margin: 8px auto 0; border-radius: 3px;
  background: linear-gradient(90deg, #3ee08f 0 25%, #ff5a5f 25% 50%, #ffd23f 50% 75%, #58a6ff 75%); box-shadow: 0 0 16px #ff4fa344; }
.logo .sub { color: var(--muted); font-size: 11px; letter-spacing: .3em; margin-top: 8px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; }
.lbl { font-size: 11px; font-weight: 900; color: var(--muted); letter-spacing: .14em; margin-bottom: 8px; text-transform: uppercase; display: flex; justify-content: space-between; }
.lbl b { color: var(--accent); letter-spacing: .06em; }
.srcs { display: grid; gap: 6px; }
.src { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; background: var(--panel2); border: 2px solid transparent; border-radius: 11px; padding: 7px 10px 7px 6px; text-align: left; width: 100%; }
.src .ic { grid-row: 1 / 3; font-size: 24px; text-align: center; }
.src .nm { font-weight: 900; font-size: 14px; font-style: italic; text-transform: uppercase; }
.src .ds { font-size: 10.5px; color: var(--muted); font-weight: 700; margin-top: 1px; line-height: 1.3; }
.src.sel { border-color: var(--accent); background: #34260f; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; background: var(--panel2); border: 1px solid var(--line); padding: 10px 4px; border-radius: 10px; font-size: 13px; }
.seg button.sel { background: var(--accent); color: #1a1400; border-color: var(--accent); }
.hint { font-size: 11.5px; color: var(--muted); margin-top: 8px; line-height: 1.45; }
.hint b { color: var(--accent); }
.hint.warn b { color: var(--accent); }
.hint.warn b:first-child { color: var(--danger); }
.hint.big { font-size: 13.5px; color: var(--text); margin: 10px 0; }
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 12px; }
.set { background: var(--panel2); border-radius: 10px; padding: 8px 10px; display: flex; justify-content: space-between; gap: 6px; text-align: left; }
.set b { color: var(--accent); white-space: nowrap; }
.go { display: block; width: 100%; padding: 14px; border-radius: 14px; background: linear-gradient(180deg, #ffe066, #f0b400); color: #241900; font-size: 20px; box-shadow: 0 8px 20px #f0b40044; text-align: center; margin-top: 4px; }
.go:disabled { filter: saturate(.2) brightness(.6); }
.life { text-align: center; font-size: 11px; color: var(--muted); margin-top: 10px; font-weight: 700; letter-spacing: .04em; }
.life b { color: var(--text); }

/* ------------------------------------------------------------ overlays */
.overlay { background: rgba(10, 6, 14, .76); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; touch-action: pan-y; }
.panel { width: 100%; max-width: 440px; padding: max(28px, calc(5vh + var(--sat))) 16px calc(24px + var(--sab)); }
.ttl { text-align: center; font-size: 34px; color: var(--accent); line-height: 1; }
.sub { text-align: center; color: var(--muted); font-size: 12px; letter-spacing: .14em; margin-top: 6px; }
.acts { display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; }
.acts .go { margin: 0; font-size: 16px; padding: 13px; }
.btn { padding: 13px; border-radius: 12px; text-align: center; font-size: 16px; }
.btn.ghost { background: var(--panel2); border: 1px solid var(--line); }
.stack { display: grid; gap: 8px; margin-top: 14px; }
.bigstars { display: flex; justify-content: center; gap: 10px; margin: 18px 0 6px; }
.bigstars div { width: 70px; height: 70px; display: grid; place-items: center; font-size: 58px; line-height: 1; color: #ffffff1f; }
.bigstars div.on { color: var(--accent); text-shadow: 0 0 22px #ffd23f88; animation: pop2 .4s ease-out backwards; }
.bigstars div:nth-child(2) { transform: translateY(-10px) scale(1.15); }
.bigstars div:nth-child(2).on { animation-delay: .25s; } .bigstars div:nth-child(3).on { animation-delay: .5s; }
@keyframes pop2 { from { opacity: 0; scale: .4; } }
.why { text-align: center; font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.why b { color: var(--text); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stat { background: var(--panel2); border-radius: 10px; padding: 8px 10px; }
.stat span { display: block; font-size: 10px; font-weight: 900; letter-spacing: .12em; color: var(--muted); }
.stat b { font-size: 19px; font-weight: 900; font-style: italic; font-variant-numeric: tabular-nums; }
.stat b small { font-size: 11px; color: var(--accent2); font-style: normal; margin-left: 4px; }
.total { display: flex; justify-content: space-between; align-items: baseline; margin: 8px 0 4px; }
.total b { font-size: 30px; font-style: italic; color: var(--accent); }
.best { font-size: 10px; font-weight: 900; background: var(--accent); color: #1a1400; border-radius: 6px; padding: 2px 7px; letter-spacing: .08em; vertical-align: 6px; }
.unlock { background: #5ff2ff14; border: 1px solid #5ff2ff55; border-radius: 12px; padding: 9px 11px; margin: 8px 0 12px; font-size: 12.5px; line-height: 1.4; }
.unlock span { display: block; font-size: 10px; font-weight: 900; letter-spacing: .14em; color: var(--rune); }
.unlock .btn { margin-top: 8px; width: 100%; font-size: 14px; padding: 9px; }
.offset { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 8px; align-items: center; margin: 14px 0 4px; }
.offset b { text-align: center; font-size: 26px; font-style: italic; color: var(--accent); font-variant-numeric: tabular-nums; }
.tsrc { margin-top: 12px; }
.howto { list-style: none; display: grid; gap: 8px; margin: 14px 0; font-size: 13px; line-height: 1.4; }
.howto li { background: var(--panel2); border-radius: 10px; padding: 8px 10px; }
.howto b { color: var(--accent); }

/* Studio credit and link back to the games page, the same on every Game Golem Studios title screen */
.ggs-foot { text-align: center; font-size: 11px; margin-top: 12px; }
.ggs-foot a { color: var(--muted); text-underline-offset: 2px; }

/* ------------------------------------------------------------ band */
.bandbtn { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; width: 100%; text-align: left; align-items: center; column-gap: 10px; margin-top: 8px; }
.bandbtn .h { font-size: 15px; }
.bandbtn span:nth-child(2) { grid-row: 2; font-size: 11px; color: var(--muted); }
.bandbtn b { grid-row: 1 / span 2; grid-column: 2; font-size: 20px; font-style: italic; color: var(--accent); }
.field { display: block; width: 100%; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; color: var(--text); font: inherit; font-size: 16px; padding: 12px 14px; margin-bottom: 8px; outline: none; -webkit-user-select: text; user-select: text; }
.field:focus { border-color: var(--accent); }
.field.code { font-size: 24px; letter-spacing: .3em; text-align: center; text-transform: uppercase; margin: 0; }
.joinrow { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.joinrow .btn { padding: 0 22px; }
.or { text-align: center; color: var(--muted); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; margin: 14px 0 8px; }
.roomcode { font-size: 54px; letter-spacing: .22em; text-align: center; color: var(--accent); background: var(--panel2); border: 2px dashed #ffd23f66; border-radius: 16px; padding: 10px 0 10px .22em; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
#room .seg button { font-size: 12px; padding: 9px 2px; }
.crew { display: grid; gap: 6px; margin: 12px 0 8px; }
.crew div { display: flex; align-items: center; gap: 8px; background: var(--panel2); border-radius: 10px; padding: 9px 12px; font-weight: 800; }
.crew div i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent2); box-shadow: 0 0 8px var(--accent2); flex: 0 0 10px; }
.crew div small { margin-left: auto; font-size: 10px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; white-space: nowrap; }
.crew div.me small { color: var(--accent); }
.cmsg:empty { display: none; }
.cmsg { color: #ff8a8d; }
.btn.wide { display: block; width: 100%; margin-top: 10px; }
.bandbox { position: absolute; top: calc(78px + var(--sat)); left: calc(10px + var(--sal)); padding: 5px 9px 6px; min-width: 150px; max-width: 46vw; font-size: 11px; }
.bandbox .bt { display: flex; justify-content: space-between; font-size: 9.5px; font-weight: 900; letter-spacing: .12em; color: var(--muted); margin-bottom: 2px; }
.bandbox .bt b { color: var(--accent); font-size: 12px; letter-spacing: 0; font-style: italic; }
.bandbox > div:not(.bt) { display: grid; grid-template-columns: 16px 1fr auto auto; gap: 5px; align-items: center; line-height: 1.5; }
.bandbox span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.bandbox b { font-variant-numeric: tabular-nums; }
.bandbox em { font-style: italic; font-weight: 900; color: var(--accent2); font-size: 10px; }
.bandbox .me span { color: var(--accent); }
.bandbox .pw em, .bandbox .pw b { color: var(--rune); text-shadow: 0 0 6px #5ff2ff; }
.bandres { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; margin: 10px 0; }
.bandres .bhead { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.bandres .bhead span { font-size: 12px; color: var(--muted); }
.bandres .bhead b { font-size: 22px; font-style: italic; color: var(--accent); }
.brow { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: center; padding: 5px 0; border-top: 1px solid #ffffff10; }
.brow em { font-style: italic; font-weight: 900; color: var(--muted); }
.brow span { font-weight: 800; font-size: 13px; }
.brow small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 700; }
.brow b { font-size: 16px; font-style: italic; font-variant-numeric: tabular-nums; }
.brow.me span { color: var(--accent); }
.acts:has(#r-again.hidden) { grid-template-columns: 1fr; }
.hint.center { text-align: center; }
