:root {
  --bg: #0b1020;
  --panel: #151b2d;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #22d3ee;
  --cube: #67e8f9;
  --spike: #f43f5e;
  --ground: #1e293b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background:
    radial-gradient(ellipse at 30% 0%, rgba(34, 211, 238, 0.2), transparent 50%),
    linear-gradient(180deg, #0b1020, #111827 55%, #0f172a);
  user-select: none;
  touch-action: manipulation;
}

.header {
  text-align: center;
  padding: 1.25rem 1rem 0.35rem;
}

.header h1 {
  margin: 0.3rem 0;
  letter-spacing: 0.03em;
}

.header p {
  margin: 0;
  color: var(--muted);
  font-family: system-ui, sans-serif;
  font-size: 0.95rem;
}

.back {
  color: var(--muted);
  text-decoration: none;
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
}

.back:hover {
  color: var(--text);
}

.hud {
  display: flex;
  justify-content: center;
  gap: 1.15rem;
  flex-wrap: wrap;
  font-family: system-ui, sans-serif;
  color: var(--muted);
  margin: 0.75rem 1rem 0.5rem;
  font-size: 0.92rem;
}

.hud strong {
  color: #fbbf24;
  font-variant-numeric: tabular-nums;
}

.stage {
  position: relative;
  width: min(720px, 96vw);
  margin: 0.5rem auto 0.75rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 0 2px #334155, 0 18px 40px rgba(0, 0, 0, 0.35);
  background: #0a0f1a;
  cursor: pointer;
}

#game {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
  background: #0a0f1a;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 1.25rem;
  text-align: center;
  background: rgba(8, 12, 24, 0.78);
  backdrop-filter: blur(4px);
}

.overlay.hidden {
  display: none;
}

#overlay-title {
  margin: 0;
  font-size: 1.45rem;
  color: var(--accent);
}

.hint {
  margin: 0;
  max-width: 28rem;
  color: var(--muted);
  font-family: system-ui, sans-serif;
  font-size: 0.92rem;
  line-height: 1.45;
}

.overlay-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
  justify-content: center;
}

button {
  font-family: system-ui, sans-serif;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1.35rem;
  cursor: pointer;
  background: var(--accent);
  color: #0f172a;
}

button.secondary {
  background: #334155;
  color: #e2e8f0;
}

button:hover {
  filter: brightness(1.08);
}

.controls {
  text-align: center;
  color: var(--muted);
  font-family: system-ui, sans-serif;
  font-size: 0.88rem;
  margin: 0 1rem 1.25rem;
}

.shop {
  max-width: 720px;
  margin: 0 auto 2.5rem;
  padding: 0 1rem;
}

.shop h2 {
  margin: 0 0 0.35rem;
  text-align: center;
}

.shop-note {
  text-align: center;
  color: var(--muted);
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.85rem;
}

.cube-card {
  background: var(--panel);
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 0.85rem 0.7rem;
  text-align: center;
  font-family: system-ui, sans-serif;
}

.cube-card.equipped {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.35);
}

.cube-preview {
  width: 52px;
  height: 52px;
  margin: 0 auto 0.55rem;
  border-radius: 6px;
  border: 2px solid #fff;
  box-shadow: 0 0 14px currentColor;
  position: relative;
}

.cube-preview .eye {
  position: absolute;
  right: 8px;
  top: 14px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.cube-card h3 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.cube-card .price,
.cube-card .blurb {
  margin: 0.15rem 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.cube-card .price {
  color: #fbbf24;
}

.cube-btn {
  margin-top: 0.55rem;
  width: 100%;
  padding: 0.45rem 0.5rem;
  font-size: 0.85rem;
}

.cube-btn:disabled {
  opacity: 0.65;
  cursor: default;
}

.cube-btn.owned {
  background: #38bdf8;
}

.cube-btn.equipped-btn {
  background: #475569;
  color: #e2e8f0;
}
