:root {
  color-scheme: dark;
  font-family:
    Inter, ui-rounded, "Arial Rounded MT Bold", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #050b2a;
  color: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  position: fixed;
  inset: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 205, 255, 0.17), transparent 34rem),
    linear-gradient(180deg, #05051d 0%, #071042 52%, #050617 100%);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  color: inherit;
}

.app-shell {
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.app-shell.is-system-paused::after {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  content: "PAUSED";
  color: #ffffff;
  font-size: clamp(2rem, 10vw, 5rem);
  font-weight: 1000;
  letter-spacing: 0;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 0 30px rgba(98, 206, 255, 0.45);
  background: rgba(3, 10, 35, 0.56);
  backdrop-filter: blur(3px);
}

.app-shell.is-system-paused::after {
  pointer-events: all;
}

.pause-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  width: 100%;
  height: 100%;
  height: 100dvh;
  padding:
    max(10px, env(safe-area-inset-top))
    clamp(14px, 4vw, 40px)
    max(10px, env(safe-area-inset-bottom));
  place-items: center;
  background: rgba(3, 10, 35, 0.64);
  backdrop-filter: blur(4px);
}

.pause-panel {
  display: grid;
  width: min(100%, 360px);
  max-width: calc(100vw - 28px);
  gap: clamp(16px, 3.6vmin, 26px);
  justify-items: center;
  padding: clamp(22px, 5vmin, 38px);
  border: 2px solid rgba(132, 190, 238, 0.55);
  border-radius: clamp(18px, 4vmin, 28px);
  text-align: center;
  background: rgba(16, 39, 69, 0.72);
  box-shadow:
    inset 0 0 28px rgba(255, 255, 255, 0.05),
    0 22px 46px rgba(0, 0, 0, 0.32);
}

.pause-panel strong {
  max-width: 100%;
  color: #ffffff;
  font-size: clamp(2rem, 8vmin, 3.4rem);
  font-weight: 1000;
  line-height: 1;
  text-transform: uppercase;
  text-shadow:
    0 5px 0 rgba(0, 0, 0, 0.38),
    0 0 26px rgba(98, 206, 255, 0.42);
}

.exit-panel {
  width: min(100%, 400px);
  gap: clamp(12px, 3vmin, 20px);
}

.exit-panel p {
  margin: 0;
  color: #c9d7eb;
  font-size: clamp(0.95rem, 2.6vmin, 1.15rem);
  font-weight: 800;
  line-height: 1.35;
}

.exit-actions {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 2.4vmin, 14px);
}

.exit-actions .primary-action,
.exit-actions .secondary-action {
  min-height: clamp(48px, 8vmin, 58px);
  border-radius: clamp(12px, 2.6vmin, 18px);
  font-size: clamp(1.05rem, 3.2vmin, 1.35rem);
  line-height: 1;
}

.danger-action {
  background: linear-gradient(145deg, #ff6868, #c43d42);
  box-shadow:
    inset 0 0 18px rgba(255, 255, 255, 0.12),
    0 12px 24px rgba(122, 15, 30, 0.28);
}

.help-panel {
  width: min(100%, 430px);
  max-height: min(82dvh, 560px);
  align-content: start;
  gap: clamp(10px, 2.5vmin, 18px);
  overflow: hidden;
}

.help-badge {
  display: grid;
  width: clamp(46px, 11vmin, 62px);
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid rgba(139, 223, 255, 0.94);
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(145deg, #64b9ff, #2c75b8);
  box-shadow:
    inset 0 0 18px rgba(255, 255, 255, 0.14),
    0 0 24px rgba(92, 191, 255, 0.3);
  font-size: clamp(1.45rem, 4.6vmin, 2.1rem);
  font-weight: 1000;
  line-height: 1;
}

.help-panel strong {
  font-size: clamp(1.45rem, 5.5vmin, 2.5rem);
}

.help-panel ul {
  display: grid;
  width: 100%;
  max-height: 34dvh;
  margin: 0;
  padding: 0;
  gap: clamp(8px, 2vmin, 12px);
  overflow: hidden;
  list-style: none;
}

.help-panel li {
  position: relative;
  padding: clamp(9px, 2vmin, 12px) clamp(10px, 2.4vmin, 14px) clamp(9px, 2vmin, 12px) clamp(30px, 7vmin, 42px);
  border: 1px solid rgba(148, 202, 255, 0.28);
  border-radius: clamp(10px, 2.4vmin, 14px);
  color: #dceaff;
  background: rgba(7, 18, 46, 0.34);
  font-size: clamp(0.82rem, 2.45vmin, 1.02rem);
  font-weight: 800;
  line-height: 1.32;
  text-align: left;
}

.help-panel li::before {
  position: absolute;
  top: 50%;
  left: clamp(10px, 2.5vmin, 14px);
  width: clamp(8px, 2.2vmin, 11px);
  aspect-ratio: 1;
  content: "";
  border-radius: 50%;
  background: #66e6ff;
  box-shadow: 0 0 10px rgba(102, 230, 255, 0.55);
  transform: translateY(-50%);
}

.help-panel .primary-action {
  width: 100%;
  min-height: clamp(48px, 8vmin, 58px);
  border-radius: clamp(12px, 2.6vmin, 18px);
  font-size: clamp(1.05rem, 3.2vmin, 1.35rem);
}

.round-icon.pause-play-icon {
  width: clamp(66px, 20vmin, 96px);
  border-color: rgba(139, 223, 255, 0.94);
  background: linear-gradient(145deg, #64b9ff, #2c75b8);
  box-shadow:
    inset 0 0 24px rgba(255, 255, 255, 0.16),
    0 12px 26px rgba(0, 0, 0, 0.28),
    0 0 28px rgba(92, 191, 255, 0.34);
}

.pause-play-icon span {
  position: relative;
  font-size: 0;
  line-height: 0;
}

.pause-play-icon span::before {
  position: absolute;
  top: 50%;
  left: 53%;
  width: 0;
  height: 0;
  content: "";
  border-top: clamp(12px, 3.8vmin, 18px) solid transparent;
  border-bottom: clamp(12px, 3.8vmin, 18px) solid transparent;
  border-left: clamp(18px, 5.8vmin, 28px) solid #ffffff;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.22));
  transform: translate(-45%, -50%);
}

.home-screen,
.play-screen,
.loading-screen {
  position: relative;
  width: min(100%, 980px);
  height: 100%;
  margin: 0 auto;
  padding:
    max(10px, env(safe-area-inset-top))
    clamp(10px, 2.7vw, 30px)
    max(10px, env(safe-area-inset-bottom));
  overflow: hidden;
  touch-action: manipulation;
}

.home-screen::before,
.play-screen::before,
.loading-screen::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  content: "";
  background-image:
    linear-gradient(rgba(60, 145, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(60, 145, 255, 0.08) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at center, #000 0%, transparent 76%);
}

.home-screen::after,
.play-screen::after,
.loading-screen::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "2 + % 7 - × = 4 9 + < > ÷";
  color: rgba(92, 169, 255, 0.09);
  font-size: clamp(60px, 10vw, 118px);
  font-weight: 900;
  line-height: 1.9;
  word-spacing: 1.1rem;
  transform: rotate(-9deg) scale(1.15);
}

.loading-screen {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  text-align: center;
}

.home-screen {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.play-screen {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.loading-screen h1,
.brand-copy h1 {
  margin: 0;
  color: #f7fbff;
  font-size: clamp(2.15rem, 7.4vmin, 5.8rem);
  font-style: italic;
  font-weight: 1000;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow:
    0 4px 0 #3158b8,
    0 9px 24px rgba(0, 0, 0, 0.45);
}

.loading-screen h1 strong,
.brand-copy h1 strong {
  color: #ffd51e;
  text-shadow:
    0 3px 0 #9e291c,
    0 0 20px rgba(255, 213, 30, 0.38);
}

.loading-screen p,
.brand-copy p {
  margin: -4px 0 0;
  color: #18e8f4;
  font-size: clamp(0.95rem, 3.2vmin, 2.1rem);
  font-style: italic;
  font-weight: 900;
}

.loading-screen h1 {
  font-size: clamp(2.7rem, 10vmin, 6.8rem);
}

.loading-screen p {
  font-size: clamp(1.2rem, 4.4vmin, 2.4rem);
}

.loading-bar {
  width: min(72vw, 430px);
  height: 18px;
  padding: 3px;
  border: 2px solid rgba(40, 187, 255, 0.78);
  border-radius: 999px;
  background: rgba(2, 12, 51, 0.72);
  box-shadow: 0 0 30px rgba(0, 178, 255, 0.35);
}

.loading-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #19f3ff, #6df14f, #ffd51e);
  animation: load-progress 1s linear forwards;
}

@keyframes load-progress {
  0% {
    width: 0;
  }

  100% {
    width: 100%;
  }
}

.brand-header {
  display: grid;
  justify-content: center;
  min-height: 0;
  padding-top: clamp(2px, 1.2dvh, 16px);
}

.logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 4vw, 30px);
}

.logo-mark {
  position: relative;
  width: clamp(54px, 11vmin, 132px);
  aspect-ratio: 1.08;
  filter: drop-shadow(0 0 22px rgba(20, 190, 255, 0.5));
}

.logo-mark.is-loading {
  width: clamp(130px, 34vw, 220px);
  animation: pulse-logo 1.2s ease-in-out infinite alternate;
}

@keyframes pulse-logo {
  to {
    transform: scale(1.05);
  }
}

.brain {
  position: absolute;
  top: 17%;
  width: 54%;
  height: 66%;
  border: 4px solid rgba(0, 0, 0, 0.58);
  box-shadow: inset 0 0 22px rgba(255, 255, 255, 0.25);
}

.brain::before,
.brain::after {
  position: absolute;
  content: "";
  border: 4px solid currentColor;
  border-radius: 50%;
}

.brain::before {
  width: 44%;
  height: 44%;
  top: 12%;
  left: 18%;
}

.brain::after {
  width: 34%;
  height: 34%;
  right: 15%;
  bottom: 14%;
}

.brain-left {
  left: 6%;
  color: #23d9ff;
  border-color: #23d9ff;
  border-radius: 46% 36% 42% 48%;
  background: linear-gradient(145deg, #2fedff, #166aff);
}

.brain-right {
  right: 6%;
  color: #ae41ff;
  border-color: #ae41ff;
  border-radius: 36% 46% 48% 42%;
  background: linear-gradient(145deg, #d949ff, #7022e8);
}

.bolt {
  position: absolute;
  z-index: 2;
  left: 42%;
  top: 3%;
  display: grid;
  place-items: center;
  width: 34%;
  height: 96%;
  clip-path: polygon(28% 0, 100% 0, 62% 39%, 92% 39%, 10% 100%, 36% 51%, 8% 51%);
  color: transparent;
  background: linear-gradient(180deg, #fff45f, #ffb000 52%, #ff6f00);
  filter: drop-shadow(0 4px 0 rgba(90, 0, 120, 0.9));
}

.choose-band {
  display: grid;
  grid-template-columns: 1fr 18px auto 18px 1fr;
  align-items: center;
  gap: clamp(12px, 2.6vw, 24px);
  margin: clamp(8px, 2.2dvh, 24px) 0 clamp(8px, 1.8dvh, 18px);
}

.choose-band h2 {
  margin: 0;
  font-size: clamp(1rem, 3.6vmin, 2.25rem);
  font-weight: 1000;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
}

.choose-band span {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #2dbdff);
}

.choose-band span:last-child {
  background: linear-gradient(90deg, #2dbdff, transparent);
}

.choose-band i {
  width: 14px;
  aspect-ratio: 1;
  background: linear-gradient(135deg, #16e4ff, #126dff);
  transform: rotate(45deg);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(5, minmax(0, 1fr));
  min-height: 0;
  gap: clamp(7px, 1.7vmin, 20px);
  padding-bottom: 0;
}

.game-card {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  padding: clamp(7px, 1.5vmin, 16px) clamp(5px, 1.4vmin, 14px) clamp(8px, 1.6vmin, 18px);
  overflow: hidden;
  border: clamp(2px, 0.55vmin, 4px) solid var(--edge);
  border-radius: clamp(12px, 2.6vmin, 24px);
  place-items: center;
  cursor: pointer;
  background:
    radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--glow) 45%, transparent), transparent 42%),
    linear-gradient(160deg, color-mix(in srgb, var(--base) 85%, #ffffff 8%), color-mix(in srgb, var(--base) 78%, #000 28%));
  box-shadow:
    inset 0 0 22px rgba(255, 255, 255, 0.12),
    inset 0 clamp(-8px, -1vmin, -4px) 0 rgba(0, 0, 0, 0.19),
    0 clamp(4px, 1vmin, 8px) 0 rgba(0, 0, 0, 0.28),
    0 18px 28px rgba(0, 0, 0, 0.35);
  transition:
    transform 150ms ease,
    filter 150ms ease;
}

.game-card:hover,
.game-card:focus-visible {
  transform: translateY(-5px);
  filter: brightness(1.14);
  outline: none;
}

.game-card:active {
  transform: translateY(3px);
}

.card-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image:
    radial-gradient(circle at 20% 22%, transparent 0 12px, rgba(255, 255, 255, 0.8) 13px, transparent 14px),
    repeating-linear-gradient(45deg, transparent 0 36px, rgba(255, 255, 255, 0.34) 37px 40px, transparent 41px 76px);
}

.card-icon {
  position: relative;
  display: grid;
  width: 100%;
  height: clamp(48px, 15vw, 76px);
  align-self: center;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: visible;
  color: #ffffff;
  font-size: clamp(1.35rem, 6.8vmin, 4.6rem);
  font-weight: 1000;
  line-height: 1;
  text-align: center;
  text-shadow:
    0 4px 0 rgba(0, 0, 0, 0.35),
    0 0 18px var(--glow);
}

.home-icon {
  width: min(100%, 170px);
  align-self: center;
  justify-self: center;
}

.timer-face {
  position: relative;
  display: grid;
  width: clamp(44px, 13vw, 62px);
  aspect-ratio: 1;
  border: clamp(3px, 0.8vmin, 6px) solid #9ce4ff;
  border-radius: 50%;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #ffffff, #6fc6ff 48%, #1162c8 100%);
  box-shadow: 0 0 18px rgba(31, 185, 255, 0.5);
}

.timer-face::before {
  position: absolute;
  top: -18%;
  width: 32%;
  height: 14%;
  border-radius: 6px;
  content: "";
  background: #9ce4ff;
}

.timer-face i,
.timer-face b {
  position: absolute;
  bottom: 50%;
  left: 50%;
  display: block;
  width: 6%;
  border-radius: 999px;
  background: #0a2a65;
  transform-origin: bottom center;
  content: "";
}

.timer-face i {
  height: 30%;
  transform: translateX(-50%) rotate(0deg);
}

.timer-face b {
  height: 38%;
  transform: translateX(-50%) rotate(48deg);
}

.speed-lines {
  position: absolute;
  left: 7%;
  display: grid;
  gap: 7px;
}

.speed-lines em {
  display: block;
  width: clamp(20px, 5vmin, 44px);
  height: 5px;
  border-radius: 999px;
  background: #22e1f3;
  box-shadow: 0 0 10px rgba(34, 225, 243, 0.65);
}

.match-tile,
.mini-key,
.seq-dot,
.unknown-token,
.puzzle-piece {
  display: grid;
  place-items: center;
  border-radius: clamp(8px, 2vmin, 14px);
  box-shadow:
    inset 0 0 12px rgba(255, 255, 255, 0.2),
    0 5px 0 rgba(0, 0, 0, 0.25);
}

.home-icon-number-match {
  display: flex;
  align-items: center;
  justify-content: center;
}

.match-tile {
  width: clamp(34px, 9.2vw, 54px);
  aspect-ratio: 0.86;
  font-size: clamp(1.45rem, 4.8vw, 2.45rem);
}

.orange-tile {
  background: linear-gradient(145deg, #ffbd2f, #f36a14);
  transform: rotate(-10deg);
}

.green-tile {
  background: linear-gradient(145deg, #a2ec33, #36a520);
  transform: rotate(10deg);
}

.match-link {
  position: relative;
  width: clamp(18px, 4.6vw, 32px);
  height: clamp(4px, 1.1vw, 6px);
  border-radius: 999px;
  background: #fff46a;
  box-shadow: 0 0 12px rgba(255, 244, 106, 0.7);
}

.match-link::before,
.match-link::after {
  position: absolute;
  top: 50%;
  width: 12px;
  aspect-ratio: 1;
  border-radius: 50%;
  content: "";
  background: #fff46a;
  transform: translateY(-50%);
}

.match-link::before {
  left: -4px;
}

.match-link::after {
  right: -4px;
}

.home-icon-missing-sign,
.home-icon-sequence,
.home-icon-true-false,
.home-icon-compare,
.home-icon-plus-minus,
.home-icon-find-answer,
.home-icon-math-puzzle,
.home-icon-target-sum {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(5px, 1.5vmin, 10px);
}

.home-icon-sequence {
  display: grid;
  grid-template-columns: 1fr 0.55fr 1fr 0.55fr 1fr;
  width: min(100%, 150px);
  align-items: center;
  justify-items: center;
  gap: clamp(2px, 0.7vmin, 8px);
}

.mini-key {
  min-width: clamp(30px, 8.4vw, 50px);
  min-height: clamp(30px, 8.4vw, 50px);
  padding: 0 clamp(4px, 1vw, 6px);
  background: linear-gradient(145deg, #cf63ff, #6f28cc);
  font-size: clamp(1.25rem, 4.6vw, 2.25rem);
}

.mystery-box {
  display: grid;
  min-width: clamp(32px, 8.8vw, 52px);
  min-height: clamp(34px, 9.4vw, 56px);
  border: clamp(3px, 0.85vw, 4px) dashed #ff79e8;
  border-radius: clamp(10px, 2.4vw, 14px);
  place-items: center;
  color: #ffffff;
  font-size: clamp(1.35rem, 5vw, 2.5rem);
  text-shadow: 0 0 12px rgba(255, 121, 232, 0.7);
}

.seq-dot {
  width: clamp(26px, 7.6vw, 42px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffbd2f, #ef4e16);
  font-size: clamp(1rem, 4.1vw, 1.85rem);
  flex: 0 0 auto;
}

.seq-dot.hot {
  border: 3px solid #fff2b0;
  background: linear-gradient(145deg, #ff7a29, #b52f0a);
  box-shadow: 0 0 16px rgba(255, 180, 48, 0.65);
}

.seq-arrow {
  color: #fff2b0;
  font-size: clamp(0.9rem, 3vw, 1.45rem);
  line-height: 1;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.32), 0 0 10px rgba(255, 220, 95, 0.55);
}

.home-sudoku-grid,
.home-2048-grid,
.home-magic-grid,
.home-caro-grid {
  display: grid;
  width: clamp(62px, 18vw, 82px);
  aspect-ratio: 1;
  gap: clamp(2px, 0.9vw, 4px);
  padding: clamp(3px, 1vw, 5px);
  border: clamp(2px, 0.8vw, 3px) solid rgba(156, 228, 255, 0.85);
  border-radius: clamp(10px, 2.6vw, 13px);
  background: rgba(0, 0, 0, 0.2);
  box-shadow: 0 0 15px rgba(34, 225, 243, 0.24);
}

.home-sudoku-grid {
  grid-template-columns: repeat(3, 1fr);
}

.home-2048-grid {
  grid-template-columns: repeat(2, 1fr);
}

.home-magic-grid,
.home-caro-grid {
  grid-template-columns: repeat(3, 1fr);
}

.home-sudoku-grid i,
.home-2048-grid i,
.home-magic-grid i,
.home-caro-grid i {
  display: grid;
  border-radius: clamp(4px, 1.3vw, 7px);
  place-items: center;
  background: rgba(255, 255, 255, 0.13);
  font-size: clamp(0.75rem, 3.1vw, 1.2rem);
  font-style: normal;
  font-weight: 1000;
}

.home-caro-grid i {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.09);
}

.home-caro-grid i:not(:empty):nth-child(odd) {
  color: #88eaff;
}

.home-caro-grid i:not(:empty):nth-child(even) {
  color: #ffdf6b;
}

.home-2048-grid i:nth-child(1) {
  background: linear-gradient(145deg, #62c4ff, #236fbd);
}

.home-2048-grid i:nth-child(2) {
  background: linear-gradient(145deg, #a3eb38, #3d9d1f);
}

.home-2048-grid i:nth-child(3) {
  background: linear-gradient(145deg, #ffbd2f, #ef6416);
}

.home-2048-grid i:nth-child(4) {
  background: linear-gradient(145deg, #c35cff, #7020d8);
}

.answer-badge {
  display: grid;
  width: clamp(34px, 9.8vw, 46px);
  aspect-ratio: 1;
  border-radius: 50%;
  place-items: center;
  box-shadow:
    inset 0 0 13px rgba(255, 255, 255, 0.22),
    0 6px 0 rgba(0, 0, 0, 0.28);
  font-size: clamp(1.3rem, 4.35vw, 2.05rem);
}

.answer-badge.yes {
  background: linear-gradient(145deg, #78e552, #219d28);
}

.answer-badge.no {
  background: linear-gradient(145deg, #ff6b50, #d42b19);
}

.compare-symbol {
  color: #7fecff;
  font-size: clamp(2rem, 7.4vw, 3.45rem);
  text-shadow:
    0 3px 0 rgba(0, 0, 0, 0.35),
    0 0 14px rgba(127, 236, 255, 0.65);
}

.formula-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(2px, 1vw, 6px);
  font-size: clamp(1.4rem, 4.8vw, 2.35rem);
}

.home-icon-formula,
.home-icon-math-puzzle {
  width: min(100%, 220px);
}

.formula-icon i {
  font-style: normal;
}

.formula-icon b,
.formula-plus {
  color: #f4d8ff;
}

.stacked-signs {
  display: grid;
  justify-items: center;
  color: #ffffff;
  font-size: clamp(1.55rem, 5.8vw, 2.8rem);
}

.stacked-signs i {
  font-style: normal;
}

.stacked-signs b {
  width: clamp(48px, 13.5vw, 74px);
  height: clamp(4px, 1vw, 5px);
  border-radius: 999px;
  background: #b855ff;
  box-shadow: 0 0 12px rgba(184, 85, 255, 0.65);
}

.xy-mark {
  color: #d5e9ff;
  font-size: clamp(1.08rem, 4vw, 1.95rem);
}

.unknown-token {
  width: clamp(38px, 10.6vw, 58px);
  aspect-ratio: 1;
  background: linear-gradient(145deg, #ffffff, #e34a28);
  color: #ffffff;
  font-size: clamp(1.45rem, 5.3vw, 2.5rem);
}

.formula-plus {
  font-size: clamp(1.65rem, 5.5vw, 2.7rem);
}

.puzzle-piece {
  position: relative;
  width: clamp(38px, 10.5vw, 58px);
  aspect-ratio: 1;
  border-radius: 10px;
  background: linear-gradient(145deg, #ffe35c, #f3ab1c);
  color: #07354a;
  font-size: clamp(1.25rem, 4.8vw, 2.25rem);
}

.puzzle-piece::before {
  position: absolute;
  top: -16%;
  width: 28%;
  aspect-ratio: 1;
  border-radius: 50%;
  content: "";
  background: #ffe35c;
}

.puzzle-equation {
  font-size: clamp(1.1rem, 4.2vw, 2rem);
  white-space: nowrap;
}

.target-bubble {
  display: grid;
  min-width: clamp(36px, 9.5vmin, 62px);
  aspect-ratio: 1;
  border-radius: 50%;
  place-items: center;
  background: linear-gradient(145deg, #96ed48, #28a83a);
  box-shadow:
    inset 0 0 12px rgba(255, 255, 255, 0.22),
    0 5px 0 rgba(0, 0, 0, 0.25);
  font-size: clamp(1.2rem, 5vmin, 2.5rem);
}

.target-plus,
.target-equals {
  color: #eaffc6;
  font-size: clamp(1.15rem, 4.4vw, 2rem);
  white-space: nowrap;
}

.sigma-mark {
  display: grid;
  width: clamp(42px, 12vw, 62px);
  aspect-ratio: 1;
  border-radius: clamp(10px, 2.4vmin, 18px);
  place-items: center;
  background: linear-gradient(145deg, #96ed48, #28a83a);
  box-shadow:
    inset 0 0 12px rgba(255, 255, 255, 0.22),
    0 5px 0 rgba(0, 0, 0, 0.25);
  font-size: clamp(1.45rem, 5.4vw, 2.55rem);
}

.game-card strong {
  position: relative;
  align-self: end;
  max-width: 100%;
  min-width: 0;
  font-size: clamp(0.66rem, 2.45vmin, 1.75rem);
  font-weight: 1000;
  letter-spacing: 0;
  line-height: 1.05;
  overflow-wrap: anywhere;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.38);
}

.blue {
  --base: #064ac2;
  --edge: #1fb9ff;
  --glow: #20d8ff;
}

.green {
  --base: #087a25;
  --edge: #63f042;
  --glow: #8bff44;
}

.purple {
  --base: #52209f;
  --edge: #bc4dff;
  --glow: #e55cff;
}

.orange {
  --base: #bd2f06;
  --edge: #ff9b1a;
  --glow: #ffea45;
}

.teal {
  --base: #087486;
  --edge: #22e1f3;
  --glow: #42fff5;
}

.simple-play {
  width: min(100%, 760px);
  grid-template-rows: auto auto auto minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(12px, 2.2dvh, 26px);
  padding:
    max(18px, env(safe-area-inset-top))
    clamp(16px, 4.2vw, 38px)
    max(18px, env(safe-area-inset-bottom));
}

.simple-play::after,
.game-over-screen::after {
  opacity: 0.24;
}

.simple-header {
  --header-icon-size: clamp(40px, 6.8vmin, 50px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(8px, 2.2vw, 14px);
  min-height: clamp(44px, 8vmin, 58px);
}

.simple-header h1 {
  grid-column: 1 / -1;
  grid-row: 1;
  justify-self: center;
  margin: 0;
  min-width: 0;
  max-width: calc(100% - clamp(184px, 54vmin, 244px));
  font-size: clamp(1.18rem, 4.4vmin, 2.4rem);
  font-weight: 1000;
  letter-spacing: 0;
  line-height: 0.92;
  text-align: center;
  text-wrap: balance;
  text-transform: uppercase;
  white-space: normal;
  pointer-events: none;
  text-shadow:
    0 3px 0 rgba(0, 0, 0, 0.45),
    0 0 18px rgba(255, 255, 255, 0.16);
}

.simple-header > .round-icon,
.simple-header > span,
.header-leading,
.header-actions {
  grid-row: 1;
  z-index: 2;
}

.simple-header > .back-icon,
.header-leading {
  grid-column: 1;
  justify-self: start;
}

.simple-header > span,
.header-actions {
  grid-column: 3;
  justify-self: end;
}

.header-leading,
.header-actions {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.45vmin, 10px);
}

.round-icon {
  position: relative;
  display: grid;
  width: var(--header-icon-size, clamp(34px, 6.8vmin, 46px));
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border: 2px solid rgba(160, 216, 255, 0.94);
  border-radius: 50%;
  place-items: center;
  cursor: pointer;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.12), transparent 30%),
    linear-gradient(145deg, rgba(30, 61, 100, 0.88), rgba(8, 22, 48, 0.82));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 -8px 16px rgba(0, 0, 0, 0.24),
    0 8px 18px rgba(0, 0, 0, 0.24),
    0 0 14px rgba(98, 190, 255, 0.18);
  color: #ffffff;
  font-size: clamp(1.45rem, 4.6vmin, 2rem);
  font-weight: 1000;
  line-height: 1;
  transition:
    border-color 160ms ease,
    filter 160ms ease,
    transform 120ms ease;
}

.round-icon::before {
  position: absolute;
  inset: 14%;
  content: "";
  border-radius: inherit;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  pointer-events: none;
}

.round-icon:active {
  filter: brightness(1.12);
  transform: translateY(2px) scale(0.97);
}

.round-icon span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  line-height: 0;
}

.back-icon span {
  width: 58%;
  height: clamp(3px, 0.36vmax, 3.5px);
  border-radius: 999px;
  background: currentcolor;
  font-size: 0;
  line-height: 0;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.24));
  transform: none;
}

.back-icon span::before,
.back-icon span::after {
  position: absolute;
  top: 50%;
  left: 0;
  display: block;
  content: "";
  background: currentcolor;
  border-radius: 999px;
  transform-origin: left center;
}

.back-icon span::before {
  width: 46%;
  height: 100%;
  transform: translateY(-50%) rotate(45deg);
}

.back-icon span::after {
  width: 46%;
  height: 100%;
  transform: translateY(-50%) rotate(-45deg);
}

.pause-icon span {
  font-size: 0;
  line-height: 0;
  transform: none;
}

.pause-icon span::before,
.pause-icon span::after {
  position: absolute;
  top: 50%;
  width: clamp(3px, 0.62vmin, 4.5px);
  height: clamp(16px, 3.35vmin, 22px);
  content: "";
  border-radius: 3px;
  background: currentcolor;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.24);
  transform: translate(-50%, -50%);
}

.pause-icon span::before {
  left: 36%;
}

.pause-icon span::after {
  left: 64%;
}

.restart-icon span {
  transform: translateY(-1px);
}

.help-icon span {
  font-size: clamp(1.15rem, 3.8vmin, 1.72rem);
  line-height: 1;
  transform: translateY(-1px);
}

.sound-icon span {
  position: relative;
  width: 62%;
  height: 62%;
  font-size: 0;
  line-height: 0;
}

.sound-icon span::before {
  position: absolute;
  top: 50%;
  left: 10%;
  width: 54%;
  height: 56%;
  content: "";
  background: currentcolor;
  clip-path: polygon(0 30%, 34% 30%, 72% 4%, 72% 96%, 34% 70%, 0 70%);
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.24));
  transform: translateY(-50%);
}

.sound-icon i,
.sound-icon b {
  position: absolute;
  display: block;
  pointer-events: none;
}

.sound-icon i {
  top: 50%;
  left: 54%;
  width: 30%;
  height: 46%;
  border: clamp(2px, 0.42vmin, 3px) solid currentcolor;
  border-left: 0;
  border-radius: 0 999px 999px 0;
  transform: translateY(-50%);
}

.sound-icon i::after {
  position: absolute;
  top: 50%;
  left: 42%;
  width: 62%;
  height: 76%;
  content: "";
  border: clamp(2px, 0.36vmin, 3px) solid currentcolor;
  border-left: 0;
  border-radius: 0 999px 999px 0;
  opacity: 0.72;
  transform: translateY(-50%);
}

.sound-icon b {
  top: 50%;
  left: 50%;
  width: 82%;
  height: clamp(3px, 0.5vmin, 4px);
  border-radius: 999px;
  background: #ff6f72;
  box-shadow: 0 0 8px rgba(255, 111, 114, 0.5);
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-45deg);
}

.sound-icon.muted {
  color: rgba(255, 255, 255, 0.88);
}

.sound-icon.muted i {
  opacity: 0;
}

.sound-icon.muted b {
  opacity: 1;
}

.hud-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 0;
  padding: 0 clamp(10px, 2vw, 26px);
}

.hud-metric {
  display: flex;
  align-items: center;
  gap: clamp(9px, 2.2vmin, 18px);
}

.hud-metric strong {
  font-size: clamp(2rem, 7.8vmin, 4.2rem);
  font-weight: 1000;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.4);
}

.hud-icon {
  display: grid;
  width: clamp(44px, 7.6vmin, 70px);
  aspect-ratio: 1;
  place-items: center;
  color: #b9ddff;
  font-size: clamp(2rem, 6vmin, 3.5rem);
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35));
}

.hud-icon.trophy,
.big-trophy {
  color: #cbb083;
}

.time-track {
  height: clamp(15px, 2.8dvh, 38px);
  overflow: hidden;
  border-radius: 999px;
  background: rgba(61, 101, 149, 0.42);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.18);
}

.time-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #84ddd3, #55c3be);
  transition: width 220ms linear;
}

.puzzle-status,
.board-message {
  display: grid;
  min-height: clamp(28px, 4.5dvh, 42px);
  padding: 6px 14px;
  border: 2px solid rgba(132, 190, 238, 0.35);
  border-radius: 999px;
  place-items: center;
  justify-self: center;
  min-width: min(100%, 220px);
  color: #c3d0e4;
  background: rgba(16, 39, 69, 0.48);
  font-size: clamp(0.82rem, 2.2vmin, 1.05rem);
  font-weight: 1000;
  text-align: center;
  text-transform: uppercase;
}

.puzzle-status.bad,
.board-message.bad {
  border-color: rgba(236, 113, 111, 0.72);
  color: #ff8885;
}

.board-message.good {
  border-color: rgba(104, 189, 118, 0.75);
  color: #7be08c;
}

.simple-question {
  display: grid;
  min-height: 0;
  padding: clamp(10px, 2.4vmin, 26px);
  border: 3px solid rgba(140, 182, 224, 0.72);
  border-radius: clamp(18px, 3.4vmin, 34px);
  place-items: center;
  background: rgba(16, 39, 69, 0.58);
  box-shadow: inset 0 0 26px rgba(255, 255, 255, 0.04);
}

.simple-question div {
  max-width: 100%;
  color: #ffffff;
  font-size: clamp(2.5rem, 10.4vmin, 7rem);
  font-weight: 1000;
  line-height: 1;
  text-align: center;
  text-shadow:
    0 5px 0 rgba(0, 0, 0, 0.38),
    0 0 20px rgba(255, 255, 255, 0.12);
}

.formula-question {
  padding: clamp(8px, 1.8vmin, 18px);
}

.simple-question .compact-formula {
  gap: clamp(5px, 1.5vmin, 12px);
  font-size: clamp(1.75rem, 7.2vmin, 4.8rem);
  line-height: 1;
}

.compact-formula .formula-token {
  min-width: clamp(44px, 13vmin, 72px);
  min-height: clamp(44px, 13vmin, 72px);
  padding: clamp(6px, 1.8vmin, 12px);
  border-radius: clamp(12px, 3vmin, 18px);
}

.compact-formula .formula-operator,
.compact-formula .formula-paren {
  min-width: clamp(16px, 4.7vmin, 34px);
}

.simple-answers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  min-height: 0;
  gap: clamp(12px, 2.4vmin, 28px);
}

.simple-answers.few {
  grid-template-rows: 1fr;
  align-content: center;
}

.simple-answer {
  min-width: 0;
  min-height: 0;
  border: 3px solid rgba(148, 202, 255, 0.9);
  border-radius: clamp(16px, 3.4vmin, 32px);
  cursor: pointer;
  background: linear-gradient(145deg, #4c8fca, #265d92);
  box-shadow:
    inset 0 0 26px rgba(255, 255, 255, 0.08),
    0 8px 0 rgba(0, 0, 0, 0.22);
  color: #ffffff;
  font-size: clamp(3rem, 11.5vmin, 7rem);
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 5px 0 rgba(0, 0, 0, 0.34);
}

.simple-answer:active,
.primary-action:active,
.secondary-action:active {
  transform: translateY(4px);
}

.game-over-screen,
.sudoku-complete-screen {
  width: min(100%, 760px);
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: clamp(8px, 1.4dvh, 14px);
  padding:
    max(10px, env(safe-area-inset-top))
    clamp(14px, 4.2vw, 38px)
    max(10px, env(safe-area-inset-bottom));
}

.sudoku-complete-screen {
  width: 100%;
  max-width: 100%;
  grid-template-rows: auto auto auto auto;
  align-content: start;
  justify-content: stretch;
  justify-items: stretch;
  gap: clamp(10px, 2dvh, 18px);
}

@media (min-width: 760px) {
  .sudoku-complete-screen {
    width: min(100%, 620px);
  }
}

.sudoku-complete-screen .simple-header,
.sudoku-complete-screen .complete-panel,
.sudoku-complete-screen .complete-stats,
.sudoku-complete-screen .complete-actions {
  grid-column: 1;
  width: 100%;
  min-width: 0;
}

.game-over-panel {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 0;
}

.complete-panel {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 0;
  gap: clamp(5px, 1dvh, 10px);
  text-align: center;
}

.complete-badge {
  display: grid;
  width: clamp(58px, 12vmin, 98px);
  aspect-ratio: 1;
  place-items: center;
  border: 3px solid rgba(132, 245, 190, 0.94);
  border-radius: 999px;
  background:
    radial-gradient(circle at 38% 28%, rgba(255, 255, 255, 0.38), transparent 36%),
    linear-gradient(145deg, #43d46d, #16874e);
  box-shadow:
    inset 0 -8px 0 rgba(0, 0, 0, 0.18),
    0 0 28px rgba(63, 231, 140, 0.32);
  color: #ffffff;
  font-size: clamp(2rem, 6.4vmin, 4rem);
  font-weight: 1000;
}

.big-trophy {
  font-size: clamp(2.35rem, 6.4vmin, 4.6rem);
  line-height: 1;
}

.game-over-panel h2 {
  margin: clamp(2px, 0.8dvh, 8px) 0 0;
  font-size: clamp(2.35rem, 7.4vmin, 5.1rem);
  font-weight: 1000;
  line-height: 0.95;
  text-align: center;
  text-transform: uppercase;
}

.complete-panel h2 {
  margin: 0;
  font-size: clamp(2rem, 6.5vmin, 4.7rem);
  font-weight: 1000;
  line-height: 0.95;
  text-transform: uppercase;
}

.complete-panel strong {
  color: #88eaff;
  font-size: clamp(1rem, 3.1vmin, 1.6rem);
  font-weight: 1000;
  text-transform: uppercase;
}

.score-summary,
.last-question,
.complete-stats {
  border: 2px solid rgba(114, 151, 190, 0.58);
  border-radius: clamp(14px, 2.8vmin, 24px);
  background: rgba(25, 50, 83, 0.62);
  box-shadow: inset 0 0 22px rgba(255, 255, 255, 0.04);
}

.score-summary,
.complete-stats {
  display: grid;
  grid-template-columns: 1fr 2px 1fr;
  align-items: center;
  align-content: center;
  gap: clamp(6px, 1.2dvh, 10px);
  padding: clamp(10px, 1.8dvh, 18px);
  text-align: center;
}

.score-summary span,
.complete-stats span,
.last-question span,
.answer-review p {
  color: #c3d0e4;
  font-size: clamp(0.78rem, 2.15vmin, 1.35rem);
  font-weight: 1000;
  text-transform: uppercase;
}

.score-summary strong,
.complete-stats strong {
  display: block;
  margin-top: clamp(2px, 0.7dvh, 6px);
  font-size: clamp(1.8rem, 5.6vmin, 3.4rem);
  font-weight: 1000;
}

.score-summary i,
.complete-stats i {
  width: 2px;
  height: 80%;
  background: rgba(145, 171, 204, 0.32);
}

.last-question {
  display: grid;
  min-height: 0;
  align-content: center;
  overflow: hidden;
  padding: clamp(10px, 2vmin, 18px);
  text-align: center;
}

.last-question strong {
  min-width: 0;
  margin: clamp(6px, 1.1dvh, 11px) 0;
  overflow-wrap: anywhere;
  font-size: clamp(1.8rem, 5.9vmin, 4rem);
  font-weight: 1000;
  line-height: 1;
}

.answer-review {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 0;
  gap: clamp(5px, 0.9dvh, 10px) 14px;
  border-top: 2px solid rgba(145, 171, 204, 0.26);
  padding-top: clamp(7px, 1.3dvh, 12px);
  text-align: left;
}

.answer-review p {
  margin: 0;
}

.answer-review b {
  font-size: clamp(1.25rem, 3.8vmin, 2.45rem);
  font-weight: 1000;
}

.answer-review .wrong {
  color: #ec716f;
}

.answer-review .right {
  color: #68bd76;
}

.game-over-actions,
.complete-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(8px, 1.4dvh, 14px);
}

.sudoku-complete-screen .primary-action,
.sudoku-complete-screen .secondary-action {
  min-height: clamp(48px, 7dvh, 64px);
  font-size: clamp(1.05rem, 3.4vmin, 1.75rem);
}

.primary-action,
.secondary-action {
  min-height: clamp(48px, 7.4dvh, 72px);
  border-radius: clamp(13px, 2.5vmin, 22px);
  cursor: pointer;
  font-size: clamp(1.45rem, 4.3vmin, 2.55rem);
  font-weight: 1000;
  text-transform: uppercase;
}

.primary-action {
  border: 0;
  background: linear-gradient(145deg, #5da4df, #326a9e);
  box-shadow: inset 0 0 22px rgba(255, 255, 255, 0.12);
}

.secondary-action {
  border: 3px solid #61a9ea;
  background: rgba(4, 16, 36, 0.28);
}

.board-play {
  width: min(100%, 760px);
  grid-template-rows: auto auto auto auto auto;
  align-content: start;
  gap: clamp(10px, 1.7dvh, 16px);
  padding:
    max(14px, env(safe-area-inset-top))
    clamp(16px, 4.2vw, 38px)
    max(14px, env(safe-area-inset-bottom));
}

.target-sum-play,
.magic-play,
.caro-play {
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  align-content: start;
}

.caro-play {
  grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
}

.sudoku-play {
  align-content: start;
  gap: clamp(7px, 1.25dvh, 13px);
}

.board-hud {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 2.2vmin, 18px);
}

.board-hud.tri-hud {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(6px, 1.5vmin, 12px);
}

.board-hud.sudoku-hud {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(5px, 1.2vmin, 10px);
}

.board-hud div {
  padding: clamp(8px, 1.6dvh, 14px);
  border: 2px solid rgba(114, 151, 190, 0.58);
  border-radius: clamp(14px, 2.8vmin, 22px);
  background: rgba(25, 50, 83, 0.62);
  text-align: center;
}

.board-hud span {
  display: block;
  color: #c3d0e4;
  font-size: clamp(0.78rem, 2.2vmin, 1.15rem);
  font-weight: 1000;
  text-transform: uppercase;
}

.board-hud strong {
  display: block;
  margin-top: 2px;
  font-size: clamp(1.4rem, 4.8vmin, 2.7rem);
  font-weight: 1000;
}

.tri-hud span {
  font-size: clamp(0.62rem, 1.85vmin, 1rem);
}

.tri-hud strong,
.sudoku-hud strong {
  font-size: clamp(1.12rem, 3.9vmin, 2.25rem);
}

.sudoku-hud span {
  font-size: clamp(0.58rem, 1.85vmin, 0.96rem);
}

.play-2048-board,
.sudoku-board,
.target-board,
.magic-board,
.caro-board {
  display: grid;
  align-self: center;
  justify-self: center;
  min-height: 0;
  aspect-ratio: 1;
  gap: clamp(6px, 1.5vmin, 12px);
  padding: clamp(8px, 1.8vmin, 14px);
  border: 3px solid rgba(140, 182, 224, 0.72);
  border-radius: clamp(18px, 3vmin, 28px);
  background: rgba(16, 39, 69, 0.58);
}

.play-2048-board {
  width: min(100%, 46dvh, 520px);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  contain: layout paint;
  touch-action: none;
}

.play-2048-screen {
  touch-action: none;
  user-select: none;
}

.play-2048-screen .board-controls {
  touch-action: none;
}

.tile-2048 {
  display: grid;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: clamp(10px, 2vmin, 18px);
  place-items: center;
  background: rgba(63, 96, 132, 0.62);
  color: #ffffff;
  font-size: clamp(1.25rem, 4.4vmin, 2.7rem);
  font-weight: 1000;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.26);
  white-space: nowrap;
}

.tile-2048.value-2 {
  background: linear-gradient(145deg, #65b8ff, #2d70bf);
}

.tile-2048.value-4 {
  background: linear-gradient(145deg, #52ddc9, #19897e);
}

.tile-2048.value-8 {
  background: linear-gradient(145deg, #7fe35a, #2e9440);
}

.tile-2048.value-16 {
  background: linear-gradient(145deg, #f4cf45, #c57a1f);
}

.tile-2048.value-32 {
  background: linear-gradient(145deg, #ff9a46, #c94c1f);
}

.tile-2048.value-64 {
  background: linear-gradient(145deg, #ff6c67, #bd2e35);
}

.tile-2048.value-128 {
  background: linear-gradient(145deg, #d96bff, #8032c8);
}

.tile-2048.value-256 {
  background: linear-gradient(145deg, #8d7cff, #4b48bd);
}

.tile-2048.value-512 {
  background: linear-gradient(145deg, #42d7ff, #1d6dac);
}

.tile-2048.value-1024 {
  background: linear-gradient(145deg, #ffdf5a, #b96717);
}

.tile-2048.value-2048 {
  background: linear-gradient(145deg, #ffffff, #ffd84a 38%, #e98018);
  color: #18304f;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.28);
}

.tile-2048.value-4096,
.tile-2048.value-8192,
.tile-2048.value-16384 {
  background: linear-gradient(145deg, #ffffff, #ff8bdc 34%, #7e38d1);
  color: #ffffff;
}

.tile-2048.value-1024,
.tile-2048.value-2048,
.tile-2048.value-4096,
.tile-2048.value-8192 {
  font-size: clamp(1rem, 3.45vmin, 2.15rem);
}

.tile-2048.value-16384 {
  font-size: clamp(0.85rem, 2.85vmin, 1.8rem);
}

.board-over-note strong {
  color: #ffd84a;
  text-shadow:
    0 3px 0 rgba(0, 0, 0, 0.34),
    0 0 18px rgba(255, 216, 74, 0.26);
}

.board-controls,
.sudoku-pad {
  display: grid;
  gap: clamp(8px, 1.8vmin, 14px);
}

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

.move-button,
.number-pad {
  min-height: clamp(46px, 7dvh, 64px);
  border: 3px solid rgba(148, 202, 255, 0.9);
  border-radius: clamp(14px, 2.8vmin, 22px);
  cursor: pointer;
  background: linear-gradient(145deg, #4c8fca, #265d92);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.08);
  font-size: clamp(1.5rem, 4.6vmin, 2.8rem);
  font-weight: 1000;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    filter 140ms ease,
    transform 140ms ease;
}

.play-2048-screen .move-button.active {
  border-color: rgba(134, 245, 255, 0.98);
  background: linear-gradient(145deg, #68d5ff, #3478c6);
  box-shadow:
    inset 0 0 18px rgba(255, 255, 255, 0.2),
    0 0 0 3px rgba(91, 222, 255, 0.18),
    0 0 24px rgba(91, 222, 255, 0.52);
  color: #ffffff;
  filter: brightness(1.12);
}

.play-2048-screen .move-up.active {
  transform: translateY(-3px) scale(1.04);
}

.play-2048-screen .move-down.active {
  transform: translateY(3px) scale(1.04);
}

.play-2048-screen .move-left.active {
  transform: translateX(-3px) scale(1.04);
}

.play-2048-screen .move-right.active {
  transform: translateX(3px) scale(1.04);
}

.sudoku-board {
  width: min(100%, 52dvh, 410px);
  max-height: 46dvh;
  gap: 0;
  padding: clamp(4px, 0.8vmin, 7px);
  border: 2px solid #7a8795;
  border-radius: 0;
  grid-template-columns: repeat(var(--sudoku-size), minmax(0, 1fr));
  background: #f3f5f7;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

.sudoku-board.size-6 {
  width: min(100%, 43dvh, 320px);
}

.target-board {
  width: min(100%, 42dvh, 500px);
  aspect-ratio: 1.45;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.magic-board,
.caro-board {
  width: min(100%, 44dvh, 500px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.caro-board.size-15 {
  width: min(100%, 52dvh, 430px);
  padding: clamp(3px, 0.6vmin, 5px);
}

.caro-board {
  position: relative;
  grid-template-columns: repeat(var(--caro-size), minmax(0, 1fr));
  grid-template-rows: repeat(var(--caro-size), minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  padding: clamp(4px, 0.8vmin, 7px);
  border: 2px solid #7a8795;
  border-radius: 0;
  background: #f3f5f7;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

.sudoku-cell {
  display: grid;
  min-width: 0;
  min-height: 0;
  border: 1px solid #c1c8cf;
  border-radius: 0;
  place-items: center;
  cursor: pointer;
  color: #19314d;
  background: #f8fafc;
  font-size: clamp(1.05rem, 4.1vmin, 2.15rem);
  font-weight: 800;
  line-height: 1;
  text-shadow: none;
}

.sudoku-cell.block-right {
  border-right-color: #6f7882;
  border-right-width: 2px;
}

.sudoku-cell.block-bottom {
  border-bottom-color: #6f7882;
  border-bottom-width: 2px;
}

.sudoku-cell.fixed {
  color: #111827;
  background: #eef2f5;
}

.sudoku-cell.selected {
  position: relative;
  z-index: 1;
  background: #d9ecff;
  box-shadow: inset 0 0 0 2px #4d90d6;
}

.sudoku-cell.wrong {
  color: #9b1c1c;
  background: #ffe1e1;
  box-shadow: inset 0 0 0 2px #ef6262;
}

.sudoku-cell.wrong.selected {
  background: #ffd3d3;
  box-shadow:
    inset 0 0 0 2px #ef6262,
    inset 0 0 0 4px rgba(77, 144, 214, 0.42);
}

.sudoku-note-grid {
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  place-items: center;
  color: #5c7ca0;
  font-size: clamp(0.34rem, 1.15vmin, 0.56rem);
  font-weight: 800;
}

.sudoku-board.size-6 .sudoku-note-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sudoku-pad {
  justify-self: center;
  width: min(100%, 460px);
  grid-template-columns: repeat(var(--sudoku-size), minmax(0, 1fr));
  gap: clamp(5px, 1.1vmin, 10px);
}

.sudoku-toolbar {
  display: grid;
  justify-self: center;
  width: min(100%, 480px);
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(5px, 1.2vmin, 10px);
}

.sudoku-tool {
  display: grid;
  min-width: 0;
  min-height: clamp(34px, 5.2dvh, 48px);
  place-items: center;
  gap: 1px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  color: #7fa1c4;
  background: rgba(14, 34, 61, 0.35);
}

.sudoku-tool b {
  font-size: clamp(1rem, 3vmin, 1.35rem);
  line-height: 1;
}

.sudoku-tool span {
  font-size: clamp(0.54rem, 1.65vmin, 0.76rem);
  font-weight: 800;
}

.sudoku-tool.active {
  color: #ffffff;
  background: rgba(75, 145, 213, 0.44);
  box-shadow: inset 0 0 0 2px rgba(148, 202, 255, 0.5);
}

.confirm-tool {
  color: #dfffee;
  background: rgba(37, 122, 81, 0.5);
}

.sudoku-pad .number-pad {
  min-height: clamp(34px, 5.6dvh, 52px);
  border: 0;
  border-radius: 10px;
  color: #6e91b5;
  background: transparent;
  box-shadow: none;
  font-size: clamp(1.45rem, 4.8vmin, 2.35rem);
  text-shadow: none;
}

.sudoku-level-screen {
  width: min(100%, 760px);
  grid-template-rows: auto auto auto minmax(0, 1fr);
  align-content: start;
  gap: clamp(10px, 1.9dvh, 18px);
  padding:
    max(14px, env(safe-area-inset-top))
    clamp(16px, 4.2vw, 38px)
    max(14px, env(safe-area-inset-bottom));
}

.level-heading {
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
  text-transform: uppercase;
}

.level-heading strong {
  font-size: clamp(1.4rem, 5.2vmin, 3rem);
  font-weight: 1000;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 0 18px rgba(34, 225, 243, 0.2);
}

.level-heading span {
  color: #b9cbe2;
  font-size: clamp(0.72rem, 2.2vmin, 1.1rem);
  font-weight: 900;
}

.sudoku-level-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(9px, 1.7dvh, 14px);
  min-height: 0;
  justify-self: center;
  width: min(100%, 560px);
}

.sudoku-level-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  justify-items: start;
  column-gap: clamp(12px, 3vw, 20px);
  min-width: 0;
  min-height: clamp(78px, 12dvh, 108px);
  padding: clamp(9px, 1.8vmin, 14px) clamp(14px, 3vw, 22px);
  border: 3px solid var(--level-edge);
  border-radius: clamp(14px, 2.6vmin, 20px);
  cursor: pointer;
  color: #ffffff;
  background:
    radial-gradient(circle at 50% 18%, color-mix(in srgb, var(--level-glow) 42%, transparent), transparent 46%),
    linear-gradient(160deg, var(--level-top), var(--level-bottom));
  box-shadow:
    inset 0 0 22px rgba(255, 255, 255, 0.1),
    0 8px 0 rgba(0, 0, 0, 0.28),
    0 18px 28px rgba(0, 0, 0, 0.32);
}

.sudoku-level-card.easy-level {
  --level-bottom: #126b23;
  --level-edge: #68f24a;
  --level-glow: #8dff63;
  --level-top: #1aa53d;
}

.sudoku-level-card.fast-level {
  --level-bottom: #174d8e;
  --level-edge: #72d5ff;
  --level-glow: #8ff2ff;
  --level-top: #2377c8;
}

.sudoku-level-card.medium-level {
  --level-bottom: #95510b;
  --level-edge: #ffbd32;
  --level-glow: #ffe66b;
  --level-top: #d47a12;
}

.sudoku-level-card.hard-level {
  --level-bottom: #72219a;
  --level-edge: #d34fff;
  --level-glow: #ff6ff4;
  --level-top: #9e36c7;
}

.level-mini-grid {
  display: grid;
  width: clamp(56px, 10dvh, 82px);
  aspect-ratio: 1;
  gap: clamp(2px, 0.55vmin, 4px);
  flex: 0 0 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: clamp(4px, 0.9vmin, 6px);
  border: 2px solid rgba(198, 234, 255, 0.78);
  border-radius: clamp(9px, 1.8vmin, 14px);
  grid-template-columns: repeat(var(--level-size), minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  background: rgba(7, 23, 52, 0.42);
}

.level-mini-grid.size-9 {
  width: clamp(54px, 9dvh, 76px);
  gap: 1px;
  padding: clamp(3px, 0.55vmin, 5px);
}

.level-mini-grid i {
  display: grid;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: clamp(4px, 0.9vmin, 7px);
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: clamp(0.42rem, 1.3vmin, 0.72rem);
  font-style: normal;
  font-weight: 1000;
  line-height: 1;
}

.level-mini-grid.size-9 i {
  border-radius: 2px;
  font-size: clamp(0.2rem, 0.72vmin, 0.34rem);
}

.level-mini-grid i:empty {
  background: rgba(9, 26, 56, 0.58);
}

.sudoku-level-card strong {
  margin: 0;
  font-size: clamp(1.25rem, 3.5vmin, 2rem);
  font-weight: 1000;
  text-transform: uppercase;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.34);
}

.sudoku-level-card em {
  justify-self: end;
  color: #d7e9ff;
  font-size: clamp(0.68rem, 1.8vmin, 0.95rem);
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.target-tile,
.magic-cell,
.caro-cell {
  display: grid;
  min-width: 0;
  min-height: 0;
  border: 2px solid rgba(148, 202, 255, 0.55);
  border-radius: clamp(10px, 2vmin, 18px);
  place-items: center;
  cursor: pointer;
  background: rgba(63, 96, 132, 0.48);
  font-weight: 1000;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.28);
}

.target-tile {
  font-size: clamp(1.8rem, 6vmin, 3.6rem);
}

.target-tile.selected {
  border-color: #a8ff76;
  background: linear-gradient(145deg, #87d84d, #218b38);
  box-shadow: 0 0 18px rgba(126, 255, 94, 0.22);
}

.target-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.magic-cell,
.caro-cell {
  font-size: clamp(1.7rem, 6vmin, 3.8rem);
}

.caro-cell {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid #c1c8cf;
  border-radius: 0;
  color: #19314d;
  background: #f8fafc;
  line-height: 1;
  text-shadow: none;
  --caro-mark-inset: 7%;
  --caro-stroke: clamp(4px, 1.15vmin, 9px);
}

.caro-board.size-7 .caro-cell {
  font-size: clamp(1.45rem, 5.4vmin, 3.25rem);
  --caro-mark-inset: 8%;
  --caro-stroke: clamp(3px, 0.85vmin, 7px);
}

.caro-board.size-15 .caro-cell {
  font-size: clamp(1.08rem, 4vmin, 1.45rem);
  font-weight: 900;
  --caro-mark-inset: 8%;
  --caro-stroke: clamp(2px, 0.48vmin, 4px);
}

.magic-cell.fixed {
  color: #b7dbff;
  background: rgba(15, 32, 58, 0.72);
}

.magic-cell.selected {
  border-color: #66e5dc;
  background: rgba(102, 229, 220, 0.18);
  box-shadow: 0 0 18px rgba(102, 229, 220, 0.18);
}

.magic-pad {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(8px, 1.8vmin, 14px);
}

.caro-cell.mark-x {
  color: #2673ca;
}

.caro-cell.mark-o {
  color: #d48323;
}

.caro-mark {
  position: absolute;
  inset: var(--caro-mark-inset);
  z-index: 5;
  display: block;
  box-sizing: border-box;
}

.caro-mark-x::before,
.caro-mark-x::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 118%;
  height: var(--caro-stroke);
  border-radius: 999px;
  content: "";
  background: #2673ca;
  box-shadow: 0 0 5px rgba(38, 115, 202, 0.18);
  transform-origin: center;
}

.caro-mark-x::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.caro-mark-x::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.caro-mark-o {
  border: var(--caro-stroke) solid #d48323;
  border-radius: 50%;
  box-shadow:
    inset 0 0 4px rgba(212, 131, 35, 0.08),
    0 0 5px rgba(212, 131, 35, 0.18);
}

.caro-cell.winning {
  background: #e7f5ff;
}

.caro-cell.last-move {
  animation: caroLastMovePulse 260ms ease-out;
}

.caro-cell.last-x {
  background: #d9ecff;
  box-shadow: inset 0 0 0 2px rgba(38, 115, 202, 0.45);
}

.caro-cell.last-o {
  background: #fff0cf;
  box-shadow: inset 0 0 0 2px rgba(212, 131, 35, 0.42);
}

.caro-cell.winning.last-move {
  background: #e7f5ff;
}

@keyframes caroLastMovePulse {
  from {
    filter: brightness(1.12);
  }

  to {
    filter: brightness(1);
  }
}

.caro-win-line {
  position: absolute;
  z-index: 4;
  top: var(--line-top);
  left: var(--line-left);
  width: var(--line-width);
  height: var(--caro-line-size);
  pointer-events: none;
  border-radius: 999px;
  background: linear-gradient(90deg, #18def1, #ffffff, #ffd84a);
  box-shadow:
    0 0 12px rgba(24, 222, 241, 0.58),
    0 0 22px rgba(255, 216, 74, 0.36);
  --caro-line-size: clamp(5px, 1.4vmin, 10px);
  transform: translateY(-50%) rotate(var(--line-rotate)) scaleX(0);
  transform-origin: left center;
  animation: caroWinLine 300ms ease-out forwards;
}

.caro-board.size-15 .caro-win-line {
  --caro-line-size: clamp(3px, 0.9vmin, 6px);
}

@keyframes caroWinLine {
  to {
    transform: translateY(-50%) rotate(var(--line-rotate)) scaleX(1);
  }
}

.compact-stats {
  opacity: 0.9;
}

.caro-actions {
  display: grid;
  justify-self: stretch;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(8px, 1.8vmin, 14px);
}

.caro-actions .primary-action,
.caro-actions .secondary-action {
  min-height: clamp(42px, 6dvh, 58px);
  font-size: clamp(1rem, 3.2vmin, 1.65rem);
}

.play-header {
  display: grid;
  grid-template-columns: clamp(38px, 7vmin, 54px) 1fr clamp(38px, 7vmin, 54px);
  align-items: center;
  gap: clamp(8px, 2vmin, 14px);
  min-height: 0;
  padding-top: 0;
}

.play-header div {
  text-align: center;
}

.play-header span {
  display: block;
  color: #18e8f4;
  font-weight: 900;
  text-transform: uppercase;
}

.play-header h1 {
  margin: 0;
  font-size: clamp(1.1rem, 4.2vmin, 2.5rem);
  font-weight: 1000;
  letter-spacing: 0;
  text-transform: uppercase;
}

.icon-button {
  display: grid;
  width: clamp(38px, 7vmin, 54px);
  aspect-ratio: 1;
  border: 3px solid var(--edge, #1fb9ff);
  border-radius: clamp(10px, 2vmin, 16px);
  place-items: center;
  cursor: pointer;
  background: linear-gradient(160deg, rgba(26, 86, 206, 0.95), rgba(10, 18, 69, 0.95));
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.28);
  font-size: clamp(1.35rem, 4vmin, 2rem);
  font-weight: 1000;
}

.score-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(6px, 1.4vmin, 10px);
  min-height: 0;
  margin: clamp(8px, 1.7dvh, 18px) 0;
}

.score-strip div {
  min-width: 0;
  padding: clamp(6px, 1.4vmin, 12px) 8px;
  border: 2px solid rgba(37, 198, 255, 0.42);
  border-radius: 18px;
  background: rgba(2, 13, 49, 0.78);
  text-align: center;
}

.score-strip span {
  display: block;
  color: #9ddfff;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.score-strip strong {
  font-size: clamp(1rem, 3vmin, 1.45rem);
  font-weight: 1000;
}

.game-stage {
  display: grid;
  align-content: start;
  min-height: 0;
  gap: clamp(8px, 2vmin, 18px);
  padding: clamp(10px, 2.4vmin, 28px);
  overflow: hidden;
  border: clamp(2px, 0.55vmin, 4px) solid var(--edge, #1fb9ff);
  border-radius: clamp(16px, 3vmin, 28px);
  background:
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--glow, #20d8ff) 20%, transparent), transparent 45%),
    rgba(2, 13, 49, 0.88);
  box-shadow:
    inset 0 0 32px rgba(255, 255, 255, 0.09),
    0 18px 34px rgba(0, 0, 0, 0.42);
}

.prompt {
  display: grid;
  min-height: clamp(82px, 23dvh, 145px);
  place-items: center;
  color: #ffffff;
  font-size: clamp(2rem, 8.5vmin, 5.8rem);
  font-weight: 1000;
  line-height: 1.05;
  text-align: center;
  text-shadow:
    0 5px 0 rgba(0, 0, 0, 0.36),
    0 0 24px var(--glow, #20d8ff);
}

.subprompt {
  margin: -8px 0 0;
  color: #bfefff;
  font-size: clamp(1rem, 2.8vw, 1.25rem);
  font-weight: 800;
  text-align: center;
}

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

.answer-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.answer-button,
.wide-button {
  min-height: clamp(52px, 9dvh, 72px);
  border: 3px solid rgba(255, 255, 255, 0.72);
  border-radius: 20px;
  cursor: pointer;
  background: linear-gradient(180deg, color-mix(in srgb, var(--edge, #1fb9ff) 82%, #ffffff), var(--base, #064ac2));
  box-shadow:
    inset 0 0 18px rgba(255, 255, 255, 0.18),
    0 8px 0 rgba(0, 0, 0, 0.28);
  font-size: clamp(1.15rem, 4.2vmin, 2.3rem);
  font-weight: 1000;
}

.answer-button:active,
.wide-button:active {
  transform: translateY(4px);
  box-shadow:
    inset 0 0 18px rgba(255, 255, 255, 0.18),
    0 4px 0 rgba(0, 0, 0, 0.28);
}

.feedback {
  justify-self: center;
  min-width: 150px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 1000;
  text-align: center;
  text-transform: uppercase;
}

.feedback.good {
  background: #41e441;
  color: #05240a;
}

.feedback.bad {
  background: #ff514b;
  color: #330604;
}

.number-row,
.sequence-row,
.board-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.tile {
  display: grid;
  width: clamp(54px, 15vmin, 104px);
  aspect-ratio: 1;
  border: 3px solid rgba(255, 255, 255, 0.65);
  border-radius: 18px;
  place-items: center;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.04));
  box-shadow:
    inset 0 0 14px rgba(255, 255, 255, 0.18),
    0 8px 0 rgba(0, 0, 0, 0.28);
  font-size: clamp(1.45rem, 5vmin, 3rem);
  font-weight: 1000;
}

.tile.is-missing {
  border-style: dashed;
  color: #31efff;
}

.mini-grid {
  display: grid;
  width: min(100%, 42dvh, 390px);
  margin: 0 auto;
  gap: 7px;
}

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

.mini-grid.sudoku-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mini-cell {
  display: grid;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.52);
  border-radius: 12px;
  place-items: center;
  background: rgba(0, 0, 0, 0.28);
  font-size: clamp(1.4rem, 7vw, 2.4rem);
  font-weight: 1000;
}

.mini-cell.blank {
  border-color: var(--edge, #1fb9ff);
  background: rgba(24, 232, 244, 0.18);
  color: #18e8f4;
}

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

.formula-line,
.puzzle-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: clamp(2rem, 9vw, 4rem);
  font-weight: 1000;
  text-align: center;
}

.formula-token {
  display: grid;
  min-width: 72px;
  min-height: 72px;
  padding: 10px 16px;
  border: 3px solid var(--edge, #1fb9ff);
  border-radius: 18px;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
}

.formula-operator,
.formula-paren {
  display: grid;
  min-width: clamp(24px, 6vmin, 42px);
  place-items: center;
  color: #f4d8ff;
  text-shadow:
    0 3px 0 rgba(0, 0, 0, 0.32),
    0 0 14px rgba(207, 104, 255, 0.45);
}

.formula-paren {
  color: #84efff;
}

.wide-button {
  width: 100%;
}

@media (max-width: 720px) {
  .home-screen {
    padding-inline: clamp(7px, 2.4vw, 14px);
  }

  .logo-row {
    gap: clamp(8px, 2.5vw, 14px);
  }

  .brand-copy {
    text-align: center;
  }

  .game-card[data-game-id="quick-math"] {
    order: 1;
  }

  .game-card[data-game-id="number-match"] {
    order: 2;
  }

  .game-card[data-game-id="missing-sign"] {
    order: 3;
  }

  .game-card[data-game-id="sequence"] {
    order: 4;
  }

  .game-card[data-game-id="true-false"] {
    order: 5;
  }

  .game-card[data-game-id="compare"] {
    order: 6;
  }

  .game-card[data-game-id="sudoku"] {
    order: 7;
  }

  .game-card[data-game-id="2048"] {
    order: 8;
  }

  .game-card[data-game-id="caro"] {
    order: 9;
  }

  .game-card[data-game-id="formula"] {
    order: 10;
  }

  .game-card[data-game-id="plus-minus"] {
    order: 11;
  }

  .game-card[data-game-id="find-answer"] {
    order: 12;
  }

  .game-card[data-game-id="math-puzzle"] {
    order: 13;
  }

  .game-card[data-game-id="target-sum"] {
    order: 14;
  }

  .game-card[data-game-id="magic-square"] {
    order: 15;
  }
}

@media (max-width: 430px) {
  .simple-play,
  .board-play,
  .sudoku-level-screen,
  .sudoku-complete-screen,
  .game-over-screen {
    padding-inline: clamp(10px, 3vw, 14px);
  }

  .game-grid {
    gap: clamp(6px, 1.8vw, 10px);
  }

  .game-card {
    border-radius: 14px;
    padding: 7px 5px 8px;
  }

  .card-icon {
    height: clamp(42px, 13.6vw, 58px);
    font-size: clamp(1.25rem, 6vw, 2.2rem);
  }

  .home-sudoku-grid,
  .home-2048-grid,
  .home-magic-grid,
  .home-caro-grid {
    width: clamp(50px, 15vw, 62px);
  }

  .home-sudoku-grid i,
  .home-2048-grid i,
  .home-magic-grid i,
  .home-caro-grid i {
    font-size: clamp(0.6rem, 2.8vw, 0.95rem);
  }

  .timer-face {
    width: clamp(40px, 13vw, 54px);
  }

  .answer-badge {
    width: clamp(32px, 9.8vw, 40px);
  }

  .compare-symbol {
    font-size: clamp(1.75rem, 7vw, 2.35rem);
  }

  .formula-icon {
    font-size: clamp(1.25rem, 4.8vw, 1.7rem);
  }

  .game-card strong {
    font-size: clamp(0.58rem, 2.8vw, 0.9rem);
    line-height: 1;
  }

  .home-icon-missing-sign,
  .home-icon-sequence,
  .home-icon-formula,
  .home-icon-math-puzzle,
  .home-icon-target-sum {
    gap: 3px;
  }

  .home-icon-sequence {
    width: min(100%, 118px);
  }

  .seq-dot {
    width: clamp(24px, 7.2vw, 32px);
    font-size: clamp(0.88rem, 3.65vw, 1.22rem);
  }

  .seq-arrow {
    font-size: clamp(0.8rem, 3.1vw, 1.12rem);
  }

  .sigma-mark {
    width: clamp(38px, 11vw, 48px);
    font-size: clamp(1.28rem, 5.1vw, 1.85rem);
  }

  .target-equals {
    font-size: clamp(0.95rem, 4vw, 1.45rem);
  }

  .mini-key {
    min-width: clamp(28px, 8vw, 38px);
    min-height: clamp(28px, 8vw, 38px);
    font-size: clamp(1rem, 4.5vw, 1.5rem);
  }

  .mystery-box {
    min-width: clamp(30px, 8.5vw, 42px);
    min-height: clamp(34px, 9vw, 46px);
    border-width: 3px;
    font-size: clamp(1.1rem, 4.8vw, 1.7rem);
  }

  .formula-icon {
    font-size: clamp(1.25rem, 5.2vw, 1.75rem);
    gap: 2px;
  }

  .puzzle-piece {
    width: clamp(34px, 9.2vw, 45px);
    font-size: clamp(1.05rem, 4.6vw, 1.5rem);
  }

  .puzzle-equation {
    font-size: clamp(1rem, 4.5vw, 1.55rem);
  }

  .answer-grid,
  .answer-grid.three,
  .operators {
    grid-template-columns: 1fr 1fr;
  }

  .sudoku-level-screen {
    gap: clamp(8px, 1.5dvh, 12px);
  }

  .level-heading strong {
    font-size: clamp(1.25rem, 6vw, 1.8rem);
  }

  .sudoku-level-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, auto);
    gap: clamp(8px, 1.4dvh, 11px);
  }

  .sudoku-level-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
    justify-items: start;
    column-gap: clamp(10px, 3vw, 16px);
    min-height: clamp(58px, 9.2dvh, 78px);
    padding: clamp(8px, 2.2vw, 12px);
  }

  .level-mini-grid {
    width: clamp(46px, 7.5dvh, 62px);
  }

  .level-mini-grid.size-9 {
    width: clamp(44px, 7dvh, 58px);
  }

  .sudoku-level-card strong {
    align-self: center;
    margin: 0;
    font-size: clamp(1.05rem, 5vw, 1.55rem);
  }

  .sudoku-level-card em {
    align-self: center;
    justify-self: end;
    font-size: clamp(0.62rem, 2.9vw, 0.82rem);
  }
}

@media (min-width: 380px) and (max-width: 430px) {
  .home-sudoku-grid,
  .home-2048-grid,
  .home-magic-grid,
  .home-caro-grid {
    width: clamp(62px, 15.4vw, 66px);
  }
}

@media (max-width: 370px) {
  .home-sudoku-grid,
  .home-2048-grid,
  .home-magic-grid,
  .home-caro-grid {
    width: clamp(46px, 14vw, 50px);
  }

  .home-sudoku-grid i,
  .home-2048-grid i,
  .home-magic-grid i,
  .home-caro-grid i {
    font-size: clamp(0.56rem, 2.55vw, 0.82rem);
  }
}

@media (max-height: 620px) and (orientation: portrait) {
  .simple-play {
    gap: clamp(8px, 1.45dvh, 12px);
    padding:
      max(10px, env(safe-area-inset-top))
      clamp(14px, 4vw, 18px)
      max(10px, env(safe-area-inset-bottom));
  }

  .simple-question {
    padding: clamp(8px, 2vmin, 16px);
  }

  .simple-question div {
    font-size: clamp(2.1rem, 9.5vmin, 3.4rem);
  }

  .simple-answers {
    gap: clamp(10px, 2vmin, 14px);
  }

  .simple-answer {
    font-size: clamp(2.4rem, 11vmin, 4.2rem);
  }
}

@media (min-width: 900px) and (min-aspect-ratio: 4 / 3) {
  .home-screen {
    width: min(100%, 1180px);
    grid-template-rows: auto auto minmax(0, 1fr);
    padding-inline: clamp(18px, 3vw, 34px);
  }

  .brand-header {
    padding-top: clamp(4px, 1dvh, 12px);
  }

  .logo-mark {
    width: clamp(58px, 8vmin, 98px);
  }

  .brand-copy h1 {
    font-size: clamp(2.7rem, 6.2vmin, 4.6rem);
  }

  .brand-copy p {
    font-size: clamp(1.1rem, 2.6vmin, 1.75rem);
  }

  .choose-band {
    margin: clamp(8px, 1.4dvh, 16px) 0 clamp(10px, 1.6dvh, 18px);
  }

  .game-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: clamp(10px, 1.5vmin, 18px);
  }

  .game-card {
    padding: clamp(10px, 1.4vmin, 16px) clamp(8px, 1.2vmin, 14px) clamp(10px, 1.4vmin, 16px);
  }

  .game-card strong {
    font-size: clamp(0.78rem, 1.75vmin, 1.22rem);
  }

  .home-sudoku-grid,
  .home-2048-grid,
  .home-magic-grid,
  .home-caro-grid {
    width: clamp(74px, 14dvh, 108px);
  }

  .home-icon-sequence {
    width: min(78%, 154px);
    gap: clamp(2px, 0.9dvh, 6px);
  }

  .home-icon-sequence .seq-dot {
    width: clamp(34px, 8.5dvh, 48px);
    font-size: clamp(1.25rem, 4.3dvh, 2rem);
  }

  .home-icon-sequence .seq-arrow {
    font-size: clamp(1rem, 3.3dvh, 1.55rem);
  }

  .home-icon-plus-minus {
    transform: scale(0.86);
  }

  .timer-face {
    width: clamp(54px, 13dvh, 92px);
  }
}

@media (orientation: landscape) and (min-width: 760px) {
  .game-over-screen {
    width: min(100%, 980px);
    grid-template-columns: minmax(0, 0.62fr) minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    column-gap: clamp(14px, 3vw, 28px);
    row-gap: clamp(8px, 1.6dvh, 14px);
  }

  .game-over-screen .simple-header {
    grid-column: 1 / 3;
  }

  .game-over-panel {
    grid-column: 1 / 3;
  }

  .big-trophy {
    font-size: clamp(2.1rem, 5.6vmin, 4rem);
  }

  .game-over-panel h2 {
    font-size: clamp(2.25rem, 6.5vmin, 4.6rem);
  }

  .score-summary {
    grid-column: 1;
    grid-row: 3;
    grid-template-columns: 1fr;
    gap: clamp(6px, 1.2dvh, 10px);
    align-self: stretch;
  }

  .score-summary i {
    width: 80%;
    height: 2px;
    justify-self: center;
  }

  .last-question {
    grid-column: 2;
    grid-row: 3;
    align-self: stretch;
  }

  .last-question strong {
    font-size: clamp(1.9rem, 6vmin, 4rem);
  }

  .game-over-actions {
    grid-column: 1 / 3;
    grid-template-columns: 1fr 1fr;
  }

  .primary-action,
  .secondary-action {
    min-height: clamp(46px, 7.2dvh, 66px);
    font-size: clamp(1.3rem, 4vmin, 2.25rem);
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  .home-screen {
    grid-template-columns: minmax(150px, 0.36fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    column-gap: clamp(12px, 2.4vw, 24px);
    padding-block: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-bottom));
  }

  .brand-header {
    align-content: center;
    grid-row: 1 / 3;
    justify-content: start;
  }

  .logo-row {
    flex-direction: column;
    align-items: start;
  }

  .brand-copy {
    text-align: left;
  }

  .choose-band {
    grid-column: 2;
    margin: 0 0 8px;
  }

  .game-grid {
    grid-column: 2;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: clamp(6px, 1.4vmin, 12px);
  }

  .game-card strong {
    font-size: clamp(0.52rem, 2vmin, 0.88rem);
  }

  .card-icon {
    font-size: clamp(1rem, 5.5vmin, 2rem);
  }

  .play-screen {
    grid-template-columns: minmax(150px, 0.3fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    column-gap: clamp(10px, 2vw, 20px);
  }

  .play-header {
    grid-column: 1 / 3;
  }

  .score-strip {
    grid-template-columns: 1fr;
    align-self: start;
  }

  .game-stage {
    grid-column: 2;
    gap: clamp(6px, 1.6vmin, 10px);
    padding: clamp(8px, 1.8vmin, 14px);
  }

  .prompt {
    min-height: clamp(58px, 20dvh, 110px);
  }

  .subprompt {
    font-size: clamp(0.72rem, 2.4vmin, 1rem);
  }

  .answer-grid,
  .operators {
    gap: 8px;
  }

  .answer-button,
  .wide-button {
    min-height: clamp(42px, 11dvh, 58px);
    border-radius: 14px;
    font-size: clamp(1rem, 4.5vmin, 1.8rem);
  }

  .mini-grid {
    width: min(100%, 46dvh, 280px);
    gap: 4px;
  }

  .mini-cell {
    border-radius: 9px;
    font-size: clamp(1rem, 5vmin, 1.75rem);
  }

  .formula-token {
    min-width: 50px;
    min-height: 50px;
    border-radius: 12px;
  }

  .simple-play {
    width: min(100%, 980px);
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    grid-template-rows: auto auto auto minmax(0, 1fr);
    gap: clamp(8px, 2dvh, 14px) clamp(14px, 3vw, 28px);
    padding:
      max(10px, env(safe-area-inset-top))
      clamp(16px, 4vw, 34px)
      max(10px, env(safe-area-inset-bottom));
  }

  .simple-header {
    grid-column: 1 / 3;
    --header-icon-size: clamp(38px, 9dvh, 42px);
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: clamp(40px, 9dvh, 48px);
  }

  .simple-header h1 {
    max-width: calc(100% - clamp(176px, 50dvh, 224px));
    font-size: clamp(1.05rem, 5.6dvh, 1.85rem);
  }

  .round-icon {
    width: clamp(38px, 9dvh, 42px);
    font-size: clamp(1.25rem, 5.8dvh, 1.8rem);
  }

  .hud-row {
    grid-column: 1 / 3;
    padding-inline: clamp(14px, 4vw, 42px);
  }

  .hud-icon {
    width: clamp(34px, 8dvh, 48px);
    font-size: clamp(1.4rem, 6dvh, 2rem);
  }

  .hud-metric strong {
    font-size: clamp(1.5rem, 7dvh, 2.6rem);
  }

  .time-track {
    grid-column: 1 / 3;
    height: clamp(10px, 3dvh, 18px);
  }

  .simple-question {
    grid-column: 1;
    min-height: 0;
  }

  .simple-question div {
    font-size: clamp(2rem, 12dvh, 4.2rem);
  }

  .simple-answers {
    grid-column: 2;
    gap: clamp(8px, 2dvh, 14px);
  }

  .simple-answer {
    border-radius: 16px;
    font-size: clamp(2rem, 11dvh, 4rem);
  }

  .game-over-screen {
    width: min(100%, 980px);
    grid-template-columns: minmax(0, 0.55fr) minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    column-gap: clamp(14px, 3vw, 28px);
  }

  .game-over-screen .simple-header {
    grid-column: 1 / 3;
  }

  .game-over-panel {
    align-content: center;
  }

  .game-over-panel h2 {
    font-size: clamp(2rem, 11dvh, 4rem);
  }

  .score-summary {
    grid-column: 1;
    grid-row: 3;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
  }

  .score-summary i {
    width: 80%;
    height: 2px;
    justify-self: center;
  }

  .last-question {
    grid-column: 2;
    grid-row: 2 / 4;
    padding: 12px;
  }

  .last-question strong {
    font-size: clamp(1.8rem, 10dvh, 3.6rem);
  }

  .game-over-actions {
    grid-column: 1 / 3;
    grid-template-columns: 1fr 1fr;
  }

  .primary-action,
  .secondary-action {
    min-height: clamp(48px, 11dvh, 68px);
    font-size: clamp(1.2rem, 6dvh, 2rem);
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  .sudoku-level-screen {
    width: min(100%, 820px);
    gap: clamp(7px, 1.6dvh, 12px);
    padding:
      max(10px, env(safe-area-inset-top))
      clamp(16px, 4vw, 34px)
      max(10px, env(safe-area-inset-bottom));
  }

  .sudoku-level-grid {
    width: min(100%, 760px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, auto);
    gap: clamp(8px, 2dvh, 12px);
  }

  .sudoku-level-card {
    min-height: clamp(70px, 21dvh, 86px);
  }

  .level-heading strong {
    font-size: clamp(1.2rem, 5dvh, 1.8rem);
  }

  .level-heading span {
    font-size: clamp(0.62rem, 2.4dvh, 0.9rem);
  }

  .board-play {
    width: min(100%, 980px);
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    align-content: start;
    column-gap: clamp(12px, 2.4vw, 24px);
    row-gap: clamp(8px, 1.8dvh, 12px);
    padding:
      max(10px, env(safe-area-inset-top))
      clamp(16px, 4vw, 34px)
      max(10px, env(safe-area-inset-bottom));
  }

  .target-sum-play,
  .magic-play,
  .caro-play {
    align-content: start;
  }

  .board-play .simple-header {
    grid-column: 1 / 3;
  }

  .board-hud {
    grid-column: 1 / 3;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-hud.tri-hud,
  .board-hud.sudoku-hud {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .play-2048-board,
  .sudoku-board,
  .target-board,
  .magic-board,
  .caro-board {
    grid-column: 1;
    grid-row: 3 / 5;
    width: min(100%, 64dvh, 360px);
    align-self: center;
  }

  .board-controls,
  .sudoku-pad,
  .magic-pad,
  .target-actions,
  .compact-stats,
  .caro-actions {
    grid-column: 2;
    grid-row: 3;
    align-self: center;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sudoku-toolbar {
    grid-column: 2;
    grid-row: 3;
    align-self: start;
  }

  .sudoku-pad {
    align-self: end;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .magic-pad {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .board-message {
    grid-column: 2;
    grid-row: 4;
    align-self: end;
  }

  .caro-actions {
    grid-row: 4;
    align-self: end;
  }

  .caro-actions + .board-message,
  .caro-play .board-message {
    align-self: start;
  }

  .move-button,
  .number-pad {
    min-height: clamp(44px, 13dvh, 64px);
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  .sudoku-complete-screen {
    width: min(calc(100dvw - 28px), 620px);
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
    align-content: start;
    justify-content: center;
    column-gap: 0;
  }

  .sudoku-complete-screen .simple-header,
  .sudoku-complete-screen .complete-panel,
  .sudoku-complete-screen .complete-stats,
  .sudoku-complete-screen .complete-actions {
    grid-column: 1;
    width: 100%;
  }

  .sudoku-complete-screen .complete-panel {
    grid-row: auto;
  }

  .sudoku-complete-screen .complete-stats {
    grid-row: auto;
    grid-template-columns: 1fr 2px 1fr;
    align-self: auto;
  }

  .sudoku-complete-screen .complete-stats i {
    width: 2px;
    height: 80%;
  }

  .sudoku-complete-screen .complete-actions {
    grid-row: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
