﻿.games-hero {
  margin-bottom: 1rem;
}

.games-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 240px));
  justify-content: center;
}

.games-card-grid .game-card {
  padding: 0.75rem;
  gap: 0.6rem;
}

.games-card-grid .game-card h2 {
  margin: 0;
  font-size: 1.05rem;
}

.games-card-grid .game-card p {
  margin: 0;
  font-size: 0.92rem;
}

.game-card {
  display: grid;
  gap: 0.75rem;
}

.game-card-media-link {
  display: block;
  width: 100%;
  max-width: 180px;
  margin-inline: auto;
  line-height: 0;
  border-radius: 10px;
}

.game-card-media-link:focus-visible {
  outline: 2px solid #1f6feb;
  outline-offset: 2px;
}

.game-card-media {
  display: block;
  width: 100%;
  max-width: 180px;
  height: 180px;
  margin-inline: auto;
  object-fit: contain;
  object-position: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f6f8fc;
  flex-shrink: 0;
}

.game-card-media-placeholder {
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #1e4d9f;
  letter-spacing: 0.06em;
  height: 180px;
  max-width: 180px;
}

.game-controls {
  display: grid;
  gap: 0.8rem;
}

.game-controls label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
}

.game-controls select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem;
  background: #fff;
}

.game-status {
  margin: 0;
  color: var(--muted);
}

.game-status.error {
  color: var(--err);
}

.game-status.ok {
  color: var(--ok);
}

.game-layout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.game-layout.hidden {
  display: none;
}

.board-card {
  overflow-x: auto;
  padding: 0.6rem;
}

.board-stage {
  position: relative;
  display: inline-block;
  width: fit-content;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.word-board {
  display: grid;
  gap: var(--board-gap, 0.2rem);
  justify-content: start;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.crossword-board {
  display: grid;
  gap: 2px;
  width: min(92vw, 560px);
  margin: 0 auto;
  background: #94a3b8;
  padding: 2px;
  border-radius: 10px;
}

.cw-cell {
  position: relative;
  background: #ffffff;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  box-sizing: border-box;
  border: 1px solid rgba(15, 23, 42, 0.2);
}

.cw-block {
  background: #1f2937;
}

.cw-number {
  position: absolute;
  top: 2px;
  left: 3px;
  z-index: 2;
  font-size: 0.58rem;
  font-weight: 800;
  color: #475569;
  line-height: 1;
  pointer-events: none;
}

.cw-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  outline: none;
  text-align: center;
  font-size: clamp(0.85rem, 2.2vw, 1.15rem);
  font-weight: 700;
  text-transform: uppercase;
  color: #0f172a;
}

.cw-input:focus {
  background: #fef9c3;
}

.cw-cell.cw-start-across {
  border-left: 2.5px solid #0f172a;
}

.cw-cell.cw-end-across {
  border-right: 2.5px solid #0f172a;
}

.cw-cell.cw-start-down {
  border-top: 2.5px solid #0f172a;
}

.cw-cell.cw-end-down {
  border-bottom: 2.5px solid #0f172a;
}

.board-overlay {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: visible;
}

.confetti-layer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  opacity: 0;
  z-index: 40;
  transition: opacity 120ms ease;
}

.confetti-layer.active {
  opacity: 1;
}

.ws-cell {
  width: var(--cell-size, 2rem);
  height: var(--cell-size, 2rem);
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  font-size: var(--cell-font-size, 1rem);
  text-transform: uppercase;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.ws-cell.temp {
  background: #dbe9ff;
  border-color: #7aa9f8;
}

.ws-cell.found {
  background: #dff7eb;
  border-color: #57b37a;
}

.ws-cell.revealed {
  background: #ffeaa7;
  border-color: #fdcb6e;
}

.clues-card h2 {
  margin-top: 0;
}

.clues-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.55rem;
}

.clues-list li {
  color: var(--text);
  line-height: 1.35;
}

.clues-list li.resolved {
  color: var(--ok);
  text-decoration: line-through;
}

.clues-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  cursor: pointer;
}

.clue-hint-btn {
  flex-shrink: 0;
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  border: 1px solid #ffb700;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.15rem 0.2rem;
  border-radius: 4px;
  transition: all 0.2s;
  min-width: 24px;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clue-hint-btn:hover {
  background: linear-gradient(135deg, #ffed4e 0%, #ffd700 100%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.clue-hint-btn:active {
  transform: translateY(0);
}

.clue-hint-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeInHint 0.15s ease-out;
}

@keyframes fadeInHint {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.clue-hint-modal {
  background: var(--surface);
  border-radius: 12px;
  max-width: 400px;
  width: 90vw;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: slideUpHint 0.2s ease-out;
}

@keyframes slideUpHint {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.clue-hint-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding: 0.8rem;
}

.clue-hint-modal-header h3 {
  margin: 0;
  font-size: 1rem;
}

.clue-hint-modal-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  color: var(--muted);
  transition: color 0.2s;
}

.clue-hint-modal-close:hover {
  color: var(--text);
}

.clue-hint-modal-content {
  padding: 1rem;
  text-align: center;
}

.clue-hint-modal-content code {
  background: #f0f0f0;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-family: "Courier New", monospace;
  font-size: 1.2rem;
  font-weight: 600;
  display: inline-block;
}

.clue-hint-options {
  margin-top: 0.6rem;
  display: grid;
  gap: 0.4rem;
  text-align: left;
}

.clue-hint-option {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fbff;
  font-weight: 600;
  line-height: 1.4;
}

@media (max-width: 920px) {
  .game-layout {
    grid-template-columns: 1fr;
  }
}

.timed-layout {
  margin-top: 1rem;
}

.timed-layout.hidden {
  display: none;
}

.timed-main-card {
  display: grid;
  gap: 0.85rem;
}

.timed-hud {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.7rem;
}

.timed-stat {
  display: grid;
  gap: 0.15rem;
}

.timed-stat-label {
  color: var(--muted);
  font-size: 0.86rem;
}

.timed-stat strong {
  font-size: 1.35rem;
  line-height: 1;
}

.timed-heart {
  display: inline-block;
  margin-right: 0.12rem;
  font-size: 1.2rem;
}

.timed-heart.on {
  color: #e53935;
}

.timed-heart.off {
  color: #c7ccd6;
}

.timed-clock {
  --clock-progress: 100%;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(#1f8bff var(--clock-progress), #e8edf8 0);
  position: relative;
  font-weight: 800;
  font-size: 1.15rem;
}

.timed-clock::after {
  content: "";
  position: absolute;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: #fff;
}

.timed-clock span {
  position: relative;
  z-index: 1;
}

.timed-clock.warning {
  background: conic-gradient(#ff9800 var(--clock-progress), #f2eee6 0);
}

.timed-clock.critical {
  background: conic-gradient(#d32f2f var(--clock-progress), #f8e8e8 0);
}

.timed-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.timed-streak-indicator {
  min-width: 190px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  padding: 0.35rem 0.55rem;
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 0.2rem 0.45rem;
  align-items: center;
}

.timed-streak-indicator .streak-title {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.timed-streak-indicator .streak-number {
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
}

.timed-streak-indicator .streak-flames {
  font-size: 0.85rem;
  color: #ff8f00;
  letter-spacing: 0.05em;
}

.timed-streak-indicator .streak-meter {
  grid-column: 1 / -1;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: #e9eef7;
}

.timed-streak-indicator .streak-meter > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 180ms ease;
}

.timed-streak-indicator.cold .streak-meter > span {
  background: linear-gradient(90deg, #9bb4d8, #6b8ec3);
}

.timed-streak-indicator.warm .streak-meter > span {
  background: linear-gradient(90deg, #ffbf59, #ff9800);
}

.timed-streak-indicator.hot .streak-meter > span {
  background: linear-gradient(90deg, #ff8a65, #ef6c00);
}

.timed-streak-indicator.legend .streak-meter > span {
  background: linear-gradient(90deg, #ff5f6d, #ff1744);
}

.timed-question-bubble {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, #eef6ff, #f8fbff);
  font-weight: 700;
  line-height: 1.4;
}

.timed-question-bubble p {
  margin: 0;
}

.timed-playfield {
  position: relative;
  min-height: 390px;
  border: 1px dashed #cfd9eb;
  border-radius: 12px;
  background: radial-gradient(circle at 30% 20%, #f5f9ff, #eef4ff 60%, #e9f1ff);
  overflow: hidden;
}

.timed-inline-restart {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 5;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.9), rgba(245, 249, 255, 0.8));
}

.timed-inline-restart.hidden {
  display: none;
}

.timed-playfield.feedback-correct {
  box-shadow: inset 0 0 0 3px rgba(63, 169, 91, 0.35);
  animation: feedbackPulseCorrect 260ms ease;
}

.timed-playfield.feedback-wrong,
.timed-playfield.feedback-timeout {
  box-shadow: inset 0 0 0 3px rgba(198, 40, 40, 0.35);
  animation: feedbackPulseWrong 260ms ease;
}

.timed-hit-badge {
  position: absolute;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  z-index: 4;
  color: #fff;
  animation: hitBadgePop 620ms ease forwards;
  pointer-events: none;
}

.timed-hit-badge.success {
  background: linear-gradient(135deg, #38b36f, #2e7d32);
}

.timed-hit-badge.error {
  background: linear-gradient(135deg, #e45f5f, #c62828);
}

.timed-hit-badge.timeout {
  background: linear-gradient(135deg, #ef6c00, #d84315);
}

.timed-balloon {
  position: absolute;
  --balloon-hue: 230;
  --balloon-tilt: 0deg;
  --balloon-scale: 1;
  transform: translate(-50%, -50%);
  border: 1px solid hsl(var(--balloon-hue) 58% 38%);
  border-radius: 999px;
  background:
    radial-gradient(circle at 24% 20%, rgba(255, 255, 255, 0.44), rgba(255, 255, 255, 0) 38%),
    linear-gradient(140deg, hsl(var(--balloon-hue) 84% 72%), hsl(var(--balloon-hue) 68% 49%));
  color: #fff;
  box-shadow: 0 10px 18px rgba(36, 64, 112, 0.24);
  cursor: pointer;
  padding: 1.05rem 1.35rem;
  max-width: min(360px, 80vw);
  min-width: 170px;
  text-align: center;
  font-weight: 700;
  font-size: 1.08rem;
  line-height: 1.25;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
  overflow: visible;
  position: absolute;
  animation-name: timedBalloonFloat;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.timed-balloon p {
  margin: 0;
}

.timed-balloon::before {
  content: "";
  position: absolute;
  top: 16%;
  left: 22%;
  width: 20%;
  height: 12%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  filter: blur(0.3px);
  pointer-events: none;
}

.timed-balloon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
  width: 10px;
  height: 8px;
  border-radius: 0 0 6px 6px;
  background: hsl(var(--balloon-hue) 64% 42%);
  pointer-events: none;
}

@keyframes timedBalloonFloat {
  0% {
    transform: translate(-50%, -50%) translate(0, 0) rotate(calc(var(--balloon-tilt) * -0.35)) scale(var(--balloon-scale));
  }
  20% {
    transform: translate(-50%, -50%) translate(calc(var(--drift-x, 0) * 0.45), calc(var(--drift-y, 0) * 0.52)) rotate(calc(var(--balloon-tilt) * 0.55)) scale(calc(var(--balloon-scale) * 1.02));
  }
  50% {
    transform: translate(-50%, -50%) translate(var(--drift-x, 0), var(--drift-y, 0)) rotate(calc(var(--balloon-tilt) * -0.75)) scale(calc(var(--balloon-scale) * 0.98));
  }
  75% {
    transform: translate(-50%, -50%) translate(calc(var(--drift-x, 0) * 0.35), calc(var(--drift-y, 0) * -0.35)) rotate(calc(var(--balloon-tilt) * 0.38)) scale(calc(var(--balloon-scale) * 1.01));
  }
  100% {
    transform: translate(-50%, -50%) translate(0, 0) rotate(calc(var(--balloon-tilt) * -0.35)) scale(var(--balloon-scale));
  }
}

.timed-balloon:hover {
  filter: brightness(1.08);
}

.hangman-layout {
  margin-top: 1rem;
}

.hangman-layout.hidden {
  display: none;
}

.hangman-main-card {
  display: grid;
  gap: 0.9rem;
  position: relative;
  overflow: hidden;
}

.hangman-main-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

.hangman-lose-card {
  animation: hangman-lose-shake 0.62s cubic-bezier(0.2, 0.6, 0.3, 1);
}

.hangman-lose-card::after {
  opacity: 1;
  animation: hangman-lose-flash 0.8s ease-out;
}

.hangman-hud {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.hangman-stat {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  background: #fff;
  display: grid;
  gap: 0.12rem;
}

.hangman-stat-label {
  color: var(--muted);
  font-size: 0.82rem;
}

.hangman-stat strong {
  font-size: 1.05rem;
}

.hangman-board {
  display: grid;
  grid-template-columns: minmax(220px, 260px) 1fr;
  gap: 1rem;
  align-items: center;
}

.hangman-figure {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto;
  background: linear-gradient(180deg, #f8fbff, #f3f8ff);
  border: 1px solid #d8e3f7;
  border-radius: 12px;
}

.hangman-lose-figure {
  animation: hangman-lose-pulse 0.85s ease-out;
}

.hangman-figure .gallow,
.hangman-figure .part {
  position: absolute;
  display: block;
  background: #364c73;
  border-radius: 999px;
}

.hangman-figure .base {
  left: 30px;
  right: 30px;
  bottom: 24px;
  height: 7px;
}

.hangman-figure .pole {
  left: 56px;
  bottom: 24px;
  width: 7px;
  height: 170px;
}

.hangman-figure .top {
  left: 56px;
  top: 26px;
  width: 95px;
  height: 7px;
}

.hangman-figure .rope {
  left: 145px;
  top: 26px;
  width: 4px;
  height: 24px;
  background: #9b7f43;
}

.hangman-figure .part {
  opacity: 0;
  transition: opacity 120ms ease;
}

.hangman-figure .head {
  left: 127px;
  top: 48px;
  width: 38px;
  height: 38px;
  border: 4px solid #364c73;
  border-radius: 50%;
  background: transparent;
}

.hangman-figure .body {
  left: 145px;
  top: 86px;
  width: 4px;
  height: 56px;
}

.hangman-figure .arm-left {
  left: 145px;
  top: 94px;
  width: 4px;
  height: 32px;
  transform: rotate(45deg);
  transform-origin: top;
}

.hangman-figure .arm-right {
  left: 145px;
  top: 94px;
  width: 4px;
  height: 32px;
  transform: rotate(-45deg);
  transform-origin: top;
}

.hangman-figure .leg-left {
  left: 145px;
  top: 138px;
  width: 4px;
  height: 38px;
  transform: rotate(35deg);
  transform-origin: top;
}

.hangman-figure .leg-right {
  left: 145px;
  top: 138px;
  width: 4px;
  height: 38px;
  transform: rotate(-35deg);
  transform-origin: top;
}

.hangman-figure[data-stage="1"] .head,
.hangman-figure[data-stage="2"] .head,
.hangman-figure[data-stage="3"] .head,
.hangman-figure[data-stage="4"] .head,
.hangman-figure[data-stage="5"] .head,
.hangman-figure[data-stage="6"] .head {
  opacity: 1;
}

.hangman-figure[data-stage="2"] .body,
.hangman-figure[data-stage="3"] .body,
.hangman-figure[data-stage="4"] .body,
.hangman-figure[data-stage="5"] .body,
.hangman-figure[data-stage="6"] .body {
  opacity: 1;
}

.hangman-figure[data-stage="3"] .arm-left,
.hangman-figure[data-stage="4"] .arm-left,
.hangman-figure[data-stage="5"] .arm-left,
.hangman-figure[data-stage="6"] .arm-left {
  opacity: 1;
}

.hangman-figure[data-stage="4"] .arm-right,
.hangman-figure[data-stage="5"] .arm-right,
.hangman-figure[data-stage="6"] .arm-right {
  opacity: 1;
}

.hangman-figure[data-stage="5"] .leg-left,
.hangman-figure[data-stage="6"] .leg-left {
  opacity: 1;
}

.hangman-figure[data-stage="6"] .leg-right {
  opacity: 1;
}

.hangman-word-box {
  display: grid;
  gap: 0.65rem;
}

.hangman-hint,
.hangman-used {
  margin: 0;
}

.hangman-word-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.hangman-slot {
  min-width: 1.5rem;
  text-align: center;
  border-bottom: 2px solid #3b557f;
  padding: 0 0.12rem;
  font-size: 1.35rem;
  font-weight: 900;
}

.hangman-slot.fixed {
  border-bottom-color: transparent;
}

.hangman-keyboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
  gap: 0.45rem;
}

.hangman-end-actions {
  display: flex;
  justify-content: center;
  margin-top: 0.4rem;
}

.hangman-key {
  border: 1px solid #b9cbe9;
  background: #fff;
  border-radius: 8px;
  min-height: 38px;
  font-weight: 700;
  cursor: pointer;
}

.hangman-key.correct {
  background: #e6f7ed;
  border-color: #7fcb98;
}

.hangman-key.wrong {
  background: #ffe8e8;
  border-color: #e5a0a0;
}

.hangman-key:disabled {
  cursor: default;
  opacity: 0.65;
}

@keyframes hangman-lose-shake {
  0% { transform: translateX(0); }
  15% { transform: translateX(-10px) rotate(-0.6deg); }
  30% { transform: translateX(8px) rotate(0.6deg); }
  45% { transform: translateX(-7px) rotate(-0.4deg); }
  60% { transform: translateX(6px) rotate(0.4deg); }
  75% { transform: translateX(-4px) rotate(-0.2deg); }
  100% { transform: translateX(0); }
}

@keyframes hangman-lose-flash {
  0% {
    background: radial-gradient(circle at 50% 40%, rgba(239, 68, 68, 0.34), rgba(239, 68, 68, 0));
  }
  100% {
    background: radial-gradient(circle at 50% 40%, rgba(239, 68, 68, 0), rgba(239, 68, 68, 0));
  }
}

@keyframes hangman-lose-pulse {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(220, 38, 38, 0));
  }
  30% {
    transform: scale(1.03);
    filter: drop-shadow(0 0 10px rgba(220, 38, 38, 0.55));
  }
  60% {
    transform: scale(0.99);
    filter: drop-shadow(0 0 8px rgba(220, 38, 38, 0.4));
  }
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(220, 38, 38, 0));
  }
}

.timed-balloon.correct-reveal {
  border-color: #2e7d32;
}

.timed-balloon.correct-hit {
  background: linear-gradient(135deg, #3fa95b, #2e7d32);
  border-color: #2e7d32;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2);
  animation: balloonHitGood 420ms ease;
}

.timed-balloon.wrong-hit {
  background: linear-gradient(135deg, #d65b5b, #c62828);
  border-color: #b71c1c;
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.2);
  animation: balloonHitBad 420ms ease;
}

.timed-balloon.timeout-reveal {
  box-shadow: 0 0 0 3px rgba(239, 108, 0, 0.24);
}

.timed-balloon:disabled {
  cursor: default;
}

@keyframes feedbackPulseCorrect {
  0% { transform: scale(1); }
  50% { transform: scale(1.01); }
  100% { transform: scale(1); }
}

@keyframes feedbackPulseWrong {
  0% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}

@keyframes hitBadgePop {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px) scale(0.7);
  }
  20% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1.04);
  }
  75% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-6px) scale(0.92);
  }
}

@keyframes balloonHitGood {
  0% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.12); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes balloonHitBad {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  20% { transform: translate(-50%, -50%) rotate(-5deg); }
  40% { transform: translate(-50%, -50%) rotate(5deg); }
  60% { transform: translate(-50%, -50%) rotate(-4deg); }
  80% { transform: translate(-50%, -50%) rotate(3deg); }
  100% { transform: translate(-50%, -50%) rotate(0deg); }
}

.timed-result-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.timed-result-modal.hidden {
  display: none;
}

.timed-result-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 16, 34, 0.54);
  backdrop-filter: blur(2px);
}

.timed-result-panel {
  position: relative;
  z-index: 1;
  width: min(680px, 94vw);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: linear-gradient(145deg, #ffffff, #f5f9ff);
  box-shadow: 0 24px 54px rgba(13, 30, 61, 0.28);
  padding: 1.1rem;
  animation: timedResultModalIn 220ms ease;
}

.timed-result-panel h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2.7vw, 1.65rem);
}

.timed-result-hero {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.timed-result-message {
  margin: 0;
  color: var(--muted);
}

.timed-result-pill {
  width: fit-content;
  border: 1px solid #f2c86b;
  background: linear-gradient(135deg, #fff4cf, #ffe69a);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.timed-result-pill span {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6d5600;
}

.timed-result-pill strong {
  font-size: 1.12rem;
  line-height: 1;
}

.timed-result-sections {
  display: grid;
  gap: 0.8rem;
}

.timed-result-block h3 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  color: #24324f;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.timed-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.timed-result-grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.timed-result-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 0.7rem 0.75rem;
  display: grid;
  gap: 0.2rem;
}

.timed-result-item span {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.timed-result-item strong {
  font-size: 1.33rem;
  line-height: 1;
}

.timed-result-item.highlight {
  background: linear-gradient(135deg, #fff4cf, #ffe69a);
  border-color: #f2c86b;
}

.timed-result-item.success {
  background: linear-gradient(135deg, #e9fbe9, #cbf0cb);
  border-color: #97d697;
}

.timed-result-item.danger {
  background: linear-gradient(135deg, #ffe9e9, #ffd2d2);
  border-color: #f0aaaa;
}

.timed-result-item.warning {
  background: linear-gradient(135deg, #fff2df, #ffe5c1);
  border-color: #f0c488;
}

.timed-result-actions {
  margin-top: 1rem;
  justify-content: flex-end;
}

body.timed-result-open {
  overflow: hidden;
}

body.kids-add-page {
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.24) 1.2px, transparent 2px),
    radial-gradient(circle at 84% 34%, rgba(255, 255, 255, 0.2) 1px, transparent 2px),
    radial-gradient(circle at 48% 76%, rgba(255, 255, 255, 0.2) 1px, transparent 2px),
    linear-gradient(160deg, #091a46 0%, #17357a 42%, #2a2f89 72%, #442f8c 100%);
  background-size: 220px 220px, 250px 250px, 280px 280px, cover;
  background-attachment: fixed;
}

body.kids-add-page .app-main {
  position: relative;
  padding-top: 2rem;
  padding-bottom: 3rem;
}

/* ── Centered game board ── */
.kids-add-board {
  width: min(960px, 92%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ── Hero section ── */
.kids-add-hero {
  text-align: center;
  padding: 0.5rem 0 0.25rem;
}

.kids-add-hero h1 {
  color: #f7fbff;
  font-size: clamp(1.4rem, 4vw, 2rem);
  text-shadow: 0 3px 10px rgba(4, 13, 41, 0.5);
  margin-bottom: 0.4rem;
}

.kids-add-hero p {
  color: rgba(230, 243, 255, 0.85);
  font-size: 0.97rem;
  margin: 0;
}

.kids-add-title-icons {
  display: inline-flex;
  gap: 0.28rem;
  font-size: 0.9em;
  transform: translateY(-1px);
}

.kids-add-layout {
  /* no extra margin — gap handled by .kids-add-board */
}

.kids-add-layout.hidden {
  display: none;
}

.kids-add-main-card {
  display: grid;
  gap: 1.5rem;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 24px 55px rgba(10, 20, 62, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(240, 247, 255, 0.82));
  backdrop-filter: blur(6px);
  padding: 1.75rem 2rem;
}

.kids-add-controls {
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 18px 45px rgba(8, 18, 57, 0.32);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(242, 248, 255, 0.85));
  padding: 1.5rem 2rem;
}

.kids-add-hud {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: center;
}

.kids-add-stat {
  display: grid;
  gap: 0.2rem;
  border-radius: 999px;
  background: rgba(245, 250, 255, 0.86);
  border: 1px solid rgba(173, 198, 242, 0.8);
  box-shadow: 0 8px 18px rgba(40, 74, 130, 0.12);
  padding: 0.35rem 0.75rem;
}

.kids-add-streaks {
  justify-items: end;
}

.kids-add-label {
  color: var(--muted);
  font-size: 0.85rem;
}

.kids-heart {
  display: inline-block;
  margin-right: 0.15rem;
  font-size: 1.2rem;
}

.kids-heart.on {
  color: #e53935;
  animation: heartBeat 0.42s ease;
}

.kids-heart.off {
  color: #c7ccd6;
}

.kids-add-question-badge {
  border: 1px solid #a8c4f4;
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  background: linear-gradient(135deg, #eff6ff, #dfeeff);
  box-shadow: 0 8px 16px rgba(44, 85, 153, 0.14);
  font-weight: 800;
}

.kids-add-progress-wrap {
  display: grid;
  gap: 0.35rem;
}

.kids-add-progress-label {
  font-size: 0.84rem;
  color: #31518a;
  font-weight: 700;
}

.kids-add-progress-track {
  height: 14px;
  border-radius: 999px;
  background: rgba(219, 230, 246, 0.92);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(11, 28, 67, 0.18);
}

.kids-add-progress-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #3fd17f, #39a6ff);
  transition: width 260ms ease;
}

.kids-add-problem {
  text-align: center;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  border-radius: 18px;
  border: 1px solid #bfd4f8;
  background: linear-gradient(135deg, #f7fbff, #e8f2ff);
  box-shadow: 0 12px 24px rgba(50, 88, 153, 0.16);
  color: #163b73;
  padding: 1.15rem;
}

.kids-add-playfield {
  position: relative;
  display: grid;
  gap: 0.75rem;
  border: 1px dashed #c3d7f4;
  border-radius: 18px;
  background: radial-gradient(circle at 30% 20%, #f8fbff, #eef5ff 60%, #e7efff);
  padding: 0.85rem;
}

.kids-add-playfield.feedback-correct {
  box-shadow: inset 0 0 0 3px rgba(63, 169, 91, 0.35);
  animation: feedbackPulseCorrect 260ms ease;
}

.kids-add-playfield.feedback-wrong {
  box-shadow: inset 0 0 0 3px rgba(198, 40, 40, 0.35);
  animation: feedbackPulseWrong 260ms ease;
}

.kids-add-hit-badge {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  padding: 0.35rem 0.72rem;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.88rem;
  z-index: 3;
  color: #fff;
  animation: hitBadgePop 620ms ease forwards;
  pointer-events: none;
}

.kids-add-hit-badge.success {
  background: linear-gradient(135deg, #38b36f, #2e7d32);
}

.kids-add-hit-badge.error {
  background: linear-gradient(135deg, #e45f5f, #c62828);
}

.kids-add-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 0.9rem;
}

.kids-add-option {
  border: 1px solid #c0d3f2;
  border-radius: 18px;
  background: linear-gradient(145deg, #f9fcff, #f0f7ff);
  color: #183d74;
  font-size: 1.5rem;
  font-weight: 800;
  min-height: 88px;
  cursor: pointer;
  box-shadow: 0 12px 20px rgba(27, 59, 112, 0.14);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.kids-add-option:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 16px 24px rgba(23, 56, 112, 0.24);
}

.kids-add-option:active:not(:disabled) {
  transform: scale(0.97);
}

.kids-add-option.variant-1 {
  background: linear-gradient(145deg, #d9efff, #bee4ff);
  border-color: #9ccbf2;
}

.kids-add-option.variant-2 {
  background: linear-gradient(145deg, #daf7df, #c4f0ce);
  border-color: #9fd7ab;
}

.kids-add-option.variant-3 {
  background: linear-gradient(145deg, #fff4d8, #ffe6a6);
  border-color: #efce7d;
}

.kids-add-option.variant-4 {
  background: linear-gradient(145deg, #ffe3f5, #ffcceb);
  border-color: #e9add4;
}

.kids-add-option:disabled {
  cursor: default;
}

.kids-add-option.correct {
  background: linear-gradient(135deg, #d8f6e6, #edfff5);
  border-color: #47a370;
  color: #1f5f40;
  animation: kidsAnswerPop 280ms ease;
}

.kids-add-option.wrong {
  background: linear-gradient(135deg, #ffe2e2, #fff3f3);
  border-color: #db5a5a;
  color: #8f2a2a;
  animation: kidsAnswerShake 320ms ease;
}

.kids-add-actions {
  display: flex;
  justify-content: flex-end;
}

.kids-add-result-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.kids-add-result-modal.hidden {
  display: none;
}

.kids-add-result-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 16, 34, 0.54);
  backdrop-filter: blur(2px);
}

.kids-add-result-panel {
  position: relative;
  z-index: 1;
  width: min(680px, 94vw);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: linear-gradient(145deg, #ffffff, #f5f9ff);
  box-shadow: 0 24px 54px rgba(13, 30, 61, 0.28);
  padding: 1.1rem;
  animation: timedResultModalIn 220ms ease;
}

.kids-add-result-hero {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.kids-add-result-message {
  margin: 0;
  color: var(--muted);
}

.kids-add-result-pill {
  width: fit-content;
  border: 1px solid #f2c86b;
  background: linear-gradient(135deg, #fff4cf, #ffe69a);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.kids-add-result-pill span {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6d5600;
}

.kids-add-result-pill strong {
  font-size: 1.12rem;
  line-height: 1;
}

.kids-add-result-sections {
  display: grid;
  gap: 0.8rem;
}

.kids-add-result-block h3 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  color: #24324f;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kids-add-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.kids-add-result-grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kids-add-result-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 0.7rem 0.75rem;
  display: grid;
  gap: 0.2rem;
}

.kids-add-result-item span {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kids-add-result-item strong {
  font-size: 1.33rem;
  line-height: 1;
}

.kids-add-result-item.success {
  background: linear-gradient(135deg, #e9fbe9, #cbf0cb);
  border-color: #97d697;
}

.kids-add-result-item.danger {
  background: linear-gradient(135deg, #ffe9e9, #ffd2d2);
  border-color: #f0aaaa;
}

.kids-add-result-item.warning {
  background: linear-gradient(135deg, #fff2df, #ffe5c1);
  border-color: #f0c488;
}

.kids-add-result-actions {
  margin-top: 1rem;
  justify-content: flex-end;
}

body.kids-add-result-open {
  overflow: hidden;
}

.kids-add-stat.life-lost {
  animation: kidsLifeLost 380ms ease;
}

@keyframes kidsAnswerPop {
  0% { transform: scale(1); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes kidsAnswerShake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

@keyframes kidsLifeLost {
  0% { transform: scale(1); }
  45% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes heartBeat {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@keyframes timedResultModalIn {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 920px) {
  .timed-hud {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .timed-progress {
    justify-content: center;
  }

  .timed-playfield {
    min-height: 460px;
  }

  .timed-balloon {
    max-width: min(320px, 88vw);
    min-width: 150px;
    font-size: 1.02rem;
  }

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

  .timed-result-grid-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hangman-board {
    grid-template-columns: 1fr;
  }

  .hangman-hud {
    grid-template-columns: 1fr;
  }

  .kids-add-hud {
    grid-template-columns: 1fr;
  }

  .kids-add-streaks {
    justify-items: start;
  }
}

@media (max-width: 560px) {
  .timed-result-grid {
    grid-template-columns: 1fr;
  }

  .timed-result-actions {
    justify-content: stretch;
  }

  .kids-add-options {
    grid-template-columns: 1fr;
  }

  .kids-add-result-grid {
    grid-template-columns: 1fr;
  }

  .kids-add-result-actions {
    justify-content: stretch;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PLANO CARTESIANO – educational game
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Page background ── */
body.plano-page {
  background: linear-gradient(160deg, #e8f4ff 0%, #d0e8ff 50%, #e2d9ff 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* ── Centered board wrapper ── */
.plano-board {
  width: min(960px, 92%);
  margin: 0 auto;
  padding: 2rem 0 3rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Screen visibility ── */
.plano-screen { display: block; }
.plano-screen.hidden { display: none; }

/* ── Shared card shell ── */
.plano-card {
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(40, 80, 180, 0.12);
  padding: 2rem;
}

/* ─── INTRO SCREEN ─────────────────────────────────────────────── */
#plano-intro {
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 8px 40px rgba(40, 80, 180, 0.13);
  padding: 2.5rem 2rem;
  text-align: center;
}

.plano-intro-header {
  margin-bottom: 1.5rem;
}

.plano-mascot {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 0.5rem;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(80,100,200,0.2));
}

.plano-title {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 900;
  color: #1a3a8c;
  margin: 0 0 0.4rem;
}

.plano-subtitle {
  font-size: 1.05rem;
  color: #4a6ab8;
  margin: 0;
}

.plano-choose-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #5570b0;
  margin: 0 0 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.plano-mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.plano-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 1.4rem 0.8rem;
  background: linear-gradient(145deg, #eef4ff, #ddeeff);
  border: 2px solid #b8d2f8;
  border-radius: 20px;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
  box-shadow: 0 4px 14px rgba(50, 100, 200, 0.1);
  color: #1a3a8c;
}

.plano-mode-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 24px rgba(50, 100, 200, 0.18);
  border-color: #6699ee;
}

.plano-mode-btn:active { transform: scale(0.97); }

.plano-mode-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.plano-mode-btn strong {
  font-size: 0.95rem;
  font-weight: 800;
  display: block;
}

.plano-mode-btn small {
  font-size: 0.78rem;
  color: #5570b0;
  display: block;
  line-height: 1.3;
}

/* ─── LEVEL SELECT ────────────────────────────────────────────── */
#plano-level-select {
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 8px 40px rgba(40, 80, 180, 0.13);
  padding: 2rem;
}

.plano-level-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #1a3a8c;
  margin: 1rem 0 1.2rem;
  text-align: center;
}

.plano-level-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.plano-level-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1.3rem 0.8rem;
  background: linear-gradient(145deg, #fffae8, #fff0c8);
  border: 2px solid #f2d86a;
  border-radius: 20px;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
  box-shadow: 0 4px 12px rgba(180, 140, 20, 0.12);
  color: #7a5200;
}

.plano-level-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 20px rgba(180, 140, 20, 0.2);
}

.plano-level-btn:active { transform: scale(0.97); }

.plano-level-stars { font-size: 1.4rem; line-height: 1; }
.plano-level-btn strong { font-size: 0.95rem; font-weight: 800; }
.plano-level-btn small { font-size: 0.78rem; color: #9a7020; line-height: 1.3; }

/* back button shared */
.plano-back-btn {
  background: none;
  border: none;
  padding: 0.35rem 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: #4a6ab8;
  cursor: pointer;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.plano-back-btn:hover { color: #1a3a8c; text-decoration: underline; }

/* ─── GAME SCREEN ─────────────────────────────────────────────── */
#plano-game {
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 8px 40px rgba(40, 80, 180, 0.13);
  padding: 1.5rem 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

#plano-game.hidden { display: none; }

.plano-game-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.plano-hud {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.plano-hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #eef4ff;
  border: 1px solid #c8daf8;
  border-radius: 14px;
  padding: 0.35rem 0.8rem;
  min-width: 54px;
}

.plano-hud-label {
  font-size: 0.7rem;
  color: #5570b8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.plano-hud-item strong { font-size: 1.1rem; font-weight: 900; color: #1a3a8c; }
.plano-lives-display { font-size: 1rem; line-height: 1.4; }

.plano-hint-btn {
  background: linear-gradient(135deg, #fff4c8, #ffe89a);
  border: 2px solid #f2d05a;
  border-radius: 14px;
  padding: 0.5rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #7a5200;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 3px 8px rgba(180,130,0,0.12);
}

.plano-hint-btn:hover { transform: scale(1.04); box-shadow: 0 5px 14px rgba(180,130,0,0.2); }

/* ── Instruction ── */
.plano-instruction-wrap {
  background: linear-gradient(135deg, #eef4ff, #e4edff);
  border: 1px solid #c0d4f8;
  border-radius: 16px;
  padding: 0.85rem 1.2rem;
}

.plano-instruction {
  margin: 0;
  font-size: 1.05rem;
  color: #1a3a8c;
  line-height: 1.5;
}

.plano-instruction .plano-coord {
  font-family: 'Courier New', monospace;
  font-size: 1.1em;
  font-weight: 900;
  color: #c0392b;
  background: #fff0ee;
  border-radius: 6px;
  padding: 0 4px;
}

/* ── Hint box ── */
.plano-hint-box {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: linear-gradient(135deg, #fffbe6, #fff4c0);
  border: 1px solid #f2d06a;
  border-radius: 14px;
  padding: 0.75rem 1rem;
}

.plano-hint-box.hidden { display: none; }

.plano-hint-icon { font-size: 1.3rem; flex-shrink: 0; line-height: 1; }

.plano-hint-box p {
  margin: 0;
  font-size: 0.92rem;
  color: #7a5200;
  line-height: 1.5;
}

/* ── Canvas ── */
.plano-canvas-wrap {
  display: flex;
  justify-content: center;
  border-radius: 18px;
  overflow: hidden;
  background: #f5f9ff;
  border: 1px solid #c8daf8;
  box-shadow: inset 0 2px 6px rgba(40, 80, 180, 0.07);
}

#plano-canvas {
  display: block;
  width: 100%;
  max-width: 480px;
  height: auto;
  cursor: crosshair;
  border-radius: 18px;
}

/* ── MCQ options ── */
.plano-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.plano-options.hidden { display: none; }

.plano-option-btn {
  border-radius: 16px;
  border: 2px solid #b8d2f8;
  background: linear-gradient(145deg, #eef4ff, #dde8ff);
  color: #1a3a8c;
  font-size: 1.2rem;
  font-weight: 800;
  font-family: 'Courier New', monospace;
  padding: 0.9rem 0.5rem;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
  box-shadow: 0 4px 12px rgba(50, 100, 200, 0.1);
}

.plano-option-btn:hover:not(:disabled) {
  transform: scale(1.04);
  box-shadow: 0 6px 18px rgba(50, 100, 200, 0.18);
}

.plano-option-btn:active:not(:disabled) { transform: scale(0.97); }
.plano-option-btn:disabled { cursor: default; }

.plano-option-btn.variant-1 { background: linear-gradient(145deg, #ddeeff, #c8e4ff); border-color: #90c2f2; }
.plano-option-btn.variant-2 { background: linear-gradient(145deg, #ddfff0, #c4f5df); border-color: #86dab0; }
.plano-option-btn.variant-3 { background: linear-gradient(145deg, #fff8dd, #ffe8a0); border-color: #ecc85a; }
.plano-option-btn.variant-4 { background: linear-gradient(145deg, #ffe4f8, #ffc8ee); border-color: #e8a0d8; }

.plano-option-btn.correct {
  background: linear-gradient(135deg, #d0f5e0, #eafff4);
  border-color: #3aaf65;
  color: #1a5a30;
}

.plano-option-btn.wrong {
  background: linear-gradient(135deg, #ffe4e4, #fff2f2);
  border-color: #e05050;
  color: #7a2020;
}

/* ── Feedback ── */
.plano-feedback {
  border-radius: 14px;
  padding: 0.85rem 1.1rem;
  font-size: 0.95rem;
  line-height: 1.55;
}

.plano-feedback.hidden { display: none; }

.plano-feedback-correct {
  background: linear-gradient(135deg, #d4f5e0, #e8fff2);
  border: 1px solid #5ab87a;
  color: #1a5a30;
}

.plano-feedback-wrong {
  background: linear-gradient(135deg, #ffe6e6, #fff4f4);
  border: 1px solid #e06060;
  color: #7a1a1a;
}

.plano-feedback-neutral {
  background: #eef4ff;
  border: 1px solid #b0c8f0;
  color: #2a4a8c;
}

/* ── Game actions ── */
.plano-game-actions { display: flex; justify-content: flex-end; }

.plano-next-btn { min-width: 160px; font-size: 1rem; }
.plano-next-btn.hidden { display: none; }

/* ─── RESULT SCREEN ───────────────────────────────────────────── */
#plano-result {
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 8px 40px rgba(40, 80, 180, 0.13);
  padding: 2.5rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
}

#plano-result.hidden { display: none; }

.plano-result-mascot { font-size: 4rem; line-height: 1; }

.plano-result-title {
  font-size: 1.9rem;
  font-weight: 900;
  color: #1a3a8c;
  margin: 0;
}

.plano-result-message {
  font-size: 1rem;
  color: #4a6ab8;
  margin: 0;
}

.plano-result-stars {
  font-size: 2.2rem;
  letter-spacing: 0.15em;
  line-height: 1;
}

.plano-result-stats {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.plano-result-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.6rem 1.2rem;
  border-radius: 16px;
  min-width: 80px;
  background: #eef4ff;
  border: 1px solid #c0d4f8;
}

.plano-result-stat span { font-size: 0.75rem; font-weight: 700; color: #5570b8; text-transform: uppercase; }
.plano-result-stat strong { font-size: 1.6rem; font-weight: 900; color: #1a3a8c; }
.plano-result-stat.success { background: #d8f5e4; border-color: #7ad0a0; }
.plano-result-stat.success strong { color: #1a5a30; }
.plano-result-stat.danger  { background: #ffe8e8; border-color: #f0a0a0; }
.plano-result-stat.danger strong  { color: #7a1a1a; }
.plano-result-stat.accent  { background: #fff4cc; border-color: #f0d060; }
.plano-result-stat.accent strong  { color: #7a5000; }

.plano-result-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Responsive ── */
@media (max-width: 680px) {
  .plano-mode-grid,
  .plano-level-grid {
    grid-template-columns: 1fr;
  }

  .plano-hud {
    justify-content: flex-start;
    gap: 0.5rem;
  }

  .plano-options {
    grid-template-columns: 1fr;
  }

  .plano-result-actions {
    flex-direction: column;
    align-items: stretch;
  }

  #plano-intro,
  #plano-level-select,
  #plano-game,
  #plano-result {
    padding: 1.25rem 1rem;
  }
}
/* ═══════════════════════════════════════════════════════════════════════════
   NÚMEROS Y PALABRAS – number/word recognition game
   Inherits most styles from .kids-add-* family.
   ═══════════════════════════════════════════════════════════════════════════ */

.numwords-hero {
  text-align: center;
  padding: 0.5rem 0 0.25rem;
}

.numwords-hero h1 {
  color: #f7fbff;
  font-size: clamp(1.4rem, 4vw, 2rem);
  text-shadow: 0 3px 10px rgba(4, 13, 41, 0.5);
  margin-bottom: 0.4rem;
}

.numwords-hero p {
  color: rgba(230, 243, 255, 0.85);
  font-size: 0.97rem;
  margin: 0;
}

.numwords-playfield {
  position: relative;
  display: grid;
  gap: 1rem;
  border: 1px dashed #c3d7f4;
  border-radius: 18px;
  background: radial-gradient(circle at 30% 20%, #f8fbff, #eef5ff 60%, #e7efff);
  padding: 1rem 0.85rem;
}

.numwords-playfield.feedback-correct {
  box-shadow: inset 0 0 0 3px rgba(63, 169, 91, 0.35);
  animation: feedbackPulseCorrect 260ms ease;
}

.numwords-playfield.feedback-wrong {
  box-shadow: inset 0 0 0 3px rgba(198, 40, 40, 0.35);
  animation: feedbackPulseWrong 260ms ease;
}

.numwords-mode-badge {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  width: fit-content;
  margin: 0 auto;
}

.numwords-badge-num {
  background: linear-gradient(135deg, #ddeeff, #c8e4ff);
  color: #1a4a8c;
  border: 1px solid #90c2f2;
}

.numwords-badge-word {
  background: linear-gradient(135deg, #e8d8ff, #d4bcff);
  color: #4a1a8c;
  border: 1px solid #b090e8;
}

.numwords-question {
  text-align: center;
  font-size: clamp(1.1rem, 3.5vw, 1.7rem);
  font-weight: 900;
  border-radius: 18px;
  border: 1px solid #bfd4f8;
  background: linear-gradient(135deg, #f7fbff, #e8f2ff);
  box-shadow: 0 12px 24px rgba(50, 88, 153, 0.16);
  color: #163b73;
  padding: 1.1rem 1rem;
  line-height: 1.4;
  word-break: break-word;
}

.numwords-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.numwords-options .kids-add-option {
  font-size: 1rem;
  min-height: 64px;
  line-height: 1.35;
  word-break: break-word;
  white-space: normal;
}

.numwords-loading {
  grid-column: 1 / -1;
  text-align: center;
  color: #5570b0;
  font-size: 0.95rem;
  padding: 1rem;
}

@media (max-width: 560px) {
  .numwords-options {
    grid-template-columns: 1fr;
  }
}

/* ── Multiplication table picker ───────────────────────────────────────────── */
.mult-table-picker {
  border: none;
  padding: 0;
  margin: 0 0 0.75rem;
}

.mult-table-picker-legend {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.mult-table-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.mult-table-check-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  background: #f0f5ff;
  border: 1.5px solid #bfd0f7;
  border-radius: 8px;
  padding: 0.3rem 0.65rem;
  font-weight: 700;
  font-size: 1rem;
  color: #1e4d9f;
  transition: background 0.15s, border-color 0.15s;
  user-select: none;
}

.mult-table-check-label:has(input:checked) {
  background: #dce8ff;
  border-color: #4a7de8;
}

.mult-table-check-label input[type="checkbox"] {
  accent-color: #2952a8;
  width: 1.1rem;
  height: 1.1rem;
}

.mult-table-picker-actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 1rem;
}

.btn-link {
  background: none;
  border: none;
  padding: 0;
  color: #2952a8;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
}

.btn-link:hover {
  color: #1a3a7c;
}

/* ── Patrones Visuales ───────────────────────────────────────────────────── */
body.patterns-page {
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.2) 1px, transparent 2px),
    radial-gradient(circle at 90% 40%, rgba(255, 255, 255, 0.2) 1px, transparent 2px),
    linear-gradient(160deg, #ff8fab 0%, #ffd166 35%, #79c7ff 68%, #9f86ff 100%);
  background-size: 220px 220px, 260px 260px, cover;
  background-attachment: fixed;
}

.patterns-board {
  width: min(1040px, 95%);
  margin: 1.5rem auto 2.25rem;
  display: grid;
  gap: 1.2rem;
}

.patterns-screen {
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 40px rgba(50, 50, 90, 0.22);
  padding: 1.5rem;
  display: grid;
  gap: 1.1rem;
}

.patterns-screen.hidden {
  display: none;
}

.patterns-screen h1,
.patterns-screen h2 {
  margin: 0;
  color: #1f2d62;
  font-size: clamp(1.55rem, 3.6vw, 2.25rem);
}

.patterns-screen p {
  margin: 0;
  color: #354b80;
  font-size: 1.05rem;
  line-height: 1.45;
}

.patterns-big-btn {
  min-height: 58px;
  font-size: 1.15rem;
  font-weight: 800;
  border-radius: 999px;
}

.patterns-setup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.patterns-setup-grid label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
}

.patterns-setup-grid select {
  border: 1px solid #bfd0f7;
  border-radius: 10px;
  padding: 0.55rem;
  background: #fff;
}

.patterns-unlock-msg {
  color: #2a4a8d;
  font-weight: 600;
  font-size: 1rem;
}

.patterns-hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.patterns-stat {
  border-radius: 18px;
  border: 1px solid #d9e4ff;
  background: #f8fbff;
  padding: 0.65rem 0.8rem;
  display: grid;
  gap: 0.2rem;
}

.patterns-stat span {
  font-size: 0.84rem;
  color: #5472a8;
  text-transform: uppercase;
}

.patterns-stat strong {
  font-size: 1.2rem;
}

.patterns-heart.on {
  color: #e63946;
}

.patterns-heart.off {
  color: #bcc4d5;
}

.patterns-question {
  font-size: clamp(1.15rem, 3vw, 1.45rem);
  font-weight: 700;
  color: #1f2d62;
}

.patterns-sequence {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  min-height: 82px;
  align-items: center;
}

.pattern-token {
  width: 68px;
  height: 68px;
  border: 3px solid rgba(34, 54, 99, 0.15);
  background: var(--token-color, #9ca3af);
  display: inline-block;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.16);
}

.pattern-token.small {
  width: 44px;
  height: 44px;
}

.pattern-token.shape-circle {
  border-radius: 50%;
}

.pattern-token.shape-square {
  border-radius: 10px;
}

.pattern-token.shape-triangle {
  border: none;
  clip-path: polygon(50% 5%, 95% 95%, 5% 95%);
}

.pattern-token.shape-star {
  border: none;
  clip-path: polygon(50% 3%, 61% 35%, 95% 35%, 68% 55%, 78% 90%, 50% 69%, 22% 90%, 32% 55%, 5% 35%, 39% 35%);
}

.pattern-token.missing {
  border-radius: 16px;
  background: #fff;
  border: 3px dashed #8aa4d9;
  color: #365995;
  font-size: 1.8rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.patterns-options {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.patterns-option {
  border: 3px solid #d6e2ff;
  border-radius: 18px;
  background: #fff;
  min-height: 98px;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0.5rem;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.patterns-option:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #7ea4f2;
}

.patterns-option.correct {
  border-color: #4caf50;
  background: #edf9ee;
  animation: patternsPop 380ms ease;
}

.patterns-option.wrong {
  border-color: #e53935;
  background: #ffefef;
  animation: patternsShake 340ms ease;
}

.patterns-option-strip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.patterns-feedback {
  min-height: 1.6rem;
  font-weight: 700;
  font-size: 1.02rem;
}

.patterns-feedback.ok {
  color: #1f8a3d;
  animation: patternsPulseText 360ms ease;
}

.patterns-feedback.error {
  color: #bf1e2d;
  animation: patternsPulseText 360ms ease;
}

.patterns-screen.effect-correct .patterns-sequence {
  animation: patternsGlow 420ms ease;
}

.patterns-screen.effect-error .patterns-sequence {
  animation: patternsShake 360ms ease;
}

.patterns-burst {
  grid-column: 1 / -1;
  justify-self: center;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  pointer-events: none;
  opacity: 0;
  animation: patternsBurstUp 620ms ease-out forwards;
}

.patterns-burst.ok {
  color: #1f8a3d;
}

.patterns-burst.error {
  color: #bf1e2d;
}

@keyframes patternsPop {
  0% { transform: scale(0.85); }
  55% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes patternsShake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

@keyframes patternsGlow {
  0% { box-shadow: none; }
  50% { box-shadow: 0 0 0 6px rgba(76, 175, 80, 0.22); }
  100% { box-shadow: none; }
}

@keyframes patternsPulseText {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes patternsBurstUp {
  0% { opacity: 0; transform: translateY(4px) scale(0.95); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-14px) scale(1.06); }
}

.patterns-result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.patterns-result-item {
  border-radius: 16px;
  border: 1px solid #d6e2ff;
  background: #f8fbff;
  padding: 0.75rem;
  display: grid;
  gap: 0.25rem;
}

.patterns-result-item span {
  font-size: 0.82rem;
  color: #5c78ad;
  text-transform: uppercase;
}

.patterns-result-item strong {
  font-size: 1.35rem;
  color: #1f2d62;
}

@media (max-width: 860px) {
  .patterns-hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 620px) {
  .patterns-setup-grid {
    grid-template-columns: 1fr;
  }

  .patterns-option {
    min-height: 88px;
  }

  .pattern-token {
    width: 58px;
    height: 58px;
  }

  .pattern-token.small {
    width: 38px;
    height: 38px;
  }
}

/* Patrones visuales: modo y niveles estilo plano cartesiano */
.patterns-choose-label {
  font-weight: 700;
  color: #243b77;
  font-size: 1.08rem;
}

.patterns-mode-grid,
.patterns-level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.85rem;
}

.patterns-mode-btn,
.patterns-level-btn {
  border: 2px solid #ffd166;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff9e6, #fff1c9);
  min-height: 126px;
  padding: 1rem 0.9rem;
  text-align: left;
  display: grid;
  gap: 0.45rem;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.patterns-mode-btn:hover,
.patterns-level-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #f1b41c;
}

.patterns-mode-icon,
.patterns-level-stars {
  font-size: 1.5rem;
  line-height: 1;
}

.patterns-mode-btn strong,
.patterns-level-btn strong {
  font-size: 1.05rem;
  color: #2d3a6f;
}

.patterns-mode-btn small,
.patterns-level-btn small {
  font-size: 0.88rem;
  color: #84611c;
  line-height: 1.3;
}

.patterns-level-btn:disabled,
.patterns-level-btn.locked {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ==================== MEMORY VISUAL GAME ==================== */

.memory-page {
  background: #f5f8ff;
}

.memory-board {
  max-width: min(1080px, 95%);
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  display: grid;
  gap: 1.4rem;
}

/* ---- Screens ---- */
.memory-screen {
  display: grid;
  gap: 1.2rem;
}

.memory-screen.hidden {
  display: none;
}

.memory-screen h1 {
  font-size: clamp(1.6rem, 3.8vw, 2.4rem);
  color: #1c2d6e;
  text-align: center;
  margin: 0;
}

.memory-screen h2 {
  font-size: clamp(1.2rem, 2.8vw, 1.75rem);
  color: #1c2d6e;
  text-align: center;
  margin: 0;
}

.memory-screen > p {
  text-align: center;
  color: #4a5e9e;
  font-size: 1.05rem;
  margin: 0;
}

/* ---- Level buttons ---- */
.memory-choose-label {
  font-weight: 700;
  color: #243b77;
  font-size: 1.08rem;
  text-align: center;
}

.memory-level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
}

.memory-level-btn {
  border: 2px solid #6ec6ff;
  border-radius: 18px;
  background: linear-gradient(180deg, #e8f4ff, #c9e6ff);
  min-height: 122px;
  padding: 1rem 0.9rem;
  text-align: left;
  display: grid;
  gap: 0.4rem;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
  color: inherit;
  font-family: inherit;
}

.memory-level-btn:hover {
  transform: translateY(-2px);
  border-color: #2196f3;
}

.memory-level-stars {
  font-size: 1.4rem;
  line-height: 1;
}

.memory-level-btn strong {
  font-size: 1.05rem;
  color: #144a7a;
}

.memory-level-btn small {
  font-size: 0.86rem;
  color: #2a6083;
  line-height: 1.3;
}

.memory-unlock-msg {
  text-align: center;
  color: #5c78ad;
  font-size: 0.88rem;
}

/* ---- Preview banner (shown in game screen before play begins) ---- */
.memory-preview-banner {
  background: linear-gradient(90deg, #1d4ed8, #3b82f6);
  color: #fff;
  border-radius: 12px;
  padding: 0.65rem 1.1rem;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.memory-preview-banner strong {
  font-size: 1.4rem;
  margin-left: 0.3rem;
}

.memory-preview-banner.hidden {
  display: none;
}

/* ---- HUD ---- */
.memory-hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  background: #eef4ff;
  border-radius: 16px;
  padding: 0.75rem;
}

.memory-stat {
  display: grid;
  gap: 0.15rem;
  text-align: center;
}

.memory-stat span {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5c78ad;
}

.memory-stat strong {
  font-size: 1.2rem;
  color: #1c2d6e;
}

.memory-heart.on {
  color: #e74c3c;
}

.memory-heart.off {
  color: #d0d8ec;
}

#memory-timer {
  transition: color 0.3s ease;
}

#memory-timer.timer-active {
  color: #1c6e4a;
}

#memory-timer.timer-warning {
  color: #d97706;
  animation: memoryPulse 0.8s ease infinite;
}

#memory-timer.timer-critical {
  color: #dc2626;
  animation: memoryPulse 0.4s ease infinite;
}

/* ---- Card grid ---- */
.memory-cards {
  display: grid;
  gap: 0.55rem;
  margin: 0 auto;
  width: fit-content;
}

/* ---- Individual card ---- */
.memory-card {
  width: var(--memory-card-size, 88px);
  height: var(--memory-card-size, 88px);
  border: 2px solid #aac4f0;
  border-radius: 14px;
  font-size: 2.2rem;
  cursor: pointer;
  font-family: inherit;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #aac4f0;
  transition: transform 0.15s ease, border-color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(30, 80, 180, 0.10);
}

.memory-card:hover:not(:disabled):not(.matched) {
  transform: scale(1.05);
  border-color: #3b82f6;
}

.memory-card.revealed {
  background: linear-gradient(135deg, #ffffff, #f0f7ff);
  border-color: #60a5fa;
  color: inherit;
  animation: memoryFlip 0.25s ease;
}

.memory-card.matched {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border-color: #34d399;
  opacity: 0.88;
  cursor: default;
  box-shadow: 0 2px 8px rgba(52, 211, 153, 0.25);
}

.memory-card.shake {
  animation: memoryShake 0.45s ease;
  border-color: #f87171;
  background: linear-gradient(135deg, #fee2e2, #fecaca);
}

.memory-card.burst {
  animation: memoryBurst 0.55s ease;
}

/* ---- Actions ---- */
.memory-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.memory-big-btn {
  min-width: 180px;
}

/* ---- Result screen ---- */
.memory-result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.memory-result-item {
  border-radius: 16px;
  border: 1px solid #c8dcff;
  background: #f4f7ff;
  padding: 0.75rem;
  display: grid;
  gap: 0.25rem;
  text-align: center;
}

.memory-result-item span {
  font-size: 0.82rem;
  color: #5c78ad;
  text-transform: uppercase;
}

.memory-result-item strong {
  font-size: 1.35rem;
  color: #1c2d6e;
}

/* ---- Animations ---- */
@keyframes memoryPop {
  0% { transform: scale(0.8); opacity: 0; }
  70% { transform: scale(1.06); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes memoryFlip {
  0% { transform: rotateY(90deg); }
  100% { transform: rotateY(0deg); }
}

@keyframes memoryShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@keyframes memoryBurst {
  0% { transform: scale(1); }
  30% { transform: scale(1.18); }
  60% { transform: scale(0.96); }
  100% { transform: scale(1); }
}

@keyframes memoryPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .memory-hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 620px) {
  .memory-level-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .memory-card {
    --memory-card-size: 62px;
    font-size: 1.75rem;
  }
}

/* ──────────────────────────────────────────
   Games Hub Categories
──────────────────────────────────────────── */
.games-category {
  margin-bottom: 2.5rem;
}
.games-category-title {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  color: #1c2d6e;
  border-bottom: 2px solid #dbeafe;
  padding-bottom: 0.5rem;
  margin-bottom: 1.2rem;
}

/* ══════════════════════════════════════════════════════════════
   Secuencia Visual — Juego de Memoria Secuencial
══════════════════════════════════════════════════════════════ */

.sequence-page {
  background: radial-gradient(circle at top right, #eef4ff, #f9fafc 45%, #f5f7fb);
}

.seq-board {
  width: min(680px, 96%);
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.seq-screen { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.seq-screen.hidden { display: none; }

.seq-title {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  color: #1c2d6e;
  margin: 0;
  text-align: center;
}
.seq-subtitle {
  color: #5b6475;
  text-align: center;
  max-width: 480px;
  line-height: 1.55;
  margin: 0;
}
.seq-section-label {
  font-size: 1rem;
  color: #5b6475;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0.5rem 0 0;
}

.seq-level-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  width: 100%;
  max-width: 480px;
}
.seq-level-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 1rem 0.75rem;
  background: #fff;
  border: 2px solid #d8deea;
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}
.seq-level-btn:hover {
  border-color: #0f6dff;
  box-shadow: 0 4px 14px rgba(15,109,255,0.15);
  transform: translateY(-2px);
}
.seq-level-btn strong { font-size: 1rem; color: #1c2d6e; }
.seq-level-btn small  { font-size: 0.78rem; color: #5b6475; text-align: center; }
.seq-level-stars      { font-size: 1.2rem; }

.seq-hud {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}
.seq-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border: 1px solid #d8deea;
  border-radius: 10px;
  padding: 0.5rem 1rem;
  min-width: 72px;
}
.seq-stat span  { font-size: 0.72rem; color: #5b6475; text-transform: uppercase; letter-spacing: 0.05em; }
.seq-stat strong { font-size: 1.25rem; color: #1c2d6e; font-weight: 700; }
.seq-stat--level { border-color: #0f6dff; }

.seq-status-bar {
  min-height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.seq-status-msg {
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: #eaf1ff;
  color: #1448aa;
  transition: background 0.2s, color 0.2s;
}
.seq-status-msg.seq-status--info    { background: #eaf1ff; color: #1448aa; }
.seq-status-msg.seq-status--waiting { background: #fff8e1; color: #7a5700; }
.seq-status-msg.seq-status--ok      { background: #e8f8ef; color: #00663d; }
.seq-status-msg.seq-status--error   { background: #ffecef; color: #b00020; }

.seq-progress-wrap {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e7edf8;
  overflow: hidden;
}
.seq-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0f6dff, #00b7a5);
  border-radius: 999px;
  transition: width 0.2s ease;
}

.seq-grid-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  position: relative;
}
.seq-grid {
  display: grid;
  gap: 0.5rem;
  width: fit-content;
}
.seq-cell {
  width: var(--seq-cell-size, 80px);
  height: var(--seq-cell-size, 80px);
  border: 2px solid #c8d4e8;
  border-radius: 12px;
  background: #f0f4fb;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s, transform 0.08s, box-shadow 0.1s;
  position: relative;
  overflow: hidden;
}
.seq-cell:hover:not(:disabled) {
  border-color: #0f6dff;
  background: #dbeafe;
  transform: scale(1.04);
}

/* ============================================
   DETECTA EL CAMBIO - Spot the Difference Game
   ============================================ */

.detect-board {
  --detect-shape-size: 50px;
  --detect-cell-size: 80px;
  width: min(980px, 100%);
  margin: 0 auto;
}

.detect-page {
  background: linear-gradient(135deg, #f8f9fc 0%, #f0f2f9 100%);
}

.detect-page .app-main {
  width: 100%;
  padding: 1rem 1rem 2rem;
}

/* Screens */
.detect-screen {
  display: block;
  animation: fadeIn 0.3s ease-out;
}
.detect-screen.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Intro Screen */
.detect-title {
  margin: 0 0 0.5rem 0;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  color: #0f172a;
  text-align: center;
}

.detect-subtitle {
  text-align: center;
  font-size: 1.1rem;
  color: #475569;
  margin: 0 0 2rem 0;
}

.detect-section-label {
  font-size: 1.3rem;
  font-weight: 600;
  color: #1e293b;
  text-align: center;
  margin-bottom: 1.5rem;
}

.detect-level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.detect-level-btn {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem 1rem;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.detect-level-btn:hover {
  border-color: #0f6dff;
  background: #dbeafe;
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(15, 109, 255, 0.2);
}

.detect-level-stars {
  font-size: 1.8rem;
  line-height: 1;
  display: inline-block;
}

.detect-level-stars--stacked {
  font-size: 1.45rem;
  line-height: 1.05;
}

.detect-level-btn strong {
  display: block;
  font-size: 1.1rem;
}

.detect-level-btn small {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 400;
  text-align: center;
}

.detect-level-btn small b {
  color: #0f172a;
  font-weight: 700;
}

/* Game Screen */
.detect-hud {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.detect-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.detect-stat span {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detect-stat strong {
  font-size: 1.4rem;
  color: #0f172a;
}

.detect-instructions {
  text-align: center;
  font-size: 1rem;
  color: #475569;
  margin-bottom: 1rem;
  min-height: 2rem;
}

.detect-game-container {
  background: white;
  border-radius: 16px;
  padding: 2rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.detect-phase-label {
  text-align: center;
  font-size: 0.95rem;
  color: #64748b;
  font-weight: 500;
  margin-bottom: 1rem;
  min-height: 1.5rem;
}

.detect-timer-bar {
  width: 100%;
  height: 6px;
  background: #e7edf8;
  border-radius: 999px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.detect-timer-bar::after {
  content: "";
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0f6dff, #00b7a5);
  border-radius: 999px;
  width: 100%;
}

/* Grid Display */
.detect-playfield {
  display: grid;
  width: fit-content;
  margin: 0 auto 1.5rem;
  gap: 0.6rem;
}

.detect-grid {
  display: grid;
  gap: 0.6rem;
  width: fit-content;
  margin: 0 auto;
}

.detect-cell {
  width: var(--detect-cell-size, 80px);
  height: var(--detect-cell-size, 80px);
  border: 2px solid #c8d4e8;
  border-radius: 12px;
  background: #f8f9fc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.detect-cell:hover:not(.detect-cell--empty):not(.detect-cell--correct):not(.detect-cell--error) {
  border-color: #0f6dff;
  background: #dbeafe;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(15, 109, 255, 0.2);
}

.detect-playfield--readonly .detect-cell {
  cursor: default;
}

.detect-playfield--readonly {
  pointer-events: none;
}

.detect-playfield--readonly .detect-cell:hover:not(.detect-cell--empty):not(.detect-cell--correct):not(.detect-cell--error) {
  border-color: #c8d4e8;
  background: #f8f9fc;
  transform: none;
  box-shadow: none;
}

.detect-playfield--readonly .detect-cell:active {
  transform: none;
}

.detect-cell--empty {
  background: #f0f4fb;
  cursor: default;
  opacity: 0.6;
}

.detect-cell--correct {
  border-color: #10b981;
  background: #d1fae5;
  animation: correctFlash 0.6s ease-out;
}

.detect-cell--error {
  border-color: #ef4444;
  background: #fee2e2;
  animation: errorShake 0.4s ease-out;
}

.detect-cell--hint {
  border-color: #f59e0b;
  background: #fef3c7;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.35) inset;
}

@keyframes correctFlash {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes errorShake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}

/* Shapes */
.detect-shape {
  width: var(--detect-shape-size, 50px);
  height: var(--detect-shape-size, 50px);
  position: relative;
}

/* Colores */
.detect-shape--red {
  --shape-color: #ef4444;
}
.detect-shape--blue {
  --shape-color: #3b82f6;
}
.detect-shape--green {
  --shape-color: #10b981;
}
.detect-shape--yellow {
  --shape-color: #f59e0b;
}
.detect-shape--purple {
  --shape-color: #8b5cf6;
}

/* Formas - Circle */
.detect-shape--circle {
  background: var(--shape-color);
  border-radius: 50%;
}

/* Formas - Square */
.detect-shape--square {
  background: var(--shape-color);
  border-radius: 6px;
}

/* Formas - Triangle */
.detect-shape--triangle {
  width: 0;
  height: 0;
  border-left: calc(var(--detect-shape-size, 50px) / 2) solid transparent;
  border-right: calc(var(--detect-shape-size, 50px) / 2) solid transparent;
  border-bottom: calc(var(--detect-shape-size, 50px) * 0.866) solid var(--shape-color);
}

/* Formas - Star */
.detect-shape--star {
  width: var(--detect-shape-size, 50px);
  height: var(--detect-shape-size, 50px);
  position: relative;
  background: var(--shape-color);
  clip-path: polygon(
    50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%,
    21% 91%, 32% 57%, 2% 35%, 39% 35%
  );
}

/* Feedback */
.detect-feedback {
  text-align: center;
  font-weight: 600;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.detect-feedback--correct {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.detect-feedback--error {
  background: #fee2e2;
  color: #7f1d1d;
  border: 1px solid #fca5a5;
}

.detect-feedback--partial {
  background: #fef3c7;
  color: #78350f;
  border: 1px solid #fcd34d;
}

.detect-feedback--success {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

/* Actions */
.detect-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.detect-actions .btn {
  min-width: 120px;
}

/* Result Screen */
.detect-result-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  max-width: 500px;
  margin: 0 auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.detect-result-card h2 {
  margin: 0 0 1.5rem 0;
  font-size: 1.8rem;
  text-align: center;
  color: #0f172a;
}

.detect-result-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f8f9fc;
  border-radius: 12px;
}

.detect-result-stat {
  text-align: center;
}

.detect-result-stat span {
  display: block;
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 500;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detect-result-stat strong {
  display: block;
  font-size: 1.8rem;
  color: #0f6dff;
  font-weight: 700;
}

.detect-result-message {
  text-align: center;
  padding: 1rem;
  background: #f0f9ff;
  border-left: 4px solid #0f6dff;
  border-radius: 8px;
  color: #0c4a6e;
  font-size: 1rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.detect-result-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.detect-result-actions .btn {
  padding: 0.875rem;
  font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .detect-board {
    --detect-shape-size: 40px;
  }

  .detect-cell {
    width: var(--detect-cell-size, 70px);
    height: var(--detect-cell-size, 70px);
  }

  .detect-game-container {
    padding: 1.5rem 1rem;
  }

  .detect-hud {
    grid-template-columns: repeat(auto-fit, minmax(85px, 1fr));
    gap: 0.5rem;
    padding: 0.75rem;
  }

  .detect-stat span {
    font-size: 0.7rem;
  }

  .detect-stat strong {
    font-size: 1.2rem;
  }

  .detect-result-card {
    padding: 1.5rem 1rem;
  }

  .detect-result-card h2 {
    font-size: 1.5rem;
  }

  .detect-result-stats {
    gap: 0.75rem;
    padding: 0.75rem;
  }

  .detect-result-stat strong {
    font-size: 1.4rem;
  }
}

@media (max-width: 480px) {
  .detect-board {
    --detect-shape-size: 32px;
    --detect-cell-size: 55px;
  }

  .detect-cell {
    width: var(--detect-cell-size, 55px);
    height: var(--detect-cell-size, 55px);
  }

  .detect-title {
    font-size: 1.5rem;
  }

  .detect-subtitle {
    font-size: 0.95rem;
  }

  .detect-level-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .detect-level-btn {
    padding: 1rem 0.75rem;
    font-size: 0.9rem;
  }

  .detect-level-stars {
    font-size: 1.4rem;
  }

  .detect-level-stars--stacked {
    font-size: 1.2rem;
  }

  .detect-level-btn strong {
    font-size: 0.95rem;
  }

  .detect-level-btn small {
    font-size: 0.65rem;
  }

  .detect-actions {
    flex-direction: column;
  }

  .detect-actions .btn {
    min-width: unset;
  }
}
.seq-cell--lit {
  background: #0f6dff !important;
  border-color: #0452c9 !important;
  box-shadow: 0 0 18px rgba(15,109,255,0.55);
  transform: scale(1.06);
  animation: seqPulse 0.15s ease;
}
.seq-cell--player {
  background: #00b7a5 !important;
  border-color: #008c7e !important;
  box-shadow: 0 0 14px rgba(0,183,165,0.5);
  transform: scale(1.06);
}
.seq-cell--error {
  background: #ff4d6a !important;
  border-color: #b00020 !important;
  box-shadow: 0 0 14px rgba(176,0,32,0.45);
  animation: seqShake 0.35s ease;
}

.seq-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
  border-radius: 14px;
  z-index: 5;
}

.seq-overlay.hidden {
  display: none;
}

.seq-overlay-card {
  min-width: min(400px, 95%);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #c7d9f8;
  border-radius: 14px;
  padding: 1rem 1.1rem;
  text-align: center;
  box-shadow: 0 14px 36px rgba(15, 40, 90, 0.22);
  animation: seqOverlayPop 0.2s ease;
}

.seq-overlay-card strong {
  display: block;
  color: #0b3f96;
  font-size: clamp(1.05rem, 3vw, 1.3rem);
  margin-bottom: 0.2rem;
}

.seq-overlay-card span {
  display: block;
  color: #334155;
  font-size: 0.9rem;
}

@keyframes seqPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.1); }
  100% { transform: scale(1.06); }
}
@keyframes seqShake {
  0%   { transform: translateX(0); }
  20%  { transform: translateX(-5px); }
  40%  { transform: translateX(5px); }
  60%  { transform: translateX(-4px); }
  80%  { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

@keyframes seqOverlayPop {
  0% {
    transform: scale(0.93);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.seq-game-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
}
.seq-btn-sm { font-size: 0.88rem; padding: 0.45rem 0.8rem; }

.seq-result-icon  { font-size: 3.5rem; }
.seq-result-title {
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: #1c2d6e;
  margin: 0;
  text-align: center;
}
.seq-result-msg {
  color: #5b6475;
  text-align: center;
  max-width: 420px;
  line-height: 1.55;
  margin: 0;
}
.seq-result-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}
.seq-result-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border: 1px solid #d8deea;
  border-radius: 12px;
  padding: 0.7rem 1.2rem;
  min-width: 90px;
}
.seq-result-stat span   { font-size: 0.75rem; color: #5b6475; text-align: center; }
.seq-result-stat strong { font-size: 1.5rem; color: #0452c9; font-weight: 700; }

.seq-result-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

@media (max-width: 520px) {
  :root { --seq-cell-size: 60px; }
  .seq-grid { gap: 0.35rem; }
  .seq-level-grid { grid-template-columns: 1fr 1fr; }
  .seq-stat { padding: 0.4rem 0.6rem; min-width: 60px; }
  .seq-stat strong { font-size: 1.05rem; }
  .seq-cell { border-radius: 9px; }
}
@media (max-width: 360px) {
  :root { --seq-cell-size: 50px; }
}

/* ══════════════════════════════════════════════════════════════
   Atencion Selectiva — Juego de Concentracion y Reaccion
══════════════════════════════════════════════════════════════ */

.selective-page {
  background: radial-gradient(circle at top right, #eef4ff, #f9fafc 45%, #f5f7fb);
}

.selective-board {
  width: min(980px, 96%);
  margin: 0 auto;
  padding: 1.3rem 0 2.6rem;
}

.selective-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.selective-screen.hidden {
  display: none;
}

.selective-title {
  margin: 0;
  text-align: center;
  color: #1c2d6e;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.selective-subtitle {
  margin: 0;
  max-width: 660px;
  text-align: center;
  color: #5b6475;
  line-height: 1.5;
}

.selective-section-label {
  margin: 0.5rem 0 0;
  color: #5b6475;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.selective-level-grid {
  width: min(640px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.selective-level-btn {
  border: 2px solid #d8deea;
  border-radius: 14px;
  background: #fff;
  padding: 1rem 0.8rem;
  display: grid;
  gap: 0.2rem;
  place-items: center;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.selective-level-btn:hover {
  transform: translateY(-2px);
  border-color: #0f6dff;
  box-shadow: 0 6px 18px rgba(15, 109, 255, 0.14);
}

.selective-level-btn strong {
  color: #1c2d6e;
  font-size: 1rem;
}

.selective-level-btn small {
  color: #5b6475;
  font-size: 0.8rem;
  text-align: center;
}

.selective-hud {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
}

.selective-stat {
  background: #fff;
  border: 1px solid #d8deea;
  border-radius: 11px;
  padding: 0.6rem 0.3rem;
  display: grid;
  gap: 0.15rem;
  text-align: center;
}

.selective-stat span {
  color: #5b6475;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
}

.selective-stat strong {
  color: #1c2d6e;
  font-size: 1.2rem;
}

.selective-rule {
  width: 100%;
  border-radius: 12px;
  background: linear-gradient(135deg, #eaf1ff, #f0f9ff);
  border: 1px solid #c8dcff;
  color: #1448aa;
  font-weight: 700;
  text-align: center;
  padding: 0.65rem 0.9rem;
}

.selective-progress-wrap {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: #e7edf8;
  overflow: hidden;
}

.selective-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #10b981, #0f6dff);
  transition: width 0.2s ease;
}

.selective-feedback {
  width: 100%;
  border-radius: 10px;
  padding: 0.5rem 0.8rem;
  text-align: center;
  color: #1f2937;
  background: #f3f4f6;
  font-weight: 600;
}

.selective-feedback--ok {
  background: #e8f8ef;
  color: #0f5132;
}

.selective-feedback--error {
  background: #ffecef;
  color: #9f1239;
}

.selective-feedback--warn {
  background: #fff8e1;
  color: #7c2d12;
}

.selective-feedback--info {
  background: #eaf1ff;
  color: #1d4ed8;
}

.selective-playfield {
  width: 100%;
  min-height: 420px;
  border-radius: 14px;
  border: 1px solid #d8deea;
  background:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,0.85), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(255,255,255,0.8), transparent 42%),
    linear-gradient(135deg, #eff6ff, #f8fafc);
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-content: flex-start;
  justify-content: center;
  padding: 1rem;
}

.selective-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
}

.selective-overlay.hidden {
  display: none;
}

.selective-overlay-card {
  width: min(620px, 96%);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #c8dcff;
  border-radius: 14px;
  padding: 1rem 1.1rem;
  text-align: center;
  box-shadow: 0 14px 34px rgba(15, 40, 90, 0.2);
  animation: selectiveOverlayPop 0.2s ease;
}

.selective-overlay-card strong {
  display: block;
  color: #0b3f96;
  font-size: clamp(1.05rem, 2.8vw, 1.3rem);
  margin-bottom: 0.2rem;
}

.selective-overlay-card span {
  display: block;
  color: #334155;
  font-size: 0.92rem;
}

.selective-item {
  border: none;
  cursor: pointer;
  position: relative;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.selective-item:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 15px rgba(15, 23, 42, 0.18);
}

.selective-item:disabled {
  cursor: default;
}

.shape-circle {
  border-radius: 999px;
}

.shape-square {
  border-radius: 12px;
}

.shape-triangle {
  border-radius: 0;
  clip-path: polygon(50% 4%, 4% 96%, 96% 96%);
  transform-origin: center;
}

.shape-triangle::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 0;
  clip-path: polygon(50% 4%, 4% 96%, 96% 96%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.shape-triangle.is-hit {
  filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.7));
}

.shape-triangle.is-miss {
  filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.7));
}

.shape-triangle.color-red,
.shape-square.color-red,
.shape-circle.color-red { background: #ef4444; }
.shape-triangle.color-blue,
.shape-square.color-blue,
.shape-circle.color-blue { background: #3b82f6; }
.shape-triangle.color-green,
.shape-square.color-green,
.shape-circle.color-green { background: #22c55e; }
.shape-triangle.color-orange,
.shape-square.color-orange,
.shape-circle.color-orange { background: #f97316; }
.shape-triangle.color-purple,
.shape-square.color-purple,
.shape-circle.color-purple { background: #a855f7; }

@keyframes selectiveOverlayPop {
  0% {
    transform: scale(0.94);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.shape-triangle {
  border-radius: 0;
}

.selective-item.is-hit {
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.35);
  filter: saturate(1.15);
}

.selective-item.is-cleared {
  opacity: 0;
  transform: none;
  pointer-events: none;
  transition: opacity 0.14s ease;
}

.selective-item.is-miss {
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.35);
  filter: grayscale(0.2);
}


.selective-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.selective-result-icon {
  font-size: 3.3rem;
}

.selective-result-msg {
  margin: 0;
  color: #5b6475;
  text-align: center;
  max-width: 560px;
}

.selective-result-grid {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.selective-result-item {
  border-radius: 12px;
  border: 1px solid #d8deea;
  background: #fff;
  padding: 0.75rem;
  display: grid;
  gap: 0.18rem;
  text-align: center;
}

.selective-result-item span {
  color: #5b6475;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.75rem;
}

.selective-result-item strong {
  color: #1c2d6e;
  font-size: 1.5rem;
}

@media (max-width: 900px) {
  .selective-hud {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .selective-playfield {
    min-height: 360px;
  }

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

@media (max-width: 620px) {
  .selective-level-grid {
    grid-template-columns: 1fr;
  }

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

  .selective-playfield {
    min-height: 320px;
    padding: 0.7rem;
    gap: 0.6rem;
  }

  .selective-item {
    transform: scale(0.92);
  }
}

/* ============ VELOCIDAD MENTAL - Fast-Paced Math Game ============ */

.vm-board {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
}

.vm-screen {
  display: block;
}

.vm-screen.hidden {
  display: none;
}

/* ============ INTRO SCREEN ============ */

.vm-intro-container {
  display: grid;
  gap: 2rem;
}

.vm-title {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  color: #1c2d6e;
  text-align: center;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.vm-subtitle {
  margin: 0;
  font-size: clamp(1.1rem, 3.5vw, 1.4rem);
  color: #5b6475;
  text-align: center;
  font-weight: 600;
}

.vm-intro-description {
  display: grid;
  gap: 0.8rem;
  padding: 1.5rem;
  background: #f0f4ff;
  border-radius: 12px;
  border-left: 4px solid #3b82f6;
}

.vm-intro-description p {
  margin: 0;
  color: #2d3748;
  font-size: 1rem;
  line-height: 1.5;
}

.vm-levels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.5rem;
  justify-items: center;
}

.vm-level-card {
  display: grid;
  gap: 0.8rem;
  text-align: center;
}

.vm-level-btn {
  width: 120px;
  height: 120px;
  border: none;
  border-radius: 50%;
  font-size: 2rem;
  font-weight: 900;
  cursor: pointer;
  display: grid;
  grid-template-rows: auto auto;
  place-items: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.vm-level-btn--1 {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.vm-level-btn--1:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.vm-level-btn--2 {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.vm-level-btn--2:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.vm-level-btn--3 {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.vm-level-btn--3:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

.vm-level-btn--4 {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.vm-level-btn--4:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

.vm-level-btn:active {
  transform: scale(0.95);
}

.vm-level-number {
  display: block;
  font-size: 2.5rem;
  line-height: 1;
}

.vm-level-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.vm-level-desc {
  margin: 0;
  font-size: 0.9rem;
  color: #5b6475;
  font-weight: 500;
  line-height: 1.4;
}

.vm-intro-rules {
  padding: 1.5rem;
  background: #f9fafb;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}

.vm-intro-rules h3 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  color: #1c2d6e;
}

.vm-intro-rules ul {
  margin: 0;
  padding-left: 1.5rem;
  list-style: none;
}

.vm-intro-rules li {
  margin: 0.5rem 0;
  color: #374151;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ============ GAME SCREEN ============ */

.vm-hud {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background: linear-gradient(135deg, #f0f4ff 0%, #f9fafb 100%);
  border-radius: 12px;
  border: 1px solid #dbeafe;
}

.vm-hud-item {
  display: grid;
  gap: 0.4rem;
  text-align: center;
}

.vm-hud-label {
  display: block;
  font-size: 0.8rem;
  color: #6b7280;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.vm-hud-value {
  display: block;
  font-size: 1.8rem;
  color: #1c2d6e;
  font-weight: 900;
}

.vm-hud-timer .vm-hud-value {
  font-size: 2.2rem;
}

.vm-timer--warning {
  color: #ef4444;
  animation: vm-pulse-warn 1s ease-in-out infinite;
}

@keyframes vm-pulse-warn {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.vm-game-container {
  display: grid;
  gap: 2rem;
  padding: 2rem;
  background: white;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  min-height: 400px;
  place-items: center;
  justify-content: center;
}

.vm-question-area {
  display: grid;
  gap: 1.5rem;
  text-align: center;
  width: 100%;
}

.vm-instruction {
  font-size: 1.1rem;
  color: #5b6475;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.vm-question {
  font-size: clamp(2rem, 8vw, 4rem);
  color: #1c2d6e;
  font-weight: 900;
  word-break: break-word;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.vm-buttons-container {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.vm-buttons {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  justify-content: center;
  width: 100%;
}

.vm-button {
  padding: 0.9rem 1.2rem;
  font-size: 1.05rem;
  font-weight: 700;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  background: white;
  color: #1c2d6e;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
}

.vm-button:hover:not(:disabled) {
  border-color: #3b82f6;
  background: #f0f4ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.vm-button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2);
}

.vm-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.vm-feedback {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1000;
}

.vm-feedback--correct {
  background: rgba(16, 185, 129, 0.15);
  border: 3px solid #10b981;
}

.vm-feedback--incorrect {
  background: rgba(239, 68, 68, 0.15);
  border: 3px solid #ef4444;
}

@keyframes vm-flash-green {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes vm-flash-red {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* ============ RESULT SCREEN ============ */

.vm-result-container {
  display: grid;
  gap: 2rem;
  padding: 2rem;
  background: white;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}

.vm-result-title {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  color: #1c2d6e;
  text-align: center;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.vm-result-badge {
  margin: -0.75rem auto 0;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  width: fit-content;
}

.vm-result-message {
  margin: -1rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.97rem;
  line-height: 1.5;
  text-align: center;
}

.vm-result-message--great {
  background: #ecfdf3;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.vm-result-message--good {
  background: #eff6ff;
  color: #1e3a8a;
  border: 1px solid #93c5fd;
}

.vm-result-message--ok {
  background: #fefce8;
  color: #854d0e;
  border: 1px solid #fde68a;
}

.vm-result-message--keep-going {
  background: #fff1f2;
  color: #9f1239;
  border: 1px solid #fda4af;
}

.vm-result-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
  background: linear-gradient(135deg, #f0f4ff 0%, #f9fafb 100%);
  border-radius: 12px;
  border: 1px solid #dbeafe;
}

.vm-result-level {
  display: grid;
  gap: 0.6rem;
  text-align: center;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  border: 2px solid #3b82f6;
}

.vm-result-item {
  display: grid;
  gap: 0.6rem;
  text-align: center;
}

.vm-result-score {
  padding: 1rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 8px;
  color: white;
}

.vm-result-score .vm-result-label,
.vm-result-score .vm-result-unit {
  color: rgba(255, 255, 255, 0.9);
}

.vm-result-score .vm-result-value {
  color: white;
}

.vm-result-label {
  font-size: 0.8rem;
  color: #6b7280;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.vm-result-value {
  font-size: 2.2rem;
  color: #1c2d6e;
  font-weight: 900;
  line-height: 1;
}

.vm-result-difficulty {
  font-size: 0.9rem;
  color: #5b6475;
  font-weight: 600;
}

.vm-result-unit {
  color: #6b7280;
  font-size: 1rem;
}

.vm-result-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  justify-content: center;
}

.vm-btn {
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vm-btn--primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.vm-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.vm-btn--secondary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.vm-btn--secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.vm-btn--tertiary {
  background: #f3f4f6;
  color: #1c2d6e;
  border: 2px solid #e5e7eb;
}

.vm-btn--tertiary:hover {
  background: #e5e7eb;
  border-color: #d1d5db;
  transform: translateY(-2px);
}

.vm-btn:active {
  transform: translateY(0);
}

/* ============ RESPONSIVE DESIGN ============ */

@media (max-width: 768px) {
  .vm-board {
    padding: 1rem;
  }

  .vm-levels-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
  }

  .vm-level-btn {
    width: 100px;
    height: 100px;
    font-size: 1.5rem;
  }

  .vm-level-number {
    font-size: 2rem;
  }

  .vm-game-container {
    padding: 1.5rem;
    gap: 1.5rem;
    min-height: 350px;
  }

  .vm-hud {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    padding: 0.8rem;
  }

  .vm-buttons {
    gap: 0.8rem;
    grid-template-columns: 1fr 1fr;
  }

  .vm-button {
    min-height: 50px;
    font-size: 0.95rem;
    padding: 0.7rem 1rem;
  }

  .vm-result-container {
    padding: 1.5rem;
  }

  .vm-result-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .vm-board {
    padding: 0.8rem;
  }

  .vm-title {
    font-size: 1.8rem;
  }

  .vm-subtitle {
    font-size: 1rem;
  }

  .vm-levels-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .vm-level-btn {
    width: 90px;
    height: 90px;
    font-size: 1.3rem;
  }

  .vm-level-number {
    font-size: 1.8rem;
  }

  .vm-level-label {
    font-size: 0.7rem;
  }

  .vm-intro-description,
  .vm-intro-rules {
    padding: 1rem;
  }

  .vm-intro-description p {
    font-size: 0.9rem;
  }

  .vm-game-container {
    padding: 1rem;
    gap: 1.2rem;
    min-height: 300px;
  }

  .vm-hud {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    padding: 0.6rem;
    margin-bottom: 1.5rem;
  }

  .vm-question {
    font-size: clamp(1.8rem, 6vw, 3rem);
  }

  .vm-buttons {
    gap: 0.6rem;
    grid-template-columns: 1fr;
  }

  .vm-button {
    min-height: 48px;
    font-size: 0.9rem;
    padding: 0.6rem 0.8rem;
  }

  .vm-result-container {
    padding: 1rem;
  }

  .vm-result-stats {
    grid-template-columns: 1fr;
    gap: 0.8rem;
    padding: 1rem;
  }

  .vm-result-actions {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .vm-btn {
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
  }
}

/* ============ GEOMETRIA INTERACTIVA ============ */

.geo-board {
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
  padding: 1.4rem;
}

.geo-screen.hidden {
  display: none;
}

.geo-intro-card,
.geo-result-card {
  display: grid;
  gap: 1.2rem;
  padding: 1.5rem;
  border: 1px solid #dbe6fb;
  border-radius: 14px;
  background: linear-gradient(160deg, #f8fbff 0%, #f3f8ff 100%);
}

.geo-title {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: #1e3a8a;
  text-align: center;
}

.geo-subtitle {
  margin: 0;
  color: #475569;
  text-align: center;
  font-size: 1.05rem;
}

.geo-intro-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.geo-field {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
  color: #1f2937;
}

.geo-field select {
  border: 1px solid #c9d6f0;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font-size: 0.95rem;
  background: #ffffff;
}

.geo-rules {
  display: grid;
  gap: 0.35rem;
  border-radius: 10px;
  border: 1px solid #dbeafe;
  background: #ffffff;
  padding: 0.85rem 0.95rem;
}

.geo-rules p {
  margin: 0;
  color: #334155;
  font-size: 0.94rem;
}

.geo-btn {
  border: none;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.98rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.geo-btn:hover {
  transform: translateY(-1px);
}

.geo-btn--primary {
  color: #ffffff;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25);
}

.geo-btn--secondary {
  color: #0f172a;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.geo-hud {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.geo-hud-item {
  display: grid;
  gap: 0.2rem;
  border: 1px solid #dbe7ff;
  border-radius: 10px;
  background: #ffffff;
  padding: 0.6rem;
  text-align: center;
}

.geo-hud-item span {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
}

.geo-hud-item strong {
  color: #1e3a8a;
  font-size: 1rem;
}

.geo-progress-wrap {
  margin-top: 1rem;
  display: grid;
  gap: 0.45rem;
}

.geo-progress-wrap p {
  margin: 0;
  color: #334155;
  font-weight: 700;
}

.geo-progress-bar {
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.geo-progress-fill {
  width: 4%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #60a5fa 0%, #2563eb 100%);
}

.geo-playfield {
  margin-top: 1rem;
  border: 1px solid #dbe7ff;
  background: #ffffff;
  border-radius: 14px;
  min-height: 430px;
  padding: 1rem;
  display: grid;
  gap: 1rem;
  align-content: start;
}

.geo-question {
  margin: 0;
  text-align: center;
  font-weight: 800;
  color: #1e293b;
  font-size: clamp(1.06rem, 2.5vw, 1.35rem);
}

.geo-visual {
  min-height: 145px;
  display: grid;
  place-items: center;
}

.geo-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.geo-option-btn {
  border: 1px solid #cbdcf9;
  border-radius: 10px;
  background: #f8fbff;
  color: #1f2937;
  font-size: 1rem;
  font-weight: 700;
  min-height: 50px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.geo-option-btn:hover {
  background: #eef4ff;
  border-color: #9fbaf2;
}

.geo-option-btn.is-correct {
  background: #dcfce7;
  border-color: #22c55e;
}

.geo-option-btn.is-wrong {
  background: #fee2e2;
  border-color: #ef4444;
}

.geo-feedback {
  margin: 0;
  text-align: center;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font-weight: 700;
}

.geo-feedback--neutral {
  background: #f8fafc;
  color: #475569;
}

.geo-feedback--ok {
  background: #ecfdf3;
  color: #166534;
}

.geo-feedback--error {
  background: #fef2f2;
  color: #b91c1c;
}

.geo-shape {
  width: 120px;
  height: 120px;
  background: #2563eb;
}

.geo-shape--compact {
  width: 64px;
  height: 64px;
}

.geo-shape--circulo {
  border-radius: 50%;
}

.geo-shape--cuadrado {
  border-radius: 8px;
}

.geo-shape--rectangulo {
  width: 176px;
  height: 88px;
  border-radius: 8px;
}

.geo-shape--compact.geo-shape--rectangulo {
  width: 102px;
  height: 46px;
}

.geo-shape--triangulo {
  width: 0;
  height: 0;
  border-left: 60px solid transparent;
  border-right: 60px solid transparent;
  border-bottom: 112px solid #2563eb;
  background: transparent;
}

.geo-shape--compact.geo-shape--triangulo {
  border-left-width: 34px;
  border-right-width: 34px;
  border-bottom-width: 60px;
}

.geo-shape--pentagono {
  clip-path: polygon(50% 0%, 95% 35%, 77% 95%, 23% 95%, 5% 35%);
}

.geo-shape--hexagono {
  clip-path: polygon(25% 6%, 75% 6%, 100% 50%, 75% 94%, 25% 94%, 0 50%);
}

.geo-shape--octagono {
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
}

.geo-shape--rombo {
  clip-path: polygon(50% 4%, 96% 50%, 50% 96%, 4% 50%);
}

.geo-shape--trapecio {
  clip-path: polygon(18% 10%, 82% 10%, 100% 90%, 0% 90%);
}

.geo-solid-svg {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.geo-solid-svg svg {
  width: 100%;
  height: 100%;
}

.geo-solid {
  width: 130px;
  height: 130px;
  position: relative;
}

.geo-solid--esfera {
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #dbeafe 0%, #60a5fa 48%, #2563eb 100%);
}

/* Isometric cube: front face (main) + top face (::before) + right face (::after) */
.geo-solid--cubo {
  width: 72px;
  height: 72px;
  background: #2563eb;
  position: relative;
  margin-top: 26px;
  margin-left: 4px;
  box-shadow: inset -3px -3px 0 rgba(0,0,0,0.15);
}

.geo-solid--cubo::before {
  content: "";
  position: absolute;
  width: 72px;
  height: 26px;
  background: #93c5fd;
  top: -26px;
  left: 13px;
  transform: skewX(-45deg);
  transform-origin: bottom left;
}

.geo-solid--cubo::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 72px;
  background: #1d4ed8;
  left: 72px;
  top: -13px;
  transform: skewY(-45deg);
  transform-origin: top left;
}

.geo-solid--cilindro {
  width: 92px;
  height: 120px;
  border-radius: 46px / 16px;
  background: linear-gradient(145deg, #93c5fd 0%, #1d4ed8 100%);
}

.geo-solid--cono {
  width: 0;
  height: 0;
  border-left: 56px solid transparent;
  border-right: 56px solid transparent;
  border-bottom: 120px solid #2563eb;
  position: relative;
}

.geo-solid--cono::after {
  content: "";
  position: absolute;
  left: -56px;
  top: 110px;
  width: 112px;
  height: 18px;
  border-radius: 50%;
  background: #1d4ed8;
}

.geo-solid--piramide {
  width: 0;
  height: 0;
  border-left: 64px solid transparent;
  border-right: 64px solid transparent;
  border-bottom: 120px solid #1d4ed8;
  position: relative;
}

.geo-solid--piramide::after {
  content: "";
  position: absolute;
  left: -62px;
  top: 114px;
  width: 124px;
  height: 14px;
  background: #2563eb;
  transform: skewX(-25deg);
}

.geo-compare-wrap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  width: 100%;
}

.geo-compare-card {
  display: grid;
  gap: 0.5rem;
  justify-items: center;
  align-items: center;
  border: 1px solid #dbe7ff;
  border-radius: 12px;
  background: #f8fbff;
  padding: 0.7rem;
}

.geo-compare-name {
  font-weight: 700;
  color: #334155;
}

.geo-compare-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: #6b7ea8;
  background: #e8eeff;
  border-radius: 20px;
  padding: 1px 8px;
}

.geo-daily-card {
  display: grid;
  gap: 0.4rem;
  justify-items: center;
}

.geo-daily-icon {
  font-size: 4rem;
  line-height: 1;
}

.geo-daily-label {
  font-size: 1rem;
  font-weight: 700;
  color: #334155;
}

.geo-result-message {
  margin: 0;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  background: #eef6ff;
  color: #1e3a8a;
  text-align: center;
  font-weight: 700;
}

.geo-result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.geo-result-grid > div {
  display: grid;
  gap: 0.2rem;
  text-align: center;
  border: 1px solid #dbe7ff;
  border-radius: 10px;
  background: #ffffff;
  padding: 0.65rem;
}

.geo-result-grid span {
  font-size: 0.74rem;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 700;
}

.geo-result-grid strong {
  color: #1e3a8a;
  font-size: 1.1rem;
}

.geo-result-actions {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .geo-hud {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 640px) {
  .geo-board {
    padding: 1rem;
  }

  .geo-intro-grid,
  .geo-options,
  .geo-result-actions {
    grid-template-columns: 1fr;
  }

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

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

  .geo-playfield {
    min-height: 390px;
  }

  .geo-shape {
    width: 94px;
    height: 94px;
  }

  .geo-shape--rectangulo {
    width: 126px;
    height: 84px;
  }

  .geo-solid {
    transform: scale(0.88);
  }
}

.mandala-hero p {
  max-width: 860px;
}

.mandala-board {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.mandala-controls-card,
.mandala-preview-card {
  border-radius: 14px;
  border: 1px solid #dbe7ff;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  padding: 1rem;
  display: grid;
  gap: 0.85rem;
}

.mandala-controls-card h2,
.mandala-preview-card h2 {
  margin: 0;
  color: #1e293b;
}

.mandala-controls-hint {
  margin: 0;
  color: #475569;
}

.mandala-controls-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: 1fr;
}

.mandala-field {
  display: grid;
  gap: 0.35rem;
}

.mandala-field span {
  font-size: 0.86rem;
  color: #475569;
  font-weight: 700;
}

.mandala-field select {
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #f8fbff;
  min-height: 42px;
  padding: 0.5rem 0.7rem;
  font-size: 0.95rem;
  color: #0f172a;
}

.mandala-seed {
  display: inline-block;
  font-family: Consolas, "Courier New", monospace;
  background: #eef6ff;
  color: #1e3a8a;
  border-radius: 8px;
  padding: 0.3rem 0.55rem;
  font-size: 0.85rem;
}

.mandala-actions {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: 1fr 1fr;
}

.mandala-note {
  margin: 0;
  font-size: 0.86rem;
  color: #64748b;
}

.mandala-status {
  font-size: 0.92rem;
  color: #334155;
  font-weight: 700;
}

.mandala-status.is-error {
  color: #b91c1c;
}

.mandala-preview {
  border: 1px dashed #bfdbfe;
  border-radius: 12px;
  background: #f8fbff;
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem;
}

.mandala-preview svg {
  width: min(560px, 100%);
  height: auto;
  aspect-ratio: 1 / 1;
}

@media (max-width: 900px) {
  .mandala-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .mandala-actions {
    grid-template-columns: 1fr;
  }

  .mandala-preview {
    min-height: 300px;
  }
}

.maze-hero p {
  max-width: 860px;
}

.maze-board {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.maze-controls-card,
.maze-preview-card {
  border-radius: 14px;
  border: 1px solid #d8f3dc;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  padding: 1rem;
  display: grid;
  gap: 0.85rem;
}

.maze-controls-card h2,
.maze-preview-card h2 {
  margin: 0;
  color: #1e293b;
}

.maze-controls-hint {
  margin: 0;
  color: #475569;
}

.maze-controls-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: 1fr;
}

.maze-field {
  display: grid;
  gap: 0.35rem;
}

.maze-field span {
  font-size: 0.86rem;
  color: #475569;
  font-weight: 700;
}

.maze-field select {
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  background: #f7fff9;
  min-height: 42px;
  padding: 0.5rem 0.7rem;
  font-size: 0.95rem;
  color: #0f172a;
}

.maze-seed {
  display: inline-block;
  font-family: Consolas, "Courier New", monospace;
  background: #ecfdf3;
  color: #166534;
  border-radius: 8px;
  padding: 0.3rem 0.55rem;
  font-size: 0.85rem;
}

.maze-actions {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: 1fr 1fr;
}

.maze-note {
  margin: 0;
  font-size: 0.86rem;
  color: #64748b;
}

.maze-status {
  font-size: 0.92rem;
  color: #334155;
  font-weight: 700;
}

.maze-status.is-error {
  color: #b91c1c;
}

.maze-preview {
  border: 1px dashed #86efac;
  border-radius: 12px;
  background: #f7fff9;
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem;
}

.maze-preview svg {
  width: min(560px, 100%);
  height: auto;
  aspect-ratio: 1 / 1;
}

@media (max-width: 900px) {
  .maze-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .maze-actions {
    grid-template-columns: 1fr;
  }

  .maze-preview {
    min-height: 300px;
  }
}

/* ==========================================================
   SUDOKU
   ========================================================== */

.sudoku-play-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.sudoku-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

.sudoku-score {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-success, #16a34a);
  text-align: center;
}

/* ── Board ─────────────────────────────────────────────── */

.sk-board {
  display: grid;
  border-top: 3px solid #1e293b;
  border-left: 3px solid #1e293b;
  gap: 0;
  user-select: none;
  touch-action: manipulation;
}

.sk-board[data-size="4"]  { grid-template-columns: repeat(4, 1fr); width: min(340px, 92vw); }
.sk-board[data-size="6"]  { grid-template-columns: repeat(6, 1fr); width: min(420px, 92vw); }
.sk-board[data-size="9"]  { grid-template-columns: repeat(9, 1fr); width: min(540px, 92vw); }

.sk-cell {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.9rem, 3.5vw, 1.5rem);
  font-weight: 500;
  cursor: pointer;
  aspect-ratio: 1;
  line-height: 1;
  position: relative;
  transition: background 0.12s;
  border-right: 1px solid #94a3b8;
  border-bottom: 1px solid #94a3b8;
}

.sk-cell.sk-given {
  font-weight: 700;
  color: #1e293b;
  background: #f1f5f9;
  cursor: default;
}

.sk-cell.sk-selected   { background: #bfdbfe !important; }
.sk-cell.sk-related    { background: #eff6ff; }
.sk-cell.sk-same-num   { background: #dbeafe; }
.sk-cell.sk-error      { background: #fee2e2 !important; color: #dc2626; }
.sk-cell.sk-hint       { color: #7c3aed; }

/* block and outer border lines */
.sk-cell.sk-block-right  { border-right:  3px solid #1e293b; }
.sk-cell.sk-block-bottom { border-bottom: 3px solid #1e293b; }
.sk-cell.sk-last-col     { border-right:  3px solid #1e293b; }
.sk-cell.sk-last-row     { border-bottom: 3px solid #1e293b; }

/* ── Number Pad ──────────────────────────────────────────── */

.sk-numpad {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  max-width: 540px;
}

.sk-num-btn {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 0.5rem;
  border: 2px solid #3b82f6;
  background: #eff6ff;
  color: #1e40af;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s, transform 0.1s;
}

.sk-num-btn:hover  { background: #dbeafe; transform: scale(1.05); }
.sk-num-btn:active { transform: scale(0.95); }

/* ── Print area ──────────────────────────────────────────── */

.sudoku-print-area {
  display: none;
}

.sudoku-print-name-line {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
  font-size: 1rem;
}

/* ── Print media ─────────────────────────────────────────── */

@media print {
  body > *:not(.sudoku-print-area) { display: none !important; }
  .sudoku-print-area {
    display: block !important;
    padding: 1.5cm 2cm;
    font-family: Arial, sans-serif;
  }
  .sudoku-print-area h2 {
    font-size: 1.6rem;
    margin-bottom: 0.3rem;
  }
  .sudoku-print-area p {
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }
  .sk-board--print {
    display: grid;
    border-top: 3px solid #000;
    border-left: 3px solid #000;
    gap: 0;
    page-break-inside: avoid;
  }
  .sk-board--print[data-size="4"]  { grid-template-columns: repeat(4, 1fr); width: 9cm; }
  .sk-board--print[data-size="6"]  { grid-template-columns: repeat(6, 1fr); width: 12cm; }
  .sk-board--print[data-size="9"]  { grid-template-columns: repeat(9, 1fr); width: 16cm; }
  .sk-board--print .sk-cell {
    background: #fff;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 500;
    cursor: default;
    border-right: 1px solid #666;
    border-bottom: 1px solid #666;
  }
  .sk-board--print .sk-cell.sk-given    { font-weight: 700; }
  .sk-board--print .sk-cell.sk-block-right  { border-right: 3px solid #000; }
  .sk-board--print .sk-cell.sk-block-bottom { border-bottom: 3px solid #000; }
  .sk-board--print .sk-cell.sk-last-col     { border-right: 3px solid #000; }
  .sk-board--print .sk-cell.sk-last-row     { border-bottom: 3px solid #000; }

#cs-submit-btn {
  padding: 1.1rem 2.8rem !important;
  font-size: 1.15rem !important;
  background: linear-gradient(135deg, #059669, #10b981) !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

#cs-submit-btn:hover {
  background: linear-gradient(135deg, #047857, #059669) !important;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4) !important;
  transform: translateY(-2px);
}

#cs-submit-btn:active {
  transform: translateY(0);
}

.btn.secondary-light {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.btn.secondary-light:hover {
  background: #e5e7eb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
}

@media (max-width: 480px) {
  .sk-num-btn {
    width: 2.4rem;
    height: 2.4rem;
    font-size: 1rem;
  }
}

/* ==========================================================
   CÓDIGO SECRETO
   ========================================================== */

.cs-guess-digit {
  width: 4.5rem;
  height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border: 3px solid #3b82f6;
  border-radius: 0.8rem;
  font-size: 2rem;
  font-weight: 900;
  color: #1e40af;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.cs-num-btn {
  width: 3.8rem;
  height: 3.8rem;
  border-radius: 0.6rem;
  border: 2px solid #a78bfa;
  background: linear-gradient(135deg, #f3e8ff, #ede9fe);
  color: #6d28d9;
  font-size: 1.4rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.12s, transform 0.1s, box-shadow 0.12s;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15);
}

.cs-num-btn:hover {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.cs-num-btn:active {
  transform: scale(0.95);
}

.cs-result-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid #e5e7eb;
  align-items: center;
}

.cs-result-row:last-child {
  border-bottom: none;
}

.cs-result-row span:first-child {
  font-weight: 600;
  color: #475569;
}

.cs-result-row code {
  font-family: "Courier New", monospace;
  background: #f1f5f9;
  padding: 0.5rem 0.8rem;
  border-radius: 0.4rem;
  font-weight: 700;
  color: #1e293b;
  font-size: 1.1rem;
  letter-spacing: 0.2em;
}

#cs-history tr {
  border-bottom: 1px solid #e5e7eb;
  transition: background 0.2s;
}

#cs-history tr:hover {
  background: #f9fafb;
}

#cs-history td {
  padding: 0.9rem 0.8rem;
  vertical-align: middle;
}

#cs-history td:nth-child(1) {
  text-align: left;
  font-weight: 600;
  width: 8%;
}

#cs-history td:nth-child(2) {
  text-align: center;
  font-family: "Courier New", monospace;
  font-weight: 700;
  letter-spacing: 0.1em;
  width: 40%;
}

#cs-history td:nth-child(3) {
  text-align: center;
  color: #16a34a;
  font-weight: 700;
  width: 26%;
}

#cs-history td:nth-child(4) {
  text-align: center;
  color: #2563eb;
  font-weight: 700;
  width: 26%;
}

.cs-confetti-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  display: none;
}

.cs-confetti-layer.active {
  display: block;
}

@media (max-width: 768px) {
  .cs-guess-digit {
    width: 3.8rem;
    height: 3.8rem;
    font-size: 1.7rem;
  }

  .cs-num-btn {
    width: 3.2rem;
    height: 3.2rem;
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .cs-guess-digit {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.1rem;
  }

  .cs-num-btn {
    width: 2.1rem;
    height: 2.1rem;
    font-size: 0.75rem;
  }

  #cs-history {
    font-size: 0.8rem;
  }

  #cs-history td {
    padding: 0.6rem 0.4rem !important;
  }
}
