/* ═══════════════════ VOIDBLOOM — interface ═══════════════════
   Type: Audiowide (display) · Chakra Petch (UI) — self-hosted
   Language: chamfered plates, hairline edges, phosphor glow      */

/* Fonts are inlined in css/fonts.css (data URIs) so the game loads them
   from file://, offline, and on any static host with zero extra requests. */

:root {
  --cyan: #38f0ff;
  --pink: #ff3ec8;
  --gold: #ffd447;
  --red: #ff4d6a;
  --green: #5dffa0;
  --violet: #c88cff;
  --bg: #04050c;
  --panel: rgba(9, 12, 26, 0.94);
  --edge: rgba(56, 240, 255, 0.28);
  --edge-dim: rgba(116, 130, 170, 0.22);
  --text: #dfe8ff;
  --text-dim: #7a86ab;
  --font-display: 'Audiowide', 'Chakra Petch', sans-serif;
  --font-ui: 'Chakra Petch', 'Segoe UI', system-ui, sans-serif;
  --cham-sm: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  --cham-md: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  --cham-lg: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

/* CRT scanlines + vignette over everything, never intercepting input */
body::before {
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(0deg,
    rgba(255, 255, 255, 0.022) 0px, rgba(255, 255, 255, 0.022) 1px,
    transparent 1px, transparent 3px);
  pointer-events: none;
  z-index: 90;
}
body::after {
  content: '';
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at center,
    transparent 58%, rgba(2, 3, 9, 0.42) 100%);
  pointer-events: none;
  z-index: 91;
}

#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }

.hidden { display: none !important; }

/* ═══════ shared bits ═══════ */
.icon {
  width: 18px; height: 18px;
  stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -3px;
  flex-shrink: 0;
}
.icon-lg { width: 26px; height: 26px; }

.kicker {
  font-size: 10px; font-weight: 600;
  letter-spacing: 4px;
  color: var(--text-dim);
  margin-bottom: 8px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.pill {
  font-size: 10px; font-weight: 700;
  background: rgba(56, 240, 255, 0.14);
  color: var(--cyan);
  padding: 2px 8px;
  clip-path: var(--cham-sm);
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(21px, 4.6vw, 28px);
  font-weight: 400;
  letter-spacing: 3px;
  margin-bottom: 16px;
}
.glow-cyan  { color: var(--cyan);  text-shadow: 0 0 22px rgba(56,240,255,0.55); }
.glow-pink  { color: var(--pink);  text-shadow: 0 0 22px rgba(255,62,200,0.55); }
.glow-gold  { color: var(--gold);  text-shadow: 0 0 22px rgba(255,212,71,0.55); }
.glow-green { color: var(--green); text-shadow: 0 0 22px rgba(93,255,160,0.55); }

/* ═══════ HUD ═══════ */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }

.hud-top {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: 14px; right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.hud-left { display: flex; flex-direction: column; gap: 6px; }
.hpbar {
  width: min(230px, 36vw);
  height: 17px;
  background: rgba(255, 77, 106, 0.1);
  border: 1px solid rgba(255, 77, 106, 0.45);
  clip-path: var(--cham-sm);
  position: relative;
  overflow: hidden;
}
#hpfill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #c2273f, #ff4d6a 60%, #ff7d92);
  transition: width 0.15s ease-out;
  box-shadow: 0 0 12px rgba(255, 77, 106, 0.7);
}
#hptext {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 700; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}
#levelbadge {
  font-family: var(--font-display);
  font-size: 11px; letter-spacing: 2px;
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(56,240,255,0.8);
}
.hud-center { text-align: center; }
#timer {
  font-family: var(--font-display);
  font-size: clamp(20px, 3.6vw, 27px);
  letter-spacing: 3px;
  color: #fff;
  text-shadow: 0 0 16px rgba(56,240,255,0.5);
  font-variant-numeric: tabular-nums;
}
#dailytag {
  font-size: 9px; font-weight: 700; letter-spacing: 4px;
  color: var(--gold); text-shadow: 0 0 10px rgba(255,212,71,0.8);
}
.hud-right { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
#pausebtn {
  pointer-events: auto;
  width: 42px; height: 42px;
  clip-path: var(--cham-sm);
  border: 1px solid rgba(122, 134, 171, 0.35);
  background: rgba(9, 12, 26, 0.72);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: filter 0.15s;
}
#pausebtn:hover { filter: brightness(1.6); }
#pausebtn:active { transform: scale(0.94); }
#pausebtn span {
  width: 4px; height: 15px;
  background: var(--text-dim);
  display: block;
}
.hud-stat {
  display: flex; align-items: center; gap: 6px;
  font-size: 15px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot.gold { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.dot.red { background: var(--red); box-shadow: 0 0 8px var(--red); }

.hud-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 0 0 max(0px, env(safe-area-inset-bottom));
}
.xpbar { height: 7px; background: rgba(93, 255, 160, 0.07); }
#xpfill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #1fae66, var(--green));
  box-shadow: 0 0 14px rgba(93,255,160,0.8);
  transition: width 0.12s ease-out;
}

#bossbar {
  position: absolute;
  top: max(58px, calc(env(safe-area-inset-top) + 48px));
  left: 50%; transform: translateX(-50%);
  width: min(440px, 70vw);
  height: 15px;
  background: rgba(255, 62, 200, 0.08);
  border: 1px solid rgba(255, 62, 200, 0.55);
  clip-path: var(--cham-sm);
  overflow: hidden;
}
#bossfill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #8912b4, var(--pink));
  box-shadow: 0 0 14px rgba(255,62,200,0.8);
  transition: width 0.1s linear;
}
#bossname {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 8.5px; letter-spacing: 3px; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

#hint {
  position: absolute;
  bottom: 18%;
  left: 50%; transform: translateX(-50%);
  font-size: 14px; font-weight: 600;
  letter-spacing: 1px;
  color: var(--text);
  text-shadow: 0 0 12px rgba(56,240,255,0.5), 0 2px 6px rgba(0,0,0,0.9);
  text-align: center;
  animation: hintpulse 2s ease-in-out infinite;
  white-space: nowrap;
}
@media (max-width: 700px) {
  #hint { white-space: normal; max-width: 82vw; font-size: 12.5px; }
}
@keyframes hintpulse { 0%,100% { opacity: 0.95; } 50% { opacity: 0.5; } }

/* ═══════ overlays & panels ═══════ */
.overlay {
  position: fixed; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(2, 3, 10, 0.74);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  z-index: 20;
  animation: fadein 0.22s ease-out;
  padding: 16px;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.menu-root { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }

/* NOTE: the panel scrolls, so its edge must be border/background (which stay
   fixed to the box) — never an absolutely-positioned overlay, which would
   scroll away with the content and expose whatever sits beneath it. */
.panel {
  position: relative;
  clip-path: var(--cham-lg);
  background:
    linear-gradient(180deg, rgba(56, 240, 255, 0.06), rgba(56, 240, 255, 0) 130px),
    var(--panel);
  border: 1px solid rgba(56, 240, 255, 0.16);
  padding: 30px clamp(22px, 5vw, 46px) 26px;
  max-width: 480px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  text-align: center;
  animation: panelin 0.26s cubic-bezier(0.2, 1.3, 0.4, 1);
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 240, 255, 0.25) transparent;
  filter: drop-shadow(0 0 34px rgba(56, 240, 255, 0.09)) drop-shadow(0 18px 40px rgba(0,0,0,0.55));
}
.panel::-webkit-scrollbar { width: 6px; }
.panel::-webkit-scrollbar-thumb { background: rgba(56, 240, 255, 0.25); }
.panel-wide { max-width: 640px; }
@keyframes panelin {
  from { transform: scale(0.9) translateY(14px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

/* ═══════ buttons ═══════ */
.btn {
  --fill: rgba(16, 21, 40, 0.9);
  --line: var(--edge-dim);
  position: relative;
  isolation: isolate;
  clip-path: var(--cham-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 8px auto 0;
  padding: 13px 22px;
  border: none;
  background: linear-gradient(155deg, var(--line), transparent 45%, transparent 60%, var(--line));
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 3px;
  cursor: pointer;
  color: var(--text);
  transition: transform 0.1s, filter 0.18s;
}
.btn::before {
  content: '';
  position: absolute; inset: 1px;
  clip-path: var(--cham-md);
  background: var(--fill);
  z-index: -1;
  transition: background 0.15s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.25); }
.btn:active { transform: scale(0.975); filter: brightness(0.95); }

.btn-primary {
  --fill: linear-gradient(180deg, #10717f, #0b4a58);
  --line: rgba(56, 240, 255, 0.85);
  color: #eafcff;
  text-shadow: 0 0 8px rgba(56, 240, 255, 0.5);
  filter: drop-shadow(0 0 14px rgba(56, 240, 255, 0.28));
}
.btn-primary:hover { filter: drop-shadow(0 0 22px rgba(56, 240, 255, 0.5)) brightness(1.12); transform: translateY(-1px); }
.btn-big { font-family: var(--font-display); font-size: 17px; font-weight: 400; padding: 17px 26px; letter-spacing: 5px; }
.btn-ghost { color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); --line: rgba(56, 240, 255, 0.5); }
.btn-danger { --line: rgba(255, 77, 106, 0.45); color: var(--red); }
.btn-gold {
  --fill: linear-gradient(180deg, #6d5511, #46370b);
  --line: rgba(255, 212, 71, 0.6);
  color: #ffedb0;
  text-shadow: 0 0 8px rgba(255, 212, 71, 0.4);
}
.btn-daily {
  --fill: linear-gradient(180deg, #4a3808, #2c2205);
  --line: rgba(255, 212, 71, 0.5);
  color: #ffedb0;
  flex-direction: column;
  gap: 3px;
  padding: 12px 22px;
}
.daily-label { font-size: 14px; letter-spacing: 3px; font-weight: 700; }
.daily-sub { font-size: 10.5px; font-weight: 500; letter-spacing: 0.6px; color: rgba(255,237,176,0.72); text-transform: none; }
.backbtn { margin-top: 18px; }

/* ═══════ main menu ═══════ */
.title-wrap { text-align: center; margin-bottom: 36px; pointer-events: none; }
.overtitle {
  font-size: clamp(9px, 1.6vw, 11px);
  font-weight: 600;
  letter-spacing: 7px;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.game-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 9.5vw, 76px);
  font-weight: 400;
  letter-spacing: clamp(2px, 1vw, 8px);
  color: #fff;
  line-height: 1;
  text-shadow: 0 0 26px rgba(56,240,255,0.85), 0 0 90px rgba(56,240,255,0.35);
  animation: titlefloat 4.5s ease-in-out infinite;
}
.game-title span {
  color: var(--pink);
  text-shadow: 0 0 26px rgba(255,62,200,0.85), 0 0 90px rgba(255,62,200,0.35);
}
@keyframes titlefloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.tagline {
  color: var(--text-dim);
  letter-spacing: 6px;
  font-size: clamp(9px, 1.8vw, 12px);
  text-transform: uppercase;
  margin-top: 12px;
}
.menu-buttons { width: min(350px, 88vw); }
.menu-row { display: flex; gap: 8px; }
.menu-row .btn { flex: 1; font-size: 12px; padding: 12px 6px; letter-spacing: 2px; }
#rankcard {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(350px, 88vw);
}
#ranklabel {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--violet);
  text-shadow: 0 0 10px rgba(200, 140, 255, 0.55);
  white-space: nowrap;
}
.rankbar {
  flex: 1;
  height: 6px;
  background: rgba(200, 140, 255, 0.1);
  clip-path: var(--cham-sm);
  overflow: hidden;
}
#rankfill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7c4dbb, var(--violet));
  box-shadow: 0 0 10px rgba(200, 140, 255, 0.7);
  transition: width 0.4s ease-out;
}
#rankxp {
  font-size: 10.5px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.menu-footer {
  margin-top: 14px;
  display: flex; align-items: center; gap: 18px;
  font-size: 15px; font-weight: 600;
}
.coin-inline { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); font-variant-numeric: tabular-nums; }
.coin-inline.big { font-size: 19px; font-weight: 700; margin-bottom: 16px; justify-content: center; display: flex; }
.streak-badge {
  display: inline-flex; align-items: center; gap: 5px;
  color: #ff9d5c;
  font-size: 13px; font-weight: 700;
  text-shadow: 0 0 12px rgba(255,157,92,0.6);
}
.online-badge {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--green);
  font-size: 12px; font-weight: 600;
  letter-spacing: 1px;
}
.online-badge::before {
  content: '';
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: hintpulse 2s ease-in-out infinite;
}
.feedline {
  margin-top: 12px;
  font-size: 11.5px;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  animation: fadein 0.4s ease-out;
}
.feedline b { color: var(--cyan); font-weight: 600; }
.version-tag {
  position: fixed;
  right: 14px; bottom: max(12px, env(safe-area-inset-bottom));
  font-size: 13px; letter-spacing: 2px; font-weight: 600;
  color: rgba(122, 134, 171, 0.55);
  background: rgba(56, 240, 255, 0.06);
  border: 1px solid rgba(56, 240, 255, 0.12);
  clip-path: var(--cham-sm);
  font-family: var(--font-ui);
  cursor: pointer;
  padding: 8px 14px;
  display: inline-flex; align-items: center; gap: 7px;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.version-tag:hover { color: var(--cyan); background: rgba(56, 240, 255, 0.12); border-color: rgba(56, 240, 255, 0.3); }
.ver-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
  animation: hintpulse 1.4s ease-in-out infinite;
}

/* ═══════ update log ═══════ */
.update-list { display: flex; flex-direction: column; gap: 16px; text-align: left; }
.update-entry {
  clip-path: var(--cham-md);
  background: rgba(255, 255, 255, 0.032);
  padding: 14px 17px;
}
.update-entry.latest { background: rgba(56, 240, 255, 0.06); }
.update-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.update-head .uv {
  font-family: var(--font-display);
  font-size: 14px; letter-spacing: 1px;
  color: var(--cyan);
}
.update-head .utitle { font-weight: 700; font-size: 13px; letter-spacing: 2px; color: var(--gold); }
.update-head .udate { font-size: 10.5px; color: var(--text-dim); margin-left: auto; }
.update-entry ul { list-style: none; }
.update-entry li {
  font-size: 12.5px; line-height: 1.65; color: var(--text);
  padding: 4px 0 4px 16px;
  position: relative;
}
.update-entry li::before {
  content: '◆';
  position: absolute; left: 0; top: 5px;
  font-size: 8px;
  color: var(--pink);
}

/* ═══════ level-up choices ═══════ */
.levelup-panel { max-width: 560px; }
#choices { display: flex; flex-direction: column; gap: 10px; margin: 4px 0; }
.choice {
  position: relative;
  isolation: isolate;
  clip-path: var(--cham-md);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: none;
  background: linear-gradient(155deg, rgba(56,240,255,0.35), transparent 40%, transparent 65%, rgba(56,240,255,0.18));
  cursor: pointer;
  text-align: left;
  transition: transform 0.12s, filter 0.15s;
  font-family: var(--font-ui);
  color: var(--text);
  width: 100%;
}
.choice::before {
  content: '';
  position: absolute; inset: 1px;
  clip-path: var(--cham-md);
  background: rgba(12, 17, 34, 0.96);
  z-index: -1;
}
.choice:hover, .choice:focus-visible {
  transform: scale(1.02);
  filter: drop-shadow(0 0 16px rgba(56,240,255,0.3)) brightness(1.15);
  outline: none;
}
.choice.new-weapon { background: linear-gradient(155deg, rgba(255,212,71,0.5), transparent 40%, transparent 65%, rgba(255,212,71,0.22)); }
.choice.new-weapon:hover { filter: drop-shadow(0 0 16px rgba(255,212,71,0.3)) brightness(1.15); }
.choice-icon {
  width: 46px; height: 46px;
  clip-path: var(--cham-sm);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 23px;
  background: rgba(0, 0, 0, 0.4);
}
.choice-icon .icon { width: 24px; height: 24px; }
.choice-body { flex: 1; min-width: 0; }
.choice-name { font-weight: 700; font-size: 15px; letter-spacing: 1px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.choice-tag {
  font-size: 8.5px; font-weight: 700; letter-spacing: 1.5px;
  padding: 2.5px 8px;
  clip-path: var(--cham-sm);
}
.tag-new { background: rgba(255,212,71,0.16); color: var(--gold); }
.tag-lv { background: rgba(56,240,255,0.13); color: var(--cyan); }
.tag-max { background: rgba(255,62,200,0.16); color: var(--pink); }
.choice-desc { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; line-height: 1.45; font-weight: 400; }

/* keyboard hints on choices */
#choices .choice::after {
  counter-increment: choice;
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: rgba(122, 134, 171, 0.5);
  font-weight: 600;
}
#choices { counter-reset: choice; }
#choices .choice:nth-child(1)::after { content: '1'; }
#choices .choice:nth-child(2)::after { content: '2'; }
#choices .choice:nth-child(3)::after { content: '3'; }
@media (hover: none) { #choices .choice::after { content: '' !important; } }

/* ═══════ build chips (pause) ═══════ */
.build-row {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin: 4px 0 16px;
}
.build-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600;
  padding: 7px 12px;
  clip-path: var(--cham-sm);
  background: rgba(56,240,255,0.09);
}
.build-chip .icon { width: 14px; height: 14px; }
.build-chip.passive { background: rgba(93,255,160,0.08); }
.build-chip small { color: var(--text-dim); font-weight: 500; }

/* ═══════ summary / game over ═══════ */
.summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 22px;
  margin: 14px 0;
  text-align: left;
}
.summary .srow {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13.5px; padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.summary .srow b { font-variant-numeric: tabular-nums; font-size: 14.5px; }
.summary .srow span { color: var(--text-dim); font-size: 12px; letter-spacing: 1px; }
#newrecords { margin: 2px 0 8px; }
.record-flash {
  color: var(--gold);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 2px;
  animation: hintpulse 1.2s ease-in-out infinite;
  margin: 2px 0;
}
#dailyresult { margin: 8px 0; font-size: 14px; font-weight: 700; color: var(--gold); letter-spacing: 0.5px; }
.submit-note {
  font-size: 11.5px;
  color: var(--text-dim);
  letter-spacing: 1px;
  margin: 4px 0 2px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.submit-note .icon { width: 14px; height: 14px; }

/* ═══════ share row (game over) ═══════ */
.share-row {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 10px 0 4px;
}
.share-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--edge-dim);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-dim);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
}
.share-btn:hover {
  transform: scale(1.12);
  border-color: var(--cyan);
  color: var(--text);
}
.share-icon {
  width: 20px; height: 20px;
  fill: currentColor;
  stroke: none;
}
.share-copy .share-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.share-whatsapp:hover { border-color: #25d366; color: #25d366; box-shadow: 0 0 14px rgba(37, 211, 102, 0.35); }
.share-telegram:hover { border-color: #26a5e4; color: #26a5e4; box-shadow: 0 0 14px rgba(38, 165, 228, 0.35); }
.share-x:hover { border-color: #e7e9ea; color: #e7e9ea; box-shadow: 0 0 14px rgba(231, 233, 234, 0.25); }
.share-copy:hover { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 14px rgba(56, 240, 255, 0.35); }

/* ═══════ shop / hangar / achievements lists ═══════ */
.grid-list { display: flex; flex-direction: column; gap: 9px; margin-top: 4px; }
.shop-item, .ship-item, .ach-item {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 14px;
  clip-path: var(--cham-md);
  background: rgba(255,255,255,0.032);
  text-align: left;
}
.item-icon {
  width: 42px; height: 42px;
  clip-path: var(--cham-sm);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px;
  background: rgba(0,0,0,0.38);
  color: var(--cyan);
}
.item-icon .icon { width: 22px; height: 22px; }
.item-body { flex: 1; min-width: 0; }
.item-name { font-weight: 700; font-size: 14px; letter-spacing: 1px; }
.item-desc { font-size: 12px; color: var(--text-dim); margin-top: 2px; line-height: 1.4; }
.pips { display: flex; gap: 4px; margin-top: 6px; }
.pip { width: 15px; height: 4px; background: rgba(255,255,255,0.1); }
.pip.on { background: var(--gold); box-shadow: 0 0 6px rgba(255,212,71,0.7); }
.buybtn {
  flex-shrink: 0;
  padding: 9px 14px;
  clip-path: var(--cham-sm);
  border: none;
  background: rgba(255,212,71,0.13);
  color: var(--gold);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: transform 0.1s, filter 0.15s;
  white-space: nowrap;
}
.buybtn:hover:not(:disabled) { filter: brightness(1.35); transform: scale(1.05); }
.buybtn:active:not(:disabled) { transform: scale(0.95); }
.buybtn:disabled { opacity: 0.35; cursor: default; color: var(--text-dim); background: rgba(255,255,255,0.06); }
.buybtn.equipped { color: var(--green); background: rgba(93,255,160,0.12); }

.ach-item.locked { opacity: 0.42; }
.ach-item .ach-mark { flex-shrink: 0; display: flex; }
.ach-item .ach-mark .icon { width: 20px; height: 20px; }
.ach-item.unlocked .ach-mark { color: var(--gold); filter: drop-shadow(0 0 6px rgba(255,212,71,0.6)); }
.ach-item.locked .ach-mark { color: var(--text-dim); }

/* ═══════ tabs / stats ═══════ */
.tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; }
.tab {
  padding: 8px 18px;
  clip-path: var(--cham-sm);
  border: none;
  background: rgba(255,255,255,0.045);
  color: var(--text-dim);
  font-family: var(--font-ui); font-weight: 700; font-size: 11px; letter-spacing: 2px;
  cursor: pointer;
  transition: filter 0.15s;
}
.tab:hover { filter: brightness(1.4); }
.tab.active { color: var(--cyan); background: rgba(56,240,255,0.12); }
#statspane { text-align: left; }
.stat-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 9px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.055);
  font-size: 13.5px;
}
.stat-row span { color: var(--text-dim); font-size: 12.5px; letter-spacing: 0.5px; }
.stat-row b { font-variant-numeric: tabular-nums; }

/* ═══════ rankings ═══════ */
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: hintpulse 1.6s ease-in-out infinite;
  display: inline-block;
}
.board-list { display: flex; flex-direction: column; gap: 4px; min-height: 120px; }
.board-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 13px;
  clip-path: var(--cham-sm);
  background: rgba(255,255,255,0.03);
  font-size: 13.5px;
  text-align: left;
  animation: fadein 0.25s ease-out;
}
.board-row .rank {
  font-family: var(--font-display);
  font-size: 13px;
  width: 34px;
  color: var(--text-dim);
  flex-shrink: 0;
}
.board-row:nth-child(1) .rank { color: var(--gold); text-shadow: 0 0 8px rgba(255,212,71,0.6); }
.board-row:nth-child(2) .rank { color: #cdd7ee; }
.board-row:nth-child(3) .rank { color: #d9975c; }
.board-row .bname { flex: 1; font-weight: 600; letter-spacing: 0.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-row .bsub { font-size: 11px; color: var(--text-dim); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.board-row .bscore { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--cyan); flex-shrink: 0; }
.board-row.me { background: rgba(56,240,255,0.1); }
.board-row.me .bname { color: var(--cyan); }
.board-note { font-size: 11.5px; color: var(--text-dim); margin-top: 12px; line-height: 1.6; letter-spacing: 0.4px; }
.board-empty { padding: 30px 10px; color: var(--text-dim); font-size: 13px; letter-spacing: 1px; }

/* ═══════ account / auth ═══════ */
.field {
  display: block;
  width: 100%;
  margin: 9px 0 0;
  padding: 12px 15px;
  clip-path: var(--cham-sm);
  background: rgba(0, 8, 18, 0.65);
  border: 1px solid rgba(56, 240, 255, 0.18);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
}
.field::placeholder { color: rgba(122, 134, 171, 0.65); font-size: 12px; letter-spacing: 2px; }
.field:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 14px rgba(56,240,255,0.18) inset; }
.auth-error {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--red);
  font-weight: 600;
  letter-spacing: 0.5px;
}
.auth-note, .offline-note {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 14px;
  line-height: 1.7;
  letter-spacing: 0.4px;
}
.offline-note { margin: 4px 0 6px; }
.profile-row {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: 2px;
  color: var(--cyan);
  margin: 10px 0 6px;
}
.profile-sub {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 12px;
  color: var(--green);
  letter-spacing: 1px;
  margin-bottom: 14px;
}

/* ═══════ settings ═══════ */
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 13px 2px;
  font-size: 13px; font-weight: 600; letter-spacing: 2px;
  border-bottom: 1px solid rgba(255,255,255,0.055);
  cursor: pointer;
}
input[type="range"] { width: 150px; accent-color: var(--cyan); cursor: pointer; }
.setting-row.check input { display: none; }
.checkmark {
  width: 46px; height: 24px;
  clip-path: var(--cham-sm);
  background: rgba(255,255,255,0.09);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.checkmark::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  clip-path: var(--cham-sm);
  background: var(--text-dim);
  top: 4px; left: 4px;
  transition: left 0.18s, background 0.18s;
}
.setting-row.check input:checked + .checkmark { background: rgba(56,240,255,0.22); }
.setting-row.check input:checked + .checkmark::after { left: 26px; background: var(--cyan); box-shadow: 0 0 10px rgba(56,240,255,0.8); }

/* ═══════ daily menu ═══════ */
.mods-list { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 16px; }
.mod-chip {
  padding: 11px 15px;
  clip-path: var(--cham-md);
  background: linear-gradient(155deg, rgba(255,212,71,0.1), rgba(255,212,71,0.04));
  border-left: 2px solid rgba(255,212,71,0.55);
  font-size: 13px;
  text-align: left;
}
.mod-chip b { color: var(--gold); letter-spacing: 1px; }
.mod-chip small { color: var(--text-dim); display: block; margin-top: 2px; }
.daily-note { font-size: 11.5px; color: var(--text-dim); line-height: 1.7; margin-bottom: 14px; letter-spacing: 0.4px; }
#dailybest { font-size: 13.5px; font-weight: 700; color: var(--green); margin-bottom: 10px; letter-spacing: 0.5px; }

/* ═══════ daily contracts ═══════ */
.contracts-kicker { margin-top: 6px; }
.contract-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.contract {
  padding: 10px 13px;
  clip-path: var(--cham-md);
  background: rgba(255, 255, 255, 0.032);
  text-align: left;
}
.contract.done { background: rgba(93, 255, 160, 0.06); }
.contract-top {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
}
.contract-name { font-weight: 700; font-size: 12.5px; letter-spacing: 1px; }
.contract.done .contract-name { color: var(--green); }
.contract-reward { font-size: 11.5px; font-weight: 700; color: var(--gold); white-space: nowrap; font-variant-numeric: tabular-nums; }
.contract-desc { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.contract-bar {
  margin-top: 7px;
  height: 5px;
  background: rgba(255, 255, 255, 0.07);
  clip-path: var(--cham-sm);
  overflow: hidden;
}
.contract-fill {
  height: 100%;
  background: linear-gradient(90deg, #1fae66, var(--green));
  box-shadow: 0 0 8px rgba(93, 255, 160, 0.6);
}
.contract.done .contract-fill { width: 100% !important; }
.contract-progress { font-size: 10.5px; color: var(--text-dim); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ═══════ toast ═══════ */
#toast {
  position: fixed;
  top: max(70px, calc(env(safe-area-inset-top) + 60px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  clip-path: var(--cham-md);
  background: linear-gradient(155deg, rgba(255,212,71,0.14), rgba(9,12,26,0.97) 30%);
  border-top: 1px solid rgba(255,212,71,0.5);
  padding: 13px 24px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--gold);
  animation: toastin 0.3s cubic-bezier(0.18, 1.4, 0.4, 1);
  pointer-events: none;
  text-align: center;
  max-width: 90vw;
}
@keyframes toastin {
  from { transform: translateX(-50%) translateY(-18px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ═══════ homepage badges: streak + high score ═══════ */
.home-badges {
  margin-top: 16px;
  display: flex; align-items: center; justify-content: center; gap: 22px;
  flex-wrap: wrap;
}
.home-best {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-size: clamp(12px, 2.4vw, 15px);
  letter-spacing: 3px;
  color: var(--gold);
  text-shadow: 0 0 16px rgba(255, 212, 71, 0.55);
  animation: fadein 0.5s ease-out;
}
.home-best .icon { width: 16px; height: 16px; }
.home-best b { font-variant-numeric: tabular-nums; }
.home-badges .streak-badge {
  font-family: var(--font-display);
  font-size: clamp(12px, 2.4vw, 15px);
  font-weight: 400;
  letter-spacing: 3px;
  text-shadow: 0 0 16px rgba(255, 157, 92, 0.55);
}

/* ═══════ auth extras ═══════ */
.linklike {
  display: block;
  margin: 10px auto 0;
  background: none; border: none;
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: 11.5px;
  letter-spacing: 1px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.linklike:hover { color: var(--cyan); }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 14px 0 2px;
  color: var(--text-dim);
  font-size: 10px; letter-spacing: 3px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px;
  background: rgba(122, 134, 171, 0.25);
}
.auth-ok {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--green);
  font-weight: 600;
  letter-spacing: 0.5px;
}
.google-btn .icon { stroke: none; }
.mini-btn {
  border: none;
  clip-path: var(--cham-sm);
  background: rgba(56, 240, 255, 0.1);
  color: var(--cyan);
  font-family: var(--font-ui);
  font-size: 9px; font-weight: 700; letter-spacing: 1.5px;
  padding: 5px 9px;
  cursor: pointer;
}
.mini-btn:hover { filter: brightness(1.4); }
.delete-link { font-size: 11px; color: rgba(255, 77, 106, 0.65); }
.delete-link:hover { color: var(--red); }
.danger-note { color: rgba(255, 77, 106, 0.8); }

/* ═══════ referral ═══════ */
.referral-box {
  margin: 18px 0 10px;
  padding: 16px 14px;
  clip-path: var(--cham-md);
  background: rgba(255, 212, 71, 0.04);
  border: 1px solid rgba(255, 212, 71, 0.15);
  text-align: center;
}
.referral-box .kicker { margin-bottom: 6px; color: var(--gold); }
.referral-desc {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  line-height: 1.6;
}
.referral-desc b { font-weight: 700; }
.referral-link-row {
  display: flex; gap: 8px; align-items: stretch;
}
.referral-link-row .field {
  flex: 1; margin: 0;
  font-size: 11px; letter-spacing: 0.5px;
  color: var(--cyan);
  background: rgba(56, 240, 255, 0.06);
}
.referral-link-row .buybtn { padding: 9px 16px; }
.referral-stats {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}

/* ═══════ friends ═══════ */
.friend-bar { display: flex; gap: 8px; align-items: stretch; margin-bottom: 12px; }
.friend-bar .field { flex: 1; margin: 0; }
.friend-bar .buybtn { padding: 9px 18px; }
.fr-remove {
  flex-shrink: 0;
  border: none;
  background: none;
  color: rgba(122, 134, 171, 0.55);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
}
.fr-remove:hover { color: var(--red); }

/* ═══════ daily streak counter ═══════ */
.daily-streak {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  margin: 2px 0 14px;
}
.daily-streak .streak-num {
  font-family: var(--font-display);
  font-size: 42px;
  line-height: 1;
  color: #ff9d5c;
  text-shadow: 0 0 26px rgba(255, 157, 92, 0.7);
  display: flex; align-items: center; gap: 10px;
}
.daily-streak .streak-num .icon { width: 34px; height: 34px; }
.daily-streak .streak-label {
  font-size: 10px; font-weight: 700; letter-spacing: 3px;
  color: var(--text-dim);
}
.daily-streak .streak-state { font-size: 11.5px; margin-top: 4px; letter-spacing: 0.5px; }
.daily-streak .streak-state.alive { color: var(--green); font-weight: 700; }
.daily-streak .streak-state.at-risk { color: var(--text-dim); }

/* ═══════ field manual ═══════ */
.manual-title { display: flex; align-items: center; justify-content: center; gap: 12px; }
.manual-title .icon { width: 24px; height: 24px; }
.manual-body {
  text-align: left;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text);
  min-height: 170px;
}
.manual-body p { margin-bottom: 12px; }
.manual-body b { color: var(--cyan); font-weight: 700; }
.manual-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 6px;
}
.manual-dots { display: flex; gap: 6px; }
.manual-dots span {
  width: 8px; height: 8px;
  clip-path: var(--cham-sm);
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
}
.manual-dots span.on { background: var(--cyan); box-shadow: 0 0 8px rgba(56, 240, 255, 0.8); }
.manual-nav .buybtn:disabled { opacity: 0.3; }

/* ═══════ run history ═══════ */
#runspane { display: flex; flex-direction: column; gap: 7px; }
.run-row {
  clip-path: var(--cham-md);
  background: rgba(255, 255, 255, 0.032);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
.run-row:hover { background: rgba(56, 240, 255, 0.06); }
.run-row.won { border-left: 2px solid rgba(93, 255, 160, 0.6); }
.run-head {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  font-size: 13px;
}
.run-head .run-when { color: var(--text-dim); font-size: 11px; flex-shrink: 0; width: 82px; }
.run-head .run-mode { font-size: 9px; font-weight: 700; letter-spacing: 1.5px; color: var(--gold); flex-shrink: 0; }
.run-head .run-mode.won { color: var(--green); }
.run-head .run-main { flex: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.run-head .run-sub { color: var(--text-dim); font-size: 11.5px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.run-detail {
  padding: 2px 14px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
}
.run-detail .summary { margin: 8px 0 6px; }
.run-detail .build-row { margin: 8px 0 2px; justify-content: flex-start; }
.run-empty { padding: 30px 10px; color: var(--text-dim); font-size: 13px; letter-spacing: 1px; text-align: center; }

@media (max-width: 560px) {
  .summary { grid-template-columns: 1fr; }
  .panel { padding: 24px 18px 20px; }
  .menu-row .btn { letter-spacing: 1px; }
  .board-row .bsub { display: none; }
  .run-head .run-when { width: 64px; }
}
