:root {
  color-scheme: light;
  --bg: #fffaf2;
  --surface: rgba(255, 255, 255, 0.8);
  --surface-strong: #ffffff;
  --text: #18181b;
  --muted: #66646e;
  --line: rgba(24, 24, 27, 0.08);
  --yellow: #ffd84d;
  --pink: #ff97d1;
  --blue: #8fd3ff;
  --green: #9af2c3;
  --shadow: 0 18px 60px rgba(24, 24, 27, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, #fffef9 0%, var(--bg) 48%, #fdf3ff 100%);
}

body.party-mode {
  background:
    radial-gradient(circle at top, #fff8d5 0%, #fff0f8 45%, #eaf7ff 100%);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  position: relative;
  overflow: hidden;
  width: min(1180px, calc(100vw - 32px));
  margin: 20px auto;
  padding: 24px;
}

.ambient {
  position: absolute;
  z-index: 0;
  border-radius: 999px;
  filter: blur(20px);
  opacity: 0.7;
}

.ambient-a {
  top: 70px;
  right: -30px;
  width: 220px;
  height: 220px;
  background: rgba(255, 216, 77, 0.45);
}

.ambient-b {
  top: 380px;
  left: -80px;
  width: 200px;
  height: 200px;
  background: rgba(143, 211, 255, 0.45);
}

.ambient-c {
  bottom: 120px;
  right: 16%;
  width: 180px;
  height: 180px;
  background: rgba(255, 151, 209, 0.38);
}

.topbar,
.hero,
.playground,
.achievement-strip,
.about-strip {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--yellow), var(--pink), var(--blue));
  font-size: 0.9rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
}

.sound-toggle,
.shuffle-wall {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  cursor: pointer;
}

.sound-toggle {
  padding: 10px 14px;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 28px;
}

.hero-copy,
.hero-panel,
.panel,
.achievement-strip,
.about-strip {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.hero-copy,
.hero-panel,
.panel,
.achievement-strip {
  border-radius: var(--radius-xl);
}

.hero-copy {
  padding: 42px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.hero h1 {
  margin: 0;
  max-width: 10ch;
  font-size: clamp(2.6rem, 5vw, 5rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.hero-text {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.1rem;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.primary-button,
.ghost-button,
.action-button,
.secondary-button,
.mini-chip,
.choice-button,
.ttt-cell,
.mole-hole,
.move-button,
.simon-pad,
.puzzle-tile {
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.primary-button,
.action-button {
  border: none;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  cursor: pointer;
}

.primary-button,
.ghost-button {
  padding: 14px 22px;
  font-weight: 700;
}

.ghost-button,
.secondary-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
}

.hero-panel {
  display: flex;
  flex-direction: column;
  padding: 28px;
  gap: 16px;
}

.wall-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.spark-card {
  flex: 1;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 216, 77, 0.58), rgba(255, 151, 209, 0.45));
}

.spark-label,
.panel-tag,
.game-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
}

.spark-label {
  margin-bottom: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.6);
}

.spark-card strong {
  display: block;
  font-size: 1.4rem;
  line-height: 1.35;
}

.mini-chip,
.secondary-button,
.shuffle-wall {
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  cursor: pointer;
}

.mini-chip {
  text-align: left;
  background: rgba(255, 255, 255, 0.72);
  font-weight: 700;
}

.game-tag,
.panel-tag {
  padding: 7px 12px;
  background: rgba(24, 24, 27, 0.06);
}

.panel h3 {
  margin: 18px 0 8px;
  font-size: 1.5rem;
}

.panel-text {
  margin: 0;
  color: var(--muted);
}

.panel-note {
  margin: -8px 0 14px;
  color: #7b7885;
  font-size: 0.9rem;
}

.playground {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 12px;
}

.panel {
  padding: 24px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-score {
  color: var(--muted);
  white-space: nowrap;
}

.action-button,
.secondary-button {
  width: 100%;
  min-height: 52px;
  margin-top: 18px;
  border-radius: 16px;
  font-weight: 700;
}

#reaction-game {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 216, 77, 0.22));
}

#reactionButton.ready {
  background: #16a34a;
}

#reactionButton.too-soon {
  background: #ef4444;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.memory-card {
  aspect-ratio: 1;
  border: none;
  border-radius: 16px;
  background: rgba(24, 24, 27, 0.06);
  cursor: pointer;
  font-size: 1.8rem;
  font-weight: 700;
}

.memory-card.revealed,
.memory-card.matched {
  background: #ffffff;
}

.memory-card.matched {
  box-shadow: inset 0 0 0 2px rgba(22, 163, 74, 0.18);
}

.guess-form {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.guess-form input {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  outline: none;
}

.guess-form .action-button {
  width: auto;
  margin-top: 0;
  padding: 0 20px;
}

.choice-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.game-wall {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.feature-card {
  position: relative;
  overflow: hidden;
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.56));
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.feature-card::before {
  content: "";
  position: absolute;
  inset: 10px auto auto 10px;
  width: 48px;
  height: 48px;
  border-radius: 18px;
  background: var(--card-glow, rgba(255, 216, 77, 0.38));
  filter: blur(10px);
}

.feature-emoji {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  margin-bottom: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.64);
  font-size: 1.5rem;
}

.feature-name {
  display: block;
  margin-bottom: 8px;
  font-size: 1.15rem;
  font-weight: 800;
}

.feature-desc {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}

.feature-tag {
  position: absolute;
  right: 14px;
  top: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.8rem;
  font-weight: 700;
}

.wall-tip {
  margin: 0;
  color: var(--muted);
}

.rps-stage,
.dice-stage,
.tap-stage,
.slot-machine,
.calc-stage,
.mines-grid {
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
}

.rps-stage {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 16px;
  margin-bottom: 12px;
}

.rps-fighter,
.dice-face-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.rps-name {
  font-size: 0.9rem;
  color: var(--muted);
}

.rps-hand,
.dice-face {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  perspective: 500px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 216, 77, 0.34), rgba(143, 211, 255, 0.28));
  font-size: 2.8rem;
  transform-origin: center;
}

.rps-hand-mirror {
  transform: scaleX(-1);
}

.rps-stage.shaking .rps-hand {
  animation: rpsShake 0.45s ease 3;
}

.rps-choice {
  min-height: 1.5em;
  font-weight: 700;
}

.rps-vs {
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.choice-button,
.ttt-cell,
.mole-hole {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.choice-button {
  min-height: 54px;
  font-weight: 700;
}

.ttt-board,
.mole-grid,
.board-2048,
.puzzle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ttt-cell,
.mole-hole {
  aspect-ratio: 1;
}

.ttt-cell {
  font-size: 2rem;
  font-weight: 800;
}

.ttt-cell:disabled {
  cursor: default;
}

.mole-hole {
  position: relative;
  overflow: hidden;
}

.mole-hole::before {
  content: "";
  position: absolute;
  inset: auto 20% 14% 20%;
  height: 18%;
  border-radius: 999px;
  background: rgba(24, 24, 27, 0.1);
}

.mole-hole span {
  position: absolute;
  left: 50%;
  bottom: -100%;
  transform: translateX(-50%);
  font-size: 2rem;
  transition: bottom 0.16s ease;
}

.mole-hole.active span {
  bottom: 24%;
}

.slot-machine {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.slot-reel {
  position: relative;
  min-height: 120px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 216, 77, 0.22));
  overflow: hidden;
}

.slot-strip {
  display: flex;
  flex-direction: column;
  transition: transform 0ms linear;
}

.slot-symbol {
  display: grid;
  place-items: center;
  height: 120px;
  font-size: 2.3rem;
  font-weight: 800;
}

.slot-reel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  box-shadow: inset 0 16px 18px rgba(255, 255, 255, 0.28), inset 0 -16px 18px rgba(255, 255, 255, 0.28);
  pointer-events: none;
}

.tap-stage {
  display: grid;
  place-items: center;
  min-height: 170px;
  margin-bottom: 12px;
  padding: 18px;
}

.tap-button {
  width: 150px;
  height: 150px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 151, 209, 0.75), rgba(255, 216, 77, 0.75));
  box-shadow: 0 18px 40px rgba(255, 151, 209, 0.24);
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.08s ease;
}

.tap-button:active,
.tap-button.active {
  transform: scale(0.95);
}

.dice-stage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
  padding: 16px;
}

.dice-face.rolling {
  animation: diceSpin 0.8s cubic-bezier(0.25, 0.8, 0.2, 1);
}

.board-2048 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 10px;
  border-radius: 20px;
  background: rgba(24, 24, 27, 0.06);
}

.tile-2048 {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 16px;
  background: var(--tile-bg, rgba(255, 255, 255, 0.72));
  color: var(--tile-color, var(--text));
  font-size: 1.5rem;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.tile-0 {
  background: rgba(255, 255, 255, 0.35);
  color: transparent;
}

.dir-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.move-button {
  min-height: 48px;
}

.puzzle-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.puzzle-tile {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 1.3rem;
  font-weight: 800;
  cursor: pointer;
}

.puzzle-tile.empty {
  background: rgba(24, 24, 27, 0.05);
  box-shadow: inset 0 0 0 1px rgba(24, 24, 27, 0.05);
  cursor: default;
}

.simon-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.simon-pad {
  min-height: 110px;
  border: none;
  border-radius: 22px;
  cursor: pointer;
  opacity: 0.8;
}

.simon-pad.active {
  opacity: 1;
  transform: scale(0.96);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.5) inset;
}

.simon-pad.hard {
  box-shadow: inset 0 0 0 3px rgba(24, 24, 27, 0.18);
}

.simon-green {
  background: #4ade80;
}

.simon-red {
  background: #fb7185;
}

.simon-yellow {
  background: #facc15;
}

.simon-blue {
  background: #60a5fa;
}

.calc-stage {
  padding: 18px;
  margin-bottom: 12px;
}

.calc-stage strong {
  display: block;
  margin-bottom: 14px;
  font-size: 2rem;
  text-align: center;
}

.quiz-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quiz-option {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  font-weight: 700;
  cursor: pointer;
}

.mines-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.mine-cell {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  font-weight: 800;
  cursor: pointer;
}

.mine-cell.revealed {
  background: rgba(24, 24, 27, 0.06);
}

.mine-cell.mine {
  background: #fb7185;
  color: #fff;
}

.wheel-stage,
.aim-stage {
  padding: 18px;
  margin-bottom: 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
}

.wheel-stage {
  display: grid;
  place-items: center;
  gap: 12px;
}

.wheel-disc {
  display: grid;
  place-items: center;
  width: 140px;
  height: 140px;
  border-radius: 999px;
  background:
    conic-gradient(#ffd84d 0 25%, #ff97d1 25% 50%, #8fd3ff 50% 75%, #9af2c3 75% 100%);
  box-shadow: 0 18px 40px rgba(24, 24, 27, 0.12);
  font-size: 3rem;
}

.wheel-disc.spinning {
  animation: wheelSpin 2s cubic-bezier(0.18, 0.82, 0.2, 1);
}

.wheel-result {
  font-weight: 700;
}

.aim-track {
  position: relative;
  height: 22px;
  border-radius: 999px;
  background: rgba(24, 24, 27, 0.1);
  overflow: hidden;
}

.aim-target-zone {
  position: absolute;
  left: 42%;
  top: 0;
  width: 16%;
  height: 100%;
  background: rgba(74, 222, 128, 0.65);
}

.aim-marker {
  position: absolute;
  top: -6px;
  left: 0;
  width: 18px;
  height: 34px;
  border-radius: 999px;
  background: #18181b;
  box-shadow: 0 6px 16px rgba(24, 24, 27, 0.2);
}

.lights-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.light-cell {
  aspect-ratio: 1;
  border: none;
  border-radius: 18px;
  background: rgba(24, 24, 27, 0.1);
  cursor: pointer;
}

.light-cell.on {
  background: linear-gradient(180deg, #ffd84d, #ff97d1);
  box-shadow: 0 10px 24px rgba(255, 151, 209, 0.24);
}

.coin-stage,
.race-stage,
.cups-stage {
  padding: 18px;
  margin-bottom: 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
}

.coin-stage {
  display: grid;
  gap: 14px;
}

.coin-face {
  display: grid;
  place-items: center;
  width: 110px;
  height: 110px;
  margin: 0 auto;
  border-radius: 999px;
  background: linear-gradient(180deg, #fde68a, #f59e0b);
  font-size: 3rem;
  box-shadow: 0 18px 32px rgba(245, 158, 11, 0.22);
}

.coin-face.flipping {
  animation: coinFlip 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.race-stage {
  display: grid;
  gap: 10px;
}

.race-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.race-track-label {
  color: var(--muted);
  font-weight: 700;
}

.race-lane {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: center;
}

.race-track {
  position: relative;
  height: 42px;
  border-radius: 999px;
  background: rgba(24, 24, 27, 0.08);
  overflow: hidden;
}

.race-stage[data-track-theme="grass"] .race-track {
  background: linear-gradient(90deg, rgba(154, 242, 195, 0.35), rgba(74, 222, 128, 0.28));
}

.race-stage[data-track-theme="beach"] .race-track {
  background: linear-gradient(90deg, rgba(253, 230, 138, 0.44), rgba(251, 191, 36, 0.24));
}

.race-stage[data-track-theme="night"] .race-track {
  background: linear-gradient(90deg, rgba(96, 165, 250, 0.28), rgba(30, 41, 59, 0.5));
}

.race-runner {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.7rem;
  transition: left 0.12s linear;
}

.race-picks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.cups-stage {
  position: relative;
  min-height: 140px;
}

.cup-button {
  position: absolute;
  top: 10px;
  width: calc(33.333% - 8px);
  min-height: 120px;
  border: none;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(143, 211, 255, 0.7), rgba(96, 165, 250, 0.8));
  font-size: 3rem;
  cursor: pointer;
  transition: left 0.36s ease, transform 0.36s ease, box-shadow 0.36s ease;
}

.cup-button.shuffling {
  transform: translateY(-10px) rotate(var(--cup-tilt, 0deg));
  box-shadow: 0 14px 28px rgba(96, 165, 250, 0.22);
}

.cup-button.reveal::after {
  content: "⭐";
  display: block;
  margin-top: 6px;
  font-size: 1.4rem;
}

.easter-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  transform: translate(-50%, 120px);
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(24, 24, 27, 0.92);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.easter-toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

.about-strip {
  margin: 22px 0 8px;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
}

.achievement-strip {
  margin-top: 20px;
  padding: 24px;
}

.achievement-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.achievement-head h2 {
  margin: 8px 0 0;
  font-size: 1.6rem;
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.achievement-card {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  opacity: 0.55;
}

.achievement-card.pop {
  animation: achievement-pop 0.8s ease;
}

.achievement-card.unlocked {
  opacity: 1;
  background: linear-gradient(145deg, rgba(255, 216, 77, 0.28), rgba(255, 255, 255, 0.92));
  box-shadow: 0 14px 28px rgba(255, 216, 77, 0.16);
}

.achievement-card.unlocked::after {
  content: "";
  position: absolute;
  inset: -30%;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.72) 48%, transparent 76%);
  transform: translateX(-120%) rotate(10deg);
  animation: achievement-shine 2.4s ease infinite;
}

.achievement-common.unlocked {
  border-color: rgba(154, 242, 195, 0.4);
}

.achievement-rare.unlocked {
  border-color: rgba(255, 151, 209, 0.42);
}

.achievement-legendary.unlocked {
  border-color: rgba(255, 216, 77, 0.56);
  box-shadow: 0 18px 42px rgba(255, 216, 77, 0.24);
}

.achievement-icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: rgba(24, 24, 27, 0.06);
  font-size: 1.25rem;
}

.achievement-tier {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(24, 24, 27, 0.06);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.achievement-title {
  position: relative;
  z-index: 1;
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 800;
}

.achievement-desc {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.victory-burst {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.victory-burst::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.14), transparent 58%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.victory-burst.show {
  opacity: 1;
}

.victory-burst.show::before {
  opacity: 1;
}

.victory-rays,
.victory-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.victory-rays {
  display: grid;
  place-items: center;
}

.victory-rays::before {
  content: "";
  width: 340px;
  height: 340px;
  border-radius: 999px;
  background:
    repeating-conic-gradient(from 0deg, rgba(255,255,255,0.22) 0deg 10deg, transparent 10deg 20deg);
  mask: radial-gradient(circle, transparent 0 34%, #000 58%, transparent 70%);
  opacity: 0;
  transform: scale(0.8) rotate(0deg);
}

.victory-burst.show .victory-rays::before {
  opacity: 0.9;
  animation: rays-spin 1.4s ease forwards;
}

.victory-particle {
  position: absolute;
  width: var(--size, 10px);
  height: var(--size, 10px);
  border-radius: 999px;
  opacity: 0;
}

.victory-burst.show .victory-particle {
  animation: particle-burst 1s ease forwards;
  animation-delay: var(--delay, 0s);
}

.victory-card {
  position: relative;
  z-index: 1;
  min-width: min(420px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(24, 24, 27, 0.95), rgba(59, 43, 95, 0.88));
  color: #fff;
  text-align: center;
  box-shadow: 0 24px 80px rgba(24, 24, 27, 0.24);
  transform: translateY(24px) scale(0.94);
  transition: transform 0.28s ease;
}

.victory-burst[data-theme="common"] .victory-card {
  background: linear-gradient(145deg, rgba(21, 41, 36, 0.95), rgba(33, 77, 88, 0.88));
}

.victory-burst[data-theme="rare"] .victory-card {
  background: linear-gradient(145deg, rgba(24, 24, 27, 0.95), rgba(59, 43, 95, 0.88));
}

.victory-burst[data-theme="legendary"] .victory-card {
  background: linear-gradient(145deg, rgba(59, 37, 8, 0.96), rgba(109, 51, 95, 0.92), rgba(26, 43, 95, 0.92));
  box-shadow: 0 28px 90px rgba(255, 216, 77, 0.26);
}

.victory-burst.show .victory-card {
  transform: translateY(0) scale(1);
}

.victory-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 216, 77, 0.18);
  color: #ffe08a;
  font-size: 0.86rem;
  font-weight: 800;
}

.victory-card strong {
  display: block;
  font-size: 1.5rem;
}

.victory-card p {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.78);
}

@keyframes achievement-shine {
  0% {
    transform: translateX(-120%) rotate(10deg);
  }
  45%,
  100% {
    transform: translateX(120%) rotate(10deg);
  }
}

@keyframes achievement-pop {
  0% {
    transform: scale(0.92);
  }
  40% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes rays-spin {
  0% {
    transform: scale(0.8) rotate(0deg);
  }
  100% {
    transform: scale(1.2) rotate(38deg);
  }
}

@keyframes particle-burst {
  0% {
    transform: translate3d(0, 0, 0) scale(0.4);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--dx), var(--dy), 0) scale(1);
    opacity: 0;
  }
}

.about-strip p {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.primary-button:hover,
.ghost-button:hover,
.action-button:hover,
.secondary-button:hover,
.sound-toggle:hover,
.shuffle-wall:hover,
.mini-chip:hover,
.choice-button:hover,
.tap-button:hover,
.move-button:hover,
.ttt-cell:hover,
.mole-hole:hover,
.feature-card:hover,
.puzzle-tile:hover,
.memory-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(24, 24, 27, 0.08);
}

@keyframes rpsShake {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(10px) rotate(-10deg);
  }
  50% {
    transform: translateY(-8px) rotate(10deg);
  }
  100% {
    transform: translateY(0) rotate(0deg);
  }
}

@keyframes reelPop {
  from {
    transform: translateY(-4px) scale(1);
  }
  to {
    transform: translateY(4px) scale(1.03);
  }
}

@keyframes diceSpin {
  0% {
    transform: rotateX(0deg) rotateY(0deg) scale(1);
  }
  50% {
    transform: rotateX(360deg) rotateY(260deg) scale(1.08);
  }
  100% {
    transform: rotateX(720deg) rotateY(540deg) scale(1);
  }
}

@keyframes wheelSpin {
  0% {
    transform: rotate(0deg) scale(1);
  }
  80% {
    transform: rotate(1260deg) scale(1.04);
  }
  100% {
    transform: rotate(1440deg) scale(1);
  }
}

@keyframes coinFlip {
  0% {
    transform: rotateY(0deg) scale(1);
  }
  50% {
    transform: rotateY(540deg) scale(1.05);
  }
  100% {
    transform: rotateY(1080deg) scale(1);
  }
}

@media (max-width: 980px) {
  .hero,
  .playground {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100vw - 16px, 1180px);
    margin: 8px auto;
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .hero-copy,
  .hero-panel,
  .panel {
    padding: 20px;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .mini-grid,
  .choice-row,
  .dir-row,
  .quiz-grid,
  .race-picks,
  .cups-stage {
    grid-template-columns: 1fr;
  }

  .rps-stage,
  .dice-stage,
  .slot-machine,
  .simon-grid,
  .game-wall,
  .achievement-grid {
    grid-template-columns: 1fr;
  }

  .guess-form {
    flex-direction: column;
  }

  .guess-form .action-button {
    width: 100%;
  }
}
