:root {
  --bg-1: #0b1426;
  --bg-2: #1a2f4a;
  --bg-3: #224d63;
  --accent: #ffd15b;
  --accent-dark: #d9aa43;
  --ice: #e8f4ff;
  --shadow: rgba(10, 18, 34, 0.6);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: "Nunito", sans-serif;
  background:
    radial-gradient(circle at 15% 15%, rgba(255, 209, 91, 0.16), transparent 45%),
    radial-gradient(circle at 85% 0%, rgba(73, 214, 255, 0.18), transparent 50%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2) 50%, var(--bg-3));
  color: var(--ice);
  overflow: hidden;
}

body {
  touch-action: none;
  user-select: none;
}

#game-wrap {
  position: relative;
  width: 100%;
  height: 100%;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#ui {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 10%, rgba(255, 209, 91, 0.18), transparent 55%),
    linear-gradient(180deg, rgba(8, 12, 26, 0.78), rgba(8, 12, 26, 0.9));
  transition: opacity 240ms ease;
}

#ui.hidden {
  opacity: 0;
  pointer-events: none;
}

.panel {
  width: min(520px, 88vw);
  padding: 26px 24px 22px;
  border-radius: 22px;
  background: rgba(14, 26, 44, 0.92);
  border: 2px solid rgba(255, 209, 91, 0.55);
  box-shadow:
    0 16px 40px var(--shadow),
    inset 0 0 30px rgba(255, 209, 91, 0.08);
  text-align: center;
  animation: panel-in 420ms ease;
}

.panel.hidden {
  display: none;
}

.panel.shop {
  width: min(560px, 90vw);
  max-height: 80vh;
  overflow-y: auto;
}

.title {
  font-family: "Bungee", sans-serif;
  font-size: clamp(32px, 8vw, 54px);
  letter-spacing: 1px;
  color: var(--accent);
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  animation: title-pop 520ms ease;
}

.title.small {
  font-size: clamp(26px, 6.5vw, 40px);
}

.subtitle {
  margin-top: 12px;
  font-size: clamp(14px, 2.8vw, 18px);
  color: #deecff;
}

.scoreline {
  margin-top: 10px;
  font-size: clamp(14px, 2.6vw, 16px);
  color: #ffe49a;
}

button {
  margin-top: 18px;
  padding: 12px 22px;
  border: none;
  border-radius: 14px;
  font-family: "Bungee", sans-serif;
  font-size: clamp(16px, 3.4vw, 20px);
  letter-spacing: 0.5px;
  color: #1a2533;
  background: linear-gradient(135deg, var(--accent), #ffe49a);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

button + button {
  margin-top: 12px;
}

button:active {
  transform: translateY(2px) scale(0.99);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.shop-items {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.shop-item {
  width: 100%;
  margin: 0;
  padding: 12px 16px;
  border-radius: 14px;
  font-family: "Nunito", sans-serif;
  font-size: clamp(14px, 2.6vw, 17px);
  letter-spacing: 0.2px;
  color: #e9f6ff;
  background: rgba(20, 34, 56, 0.9);
  border: 1px solid rgba(255, 209, 91, 0.35);
  box-shadow: inset 0 0 18px rgba(255, 209, 91, 0.08);
  text-align: left;
  white-space: pre-line;
  cursor: pointer;
}

.shop-item:active {
  transform: translateY(1px);
}

@keyframes panel-in {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes title-pop {
  0% {
    transform: translateY(-8px) scale(0.98);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}
