/* ---------------------------------------------------------
   Dash Runner — clean, flat, colorful theme
--------------------------------------------------------- */

:root {
  --bg-top: #cfe8ff;
  --bg-bottom: #f4faff;
  --surface: #ffffff;
  --ink: #22262b;
  --ink-soft: #6b7280;
  --line: #e3e8ef;
  --accent: #3b6df6;
  --accent-soft: #eaf0ff;
  --sun: #ffc93c;
  --coral: #f2545b;
  --grass: #bfe3b0;
  --grass-line: #8fcb78;
  --font-head: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-bottom);
  color: var(--ink);
  font-family: var(--font-body);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#app {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 55%);
}

/* --- HUD --- */
.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 6px;
  z-index: 10;
  position: relative;
}

.hud-block {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 90px;
}

.hud-right { align-items: flex-end; text-align: right; }
.hud-combo { align-items: center; }

.hud-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.hud-value {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.hud-combo .hud-value {
  color: var(--coral);
}

/* --- Stage / canvas --- */
.stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  min-height: 0;
}

#game {
  width: 100%;
  height: auto;
  max-height: 100%;
  aspect-ratio: 900 / 300;
  background: transparent;
  border-radius: 18px;
  display: block;
  touch-action: none;
  user-select: none;
  box-shadow: 0 12px 30px rgba(59, 109, 246, 0.12);
}

/* --- Overlays --- */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: rgba(244, 250, 255, 0.88);
  border-radius: 18px;
}

.overlay h1 {
  font-family: var(--font-head);
  font-size: clamp(30px, 6vw, 44px);
  font-weight: 800;
  margin: 0 0 12px;
  color: var(--ink);
}

.overlay h2 {
  font-family: var(--font-head);
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--ink);
}

.sub {
  font-size: 14px;
  color: var(--ink-soft);
  max-width: 460px;
  line-height: 1.6;
  margin: 0 0 18px;
}

.keys {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 24px;
}

kbd {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 12px;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--ink);
  box-shadow: 0 1px 0 var(--line);
}

.new-best {
  color: var(--coral);
  font-weight: 600;
  font-size: 14px;
  margin: -8px 0 18px;
}

.btn {
  font-family: var(--font-head);
  background: var(--accent);
  border: none;
  color: #ffffff;
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(59, 109, 246, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover, .btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(59, 109, 246, 0.45);
  outline: none;
}

.btn:active {
  transform: translateY(0);
}

/* --- Footer --- */
.footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px 14px;
  font-size: 12px;
  color: var(--ink-soft);
  z-index: 10;
}

.icon-btn {
  font-family: var(--font-body);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
}

.icon-btn:hover, .icon-btn:focus-visible {
  color: var(--ink);
  border-color: var(--accent);
  outline: none;
}

.mode-indicator {
  font-weight: 500;
}

/* --- Touch controls (mobile) --- */
.touch-controls {
  display: none;
  gap: 10px;
  padding: 0 20px 18px;
  z-index: 10;
}

.touch-btn {
  flex: 1;
  font-family: var(--font-head);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--accent);
  font-weight: 600;
  padding: 15px 0;
  font-size: 14px;
  border-radius: 14px;
  user-select: none;
  touch-action: none;
  box-shadow: 0 4px 10px rgba(59, 109, 246, 0.12);
}

.touch-btn:active {
  background: var(--accent-soft);
}

@media (hover: none) and (pointer: coarse) {
  .touch-controls { display: flex; }
}

@media (max-width: 480px) {
  .keys { font-size: 12px; }
  .hud-value { font-size: 18px; }
}
