*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --ink: #23104a;
  --yellow: #ffd23f;
  --pink: #ff6fb5;
  --green: #3ddc84;
  --blue: #6cc8ff;
  --purple: #a78bfa;
  --card: #fffaf0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Fredoka', system-ui, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  background: linear-gradient(160deg, #7fd4ff 0%, #a9c4ff 45%, #ffb8e0 100%);
  background-attachment: fixed;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
  color: inherit;
  cursor: pointer;
}

.blobs span {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(46px);
  opacity: 0.55;
  pointer-events: none;
  animation: drift 16s ease-in-out infinite;
}

.blobs span:nth-child(1) { width: 320px; height: 320px; background: var(--yellow); top: -80px; left: -60px; }
.blobs span:nth-child(2) { width: 280px; height: 280px; background: var(--pink); bottom: 8%; right: -70px; animation-delay: -4s; }
.blobs span:nth-child(3) { width: 240px; height: 240px; background: var(--green); bottom: -90px; left: 18%; animation-delay: -8s; }
.blobs span:nth-child(4) { width: 200px; height: 200px; background: var(--purple); top: 20%; right: 22%; animation-delay: -12s; }

/* header */
.top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
  max-width: 1200px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
}

.brand-pic {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 22%;
  border: 3px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  background: #fff;
  animation: bounce 1.6s ease-in-out infinite;
}

nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.link {
  font-weight: 600;
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

.pill {
  font-weight: 700;
  text-decoration: none;
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 8px 18px;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 0.1s, box-shadow 0.1s;
}

.pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--ink);
}

.pill:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--ink);
}

.pill.soon,
.foot a.soon {
  opacity: 0.75;
  cursor: default;
}

/* main */
main {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 4px 18px 30px;
}

.tagline-wrap {
  text-align: center;
  margin: 4px 0 16px;
}

.tagline {
  display: inline-block;
  font-weight: 700;
  font-size: clamp(1.1rem, 3vw, 1.7rem);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 8px 20px;
  box-shadow: 0 5px 0 var(--ink);
  transform: rotate(-1.2deg);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 10px 14px;
  box-shadow: 0 4px 0 var(--ink);
  font: inherit;
}

.stat-mc { background: var(--pink); }
.stat-best { background: var(--green); }
.stat-ca { background: #fff; transition: transform 0.1s; }
.stat-ca:hover { transform: translateY(-2px); }
.stat-ca:active { transform: translateY(2px); }

.stat .k {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.8;
}

.stat .v {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  word-break: break-all;
}

/* game */
.game-card {
  background: var(--card);
  border: 4px solid var(--ink);
  border-radius: 24px;
  padding: 12px;
  box-shadow: 0 8px 0 var(--ink);
}

.game-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 960 / 340;
  border: 3px solid var(--ink);
  border-radius: 16px;
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  background: #9fdcff;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
}

.hud {
  position: absolute;
  top: 10px;
  left: 14px;
  right: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
}

.hud-score {
  font-weight: 700;
  font-size: clamp(1.2rem, 3vw, 1.9rem);
  color: #fff;
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--ink);
}

.mute {
  pointer-events: auto;
  font-weight: 600;
  font-size: 0.8rem;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 4px 10px;
  box-shadow: 0 2px 0 var(--ink);
}

.mute.off {
  background: #ddd;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  text-align: center;
  background: rgba(35, 16, 74, 0.32);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  color: #fff;
  animation: pop-in 0.25s ease-out;
}

.overlay[hidden] {
  display: none;
}

.overlay h2 {
  font-size: clamp(1.4rem, 4vw, 2.3rem);
  font-weight: 700;
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 4px 0 var(--ink);
}

.picks {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: #fff;
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 8px 12px 6px;
  box-shadow: 0 4px 0 var(--ink);
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.12s, background 0.12s;
}

.pick img {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--ink);
  background: #fff;
}

.pick:hover {
  transform: translateY(-3px);
}

.pick.active {
  background: var(--yellow);
  transform: translateY(-4px) rotate(-3deg);
  box-shadow: 0 7px 0 var(--ink);
}

.big-btn {
  font-weight: 700;
  font-size: 1.35rem;
  background: var(--green);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 8px 40px;
  box-shadow: 0 5px 0 var(--ink);
  transition: transform 0.1s, box-shadow 0.1s;
}

.big-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 var(--ink);
}

.big-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--ink);
}

.small-btn {
  font-weight: 600;
  font-size: 1rem;
  background: #fff;
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 8px 18px;
  box-shadow: 0 4px 0 var(--ink);
}

.over-score {
  font-size: 1.2rem;
  font-weight: 600;
  -webkit-text-stroke: 1px var(--ink);
  paint-order: stroke fill;
}

.over-score b {
  color: var(--yellow);
  font-size: 1.5rem;
}

.over-best {
  font-weight: 600;
  opacity: 0.95;
}

.over-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}

.controls {
  margin-top: 12px;
  text-align: center;
  font-weight: 500;
}

.legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0.85;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--ink);
}

.dot.red { background: #ff4d6d; border-radius: 3px; }
.dot.grey { background: #6b6f8f; }
.dot.gold { background: var(--yellow); }

.foot {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 10px 18px 28px;
  font-weight: 600;
  opacity: 0.85;
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -24px) scale(1.08); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

@media (max-width: 720px) {
  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .stat-ca {
    grid-column: 1 / -1;
  }

  .game-wrap {
    aspect-ratio: 4 / 3;
  }

  .pick img {
    width: 58px;
    height: 58px;
  }

  .brand {
    font-size: 1.3rem;
  }

  .pill {
    padding: 6px 12px;
    font-size: 0.9rem;
  }
}
