:root {
  color-scheme: dark;
  --bg: #03040a;
  --panel: rgba(10, 14, 30, 0.82);
  --line: rgba(120, 180, 255, 0.22);
  --text: #e6ecff;
  --muted: #8f9cc0;
  --cyan: #46e3ff;
  --gold: #ffd34d;
  --pink: #ff50c8;
  --font: "Exo 2", "Rajdhani", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); overflow: hidden; }
canvas { display: block; width: 100vw; height: 100vh; }

.screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px;
  background: radial-gradient(ellipse at center, rgba(3, 4, 12, 0.25), rgba(3, 4, 12, 0.7));
}
.screen[hidden] { display: none; }
.panel {
  width: min(560px, 100%);
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 0 60px rgba(40, 120, 255, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(6px);
  text-align: center;
  max-height: calc(100vh - 32px); overflow: auto;
}
.panel.small { width: min(400px, 100%); }
.title-panel { background: transparent; border: 0; box-shadow: none; backdrop-filter: none; width: min(1100px, 100%); overflow: visible; }

.logo {
  margin: 0;
  font-size: clamp(40px, 10vw, 116px); white-space: nowrap; padding: 0 0.1em 0 0.22em;
  font-weight: 900; letter-spacing: 0.12em; line-height: 1;
  background: linear-gradient(180deg, #ffffff 0%, #bfe9ff 45%, #3aa7ff 55%, #7a5cff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(70, 180, 255, 0.55)) drop-shadow(0 0 2px rgba(255, 255, 255, 0.6));
  animation: hum 4s ease-in-out infinite;
}
@keyframes hum { 50% { filter: drop-shadow(0 0 28px rgba(120, 90, 255, 0.7)) drop-shadow(0 0 2px rgba(255, 255, 255, 0.6)); } }
.tag { color: #a9c8ff; letter-spacing: 0.18em; text-transform: uppercase; font-size: 14px; margin: 14px 0 34px; }
h2 { margin: 0 0 18px; font-size: 32px; letter-spacing: 0.06em; text-transform: uppercase; }

button {
  font: inherit; font-weight: 700; font-size: 17px; letter-spacing: 0.06em;
  color: var(--text); background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 22px; margin: 6px; min-width: 200px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}
button:hover, button:focus-visible { background: rgba(70, 227, 255, 0.14); border-color: var(--cyan); outline: none; box-shadow: 0 0 18px rgba(70, 227, 255, 0.35); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.4; cursor: default; box-shadow: none; }
button.primary {
  background: linear-gradient(180deg, #3fc8ff, #1f6dff); border-color: #8fe0ff; color: #fff;
  text-transform: uppercase; font-size: 19px; padding: 14px 30px;
  box-shadow: 0 0 24px rgba(50, 150, 255, 0.45);
}
button.primary:hover, button.primary:focus-visible { background: linear-gradient(180deg, #6fd8ff, #3a83ff); box-shadow: 0 0 34px rgba(80, 190, 255, 0.75); }

.controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; margin: 34px 0 14px; color: var(--muted); font-size: 15px; }
kbd {
  display: inline-block; min-width: 28px; padding: 3px 7px; margin: 0 2px;
  border: 1px solid rgba(255, 255, 255, 0.25); border-bottom-width: 3px; border-radius: 6px;
  font: 700 13px var(--font); color: #fff; background: rgba(255, 255, 255, 0.06);
}
.hint { color: var(--muted); font-size: 14px; margin: 8px 0; }
.best { color: var(--gold); letter-spacing: 0.08em; margin-top: 18px; }
footer { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font-size: 13px; color: var(--muted); }
footer a { color: var(--muted); text-decoration: none; margin: 0 6px; }
footer a:hover, footer a:focus-visible { color: #fff; outline: none; }

.coin { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 6px; vertical-align: -1px;
  background: radial-gradient(circle at 35% 35%, #fff3b0, #ffc21a 55%, #a86a00); box-shadow: 0 0 8px rgba(255, 200, 40, 0.6); }
.coin.big { width: 24px; height: 24px; vertical-align: -4px; margin-right: 10px; }

/* Shop */
.shop-panel { width: min(900px, 100%); text-align: left; }
.shop-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.shop-head h2 { margin: 0; }
.kicker { margin: 0 0 4px; color: var(--cyan); letter-spacing: 0.3em; text-transform: uppercase; font-size: 13px; }
.wallet { font-size: 30px; color: var(--gold); font-weight: 800; }
.loadout { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.loadout div { flex: 1 1 140px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.loadout span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.15em; }
.loadout strong { font-size: 17px; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 20px; }
.card {
  display: grid; grid-template-columns: 44px 1fr; grid-template-rows: 1fr auto; gap: 4px 12px;
  padding: 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
}
.card svg { width: 44px; height: 44px; grid-row: 1 / 3; align-self: start; background: rgba(0, 0, 0, 0.3); border-radius: 10px; padding: 5px; }
.card h3 { margin: 0 0 2px; font-size: 17px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.35; }
.card .status { display: block; margin-top: 6px; font-size: 12px; color: #ff9a8a; letter-spacing: 0.04em; }
.card.owned { border-color: rgba(120, 255, 160, 0.35); }
.card.owned .status { color: #7dff9a; }
.card .buy { grid-column: 2; justify-self: start; min-width: 0; margin: 8px 0 0; padding: 7px 14px; font-size: 16px; color: var(--gold); }
.card.owned .buy { color: #7dff9a; }
.shop-panel > .primary { display: block; margin: 0 auto; }

/* Game Over */
.over-title { font-size: 44px; color: #ff6a5a; text-shadow: 0 0 22px rgba(255, 80, 60, 0.6); }
.new-best { color: var(--gold); font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; margin: -6px 0 14px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin: 0 0 22px; text-align: left; }
.stats dt { color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; font-size: 14px; align-self: center; }
.stats dd { margin: 0; font-size: 24px; font-weight: 800; text-align: right; }
.panel.small button { display: block; width: 100%; margin: 8px 0; }

@media (max-width: 600px) {
  .panel { padding: 20px; }
  .controls { font-size: 13px; }
}
