* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #1d2433;
  color: #fffefa;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

#game { display: block; width: 100vw; height: 100vh; }

/* start.ng profile card */
.startng-card {
  position: fixed; top: 16px; left: 16px; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px 8px 8px; border-radius: 999px;
  background: rgba(41, 42, 35, .9); color: #fffefa;
}
.startng-card img { width: 44px; height: 44px; border-radius: 50%; background: #d8fd71; }
.startng-card img:not([src]) { display: none; }
.startng-card:has(img:not([src])) { padding-left: 16px; }
.startng-card b { display: block; font-size: 15px; }
.startng-card span { font-size: 12px; opacity: .7; }
.startng-card button {
  margin-left: 4px; border: 0; border-radius: 999px; padding: 6px 12px;
  background: #d8fd71; color: #292a23; font-weight: 700; cursor: pointer;
}

/* in-game numbers */
.hud {
  position: fixed; top: 16px; right: 16px; z-index: 5;
  display: flex; gap: 8px;
}
.hud .stat {
  min-width: 72px; padding: 6px 12px; border-radius: 12px;
  background: rgba(41, 42, 35, .85); text-align: center;
}
.hud span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.hud b { font-size: 20px; font-variant-numeric: tabular-nums; }
.hud .lives b { color: #ff6b6b; letter-spacing: 2px; }

.hud .combo.hot b { color: #d8fd71; }

/* active power-ups */
.powers {
  position: fixed; top: 78px; right: 16px; z-index: 5;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
.power {
  padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: rgba(41, 42, 35, .85); font-variant-numeric: tabular-nums;
}
.power.shield { color: #4dffc3; }
.power.bigbucket { color: #ffb366; }
.power.double { color: #d9a6ff; }

/* floating points */
.pop-layer { position: fixed; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.pop {
  position: absolute; transform: translate(-50%, -50%);
  font-weight: 900; font-size: 22px; white-space: nowrap;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .6);
  animation: pop-up .9s ease-out forwards;
}
.pop.big { font-size: 34px; animation-duration: 1.4s; }
@keyframes pop-up {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(.7); }
  15% { opacity: 1; transform: translate(-50%, -60%) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -220%) scale(1); }
}

.demo-badge {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 5;
  padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(41, 42, 35, .75); color: #d8fd71; letter-spacing: .04em;
}

/* lightning flash */
.flash {
  position: fixed; inset: 0; z-index: 4; pointer-events: none;
  background: #fff; opacity: 0; transition: opacity .35s ease-out;
}
.flash.on { opacity: .75; transition: none; }

/* menu and game over */
.panel {
  position: fixed; left: 50%; top: 50%; z-index: 6;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 32px)); max-height: calc(100vh - 120px); overflow: auto;
  padding: 24px; border-radius: 20px;
  background: rgba(29, 36, 51, .92); border: 1px solid rgba(255, 255, 255, .12);
  text-align: center;
}
.panel[hidden], .hud[hidden] { display: none; }
.panel h1 { margin: 0 0 8px; font-size: 40px; color: #8fd3ff; }
.panel h2 { margin: 0 0 8px; font-size: 30px; }
.panel h3 { margin: 20px 0 8px; font-size: 16px; opacity: .8; }
.tagline { margin: 0 0 16px; line-height: 1.45; opacity: .9; }
.howto { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.howto li { display: flex; align-items: center; justify-content: center; gap: 8px; }
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.dot.blue { background: #5ab9ff; }
.dot.gold { background: #ffcc33; }
.dot.bolt { background: #fff35c; border-radius: 2px; transform: skewX(-20deg); }
.controls { font-size: 14px; opacity: .8; }
.bonuses { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 4px; font-size: 13px; text-align: left; }
.bonuses li { display: flex; gap: 8px; padding: 5px 10px; border-radius: 8px; background: rgba(255, 255, 255, .05); line-height: 1.35; }
.bonuses b { flex: 0 0 92px; color: #d8fd71; }
kbd {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  background: rgba(255, 255, 255, .12); font-family: inherit; font-size: 12px;
}
button.primary {
  margin-top: 8px; padding: 12px 36px; border: 0; border-radius: 999px;
  background: #d8fd71; color: #292a23; font-size: 18px; font-weight: 800; cursor: pointer;
}
button.primary:hover { filter: brightness(1.05); }
.best, .saved { font-size: 14px; opacity: .8; min-height: 1em; }
.result { font-size: 18px; }
.board { margin: 0; padding: 0; list-style: none; text-align: left; font-size: 14px; }
.board li {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 6px 10px; border-radius: 8px;
}
.board li:nth-child(odd) { background: rgba(255, 255, 255, .05); }
.board li.me { background: rgba(216, 253, 113, .2); }
.board .muted { opacity: .6; justify-content: center; }

@media (max-width: 600px) {
  .startng-card { top: 10px; left: 10px; padding: 6px 12px 6px 6px; }
  .startng-card img { width: 34px; height: 34px; }
  .startng-card span { display: none; }
  .hud { top: auto; bottom: 12px; right: 50%; transform: translateX(50%); }
  .hud .stat { min-width: 58px; padding: 6px 8px; }
  .powers { top: 60px; right: 10px; }
  .demo-badge { bottom: 76px; }
  .panel h1 { font-size: 32px; }
}
