:root {
  --gold: #ffc84d;
  --gold-bright: #ffe6a1;
  --gold-deep: #c9820f;
  --teal: #4ce7e0;
  --teal-deep: #0c8fa6;
  --ember: #ff6a4a;
  --violet: #a678ff;
  --ink: #050812;
  --ink-2: #0a1224;
  --paper: #e9f7ff;
  --muted: rgba(220, 241, 255, 0.62);
  --panel: rgba(7, 15, 30, 0.78);
  --line: rgba(150, 225, 255, 0.18);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #03050c;
  color: var(--paper);
  font-family: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  position: fixed;
  inset: 0;
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

button { font-family: inherit; }

#app {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(68, 35, 120, 0.35), transparent 58%),
    radial-gradient(ellipse at 20% 10%, rgba(12, 112, 120, 0.18), transparent 45%),
    #03050c;
}

#void {
  position: absolute;
  inset: -6%;
  background: url("assets/bg_space.webp") center / cover no-repeat;
  filter: blur(14px) brightness(0.42) saturate(0.85);
  transform: scale(1.04);
  opacity: 0.9;
}

#stage {
  position: relative;
  width: min(100vw, calc(100dvh * 0.5625));
  height: min(100dvh, calc(100vw * 1.7777778));
  max-width: 100vw;
  max-height: 100dvh;
  overflow: hidden;
  background: #040712;
  container-type: size;
  isolation: isolate;
  box-shadow:
    0 0 0 1px rgba(255, 210, 100, 0.16),
    0 0 46px rgba(0, 0, 0, 0.9),
    0 0 120px rgba(20, 190, 200, 0.08);
  border-radius: clamp(0px, 2.4cqw, 22px);
}

@media (max-aspect-ratio: 9 / 16) {
  #stage {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
}

#game { position: absolute; inset: 0; z-index: 1; }
#game canvas { display: block; width: 100% !important; height: 100% !important; }

#ui { position: absolute; inset: 0; z-index: 30; pointer-events: none; }

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  pointer-events: auto;
  z-index: 10;
  touch-action: none;
  -webkit-overflow-scrolling: touch;
  padding:
    max(14px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(14px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
  scrollbar-width: none;
}
.screen::-webkit-scrollbar { display: none; }
.screen.active { display: flex; }
.screen.active > * {
  transform: translate(calc(var(--look-x, 0) * 3px), calc(var(--look-y, 0) * 3px));
}

.hidden { display: none !important; }

/* ---------------- shared bits ---------------- */

.eyebrow {
  font-size: clamp(9px, 2.25cqw, 13px);
  font-weight: 800;
  letter-spacing: 0.22em;
  color: var(--teal);
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(76, 231, 224, 0.45);
}

.logo {
  margin: 0;
  font-family: "Pirata One", Georgia, serif;
  font-weight: 400;
  line-height: 0.8;
  letter-spacing: 0.02em;
  text-align: center;
  color: transparent;
  background: linear-gradient(180deg, #fff8d8 2%, #ffd968 38%, #f0a620 64%, #b66a0a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 4px 0 rgba(56, 24, 0, 0.75)) drop-shadow(0 0 26px rgba(255, 180, 40, 0.28));
  -webkit-text-stroke: 1px rgba(255, 235, 170, 0.22);
}
.logo span { display: block; font-size: clamp(48px, 18cqw, 112px); }
.logo .logo-x { font-size: clamp(42px, 16cqw, 100px); color: transparent; }
.logo .logo-x b {
  color: var(--gold-bright);
  -webkit-text-fill-color: var(--gold-bright);
  text-shadow: 0 0 24px rgba(255, 220, 120, 0.8);
}

.btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.12em;
  width: 100%;
  min-height: clamp(46px, 7.4cqh, 70px);
  padding: clamp(8px, 1.7cqh, 16px) clamp(12px, 3.6cqw, 24px);
  border: 0;
  border-radius: clamp(10px, 2.6cqw, 18px);
  font-size: clamp(13px, 4.1cqw, 23px);
  font-weight: 900;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: left;
  line-height: 1.05;
  color: #1c1102;
  background: linear-gradient(135deg, #fff0b3 0%, #ffd15c 40%, #f2a81e 72%, #c57c0b 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    inset 0 -2px 0 rgba(120, 62, 0, 0.35),
    0 6px 0 rgba(84, 42, 0, 0.42),
    0 0 30px rgba(255, 190, 60, 0.22);
  transition: transform 0.1s ease, filter 0.18s ease;
  touch-action: manipulation;
}
.btn small {
  font-size: 0.58em;
  font-weight: 700;
  letter-spacing: 0.06em;
  opacity: 0.68;
  text-transform: uppercase;
  line-height: 1.2;
}
.btn:active { transform: translateY(3px); filter: brightness(1.06); }
.btn:disabled { filter: grayscale(0.7) brightness(0.6); cursor: default; }

.btn-wide { width: 100%; }

.btn-teal {
  color: #00171a;
  background: linear-gradient(135deg, #bdfff8 0%, #55eee4 38%, #19b6c7 72%, #087c96 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -2px 0 rgba(0, 86, 100, 0.4),
    0 6px 0 rgba(0, 58, 70, 0.48),
    0 0 28px rgba(60, 230, 220, 0.18);
}

.btn-ember {
  color: #240603;
  background: linear-gradient(135deg, #ffd0ac 0%, #ff9b64 34%, #f85437 72%, #b7272c 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -2px 0 rgba(94, 16, 6, 0.45),
    0 6px 0 rgba(80, 18, 10, 0.46),
    0 0 28px rgba(255, 90, 60, 0.2);
}

.btn-ghost {
  color: var(--paper);
  background: linear-gradient(180deg, rgba(180, 235, 255, 0.12), rgba(80, 140, 190, 0.07));
  border: 1px solid rgba(150, 225, 255, 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 5px 0 rgba(0, 0, 0, 0.28);
}
.btn-ghost small { opacity: 0.55; }

.icon-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(36px, 9.2cqw, 52px);
  height: clamp(36px, 9.2cqw, 52px);
  padding: 0;
  border: 1px solid rgba(160, 230, 255, 0.24);
  border-radius: 50%;
  color: var(--paper);
  background: rgba(7, 16, 32, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 20px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}
.icon-btn svg { width: 56%; height: 56%; fill: currentColor; opacity: 0.9; }
.icon-btn:active { transform: scale(0.94); }

.mini-btn {
  border: 1px solid rgba(160, 230, 255, 0.2);
  border-radius: 99px;
  padding: 0.42em 0.9em;
  font-size: clamp(8px, 2.15cqw, 12px);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(6, 14, 28, 0.55);
  cursor: pointer;
  pointer-events: auto;
}
.mini-btn:active { color: var(--teal); }

/* ---------------- loading ---------------- */

#scr-loading {
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 45%, rgba(20, 46, 80, 0.7), #03050c 70%);
}
.loading-inner { display: flex; flex-direction: column; align-items: center; gap: 2.4cqh; width: 74%; }
.loading-skull {
  font-size: clamp(40px, 14cqw, 90px);
  color: var(--gold);
  filter: drop-shadow(0 0 26px rgba(255, 200, 70, 0.55));
  animation: floaty 2.6s ease-in-out infinite;
}
.loading-title {
  font-family: "Pirata One", Georgia, serif;
  font-size: clamp(30px, 10cqw, 64px);
  color: var(--gold-bright);
  letter-spacing: 0.04em;
  text-shadow: 0 0 30px rgba(255, 190, 60, 0.4);
}
.loading-bar {
  width: 100%;
  height: clamp(6px, 1.2cqh, 10px);
  border-radius: 99px;
  background: rgba(120, 200, 230, 0.14);
  overflow: hidden;
  border: 1px solid rgba(150, 230, 255, 0.16);
}
.loading-bar i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  box-shadow: 0 0 18px rgba(255, 200, 70, 0.5);
  transition: width 0.2s ease;
}
.loading-text {
  font-size: clamp(9px, 2.3cqw, 13px);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

@keyframes floaty {
  0%, 100% { transform: translateY(-3px) rotate(-2deg); }
  50% { transform: translateY(5px) rotate(2deg); }
}

/* ---------------- menu ---------------- */

.menu-screen {
  touch-action: none;
  background:
    linear-gradient(180deg, rgba(4, 7, 18, 0.18) 0%, rgba(4, 7, 18, 0.45) 38%, rgba(3, 6, 15, 0.9) 78%, #03050c 100%);
}
.menu-inner {
  display: flex;
  flex-direction: column;
  gap: clamp(7px, 1.4cqh, 15px);
  width: 100%;
  min-height: 100%;
  padding: clamp(10px, 2.4cqh, 22px) clamp(8px, 3.2cqw, 22px);
  margin: auto 0;
}
.brand { text-align: center; display: flex; flex-direction: column; gap: clamp(3px, 0.7cqh, 8px); }
.tagline {
  margin: 0;
  font-size: clamp(9px, 2.55cqw, 14px);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(225, 245, 255, 0.72);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}

.menu-stats { display: flex; gap: clamp(6px, 1.6cqw, 12px); }
.stat-chip {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1em;
  min-height: clamp(38px, 6cqi, 58px);
  padding: 0.35em 0.3em;
  border: 1px solid rgba(150, 225, 255, 0.16);
  border-radius: clamp(9px, 2.4cqw, 16px);
  background: linear-gradient(180deg, rgba(28, 54, 86, 0.44), rgba(6, 13, 27, 0.72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.stat-chip img { width: clamp(14px, 4.2cqw, 26px); height: auto; }
.stat-chip span { font-size: clamp(14px, 4.5cqw, 26px); font-weight: 900; color: var(--gold-bright); line-height: 1; }
.stat-chip small { font-size: clamp(7px, 1.8cqw, 10px); font-weight: 800; letter-spacing: 0.12em; color: var(--muted); }
.stat-chip .stat-num { color: var(--teal); }

.waiting-note {
  text-align: center;
  font-size: clamp(8px, 2.2cqw, 12px);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
  padding: 0.45em 0.8em;
  border-radius: 99px;
  background: rgba(255, 190, 50, 0.1);
  border: 1px solid rgba(255, 205, 90, 0.22);
}

.menu-actions { display: flex; flex-direction: column; gap: clamp(7px, 1.3cqh, 13px); margin-top: auto; }
.menu-row { display: flex; gap: clamp(7px, 1.7cqw, 13px); }
.menu-row .btn { flex: 1; }

.legend-strip {
  min-height: 0;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.9em;
  font-size: clamp(7px, 2cqw, 11px);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(225, 245, 255, 0.55);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
}
.legend-strip.on { display: flex; }
.legend-strip b { color: var(--gold-bright); }

.menu-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7em;
  flex-wrap: wrap;
  padding-top: 0.2em;
}
.build { font-size: clamp(7px, 1.8cqw, 10px); color: rgba(200, 230, 250, 0.3); letter-spacing: 0.1em; }

/* ---------------- hangar ---------------- */

#scr-hangar {
  background: linear-gradient(180deg, rgba(4, 7, 18, 0.72), rgba(3, 6, 15, 0.96) 34%, #03050c 100%);
  gap: clamp(6px, 1.2cqh, 12px);
}
.scr-head {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2.4cqw, 16px);
  flex: 0 0 auto;
}
.head-title { flex: 1; min-width: 0; }
.head-title h2 {
  margin: 0;
  font-family: "Pirata One", Georgia, serif;
  font-weight: 400;
  font-size: clamp(24px, 8.4cqw, 52px);
  line-height: 0.9;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
  text-shadow: 0 2px 0 rgba(50, 22, 0, 0.6);
}
.head-sub, .head-coins {
  display: flex;
  align-items: center;
  gap: 0.3em;
  font-size: clamp(8px, 2.3cqw, 13px);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.head-coins img { width: clamp(13px, 3.4cqw, 20px); }
.captain-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: clamp(44px, 11cqw, 64px);
  padding: 0.3em 0.4em;
  border-radius: clamp(8px, 2cqw, 14px);
  border: 1px solid rgba(255, 205, 90, 0.28);
  background: rgba(255, 190, 50, 0.08);
}
.captain-badge span { font-size: clamp(15px, 4.6cqw, 26px); font-weight: 900; color: var(--gold-bright); line-height: 1; }
.captain-badge small { font-size: clamp(6px, 1.7cqw, 9px); font-weight: 800; letter-spacing: 0.1em; color: var(--muted); }

.xpbar {
  position: relative;
  height: clamp(9px, 1.8cqh, 14px);
  border-radius: 99px;
  background: rgba(120, 200, 230, 0.12);
  border: 1px solid rgba(150, 230, 255, 0.12);
  overflow: hidden;
  flex: 0 0 auto;
}
.xpbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--teal-deep), var(--teal), #b9fff8); border-radius: inherit; }
.xpbar em {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  font-size: clamp(6px, 1.7cqw, 9px);
  font-weight: 800;
  letter-spacing: 0.1em;
  color: rgba(5, 12, 24, 0.7);
}

.tabs { display: flex; gap: clamp(4px, 1.2cqw, 8px); flex: 0 0 auto; }
.tab {
  flex: 1;
  padding: 0.62em 0.3em;
  border-radius: 99px;
  border: 1px solid rgba(150, 225, 255, 0.14);
  background: rgba(8, 18, 34, 0.55);
  color: var(--muted);
  font-size: clamp(8px, 2.35cqw, 13px);
  font-weight: 900;
  letter-spacing: 0.1em;
  cursor: pointer;
  touch-action: manipulation;
}
.tab.active {
  color: #1a1002;
  border-color: rgba(255, 215, 110, 0.6);
  background: linear-gradient(135deg, #ffe9a9, #f6b62f);
  box-shadow: 0 0 20px rgba(255, 190, 60, 0.2);
}

.hangar-body {
  flex: 1 1 auto;
  touch-action: pan-y;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.35em 0.15em 0.8em;
  touch-action: pan-y;
  scrollbar-width: none;
}
.hangar-body::-webkit-scrollbar { display: none; }

.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(7px, 1.8cqw, 13px); }
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35em;
  padding: clamp(8px, 2.2cqw, 14px);
  border-radius: clamp(10px, 2.6cqw, 17px);
  border: 1px solid rgba(150, 225, 255, 0.14);
  background: linear-gradient(165deg, rgba(24, 47, 78, 0.5), rgba(5, 12, 26, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 0%, rgba(255, 210, 100, 0.12), transparent 55%);
  pointer-events: none;
}
.card.equipped { border-color: rgba(255, 208, 90, 0.55); box-shadow: 0 0 20px rgba(255, 190, 60, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.1); }
.card.locked { opacity: 0.55; }
.card-art {
  align-self: center;
  width: 76%;
  height: clamp(54px, 10.5cqh, 110px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.1em;
}
.card-art img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5)); }
.card-art.icon img { width: 58%; }
.card h3 {
  margin: 0;
  font-size: clamp(10px, 3cqw, 16px);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--paper);
  line-height: 1.1;
}
.card p { margin: 0; font-size: clamp(7.5px, 2.1cqw, 11px); line-height: 1.35; color: var(--muted); flex: 1; }
.card .tags { display: flex; flex-direction: column; gap: 0.22em; }
.tagline-row { display: flex; align-items: center; gap: 0.4em; font-size: clamp(6px, 1.7cqw, 9px); font-weight: 800; letter-spacing: 0.08em; color: rgba(210, 240, 255, 0.5); }
.tagline-row i { flex: 1; height: 4px; border-radius: 99px; background: rgba(120, 200, 230, 0.14); overflow: hidden; }
.tagline-row i b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), var(--gold)); }
.card-foot { display: flex; align-items: center; gap: 0.4em; margin-top: 0.2em; }
.card-cost { display: flex; align-items: center; gap: 0.25em; font-size: clamp(9px, 2.5cqw, 13px); font-weight: 900; color: var(--gold-bright); }
.card-cost img { width: clamp(11px, 3cqw, 16px); }
.card-btn {
  margin-left: auto;
  border: 0;
  border-radius: 99px;
  padding: 0.5em 0.8em;
  font-size: clamp(7px, 1.95cqw, 10px);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1b1001;
  background: linear-gradient(135deg, #ffe9a9, #f4b32b);
  cursor: pointer;
  touch-action: manipulation;
}
.card-btn:disabled { background: rgba(130, 170, 200, 0.16); color: var(--muted); cursor: default; }
.card-btn.own { background: rgba(76, 231, 224, 0.18); color: var(--teal); border: 1px solid rgba(76, 231, 224, 0.3); }
.card .lock-note { font-size: clamp(6px, 1.7cqw, 9px); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ember); }

.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(6px, 1.6cqw, 12px); }
.chart-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.2em;
  align-items: flex-start;
  padding: clamp(8px, 2.4cqw, 15px);
  border-radius: clamp(9px, 2.4cqw, 16px);
  border: 1px solid rgba(150, 225, 255, 0.14);
  background: linear-gradient(160deg, rgba(20, 40, 68, 0.55), rgba(5, 12, 26, 0.9));
  color: var(--paper);
  cursor: pointer;
  text-align: left;
  touch-action: manipulation;
}
.chart-card b { font-family: "Pirata One", Georgia, serif; font-weight: 400; font-size: clamp(17px, 5.4cqw, 30px); line-height: 1; color: var(--gold-bright); }
.chart-card span { font-size: clamp(7px, 1.9cqw, 10px); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.chart-card.sel { border-color: rgba(255, 208, 90, 0.65); box-shadow: 0 0 24px rgba(255, 190, 60, 0.16); }
.chart-card.locked { opacity: 0.42; cursor: default; }
.chart-card .lock { color: var(--ember); }

.hangar-foot {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.45em;
  padding-top: 0.3em;
  border-top: 1px solid rgba(150, 225, 255, 0.1);
}
.loadout-line {
  font-size: clamp(7px, 1.95cqw, 10px);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  line-height: 1.35;
}
.hangar-foot .btn { min-height: clamp(42px, 6.2cqh, 60px); align-items: center; text-align: center; }

/* ---------------- crew ---------------- */

#scr-crew {
  background: linear-gradient(180deg, rgba(4, 7, 18, 0.76), rgba(3, 6, 15, 0.96) 36%, #03050c 100%);
  gap: clamp(8px, 1.6cqh, 16px);
}
.crew-body { flex: 1; display: flex; flex-direction: column; gap: clamp(8px, 1.5cqh, 14px); min-height: 0; overflow-y: auto; touch-action: pan-y; scrollbar-width: none; }
.crew-body::-webkit-scrollbar { display: none; }
.crew-setup { display: flex; flex-direction: column; gap: clamp(8px, 1.5cqh, 14px); }
.setup-block { display: flex; flex-direction: column; gap: 0.45em; }
.setup-label { font-size: clamp(8px, 2.15cqw, 12px); font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.chip-row { display: flex; gap: clamp(6px, 1.6cqw, 12px); }
.chip {
  flex: 1;
  padding: 0.68em 0.4em;
  border-radius: clamp(9px, 2.4cqw, 16px);
  border: 1px solid rgba(150, 225, 255, 0.16);
  background: rgba(8, 18, 34, 0.6);
  color: var(--muted);
  font-size: clamp(9px, 2.6cqw, 14px);
  font-weight: 900;
  letter-spacing: 0.06em;
  cursor: pointer;
  touch-action: manipulation;
}
.chip.active { color: #1a1002; border-color: rgba(255, 215, 110, 0.6); background: linear-gradient(135deg, #ffe9a9, #f6b62f); }
.chip:disabled { opacity: 0.4; cursor: default; }
.crew-note { font-size: clamp(8px, 2.2cqw, 12px); line-height: 1.45; color: var(--muted); text-align: center; }
.crew-actions { display: flex; flex-direction: column; gap: clamp(7px, 1.2cqh, 12px); }

.lobby-panel {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.5cqh, 14px);
  padding: clamp(10px, 2.8cqw, 18px);
  border-radius: clamp(11px, 3cqw, 18px);
  border: 1px solid rgba(150, 225, 255, 0.18);
  background: linear-gradient(165deg, rgba(22, 45, 74, 0.58), rgba(5, 12, 26, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.lobby-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5em; }
.room-name { font-size: clamp(9px, 2.5cqw, 13px); font-weight: 800; letter-spacing: 0.08em; color: var(--teal); word-break: break-all; }
.room-mode { font-size: clamp(8px, 2.1cqw, 11px); font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-bright); }
.seat-slots { display: flex; flex-direction: column; gap: 0.35em; }
.seat-slot {
  display: flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.5em 0.65em;
  border-radius: clamp(7px, 2cqw, 12px);
  background: rgba(120, 200, 230, 0.06);
  border: 1px solid rgba(150, 225, 255, 0.09);
  font-size: clamp(9px, 2.6cqw, 14px);
  font-weight: 800;
  color: var(--muted);
}
.seat-slot.filled { color: var(--paper); background: rgba(76, 231, 224, 0.09); border-color: rgba(76, 231, 224, 0.22); }
.seat-slot.you { border-color: rgba(255, 208, 90, 0.45); }
.seat-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7em;
  height: 1.7em;
  border-radius: 50%;
  font-size: 0.8em;
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold-bright);
}
.seat-slot .you-tag { margin-left: auto; font-size: 0.7em; letter-spacing: 0.1em; color: var(--gold-bright); }
.link-box { display: flex; gap: 0.4em; }
.link-box input {
  flex: 1;
  min-width: 0;
  padding: 0.6em 0.7em;
  border-radius: clamp(7px, 2cqw, 12px);
  border: 1px solid rgba(150, 225, 255, 0.16);
  background: rgba(2, 8, 18, 0.65);
  color: var(--teal);
  font-family: inherit;
  font-size: clamp(8px, 2.1cqw, 11px);
  font-weight: 700;
  user-select: all;
  -webkit-user-select: all;
}
.lobby-actions { display: flex; gap: 0.45em; }
.lobby-actions .mini-btn { flex: 1; padding: 0.65em 0.3em; }
.lobby-status { font-size: clamp(8px, 2.2cqw, 12px); font-weight: 800; letter-spacing: 0.06em; color: var(--gold-bright); text-align: center; }
.lobby-refused {
  padding: 0.7em;
  border-radius: 0.6em;
  background: rgba(255, 90, 60, 0.1);
  border: 1px solid rgba(255, 120, 90, 0.3);
  font-size: clamp(8px, 2.2cqw, 12px);
  line-height: 1.4;
  color: #ffc7b8;
  text-align: center;
}

/* ---------------- staging ---------------- */

.staging-screen {
  justify-content: center;
  align-items: stretch;
  background: radial-gradient(ellipse at 50% 40%, rgba(12, 28, 54, 0.72), rgba(2, 4, 10, 0.92));
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.staging-inner { display: flex; flex-direction: column; align-items: center; gap: clamp(8px, 1.5cqh, 16px); margin: auto 0; }
.staging-inner h2 {
  margin: 0;
  font-family: "Pirata One", Georgia, serif;
  font-weight: 400;
  font-size: clamp(28px, 9cqw, 54px);
  line-height: 0.95;
  text-align: center;
  color: var(--gold-bright);
  text-shadow: 0 0 30px rgba(255, 200, 70, 0.25);
}
.staging-sub { margin: 0; max-width: 88%; text-align: center; font-size: clamp(8px, 2.3cqw, 13px); line-height: 1.4; color: var(--muted); }
.vote-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(7px, 2cqw, 14px); width: 100%; }
.vote-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25em;
  padding: clamp(9px, 2.6cqw, 16px);
  border-radius: clamp(10px, 2.8cqw, 18px);
  border: 1px solid rgba(150, 225, 255, 0.16);
  background: linear-gradient(165deg, rgba(24, 50, 82, 0.68), rgba(5, 12, 26, 0.94));
  color: var(--paper);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  overflow: hidden;
}
.vote-card b { font-size: clamp(10px, 3cqw, 17px); font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; }
.vote-card small { font-size: clamp(7px, 2cqw, 11px); line-height: 1.35; color: var(--muted); }
.vote-icon { font-size: clamp(20px, 6.6cqw, 38px); color: var(--gold); filter: drop-shadow(0 0 14px rgba(255, 200, 70, 0.5)); line-height: 1; }
.vote-card em {
  position: absolute;
  top: 0.4em;
  right: 0.5em;
  font-style: normal;
  font-size: clamp(15px, 5cqw, 30px);
  font-weight: 900;
  color: rgba(255, 255, 255, 0.16);
}
.vote-card.mine { border-color: rgba(255, 208, 90, 0.6); box-shadow: 0 0 24px rgba(255, 190, 60, 0.15); }
.vote-card.mine em { color: var(--gold-bright); }
.staging-seats { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4em; }
.stage-seat {
  padding: 0.35em 0.7em;
  border-radius: 99px;
  border: 1px solid rgba(150, 225, 255, 0.16);
  background: rgba(8, 18, 34, 0.66);
  font-size: clamp(8px, 2.2cqw, 12px);
  font-weight: 800;
  color: var(--paper);
}
.stage-seat.you { border-color: rgba(255, 208, 90, 0.5); color: var(--gold-bright); }
.stage-seat span { color: var(--teal); margin-left: 0.4em; font-size: 0.85em; text-transform: uppercase; }
.staging-count {
  font-family: "Pirata One", Georgia, serif;
  font-size: clamp(20px, 7cqw, 42px);
  color: var(--teal);
  text-shadow: 0 0 26px rgba(76, 231, 224, 0.4);
  text-align: center;
  min-height: 1.2em;
}

/* ---------------- results ---------------- */

.results-screen {
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, rgba(20, 40, 72, 0.74), rgba(2, 4, 10, 0.94));
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.results-panel {
  display: flex;
  flex-direction: column;
  gap: clamp(7px, 1.4cqh, 14px);
  width: 100%;
  max-width: 92%;
  margin: auto;
  padding: clamp(13px, 3.4cqw, 24px);
  border-radius: clamp(13px, 3.4cqw, 22px);
  border: 1px solid rgba(255, 208, 90, 0.3);
  background: linear-gradient(165deg, rgba(30, 54, 88, 0.72), rgba(5, 11, 24, 0.95));
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  text-align: center;
  max-height: 88cqh;
  overflow-y: auto;
  touch-action: pan-y;
  scrollbar-width: none;
}
.results-panel::-webkit-scrollbar { display: none; }
.results-panel h2 {
  margin: 0;
  font-family: "Pirata One", Georgia, serif;
  font-weight: 400;
  font-size: clamp(30px, 10cqw, 58px);
  line-height: 0.92;
  color: var(--gold-bright);
  text-shadow: 0 0 30px rgba(255, 200, 70, 0.3);
}
.result-sub { margin: 0; font-size: clamp(8px, 2.3cqw, 13px); line-height: 1.4; color: var(--muted); }
.result-stats { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(5px, 1.3cqw, 10px); }
.result-stat {
  padding: 0.55em 0.4em;
  border-radius: clamp(8px, 2.2cqw, 14px);
  background: rgba(120, 200, 230, 0.07);
  border: 1px solid rgba(150, 225, 255, 0.12);
}
.result-stat span { display: block; font-size: clamp(15px, 4.8cqw, 28px); font-weight: 900; color: var(--gold-bright); line-height: 1; }
.result-stat small { display: block; margin-top: 0.2em; font-size: clamp(6px, 1.8cqw, 9px); font-weight: 800; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; }
.result-board { display: flex; flex-direction: column; gap: 0.25em; }
.result-row {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.45em 0.65em;
  border-radius: 0.5em;
  background: rgba(120, 200, 230, 0.06);
  font-size: clamp(8px, 2.3cqw, 13px);
  font-weight: 800;
}
.result-row.you { background: rgba(255, 208, 90, 0.12); color: var(--gold-bright); }
.result-row .place { color: var(--teal); min-width: 1.4em; text-align: left; }
.result-row .rname { flex: 1; text-align: left; }
.result-row .rval { color: var(--muted); }
.result-actions { display: flex; flex-direction: column; gap: clamp(6px, 1.1cqh, 10px); }
.result-actions .btn { align-items: center; text-align: center; min-height: clamp(40px, 5.6cqh, 56px); }

/* ---------------- HUD ---------------- */

#hud { position: absolute; inset: 0; z-index: 20; pointer-events: none; font-family: "Nunito Sans", sans-serif; }

.hud-top {
  position: absolute;
  top: max(8px, 1.2cqh);
  left: 2.6cqw;
  right: 2.6cqw;
  display: flex;
  align-items: flex-start;
  gap: 2cqw;
}
.hud-top .icon-btn { pointer-events: auto; background: rgba(4, 12, 26, 0.6); }
.mission {
  flex: 1;
  min-width: 0;
  padding: 0.42em 0.75em 0.52em;
  border-radius: clamp(8px, 2.2cqw, 14px);
  background: linear-gradient(180deg, rgba(6, 14, 30, 0.82), rgba(4, 10, 22, 0.58));
  border: 1px solid rgba(150, 225, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.mission-row { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5em; }
#levelLabel { font-size: clamp(8px, 2.35cqw, 13px); font-weight: 900; letter-spacing: 0.12em; color: var(--teal); }
#timerLabel { font-family: "Pirata One", Georgia, serif; font-size: clamp(15px, 4.5cqw, 26px); line-height: 1; color: var(--gold-bright); }
.meter { height: clamp(5px, 1cqh, 8px); border-radius: 99px; background: rgba(120, 200, 230, 0.14); overflow: hidden; margin-top: 0.28em; }
.meter i { display: block; height: 100%; width: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal-deep), var(--teal), #d8fff9); box-shadow: 0 0 12px rgba(76, 231, 224, 0.5); transition: width 0.2s linear; }
.meter i.low { background: linear-gradient(90deg, #a32222, var(--ember), #ffb08a); box-shadow: 0 0 12px rgba(255, 90, 60, 0.55); }
.sector { font-size: clamp(6px, 1.75cqw, 9px); font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(220, 241, 255, 0.46); margin-top: 0.2em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.coinbox {
  display: flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.35em 0.6em;
  border-radius: 99px;
  background: rgba(6, 14, 30, 0.78);
  border: 1px solid rgba(255, 210, 100, 0.2);
  font-size: clamp(10px, 3cqw, 16px);
  font-weight: 900;
  color: var(--gold-bright);
  pointer-events: none;
}
.coinbox img { width: clamp(14px, 3.8cqw, 22px); }
.coinbox.pop { animation: coinpop 0.28s ease; }
@keyframes coinpop { 50% { transform: scale(1.12); filter: brightness(1.35); } }

.hud-score {
  position: absolute;
  top: clamp(52px, 8.5cqh, 84px);
  left: 4cqw;
  display: flex;
  align-items: flex-end;
  gap: 0.6em;
}
.score-main { display: flex; flex-direction: column; line-height: 0.86; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7); }
.score-main span { font-family: "Pirata One", Georgia, serif; font-size: clamp(24px, 7.4cqw, 44px); color: #f4fbff; }
.score-main small { font-size: clamp(6px, 1.7cqw, 9px); font-weight: 900; letter-spacing: 0.2em; color: rgba(220, 241, 255, 0.5); }
.combo { font-size: clamp(9px, 2.8cqw, 15px); font-weight: 900; color: var(--gold-bright); text-shadow: 0 0 14px rgba(255, 200, 70, 0.6); min-width: 2.2em; }
.combo.on { animation: comboPulse 0.4s ease; }
@keyframes comboPulse { 50% { transform: scale(1.25); color: #fff; } }

.bossbar {
  position: absolute;
  top: clamp(104px, 16cqh, 160px);
  left: 12cqw;
  right: 12cqw;
  padding: 0.4em 0.8em 0.5em;
  border-radius: clamp(8px, 2cqw, 14px);
  background: rgba(8, 6, 18, 0.8);
  border: 1px solid rgba(255, 90, 60, 0.35);
  box-shadow: 0 0 30px rgba(255, 60, 40, 0.18);
}
.boss-name { display: flex; justify-content: space-between; font-size: clamp(8px, 2.2cqw, 12px); font-weight: 900; letter-spacing: 0.14em; color: #ffb4a2; }
.boss-meter { background: rgba(255, 90, 60, 0.14); height: clamp(6px, 1.2cqh, 10px); }
.boss-meter i { background: linear-gradient(90deg, #7c1010, var(--ember), #ffc1a0); box-shadow: 0 0 14px rgba(255, 90, 60, 0.5); }

.hud-left {
  position: absolute;
  top: clamp(86px, 13.4cqh, 128px);
  left: 4cqw;
  display: flex;
  flex-direction: column;
  gap: 0.28em;
  max-width: 44cqw;
}
.hull-wrap { display: flex; gap: 0.28em; }
.pip {
  width: clamp(12px, 3.6cqw, 22px);
  height: clamp(7px, 2cqw, 12px);
  border-radius: 2px;
  transform: skewX(-18deg);
  background: rgba(120, 200, 230, 0.14);
  border: 1px solid rgba(150, 225, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.pip.full { background: linear-gradient(180deg, #d9fff8, var(--teal) 45%, #0a9cb4); border-color: rgba(120, 255, 240, 0.5); box-shadow: 0 0 10px rgba(76, 231, 224, 0.45); }
.pip.lowfull { background: linear-gradient(180deg, #ffd7c6, var(--ember) 45%, #a62525); border-color: rgba(255, 140, 100, 0.5); box-shadow: 0 0 10px rgba(255, 90, 60, 0.4); }
.weapon-label { font-size: clamp(7px, 2cqw, 11px); font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(220, 241, 255, 0.66); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8); }
.buff-row { display: flex; gap: 0.3em; }
.buff {
  display: inline-flex;
  align-items: center;
  gap: 0.2em;
  padding: 0.12em 0.4em;
  border-radius: 99px;
  font-size: clamp(6px, 1.7cqw, 9px);
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  background: rgba(255, 190, 50, 0.12);
  border: 1px solid rgba(255, 205, 90, 0.24);
}

.roster {
  position: absolute;
  top: clamp(52px, 8.5cqh, 84px);
  right: 3cqw;
  display: flex;
  flex-direction: column;
  gap: 0.25em;
  max-width: 46cqw;
}
.roster-row {
  display: flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.22em 0.45em;
  border-radius: 99px;
  background: rgba(5, 12, 26, 0.62);
  border: 1px solid rgba(150, 225, 255, 0.1);
  font-size: clamp(6px, 1.8cqw, 10px);
  font-weight: 800;
  color: rgba(220, 241, 255, 0.74);
  white-space: nowrap;
}
.roster-row.me { border-color: rgba(255, 208, 90, 0.35); color: var(--gold-bright); }
.roster-row .dot { width: 0.55em; height: 0.55em; border-radius: 50%; background: var(--teal); box-shadow: 0 0 8px currentColor; flex: 0 0 auto; }
.roster-row .rscore { margin-left: auto; color: var(--muted); }
.roster-row .rkills { margin-left: auto; color: var(--gold-bright); }

.controls {
  position: absolute;
  left: 3.2cqw;
  right: 3.2cqw;
  bottom: max(3.6cqh, env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
}
.round-btn {
  position: relative;
  width: clamp(52px, 17cqw, 92px);
  height: clamp(52px, 17cqw, 92px);
  border-radius: 50%;
  border: 1px solid rgba(255, 208, 90, 0.35);
  background:
    radial-gradient(circle at 38% 28%, rgba(255, 255, 255, 0.22), transparent 38%),
    linear-gradient(160deg, rgba(60, 86, 116, 0.85), rgba(8, 16, 32, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 6px 18px rgba(0, 0, 0, 0.55), 0 0 26px rgba(255, 190, 60, 0.12);
  color: var(--paper);
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05em;
}
.round-btn:active { transform: scale(0.94); }
.round-btn .rb-icon { font-size: clamp(15px, 5.2cqw, 30px); line-height: 1; color: var(--gold-bright); }
.round-btn .rb-label { font-size: clamp(6px, 1.9cqw, 10px); font-weight: 900; letter-spacing: 0.1em; color: rgba(230, 245, 255, 0.8); }
.round-btn.combine { margin-right: auto; border-color: rgba(76, 231, 224, 0.45); box-shadow: 0 0 26px rgba(76, 231, 224, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.round-btn.combine .rb-icon { color: var(--teal); }
.round-btn.burst { margin-left: auto; border-color: rgba(255, 208, 90, 0.4); }
.round-btn.burst.ready { animation: burstReady 1.2s ease-in-out infinite; }
.round-btn.burst.ready .rb-icon { color: #fff; text-shadow: 0 0 18px #ffd15c; }
@keyframes burstReady { 50% { box-shadow: 0 0 38px rgba(255, 208, 90, 0.55), inset 0 0 20px rgba(255, 208, 90, 0.2); } }
.round-btn.burst:disabled { opacity: 0.42; }
.charge-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(var(--gold) calc(var(--charge, 0) * 1%), rgba(255, 208, 90, 0.1) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
  pointer-events: none;
}

.banner {
  position: absolute;
  top: 30cqh;
  left: 4cqw;
  right: 4cqw;
  text-align: center;
  font-family: "Pirata One", Georgia, serif;
  font-size: clamp(28px, 9.6cqw, 58px);
  line-height: 1;
  color: var(--gold-bright);
  text-shadow: 0 3px 0 rgba(50, 20, 0, 0.7), 0 0 40px rgba(255, 200, 70, 0.4);
  animation: bannerIn 0.42s cubic-bezier(0.2, 1.4, 0.4, 1);
  pointer-events: none;
}
.banner small { display: block; margin-top: 0.18em; font-family: "Nunito Sans", sans-serif; font-size: clamp(8px, 2.3cqw, 13px); font-weight: 900; letter-spacing: 0.18em; color: var(--teal); text-shadow: none; }
@keyframes bannerIn { 0% { opacity: 0; transform: scale(0.7) translateY(12px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }

.respawn-note {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24cqh;
  text-align: center;
  font-size: clamp(9px, 2.7cqw, 15px);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffc3b2;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.hud-toast {
  position: absolute;
  left: 50%;
  bottom: 19cqh;
  transform: translateX(-50%);
  max-width: 84cqw;
  padding: 0.5em 0.9em;
  border-radius: 99px;
  background: rgba(5, 12, 26, 0.88);
  border: 1px solid rgba(255, 208, 90, 0.3);
  font-size: clamp(8px, 2.35cqw, 13px);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

#damageFlash {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  opacity: 0;
  box-shadow: inset 0 0 90px 30px rgba(255, 40, 30, 0.8);
  transition: opacity 0.16s ease;
}
#damageFlash.on { opacity: 1; transition: opacity 0.04s ease; }

/* ---------------- modal + toast ---------------- */

.modal {
  position: absolute;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6cqw;
  background: rgba(2, 4, 10, 0.78);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  pointer-events: auto;
  touch-action: pan-y;
}
.modal-card {
  width: 100%;
  max-height: 82cqh;
  overflow-y: auto;
  padding: clamp(14px, 4cqw, 24px);
  border-radius: clamp(13px, 3.4cqw, 22px);
  border: 1px solid rgba(255, 208, 90, 0.3);
  background: linear-gradient(165deg, rgba(28, 50, 82, 0.9), rgba(5, 11, 24, 0.98));
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  scrollbar-width: none;
}
.modal-card::-webkit-scrollbar { display: none; }
.modal-card h2 {
  margin: 0 0 0.4em;
  font-family: "Pirata One", Georgia, serif;
  font-weight: 400;
  font-size: clamp(26px, 8.4cqw, 48px);
  line-height: 0.95;
  color: var(--gold-bright);
  text-align: center;
}
.modal-card p { margin: 0 0 0.7em; font-size: clamp(9px, 2.5cqw, 14px); line-height: 1.5; color: var(--muted); }
.modal-card p b { color: var(--paper); }
.modal-card .help-list { display: flex; flex-direction: column; gap: 0.55em; margin: 0 0 0.8em; padding: 0; list-style: none; }
.modal-card .help-list li { display: flex; gap: 0.6em; font-size: clamp(8.5px, 2.4cqw, 13px); line-height: 1.45; color: var(--muted); }
.modal-card .help-list li b { color: var(--teal); flex: 0 0 auto; }
.modal-card .modal-actions { display: flex; flex-direction: column; gap: 0.5em; }
.modal-card .btn { align-items: center; text-align: center; min-height: clamp(40px, 6cqh, 58px); }
.modal-card .warn { color: #ffc3b2; font-size: clamp(8px, 2.2cqw, 12px); font-weight: 800; text-align: center; }

.toast {
  position: absolute;
  left: 50%;
  bottom: max(16px, 3cqh);
  transform: translateX(-50%);
  z-index: 90;
  max-width: 86cqw;
  padding: 0.65em 1.1em;
  border-radius: 99px;
  background: rgba(5, 13, 27, 0.94);
  border: 1px solid rgba(150, 225, 255, 0.24);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  font-size: clamp(9px, 2.55cqw, 14px);
  font-weight: 800;
  text-align: center;
  color: var(--paper);
  pointer-events: none;
}

.side-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 34%, rgba(0, 0, 0, 0.5) 100%),
    linear-gradient(90deg, rgba(20, 10, 40, 0.35), transparent 30%, transparent 70%, rgba(10, 30, 40, 0.35));
  z-index: 0;
}

@media (min-aspect-ratio: 1/1) {
  #void { opacity: 0.7; }
}

@media (max-height: 520px) {
  .screen { padding-top: 8px; padding-bottom: 8px; }
  .menu-inner { gap: 5px; }
  .brand { gap: 1px; }
  .logo span { font-size: clamp(38px, 14cqw, 80px); }
  .logo .logo-x { font-size: clamp(34px, 12.5cqw, 72px); }
  .tagline { display: none; }
  .menu-stats { display: none; }
  .legend-strip { display: none !important; }
}

.chart-note {
  margin: 0 0 0.75em;
  padding: 0.65em 0.8em;
  border-radius: 0.6em;
  border: 1px solid rgba(150, 225, 255, 0.12);
  background: rgba(120, 200, 230, 0.06);
  font-size: clamp(7.5px, 2.05cqw, 11px);
  line-height: 1.4;
  color: var(--muted);
}

.staging-hint {
  font-size: clamp(8px, 2.15cqw, 12px);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(220, 241, 255, 0.48);
  text-align: center;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}
