@font-face {
  font-family: 'Lilita One';
  src: url('../fonts/lilita-one.woff2') format('woff2');
  font-display: swap;
}

:root {
  --bg: #12141c;
  --panel-edge: rgba(255, 255, 255, 0.08);
  --text: #f4f6fb;
  --muted: #9aa3b8;
  --blue: #3f8ae0;
  --blue-d: #255fa6;
  --red: #d8404a;
  --red-d: #8e2330;
  --yellow: #f2b632;
  --yellow-d: #a8740f;
  --green: #35c277;
  --common: #9aa3b5;
  --rare: #3f8ae0;
  --epic: #b764ff;
  --legendary: #ffb52e;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --display: 'Lilita One', "Arial Black", "Segoe UI Black", Impact, system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; width: 100%; height: 100%; height: 100dvh;
  overflow: hidden; background: var(--bg); color: var(--text);
  font-family: var(--font);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  touch-action: none; overscroll-behavior: none;
}

canvas#game { position: fixed; inset: 0; display: block; touch-action: none; }

.hidden { display: none !important; }

/* ---------- screens ---------- */
.screen {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(63, 138, 224, 0.28), transparent 70%),
    radial-gradient(ellipse 70% 45% at 50% 100%, rgba(216, 64, 74, 0.18), transparent 70%),
    rgba(14, 16, 24, 0.86);
  overflow-y: auto;
}
.screen:not(.hidden) { animation: screenIn .22s ease-out; }
@keyframes screenIn { from { opacity: 0; } to { opacity: 1; } }
.screen.overlay { background: transparent; justify-content: flex-end; padding-bottom: max(8vh, 28px); pointer-events: none; }
.screen.overlay > * { pointer-events: auto; }

.panel {
  width: min(420px, 100%);
  background: linear-gradient(180deg, rgba(40, 46, 66, .96), rgba(26, 30, 43, .96));
  border: 1px solid var(--panel-edge);
  border-radius: 24px;
  padding: 22px 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  display: flex; flex-direction: column; gap: 12px;
  animation: pop .28s cubic-bezier(.2, 1.3, .4, 1);
}
.panel h2, .shop-head h2 {
  margin: 0 0 4px; text-align: center; font-weight: 400;
  font-family: var(--display); font-size: 32px; letter-spacing: .5px;
  text-shadow: 0 3px 0 var(--blue-d), 0 8px 18px rgba(0, 0, 0, .35);
}
@keyframes pop { from { transform: scale(.9) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- logo ---------- */
.logo { text-align: center; line-height: .86; margin: 4px 0 10px; transform: rotate(-4deg); animation: logoFloat 4s ease-in-out infinite, logoIn .8s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes logoFloat { 50% { transform: rotate(-3deg) translateY(-4px); } }
@keyframes logoIn { from { transform: scale(0.3) rotate(-15deg); opacity: 0; filter: blur(8px); } to { transform: rotate(-4deg); opacity: 1; filter: blur(0); } }
.logo-line1, .logo-line2 {
  font-family: var(--display); font-weight: 400;
  color: #fff; letter-spacing: 1px;
  font-size: clamp(54px, 15vw, 112px);
  text-shadow: 0 4px 0 var(--blue), 0 9px 0 var(--blue-d), 0 16px 30px rgba(0, 0, 0, .5);
}
.logo-line1 { animation: lineSlide .6s cubic-bezier(.2, 1.3, .4, 1) .1s both; }
.logo-line2 { text-shadow: 0 4px 0 var(--red), 0 9px 0 var(--red-d), 0 16px 30px rgba(0, 0, 0, .5); margin-left: 14%; animation: lineSlide .6s cubic-bezier(.2, 1.3, .4, 1) .25s both; }
@keyframes lineSlide { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: none; } }

/* ---------- main menu ---------- */
.menu-top { position: absolute; top: max(14px, env(safe-area-inset-top)); left: 14px; right: 14px; display: flex; justify-content: flex-end; }
.profile-card {
  width: min(360px, 100%); margin: 6px 0 16px; padding: 14px 16px 12px;
  border-radius: 22px; border: 1px solid var(--panel-edge);
  background: linear-gradient(180deg, rgba(44, 51, 73, .9), rgba(28, 32, 46, .9));
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
  display: grid; grid-template-columns: 116px 1fr; align-items: center; gap: 4px 12px;
}
.profile-card canvas { width: 116px; height: 70px; grid-row: span 2; }
.profile-gun { font: 400 22px var(--display); line-height: 1.05; letter-spacing: .3px; }
.profile-sub { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--muted); }
.profile-sub .rarity { --rc: var(--common); }
.menu-track { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--panel-edge); }
.track-note { font-size: 13px; font-weight: 800; color: var(--muted); letter-spacing: .3px; }

.menu-buttons { display: flex; flex-direction: column; gap: 12px; width: min(360px, 100%); }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.menu-footer { display: flex; gap: 12px; margin-top: 20px; }

/* ---------- buttons ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer; position: relative;
  font-family: var(--display); font-weight: 400; font-size: 22px; color: #fff; letter-spacing: .5px;
  padding: 14px 18px; border-radius: 18px; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: linear-gradient(180deg, #58a0f0, var(--blue));
  box-shadow: 0 6px 0 var(--blue-d), 0 12px 22px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .08s, box-shadow .08s, filter .15s;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .22);
}
.btn small { font-family: var(--font); font-weight: 700; font-size: 13px; opacity: .9; text-shadow: none; letter-spacing: 0; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--blue-d), 0 4px 10px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn-red { background: linear-gradient(180deg, #ea5d66, var(--red)); box-shadow: 0 6px 0 var(--red-d), 0 12px 22px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn-red:active { box-shadow: 0 2px 0 var(--red-d); }
.btn-yellow { background: linear-gradient(180deg, #ffcb57, var(--yellow)); box-shadow: 0 6px 0 var(--yellow-d), 0 12px 22px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .45); }
.btn-yellow:active { box-shadow: 0 2px 0 var(--yellow-d); }
.btn-ghost { background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); font-size: 19px; }
.btn-ghost:active { box-shadow: none; }
.btn-small { font-size: 17px; padding: 10px 14px; border-radius: 14px; }
.btn:disabled { opacity: .45; cursor: default; filter: grayscale(.3); }
.btn .ico { width: 28px; height: 28px; fill: currentColor; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .2)); flex: none; }
.btn-play { flex-direction: row; justify-content: center; gap: 14px; padding: 18px; font-size: 30px; }
.btn-play .ico { width: 34px; height: 34px; }
.btn-play .play-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; gap: 4px; }
.btn-tile { flex-direction: row; justify-content: center; gap: 10px; padding: 14px 10px; }
.btn .badge {
  position: absolute; top: -8px; right: -6px; font: 400 12px var(--display); letter-spacing: .5px;
  background: var(--red); color: #fff; padding: 3px 8px; border-radius: 999px; box-shadow: 0 3px 8px rgba(0, 0, 0, .4);
  animation: badgePulse 1.4s ease-in-out infinite;
}
@keyframes badgePulse { 50% { transform: scale(1.12); } }

.icon-btn {
  appearance: none; border: 0; cursor: pointer;
  width: 46px; height: 46px; border-radius: 14px;
  background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
  display: grid; place-items: center;
  font: 400 24px var(--display);
}
.icon-btn svg { width: 24px; height: 24px; fill: currentColor; }
.icon-btn:active { transform: scale(.94); }

/* ---------- HUD ---------- */
#hud {
  position: fixed; left: 0; right: 0; top: 0; z-index: 5;
  height: 56px; padding: 6px max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left));
  display: flex; align-items: center; justify-content: space-between;
  pointer-events: none;
}
#hud > * { pointer-events: auto; }
#hudCenter {
  pointer-events: none;
  font-family: var(--display); font-size: 24px; letter-spacing: .5px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .45);
  display: flex; gap: 10px; align-items: center;
}
.score-chip { padding: 2px 12px; border-radius: 10px; min-width: 40px; text-align: center; }
.hud-right { display: flex; align-items: center; gap: 8px; }

/* phones in portrait: HUD floats over the full-screen arena */
body.full-bleed #hud { background: linear-gradient(rgba(0, 0, 0, .38), transparent); padding-top: max(6px, env(safe-area-inset-top)); height: auto; min-height: 56px; }
body.full-bleed .icon-btn { background: rgba(0, 0, 0, .3); }

/* ---------- boss bar ---------- */
#bossBar {
  position: fixed; left: 50%; transform: translateX(-50%); top: calc(max(6px, env(safe-area-inset-top)) + 58px); z-index: 6;
  width: min(520px, calc(100% - 24px)); pointer-events: none; animation: bossIn .5s cubic-bezier(.2, 1.4, .4, 1);
}
.boss-head { display: flex; align-items: center; justify-content: center; gap: 8px; font: 400 19px var(--display); color: #ffcc4d; text-shadow: 0 2px 0 #3f0c15, 0 0 12px rgba(255, 90, 40, .6); margin-bottom: 4px; letter-spacing: 1px; text-transform: uppercase; }
.boss-head .skull { font-size: 20px; }
.boss-track { height: 14px; border-radius: 8px; background: rgba(0, 0, 0, .55); border: 2px solid rgba(255, 204, 77, .55); overflow: hidden; box-shadow: 0 6px 18px rgba(0, 0, 0, .4); }
#bossFill { height: 100%; width: 100%; background: linear-gradient(90deg, #b3262e, #ff5a3c 60%, #ffb347); transition: width .18s ease-out; }
#bossBar.enraged .boss-track { border-color: #ff3b3b; animation: rage .5s ease-in-out infinite alternate; }
#bossBar.enraged #bossFill { background: linear-gradient(90deg, #ff1a1a, #ff7a3a); }
@keyframes rage { to { box-shadow: 0 0 22px rgba(255, 40, 40, .85); } }
@keyframes bossIn { from { opacity: 0; transform: translate(-50%, -20px) scale(.9); } to { opacity: 1; transform: translateX(-50%); } }

/* ---------- road-to-boss track ---------- */
.track { display: inline-flex; align-items: center; gap: 6px; }
.track .node { width: 14px; height: 14px; border-radius: 50%; background: rgba(255, 255, 255, .14); border: 2px solid rgba(255, 255, 255, .22); display: inline-grid; place-items: center; font-style: normal; }
.track .node.done { background: var(--blue); border-color: #7fb6f5; }
.track .node.now { background: #fff; border-color: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .18); animation: nodePulse 1.2s ease-in-out infinite; }
.track .node.boss { width: 26px; height: 26px; font-size: 15px; color: #ffcc4d; background: #5a1520; border-color: #ffcc4d; }
.track .node.boss.now { background: #b3262e; color: #fff; }
.track.small { gap: 4px; margin-left: 10px; }
.track.small .node { width: 9px; height: 9px; border-width: 1.5px; }
.track.small .node.boss { width: 18px; height: 18px; font-size: 11px; }
@keyframes nodePulse { 50% { box-shadow: 0 0 0 7px rgba(255, 255, 255, .06); } }

/* ---------- coins ---------- */
.coin-ico {
  display: inline-block; width: 18px; height: 18px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 32%, #fff3b0 0 18%, #ffd23f 22% 62%, #c8960f 66%);
  box-shadow: 0 2px 0 #9a6f06; vertical-align: -3px; margin-right: 6px;
}
.coin-pill {
  display: inline-flex; align-items: center; gap: 2px;
  background: rgba(0, 0, 0, .38); border-radius: 999px; padding: 6px 13px 6px 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 210, 63, .25);
  font: 400 19px var(--display); color: #ffe27a; letter-spacing: .5px; text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
}
.coin-pill.pop { animation: coinPop .25s ease-out; }
@keyframes coinPop { 50% { transform: scale(1.18); } }

.reward {
  width: min(330px, 90vw); margin-bottom: 14px; padding: 14px 16px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(44, 51, 73, .96), rgba(28, 32, 46, .96)); border: 1px solid var(--panel-edge);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45); animation: pop .28s cubic-bezier(.2, 1.3, .4, 1);
}
.rw-line { display: flex; justify-content: space-between; font-weight: 800; color: #dfe3ec; padding: 3px 0; }
.rw-line b { color: #ffe27a; font: 400 18px var(--display); }
.rw-total { display: flex; align-items: center; justify-content: center; margin-top: 8px; font: 400 34px var(--display); color: #ffe27a; text-shadow: 0 3px 0 #8a5d05; }
.rw-total .coin-ico { width: 28px; height: 28px; }

/* ---------- gun shop ---------- */
.shop-panel {
  width: min(820px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(180deg, rgba(40, 46, 66, .97), rgba(22, 25, 36, .97)); border: 1px solid var(--panel-edge);
  border-radius: 24px; padding: 16px; animation: pop .28s cubic-bezier(.2, 1.3, .4, 1);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.shop-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.shop-head h2 { margin: 0; text-align: left; line-height: 1; text-shadow: 0 3px 0 var(--yellow-d), 0 8px 18px rgba(0, 0, 0, .35); }
.shop-owned { font-size: 12px; font-weight: 800; color: var(--muted); margin-top: 4px; }
.shop-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; flex: none; }
.shop-tabs::-webkit-scrollbar { display: none; }
.shop-tabs button {
  appearance: none; border: 0; cursor: pointer; flex: none;
  font: 400 15px var(--display); letter-spacing: .5px; color: var(--muted);
  background: rgba(255, 255, 255, .06); border-radius: 999px; padding: 8px 14px;
}
.shop-tabs button.on { background: #fff; color: #1a1e2b; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; overflow-y: auto; padding: 4px 2px; }
.gun-card {
  --rc: var(--common);
  position: relative; border-radius: 18px; padding: 10px 10px 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
  border: 2px solid rgba(154, 163, 181, .35);
  display: flex; flex-direction: column; gap: 6px;
}
.gun-card.rare { --rc: var(--rare); border-color: rgba(63, 138, 224, .55); background: linear-gradient(180deg, rgba(63, 138, 224, .16), rgba(255, 255, 255, .02)); }
.gun-card.epic { --rc: var(--epic); border-color: rgba(183, 100, 255, .6); background: linear-gradient(180deg, rgba(183, 100, 255, .17), rgba(255, 255, 255, .02)); }
.gun-card.legendary { --rc: var(--legendary); border-color: rgba(255, 181, 46, .75); background: linear-gradient(180deg, rgba(255, 181, 46, .18), rgba(255, 255, 255, .02)); box-shadow: 0 0 18px rgba(255, 181, 46, .25); }
.gun-card.equipped { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .15); }
.gun-card canvas { width: 100%; height: 74px; }
.rarity { align-self: flex-start; font: 400 11px var(--display); letter-spacing: 1px; text-transform: uppercase; color: #141722; background: var(--rc, var(--common)); border-radius: 6px; padding: 2px 7px; }
.rarity.rare { --rc: var(--rare); } .rarity.epic { --rc: var(--epic); } .rarity.legendary { --rc: var(--legendary); }
.gun-name { font: 400 18px var(--display); letter-spacing: .3px; line-height: 1.05; }
.gun-blurb { font-size: 12px; color: var(--muted); font-weight: 600; min-height: 30px; line-height: 1.25; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; min-height: 18px; }
.chip { font: 800 10px var(--font); letter-spacing: .3px; text-transform: uppercase; padding: 2px 6px; border-radius: 6px; background: rgba(255, 255, 255, .1); color: #e7ebf4; }
.chip.multi { background: rgba(63, 138, 224, .38); }
.chip.dmg { background: rgba(216, 64, 74, .5); }
.chip.beam { background: rgba(183, 100, 255, .45); }
.stat { display: grid; grid-template-columns: 58px 1fr; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--muted); }
.stat i { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .1); position: relative; overflow: hidden; }
.stat i::after { content: ''; position: absolute; inset: 0; width: calc(var(--v) * 100%); background: linear-gradient(90deg, var(--rc), #fff); border-radius: 3px; }
.gun-card .btn { margin-top: 4px; }
.gun-card .btn span { display: inline-flex; align-items: center; }
.owned-tag { position: absolute; top: 11px; right: 10px; font: 400 11px var(--display); color: var(--green); letter-spacing: .5px; }

/* ---------- level select ---------- */
.play-row { display: flex; gap: 12px; }
.play-row .btn-play { flex: 1; }
.btn-levels { width: 86px; flex: none; padding: 10px 6px; gap: 4px; justify-content: center; }
.btn-levels .ico { width: 30px; height: 30px; }
.levels-panel { width: min(560px, 100%); }
.level-list { overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 2px; }
.chapter { background: rgba(255, 255, 255, .04); border: 1px solid var(--panel-edge); border-radius: 18px; padding: 10px 12px 12px; }
.chapter.locked { opacity: .55; }
.chapter-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.chapter-head span { font: 400 19px var(--display); letter-spacing: .3px; }
.chapter-head small { color: var(--muted); font-weight: 700; font-size: 12px; }
.chapter-head em { margin-left: auto; font: 400 15px var(--display); color: #ffd23f; font-style: normal; }
.level-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.lvl {
  appearance: none; border: 0; cursor: pointer; position: relative; aspect-ratio: 1; border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font: 400 26px var(--display); color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .3);
  background: linear-gradient(180deg, #58a0f0, var(--blue)); box-shadow: 0 5px 0 var(--blue-d), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.lvl:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--blue-d); }
.lvl b { font-weight: 400; line-height: 1; }
.lvl small { position: absolute; top: 5px; left: 8px; font: 400 11px var(--display); opacity: .85; }
.lvl.cleared { background: linear-gradient(180deg, #3f4a66, #2f3850); box-shadow: 0 5px 0 #1f2536, inset 0 1px 0 rgba(255, 255, 255, .12); }
.lvl.boss { background: linear-gradient(180deg, #b3262e, #7a1d2b); box-shadow: 0 5px 0 #3f0c15, inset 0 1px 0 rgba(255, 204, 77, .4); color: #ffcc4d; }
.lvl.boss.cleared { background: linear-gradient(180deg, #6a2830, #4a1a22); }
.lvl.next { box-shadow: 0 5px 0 var(--blue-d), 0 0 0 3px #fff, 0 0 18px rgba(255, 255, 255, .45); animation: nextPulse 1.3s ease-in-out infinite; }
.lvl.boss.next { box-shadow: 0 5px 0 #3f0c15, 0 0 0 3px #ffcc4d, 0 0 20px rgba(255, 170, 60, .6); }
@keyframes nextPulse { 50% { transform: scale(1.06); } }
.lvl.locked { background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); color: var(--muted); }
.lvl.locked svg { width: 22px; height: 22px; fill: currentColor; opacity: .7; }
.lvl.shake { animation: shake .38s cubic-bezier(.36, .07, .19, .97); }
.lvl-stars { position: absolute; bottom: 5px; display: flex; gap: 1px; font-size: 11px; line-height: 1; }
.lvl-stars i { font-style: normal; color: rgba(0, 0, 0, .35); }
.lvl-stars i.on { color: #ffd23f; text-shadow: 0 1px 0 #8a5d05; }
.rw-stars { display: flex; justify-content: center; gap: 10px; margin: -4px 0 8px; }
.rw-stars .star { font-style: normal; font-size: 46px; line-height: 1; color: rgba(255, 255, 255, .12); }
.rw-stars .star.on { color: #ffd23f; text-shadow: 0 3px 0 #8a5d05, 0 0 16px rgba(255, 210, 63, .6); animation: starIn .45s cubic-bezier(.2, 1.8, .4, 1) both; }
.rw-stars .star:nth-child(2) { font-size: 56px; margin-top: -8px; }
@keyframes starIn { from { transform: scale(0) rotate(-90deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- shop feedback ---------- */
.btn.cant { filter: grayscale(.55) brightness(.85); }
.gun-card.shake { animation: shake .38s cubic-bezier(.36, .07, .19, .97); }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.gun-card.flash { animation: cardFlash .6s ease-out; }
@keyframes cardFlash { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .9); transform: scale(1.04); } 100% { box-shadow: 0 0 0 14px rgba(255, 255, 255, 0); transform: none; } }

/* ---------- quick sound toggles ---------- */
.sound-row { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.panel .sound-row { margin: 0 0 4px; }
.snd-toggle {
  appearance: none; border: 0; cursor: pointer; display: flex; align-items: center; gap: 6px;
  padding: 9px 13px; border-radius: 999px; color: #fff; font: 400 15px var(--display); letter-spacing: .4px;
  background: rgba(53, 194, 119, .22); box-shadow: inset 0 0 0 1.5px rgba(53, 194, 119, .7);
  transition: background .15s, box-shadow .15s, opacity .15s;
}
.snd-toggle svg { width: 19px; height: 19px; fill: currentColor; flex: none; }
.snd-toggle:active { transform: scale(.95); }
.snd-toggle.off { background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .12); color: var(--muted); }
.snd-toggle.off span { text-decoration: line-through; text-decoration-thickness: 2px; }
.snd-toggle.off svg { opacity: .55; }

/* ---------- settings ---------- */
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .05); }
.setting span { display: flex; flex-direction: column; gap: 2px; }
.setting b { font: 400 19px var(--display); letter-spacing: .3px; }
.setting small { color: var(--muted); font-weight: 600; font-size: 12px; }
.switch {
  appearance: none; border: 0; cursor: pointer; flex: none; position: relative;
  width: 58px; height: 32px; border-radius: 999px; background: rgba(255, 255, 255, .15);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .35); transition: background .2s;
}
.switch i { position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .35); transition: transform .2s cubic-bezier(.3, 1.4, .5, 1); }
.switch.on { background: var(--green); }
.switch.on i { transform: translateX(26px); }
.pause-level { text-align: center; color: var(--muted); font-weight: 800; margin-top: -6px; }

/* ---------- banner ---------- */
#banner {
  position: fixed; left: 0; right: 0; top: 18%; z-index: 8;
  text-align: center; pointer-events: none; padding: 0 12px;
}
.banner-text {
  position: relative; display: inline-block;
  font-family: var(--display); font-weight: 400; letter-spacing: 1px;
  font-size: clamp(46px, 13vw, 110px); line-height: 1.02;
  color: #f7f8fb;
  text-shadow: 0 4px 0 var(--banner-c, #1a6ae0), 0 7px 0 var(--banner-c, #1a6ae0), 0 14px 24px rgba(0, 0, 0, .5);
  animation: bannerIn .45s cubic-bezier(.2, 1.6, .4, 1);
}
.banner-text::before {
  content: attr(data-text); position: absolute; inset: 0; z-index: -1;
  color: rgba(255, 255, 255, .07); text-shadow: none;
  transform: scale(1.18) translate(-3%, -8%);
  animation: ghost 1.2s ease-out forwards;
}
.banner-sub { margin-top: 14px; font: 400 clamp(17px, 4.2vw, 26px) var(--display); letter-spacing: .5px; color: #cfd5e3; text-shadow: 0 2px 0 rgba(0, 0, 0, .4); }
@keyframes bannerIn { from { transform: scale(2.2) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ghost { from { transform: scale(1.8); opacity: 0; } to { transform: scale(1.18) translate(-3%, -8%); opacity: 1; } }

.end-buttons { display: flex; flex-direction: column; gap: 12px; width: min(330px, 90vw); }

/* ---------- forms / online ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; color: var(--muted); font-size: 14px; }
input {
  font: 800 20px var(--font); color: #fff;
  background: rgba(0, 0, 0, .3); border: 2px solid rgba(255, 255, 255, .1);
  border-radius: 14px; padding: 11px 13px; outline: none; width: 100%;
  user-select: text; -webkit-user-select: text;
}
input:focus { border-color: var(--blue); }
.join-row { display: flex; gap: 10px; }
.join-row input { text-transform: uppercase; letter-spacing: 4px; text-align: center; }
.join-row .btn { width: 110px; flex: none; }
.status { text-align: center; color: var(--muted); min-height: 20px; margin: 0; font-weight: 600; }
.status.error { color: #ff7b7b; }
.privacy-note { margin: 0; font-size: 11.5px; line-height: 1.4; color: var(--muted); text-align: center; opacity: .85; }

.room-code {
  text-align: center; font: 400 48px var(--display); letter-spacing: 12px;
  color: #fff; text-shadow: 0 3px 0 var(--yellow-d);
}
.player-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.player-list li {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, .06); border-radius: 12px; padding: 10px 12px; font-weight: 800;
}
.player-list .swatch { width: 18px; height: 18px; border-radius: 5px; flex: none; }
.player-list .tag { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 700; }

.help-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; line-height: 1.4; color: #dfe3ec; max-height: 55vh; overflow-y: auto; }
kbd { background: rgba(255, 255, 255, .15); border-radius: 5px; padding: 1px 6px; font-weight: 800; }

/* ---------- toast / loading ---------- */
#toast {
  position: fixed; left: 50%; top: calc(max(12px, env(safe-area-inset-top)) + 62px); transform: translateX(-50%); z-index: 50;
  background: rgba(16, 18, 26, .96); padding: 12px 18px; border-radius: 14px; font-weight: 800;
  border: 1px solid var(--panel-edge);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45); max-width: calc(100% - 32px); text-align: center;
}
#loading { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 5px solid rgba(255, 255, 255, .15); border-top-color: var(--blue); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- menu entrance animations ---------- */
.menu-buttons { animation: fadeUp .5s ease-out .35s both; }
.profile-card { animation: fadeUp .5s ease-out .2s both; }
.sound-row { animation: fadeUp .4s ease-out .5s both; }
.menu-footer { animation: fadeUp .4s ease-out .6s both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- tutorial pulse overlay ---------- */
.tut-pulse {
  position: fixed; inset: 0; z-index: 7; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}
.tut-pulse .tut-ring {
  width: 120px; height: 120px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.5);
  animation: tutPulse 1.6s ease-in-out infinite;
}
@keyframes tutPulse { 0%, 100% { transform: scale(0.8); opacity: 0.3; } 50% { transform: scale(1.4); opacity: 0.8; } }
.tut-hand {
  position: absolute; font-size: 48px; animation: tutTap 1.2s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}
@keyframes tutTap { 0%, 100% { transform: scale(1) translateY(0); } 50% { transform: scale(0.85) translateY(6px); } }

@media (max-height: 700px) {
  .logo-line1, .logo-line2 { font-size: clamp(40px, 9.5vh, 76px); }
  .profile-card { margin: 2px 0 10px; padding: 10px 12px 8px; }
  .menu-buttons { gap: 8px; }
  .btn { padding: 9px 14px; font-size: 19px; }
  .btn-play { padding: 12px; font-size: 24px; }
  .menu-footer { margin-top: 10px; }
}
