@import url('https://fonts.googleapis.com/css2?family=Black+Ops+One&family=Rajdhani:wght@400;600;700&display=swap');

:root {
  --track-bg: #1a1a2e;
  --lane1: #00e5ff;
  --lane2: #ff4081;
  --lane3: #76ff03;
  --lane4: #ffd740;
  --ground: #2d5016;
  --sky: #0d1b3e;
}

* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; user-select:none; }

body {
  background: var(--sky);
  font-family: 'Rajdhani', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

#game-wrap {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
}

/* ── HUD ── */
#hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: rgba(0,0,0,0.7);
  border-bottom: 2px solid var(--lane1);
  flex-shrink: 0;
  z-index: 20;
}
#hud-title {
  font-family: 'Black Ops One', cursive;
  font-size: 18px;
  color: var(--lane1);
  letter-spacing: 2px;
  text-shadow: 0 0 12px rgba(0,229,255,0.8);
}
#hud-timer {
  font-size: 28px;
  font-weight: 700;
  color: #ffd740;
  text-shadow: 0 0 10px rgba(255,215,64,0.8);
  min-width: 50px;
  text-align: center;
}
#mute-btn {
  background: rgba(0,229,255,0.12);
  border: 1.5px solid var(--lane1);
  color: var(--lane1);
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 16px;
  cursor: pointer;
}

/* ── CANVAS ── */
#canvas-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
}
#canvas { display: block; width: 100%; height: 100%; }

/* ── SPEED BAR ── */
#speed-bar-wrap {
  padding: 6px 14px;
  background: rgba(0,0,0,0.6);
  flex-shrink: 0;
}
#speed-label {
  font-size: 11px;
  color: #888;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
#speed-track {
  height: 12px;
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(0,229,255,0.3);
}
#speed-fill {
  height: 100%;
  width: 0%;
  border-radius: 6px;
  background: linear-gradient(90deg, #00e5ff, #76ff03);
  transition: width 0.08s;
  box-shadow: 0 0 8px rgba(0,229,255,0.6);
}

/* ── ARROW CONTROLS ── */
#controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 6px;
  padding: 8px 14px 10px;
  background: rgba(0,0,0,0.75);
  border-top: 2px solid rgba(0,229,255,0.3);
  flex-shrink: 0;
}
.arrow-btn {
  height: 58px;
  border-radius: 12px;
  border: 2px solid rgba(0,229,255,0.5);
  background: rgba(0,229,255,0.08);
  color: var(--lane1);
  font-size: 26px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.06s, transform 0.06s;
  touch-action: manipulation;
}
.arrow-btn:active, .arrow-btn.pressed {
  background: rgba(0,229,255,0.28);
  transform: scale(0.93);
  border-color: var(--lane1);
}
#btn-up    { grid-column: 2; grid-row: 1; }
#btn-left  { grid-column: 1; grid-row: 2; }
#btn-down  { grid-column: 2; grid-row: 2; }
#btn-right { grid-column: 3; grid-row: 2; }
#btn-boost { grid-column: 3; grid-row: 1; background: rgba(255,215,64,0.1); border-color: rgba(255,215,64,0.5); color: #ffd740; font-size: 18px; }
#btn-boost:active { background: rgba(255,215,64,0.3); border-color: #ffd740; }
#tap-hint  { grid-column: 1; grid-row: 1; display:flex; align-items:center; justify-content:center; font-size:10px; color:#555; letter-spacing:1px; text-transform:uppercase; }

/* ── OVERLAY ── */
#overlay {
  position: absolute;
  inset: 0;
  background: rgba(5,5,20,0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  z-index: 50;
}
#overlay h1 {
  font-family: 'Black Ops One', cursive;
  font-size: 30px;
  color: var(--lane1);
  text-align: center;
  text-shadow: 0 0 20px rgba(0,229,255,0.8);
  line-height: 1.2;
}
#overlay p {
  color: #aaa;
  font-size: 14px;
  text-align: center;
  line-height: 1.8;
  max-width: 320px;
}
.result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 600;
  width: 100%;
  max-width: 300px;
}
.result-medal { font-size: 24px; width: 32px; text-align: center; }
.result-name { flex: 1; }
.result-time { color: #ffd740; font-size: 14px; }
#start-btn {
  margin-top: 6px;
  padding: 18px 0;
  width: 100%;
  max-width: 300px;
  background: var(--lane1);
  color: #000;
  border: none;
  border-radius: 14px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 3px;
  font-family: 'Black Ops One', cursive;
}
#start-btn:active { background: #00b8cc; }
#winner-banner {
  font-family: 'Black Ops One', cursive;
  font-size: 26px;
  text-align: center;
  padding: 10px 20px;
  border-radius: 12px;
  margin-bottom: 4px;
}

/* ── FLOATING LABELS ── */
.float-label {
  position: absolute;
  pointer-events: none;
  font-family: 'Black Ops One', cursive;
  font-size: 22px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
  animation: floatUp 0.9s forwards;
  z-index: 30;
}
@keyframes floatUp {
  0%   { transform: translateY(0) scale(1);   opacity: 1; }
  100% { transform: translateY(-60px) scale(1.3); opacity: 0; }
}
