:root {
  --ink: #1a1020;
  --cream: #fff6e8;
  --stripe: #ff4d6d;
  --gold: #ffd166;
  --sky: #7ec8e3;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: #5bb4d4;
  color: var(--ink);
  font-family: Figtree, sans-serif;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.sky {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, #fff8 0%, transparent 55%),
    linear-gradient(180deg, #9ad7ee 0%, #6ec0dc 42%, #f7c59f 100%);
  pointer-events: none;
}

.sky::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0 28px,
    rgba(255,255,255,0.06) 28px 29px
  );
  opacity: 0.5;
}

.stage {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 12px 24px;
}

.hud {
  width: min(420px, 100%);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 8px;
  padding: 6px 4px 10px;
}

.hud-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: #1a1020aa;
}

.hud-value {
  font-family: Bungee, cursive;
  font-size: 28px;
  line-height: 1;
  color: #1a1020;
}

.hud-right { text-align: right; }

.title-mark {
  font-family: Bungee, cursive;
  font-size: 18px;
  letter-spacing: 0.04em;
  color: #ff2d55;
  text-shadow: 2px 2px 0 #fff, 4px 4px 0 #ffd166;
}

.canvas-wrap {
  position: relative;
  width: min(420px, 100%);
  aspect-ratio: 420 / 720;
  max-height: calc(100dvh - 90px);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 28px;
  border: 4px solid #1a1020;
  box-shadow:
    0 0 0 6px #ffd166,
    8px 16px 0 #1a102022;
  background: #8fd3ee;
  cursor: pointer;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(26, 16, 32, 0.28);
  border-radius: 24px;
}

.overlay.hidden { display: none; }

.card {
  width: min(340px, 100%);
  background: var(--cream);
  border: 4px solid #1a1020;
  border-radius: 20px;
  padding: 28px 22px 24px;
  text-align: center;
  box-shadow: 6px 8px 0 #1a1020;
}

.kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #ff2d55;
  margin-bottom: 8px;
}

h1, h2 {
  font-family: Bungee, cursive;
  font-size: 42px;
  line-height: 0.95;
  color: #ff2d55;
  text-shadow: 3px 3px 0 #ffd166;
  margin-bottom: 12px;
}

h2 { font-size: 28px; }

.tagline {
  font-size: 15px;
  line-height: 1.45;
  color: #3a2a40;
  margin-bottom: 16px;
}

.hint {
  font-size: 13px;
  color: #5a4a58;
  margin-bottom: 18px;
}

kbd {
  display: inline-block;
  padding: 2px 8px;
  border: 2px solid #1a1020;
  border-radius: 6px;
  background: #fff;
  font-family: Figtree, sans-serif;
  font-weight: 700;
  font-size: 12px;
}

button {
  font-family: Bungee, cursive;
  font-size: 18px;
  letter-spacing: 0.04em;
  color: #fff;
  background: #ff2d55;
  border: 3px solid #1a1020;
  border-radius: 999px;
  padding: 12px 28px;
  cursor: pointer;
  box-shadow: 0 4px 0 #1a1020;
}

button:active { transform: translateY(3px); box-shadow: 0 1px 0 #1a1020; }

.final-score {
  font-family: Bungee, cursive;
  font-size: 64px;
  color: #1a1020;
  line-height: 1;
}

.best-line {
  margin: 6px 0 18px;
  font-weight: 700;
  color: #5a4a58;
}
