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

:root {
  --bg: #090912;
  --surface: #0f0f1e;
  --cyan: #00e5ff;
  --magenta: #e040fb;
  --green: #69ff47;
  --orange: #ff6d00;
  --yellow: #ffea00;
  --red: #ff5252;
  --text: #e0e0e0;
  --muted: #666;
  --header-h: 68px;
  --footer-h: 60px;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

#app {
  position: relative;
  width: 100%; height: 100%;
  overflow: hidden;
}

/* ── Slides ── */
#slides-track {
  display: flex;
  width: 500%;
  height: 100%;
  transition: transform 0.42s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.slide {
  width: 20%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* ── Game Header ── */
.game-header {
  height: var(--header-h);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  text-align: center;
  flex-shrink: 0;
  background: linear-gradient(to bottom, var(--surface) 0%, transparent 100%);
  border-bottom: 1px solid #ffffff0a;
}

.game-title {
  font-size: clamp(15px, 3.5vw, 20px);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.game-desc {
  font-size: clamp(10px, 2vw, 12px);
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.3;
}

/* ── Canvas ── */
.canvas-wrap {
  flex: 1;
  position: relative;
  min-height: 0;
  min-width: 0;
}

.canvas-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Game Footer ── */
.game-footer {
  height: var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  gap: 10px;
  flex-shrink: 0;
  background: linear-gradient(to top, var(--surface) 0%, transparent 100%);
  border-top: 1px solid #ffffff0a;
}

.score-area {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.label {
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.value {
  font-size: 22px;
  font-weight: 700;
  color: var(--cyan);
  min-width: 24px;
}

.value.small { font-size: 14px; }
.value.cyan   { color: var(--cyan); }
.value.magenta{ color: var(--magenta); }
.value.green  { color: var(--green); }
.value.red    { color: var(--red); }

.sep {
  width: 1px;
  height: 20px;
  background: #333;
  flex-shrink: 0;
  margin: 0 4px;
}

.game-btn {
  background: transparent;
  border: 1px solid #2a2a3a;
  color: var(--muted);
  padding: 6px 13px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.game-btn:hover, .game-btn:active {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

/* ── Nav Dots ── */
#nav-dots {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 100;
  pointer-events: all;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: #2a2a3a;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.dot.active {
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.6);
  width: 22px;
}

/* ── Nav Arrows ── */
.nav-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.04);
  border: 1px solid #2a2a3a;
  color: #444;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0 0 1px 0;
  line-height: 1;
}

.nav-arrow:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(0, 229, 255, 0.08);
}

#btn-prev { left: 6px; }
#btn-next { right: 6px; }

/* ── Swipe Hint ── */
#swipe-hint {
  position: fixed;
  inset: 0;
  background: rgba(9, 9, 18, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  pointer-events: none;
  animation: hintFade 0.5s ease 2.5s forwards;
}

.hint-content { text-align: center; }

.hint-arrows {
  font-size: 40px;
  color: var(--cyan);
  letter-spacing: 8px;
  animation: hintPulse 0.9s ease infinite alternate;
}

.hint-content p {
  color: var(--muted);
  margin-top: 10px;
  font-size: 13px;
  letter-spacing: 0.03em;
}

@keyframes hintFade {
  to { opacity: 0; pointer-events: none; }
}

@keyframes hintPulse {
  from { opacity: 0.3; transform: scaleX(0.9); }
  to   { opacity: 1;   transform: scaleX(1.05); }
}

/* ── Color Surge palette ── */
#surge-colors {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.surge-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
  flex-shrink: 0;
}

.surge-btn:hover {
  transform: scale(1.15);
}

.surge-btn.selected {
  border-color: #fff;
  transform: scale(1.2);
}

/* ── Mobile ── */
@media (max-width: 500px) {
  .nav-arrow { display: none; }
  #nav-dots  { bottom: 66px; }
  .value     { font-size: 18px; }
}
