:root {
  --sky: #dff5ff;
  --sky-2: #bdeaff;
  --blue: #2aa8ff;
  --blue-dark: #1167b1;
  --pink: #ff5bbd;
  --yellow: #ffd84d;
  --green: #3bd67f;
  --ink: #12324a;
  --soft: #5b7b94;
  --panel: rgba(255, 255, 255, 0.86);
  --line: rgba(17, 103, 177, 0.22);
  --shadow: rgba(17, 103, 177, 0.18);
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--sky);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Trebuchet MS", "Aptos Display", Verdana, sans-serif;
  background:
    linear-gradient(90deg, rgba(255,255,255,.28) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.28) 1px, transparent 1px),
    radial-gradient(circle at 20% 12%, rgba(255, 91, 189, .24), transparent 21rem),
    radial-gradient(circle at 82% 20%, rgba(255, 216, 77, .32), transparent 19rem),
    linear-gradient(135deg, #dff5ff, #bdeaff 48%, #effaff);
  background-size: 42px 42px, 42px 42px, auto, auto, auto;
  overflow-x: hidden;
}

#numberSky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.cursor-cloud {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.cursor-number {
  position: fixed;
  z-index: 4;
  pointer-events: none;
  color: var(--pink);
  font-size: 30px;
  font-weight: 900;
  text-shadow: 2px 2px 0 #fff, 0 0 18px rgba(42,168,255,.75);
  animation: floatAway .9s ease-out forwards;
}

.hero,
.layout {
  position: relative;
  z-index: 2;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  padding: 28px;
}

.hero-copy {
  flex: 1 1 auto;
}

.hero-tools {
  display: grid;
  grid-template-columns: 150px 176px;
  gap: 14px;
  align-items: stretch;
}

.logo {
  width: 88px;
  height: 88px;
  image-rendering: pixelated;
  filter: drop-shadow(0 18px 24px rgba(17,103,177,.22));
}

.eyebrow {
  margin: 10px 0 4px;
  color: var(--blue-dark);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.breathing-title {
  margin: 0;
  max-width: 980px;
  font-size: clamp(50px, 10vw, 132px);
  line-height: .88;
  letter-spacing: 0;
  color: #075a9e;
  text-shadow:
    4px 4px 0 #ffffff,
    8px 8px 0 rgba(255,91,189,.28),
    0 0 22px rgba(42,168,255,.65);
  animation: titleBreath 2.2s ease-in-out infinite;
  transform-origin: left center;
}

.nameplate {
  display: inline-block;
  margin: 12px 0 0;
  padding: 8px 12px;
  border: 3px solid #0d5c9d;
  border-radius: 9px;
  background: linear-gradient(180deg, #ffffff, #ccefff);
  color: #b81372;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 5px 5px 0 rgba(17,103,177,.18);
}

.tagline {
  max-width: 740px;
  margin: 14px 0 0;
  color: var(--soft);
  font-size: 20px;
  font-weight: 800;
}

.score-card,
.qr-card,
.panel {
  border: 3px solid var(--line);
  background: var(--panel);
  box-shadow: 0 18px 44px var(--shadow), inset 0 0 0 3px rgba(255,255,255,.55);
  backdrop-filter: blur(14px);
}

.score-card {
  min-width: 150px;
  padding: 14px;
  border-radius: 8px;
  text-align: center;
}

.score-card span {
  display: block;
  color: var(--soft);
  font-weight: 900;
}

.score-card strong {
  display: block;
  font-size: 48px;
  color: var(--pink);
  line-height: 1;
}

.qr-card {
  padding: 12px;
  border-radius: 8px;
  text-align: center;
}

.qr-card span,
.qr-card a {
  display: block;
  color: var(--blue-dark);
  font-weight: 900;
}

.qr-card img {
  width: 132px;
  height: 132px;
  margin: 8px auto;
  display: block;
  border: 4px solid #0d5c9d;
  border-radius: 8px;
  background: #fff;
  image-rendering: pixelated;
  box-shadow: 5px 5px 0 rgba(255,91,189,.22);
}

.layout {
  display: grid;
  grid-template-columns: minmax(300px, 430px) 1fr;
  gap: 18px;
  padding: 0 28px 28px;
}

.panel {
  border-radius: 10px;
  padding: 18px;
}

h2 {
  margin: 0 0 14px;
  font-size: 28px;
  color: var(--blue-dark);
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.panel-title-row h2 {
  margin-bottom: 0;
}

.helper-text {
  margin: 10px 0 12px;
  color: var(--soft);
  font-weight: 900;
}

button {
  border: 3px solid #0d5c9d;
  border-radius: 8px;
  background: linear-gradient(180deg, #6dccff, #2aa8ff);
  color: #06253d;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 6px 0 #0d5c9d;
  transition: transform .08s ease, box-shadow .08s ease, filter .12s ease;
}

button:hover,
button:focus-visible {
  filter: brightness(1.08);
}

button:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #0d5c9d;
}

.talk-toggle {
  min-width: 108px;
  padding: 8px 10px;
  background: linear-gradient(180deg, #ff9bd8, #ff5bbd);
  border-color: #b81372;
  color: #fff;
  box-shadow: 0 6px 0 #b81372;
}

.calc-display {
  display: block;
  min-height: 76px;
  padding: 14px;
  border: 4px solid var(--blue-dark);
  border-radius: 8px;
  background: #f7fcff;
  color: var(--pink);
  font-size: 44px;
  font-weight: 900;
  text-align: right;
  overflow-x: auto;
  box-shadow: inset 0 0 0 4px #dff5ff;
}

.calc-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.calc-actions button {
  min-height: 48px;
  background: linear-gradient(180deg, #ffffff, #ccefff);
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.calc-grid button {
  min-height: 62px;
  font-size: 28px;
}

.games-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.game-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 10px;
}

.game-tabs button {
  flex: 0 0 auto;
  padding: 10px 12px;
  background: linear-gradient(180deg, #ffffff, #ccefff);
}

.game-tabs button.active {
  background: linear-gradient(180deg, #ff9bd8, #ff5bbd);
  color: #fff;
  border-color: #b81372;
  box-shadow: 0 6px 0 #b81372;
}

.game-stage {
  min-height: 360px;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 4px dashed rgba(17,103,177,.28);
  border-radius: 10px;
  background: rgba(255,255,255,.54);
}

.game-card {
  width: min(720px, 100%);
  display: grid;
  gap: 14px;
  text-align: center;
}

.prompt {
  font-size: clamp(28px, 5vw, 56px);
  font-weight: 900;
  color: var(--blue-dark);
}

.choices,
.blocks,
.memory-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.choices button,
.number-pop {
  min-width: 84px;
  min-height: 70px;
  padding: 10px 16px;
  font-size: 34px;
}

.number-pop {
  animation: blink 1.1s infinite alternate;
}

.block {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 4px solid #0d5c9d;
  border-radius: 7px;
  background: linear-gradient(135deg, #6dccff, #2aa8ff);
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 5px 5px 0 rgba(17,103,177,.3);
}

.memory-grid {
  max-width: 520px;
  margin: 0 auto;
}

.memory-card {
  width: 86px;
  height: 78px;
  font-size: 30px;
}

.feedback {
  min-height: 34px;
  margin: 12px 0 0;
  color: var(--blue-dark);
  font-size: 22px;
  font-weight: 900;
  text-align: center;
}

.good-pop {
  animation: goodPop .38s ease both;
}

@keyframes blink {
  from { filter: brightness(1); transform: translateY(0); }
  to { filter: brightness(1.18); transform: translateY(-5px); }
}

@keyframes floatAway {
  to {
    opacity: 0;
    transform: translate(var(--dx), -80px) scale(.65) rotate(14deg);
  }
}

@keyframes goodPop {
  50% { transform: scale(1.08); }
}

@keyframes titleBreath {
  0%, 100% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.035);
    filter: brightness(1.16);
    text-shadow:
      4px 4px 0 #ffffff,
      10px 10px 0 rgba(255,91,189,.36),
      0 0 34px rgba(42,168,255,.95);
  }
}

@media (max-width: 920px) {
  .hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-tools {
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .hero,
  .layout {
    padding-left: 14px;
    padding-right: 14px;
  }

  .calc-grid button,
  .choices button,
  .number-pop {
    min-width: 68px;
    font-size: 25px;
  }

  .hero-tools {
    grid-template-columns: 1fr;
  }
}
