:root {
  --bg: #0a0a14;
  --bg2: #12122a;
  --neon: #a855f7;      /* purple */
  --neon2: #22d3ee;     /* cyan */
  --accent: #f0abfc;
  --text: #e8e8f0;
  --gold: #fbbf24;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  max-width: 900px;
  overflow: hidden;
}

canvas#game {
  display: block;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(1200px 500px at 50% -10%, #1c1440 0%, transparent 60%),
    linear-gradient(180deg, var(--bg2) 0%, var(--bg) 100%);
  touch-action: none;
}

.hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  z-index: 5;
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  letter-spacing: 2px;
  font-size: 18px;
  color: #fff;
  text-shadow: 0 0 12px var(--neon);
}
.brand span { color: var(--gold); text-shadow: 0 0 12px var(--gold); }
.brandLogo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(245, 179, 1, 0.5);
}

.bigLogo {
  width: clamp(120px, 30vw, 160px);
  height: auto;
  border-radius: 50%;
  box-shadow: 0 0 40px rgba(245, 179, 1, 0.35);
  margin-bottom: 4px;
}
.smallLogo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  box-shadow: 0 0 22px rgba(245, 179, 1, 0.4);
}
.tagline {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--gold);
  font-weight: 600;
  text-transform: uppercase;
}

.hud-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.muteBtn {
  pointer-events: auto;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(168, 85, 247, 0.5);
  background: rgba(10, 10, 20, 0.6);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
  transition: transform 0.1s ease;
}
.muteBtn:active { transform: scale(0.9); }

.score {
  font-weight: 700;
  font-size: 16px;
  color: var(--accent);
  text-shadow: 0 0 10px var(--neon);
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: rgba(6, 6, 16, 0.82);
  backdrop-filter: blur(6px);
  gap: 14px;
}
.overlay.hidden { display: none; }

h1 {
  font-size: clamp(32px, 8vw, 56px);
  font-weight: 900;
  letter-spacing: 1px;
  text-shadow: 0 0 24px var(--neon);
}
h1 span { color: var(--neon2); text-shadow: 0 0 24px var(--neon2); }

h2 { font-size: clamp(26px, 7vw, 44px); text-shadow: 0 0 18px var(--neon2); }

.sub { max-width: 460px; color: #c8c8e0; font-size: 15px; line-height: 1.5; }

.prizes { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 6px 0; }
.prizes li {
  display: flex; justify-content: space-between; gap: 18px;
  min-width: 260px;
  padding: 9px 16px;
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 10px;
  background: rgba(168, 85, 247, 0.08);
  font-size: 14px;
}
.prizes li .req { color: var(--neon2); font-weight: 700; }
.prizes li .rew { color: var(--gold); font-weight: 700; }

.btn {
  margin-top: 8px;
  padding: 14px 40px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #0a0a14;
  background: linear-gradient(90deg, var(--neon2), var(--neon));
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(168, 85, 247, 0.6);
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}
.btn:active { transform: scale(0.96); }

.perk {
  font-size: 13px;
  font-weight: 600;
  color: var(--neon2);
  padding: 6px 14px;
  border: 1px dashed rgba(34, 211, 238, 0.4);
  border-radius: 20px;
}

.hint { font-size: 13px; color: #9090b0; }

.finalScore { font-size: 18px; color: var(--accent); }

.winBox {
  border: 2px solid var(--gold);
  border-radius: 16px;
  padding: 20px 26px;
  background: rgba(251, 191, 36, 0.06);
  box-shadow: 0 0 30px rgba(251, 191, 36, 0.35);
  animation: pop 0.4s ease;
}
.winBox.hidden, .loseBox.hidden { display: none; }

@keyframes pop { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.tier { font-weight: 900; letter-spacing: 3px; color: var(--gold); font-size: 14px; }
.prize { font-size: 40px; font-weight: 900; color: #fff; margin: 4px 0 10px; text-shadow: 0 0 18px var(--gold); }
.codeLabel { font-size: 12px; color: #b0b0c8; text-transform: uppercase; letter-spacing: 2px; }
.code {
  font-family: 'Courier New', monospace;
  font-size: 32px;
  font-weight: 800;
  color: var(--neon2);
  letter-spacing: 3px;
  margin: 4px 0 10px;
  text-shadow: 0 0 16px var(--neon2);
}
.claim { font-size: 14px; color: #d8d8ea; margin-bottom: 8px; }
.warn { font-size: 13px; color: var(--gold); font-weight: 600; }

.loseBox { color: #c8c8e0; font-size: 16px; }
.loseBox b { color: var(--neon2); }
