:root {
  --bg: #0a1628;
  --ink: #e8f4ff;
  --muted: #8db3d9;
  --accent: #4fb3ff;
  --orange: #ff8533;
  --card: rgba(16, 32, 56, 0.9);
}

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

html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--ink);
  font-family: "Segoe UI", "Avenir Next", Futura, system-ui, sans-serif;
  user-select: none; touch-action: none;
}

#game { display: block; width: 100%; height: 100%; cursor: pointer; }

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 2; }

#hud-left { position: absolute; top: 18px; left: 20px; }
#brand { font-weight: 800; letter-spacing: 0.28em; font-size: 13px; color: var(--accent); }
#score { margin-top: 6px; font-size: 18px; font-variant-numeric: tabular-nums; }

#hud-center { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); text-align: center; }
#clock { font-weight: 800; letter-spacing: 0.12em; font-size: 22px; text-shadow: 0 2px 12px #000; }
#toast { min-height: 1.2em; font-weight: 700; text-shadow: 0 2px 12px #000; color: var(--orange); }

#board {
  position: absolute; top: 16px; right: 16px; width: 210px;
  padding: 12px 14px 10px; background: var(--card);
  border: 1px solid rgba(79,179,255,0.28); border-radius: 12px;
}
.board-title { font-size: 10px; letter-spacing: 0.22em; color: var(--muted); margin-bottom: 8px; }
#board-list { list-style: none; font-size: 13px; }
#board-list li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
#board-list .you { font-weight: 700; }
#board-list .buried { opacity: 0.5; text-decoration: line-through; }
.swatch { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }

#combo-bar {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  z-index: 2; pointer-events: none; width: min(420px, 70vw); text-align: center;
}
#combo-fill {
  height: 10px; border-radius: 99px; background: rgba(255,255,255,0.08);
  overflow: hidden; border: 1px solid rgba(255,255,255,0.1);
}
#combo-fill span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--orange));
  transform-origin: left; transition: width 0.2s ease;
}
#hint { margin-top: 8px; font-size: 11px; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }

#splash {
  position: fixed; inset: 0; z-index: 5; display: grid; place-items: center;
  background:
    radial-gradient(800px 500px at 20% 20%, rgba(79,179,255,0.22), transparent 55%),
    radial-gradient(700px 500px at 80% 80%, rgba(255,133,51,0.16), transparent 50%),
    var(--bg);
}
#over {
  position: fixed; inset: 0; z-index: 5; display: grid; place-items: center;
  background: none; pointer-events: none;
}
#splash.hidden, #over.hidden { display: none; }

.splash-card {
  width: min(420px, 90vw); padding: 36px 32px 28px; background: var(--card);
  border: 1px solid rgba(79,179,255,0.3); border-radius: 20px; text-align: center; pointer-events: auto;
}
#over .splash-card {
  width: min(320px, 80vw); padding: 22px 22px 18px;
  background: rgba(16, 32, 56, 0.94);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
#over h1 { font-size: 32px; margin-bottom: 8px; }
#over .tag { margin-bottom: 16px; }
.kicker { letter-spacing: 0.32em; font-size: 11px; color: var(--accent); margin-bottom: 10px; }
h1 { font-size: 44px; letter-spacing: 0.12em; line-height: 1; margin-bottom: 10px; }
.tag { color: var(--muted); margin-bottom: 22px; }

label { display: block; text-align: left; font-size: 11px; letter-spacing: 0.16em; color: var(--muted); text-transform: uppercase; }
input {
  width: 100%; margin: 8px 0 18px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12); background: rgba(0,0,0,0.35);
  color: white; font-size: 16px; outline: none;
}
button {
  width: 100%; padding: 14px; border: 0; border-radius: 12px;
  background: linear-gradient(90deg, var(--accent), var(--orange));
  color: #0a1628; font-weight: 800; letter-spacing: 0.22em; cursor: pointer; font-size: 15px;
}
.fine { margin-top: 14px; font-size: 11px; color: var(--muted); }