:root {
  color-scheme: light;
  --pink: #ff78b7;
  --pink-deep: #e84f9e;
  --peach: #ffd3a8;
  --mint: #a8f4d3;
  --aqua: #8ee8ff;
  --lavender: #c9b6ff;
  --cream: #fff8ec;
  --paper: #fffdf8;
  --ink: #55415b;
  --muted: #876f8d;
  --shadow: 0 22px 60px rgba(187, 83, 148, 0.24);
  --soft-shadow: 0 12px 28px rgba(128, 86, 151, 0.18);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-rounded, "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #fff5fb;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 255, 255, 0.95) 0 8%, transparent 18%),
    radial-gradient(circle at 86% 12%, rgba(255, 239, 150, 0.9) 0 7%, transparent 18%),
    radial-gradient(circle at 80% 84%, rgba(168, 244, 211, 0.8) 0 9%, transparent 21%),
    linear-gradient(145deg, #ffe4f2 0%, #fff2c8 48%, #d9fbff 100%);
  overflow-x: hidden;
}

button {
  border: 0;
  font: inherit;
}

button:not(:disabled) {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 4px solid rgba(255, 120, 183, 0.45);
  outline-offset: 3px;
}

.app-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 16px calc(24px + var(--safe-bottom));
  position: relative;
  z-index: 1;
}

.screen {
  display: none;
  min-height: calc(100vh - 44px - var(--safe-bottom));
}

.screen.is-active {
  display: flex;
}

.screen-home {
  align-items: center;
  justify-content: center;
}

.hero-card,
.modal-card {
  width: 100%;
  border: 2px solid rgba(255, 255, 255, 0.74);
  border-radius: var(--radius-xl);
  background: rgba(255, 253, 248, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card {
  padding: clamp(24px, 6vw, 42px);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-card::before,
.hero-card::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  opacity: 0.72;
  pointer-events: none;
}

.hero-card::before {
  width: 180px;
  height: 180px;
  top: -70px;
  right: -60px;
  background: radial-gradient(circle, #ffb7dd, transparent 68%);
}

.hero-card::after {
  width: 160px;
  height: 160px;
  bottom: -68px;
  left: -54px;
  background: radial-gradient(circle, #a8f4d3, transparent 70%);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--pink-deep);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow.mini {
  margin-bottom: 2px;
  font-size: 0.68rem;
}

h1,
h2,
p {
  position: relative;
  z-index: 1;
}

h1 {
  margin: 0;
  font-size: clamp(2.45rem, 12vw, 5rem);
  line-height: 0.92;
  letter-spacing: -0.07em;
  color: #ff5eae;
  text-shadow: 0 4px 0 #fff, 0 12px 24px rgba(255, 94, 174, 0.26);
}

h2 {
  margin: 0;
  font-size: clamp(1.55rem, 6vw, 2.4rem);
  letter-spacing: -0.04em;
}

.subtitle {
  max-width: 430px;
  margin: 16px auto 24px;
  color: var(--muted);
  font-size: 1.08rem;
}

.quick-stats,
.dashboard,
.secondary-actions,
.home-actions,
.modal-actions {
  display: flex;
  gap: 12px;
}

.quick-stats {
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.stat-pill,
.dash-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 143, 199, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--soft-shadow);
}

.stat-pill {
  padding: 10px 15px;
  font-size: 0.98rem;
}

.stat-icon {
  filter: drop-shadow(0 4px 8px rgba(255, 170, 52, 0.24));
}

.reward-card {
  border: 1px solid rgba(255, 143, 199, 0.24);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 239, 250, 0.84));
  box-shadow: var(--soft-shadow);
}

.reward-card.compact {
  padding: 16px;
  margin: 0 auto 22px;
  max-width: 520px;
}

.reward-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.reward-heading strong {
  color: var(--pink-deep);
}

.progress-track {
  height: 16px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 216, 236, 0.9);
  overflow: hidden;
}

.progress-fill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff78b7, #ffc44f, #7de4c2);
  box-shadow: 0 0 14px rgba(255, 120, 183, 0.56);
  transition: width 240ms ease;
}

.reward-status,
.daily-message,
.game-message {
  margin: 10px 0 0;
  color: var(--muted);
  font-weight: 750;
}

.daily-message.is-warning,
.game-message.is-warning {
  color: #bf4f6f;
}

.daily-message.is-success,
.game-message.is-success {
  color: #33856b;
}

.reward-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
}

.reward-status.small {
  margin-top: 8px;
  font-size: 0.78rem;
  line-height: 1.35;
}

.mode-label {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.challenge[hidden] {
  display: none;
}

.home-actions {
  justify-content: center;
  flex-wrap: wrap;
}

.btn,
.icon-button,
.sound-chip {
  min-height: 48px;
  border-radius: 999px;
  font-weight: 900;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.btn:not(:disabled):active,
.icon-button:not(:disabled):active,
.sound-chip:not(:disabled):active {
  transform: translateY(2px) scale(0.98);
}

.btn-primary {
  min-width: 190px;
  padding: 15px 28px;
  color: #fff;
  background: linear-gradient(135deg, #ff68b2, #ff9a5f);
  box-shadow: 0 14px 26px rgba(255, 104, 178, 0.35);
}

.btn-soft,
.btn-ghost {
  padding: 14px 20px;
  color: var(--pink-deep);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--soft-shadow);
}

.btn-ghost {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.48);
}

.btn.small {
  min-height: 42px;
  padding: 10px 15px;
  font-size: 0.9rem;
}

.btn:disabled {
  opacity: 0.58;
}

.screen-game {
  position: relative;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  background:
    radial-gradient(circle at 11% 16%, rgba(255, 160, 205, 0.18) 0 12px, transparent 13px),
    radial-gradient(circle at 84% 20%, rgba(255, 203, 102, 0.22) 0 10px, transparent 11px),
    radial-gradient(circle at 14% 78%, rgba(255, 160, 205, 0.16) 0 12px, transparent 13px),
    radial-gradient(circle at 88% 78%, rgba(144, 232, 205, 0.22) 0 14px, transparent 15px),
    linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0));
}

.screen-game::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0) 36%),
    radial-gradient(circle at 8% 22%, rgba(255,255,255,0.55) 0 2px, transparent 3px),
    radial-gradient(circle at 92% 35%, rgba(255,255,255,0.5) 0 2px, transparent 3px),
    radial-gradient(circle at 88% 15%, rgba(255,150,193,0.4) 0 7px, transparent 8px),
    radial-gradient(circle at 16% 82%, rgba(255,150,193,0.35) 0 7px, transparent 8px);
  opacity: .9;
}

.screen-game > * {
  position: relative;
  z-index: 1;
}

.game-header {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  gap: 12px;
  padding-top: 4px;
}

.icon-button,
.sound-chip {
  width: 52px;
  height: 52px;
  color: var(--pink-deep);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--soft-shadow);
}

.sound-chip {
  font-size: 1.15rem;
}

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

.dashboard:has(.challenge:not([hidden])) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dash-item {
  padding: 10px 10px;
  border-radius: 18px;
  min-width: 0;
}

.dash-item > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: #fff2bf;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.dash-item small {
  display: block;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.dash-item strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.1;
}

.game-progress {
  padding: 13px 14px;
}

.board-wrap {
  padding: 7px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(55, 45, 64, 0.18), rgba(255,255,255,0.22));
  box-shadow: inset 0 0 0 1px rgba(40, 31, 49, 0.14), 0 10px 18px rgba(58, 44, 69, 0.10);
}

.memory-board {
  display: grid;
  grid-template-columns: repeat(var(--columns, 4), minmax(0, 1fr));
  gap: clamp(8px, 2.4vw, 14px);
}

.memory-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 1 / 1.12;
  padding: 0;
  border-radius: clamp(14px, 4vw, 22px);
  background: transparent;
  perspective: 900px;
}

.card-inner {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transform-style: preserve-3d;
  transition: transform 300ms cubic-bezier(0.2, 0.7, 0.3, 1.2);
}

.memory-card.is-flipped .card-inner,
.memory-card.is-matched .card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: inherit;
  backface-visibility: hidden;
  overflow: hidden;
}

.card-back {
  border: 2px solid rgba(41, 32, 49, 0.18);
  background:
    radial-gradient(circle at 24% 24%, rgba(255, 255, 255, 0.96) 0 8%, transparent 9%),
    radial-gradient(circle at 74% 32%, rgba(255, 255, 255, 0.7) 0 7%, transparent 8%),
    linear-gradient(180deg, #3a2f45 0%, #5a4763 8%, #ff79ba 10%, #ffbd6a 48%, #92ead9 100%);
  box-shadow: 0 7px 0 rgba(58, 47, 69, 0.40), 0 14px 24px rgba(58, 47, 69, 0.20);
}

.card-back::before {
  content: "✦";
  display: grid;
  place-items: center;
  width: 54%;
  aspect-ratio: 1;
  border-radius: 20px;
  color: #fff;
  font-size: clamp(1.4rem, 7vw, 2.5rem);
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.38);
}

.card-front {
  transform: rotateY(180deg);
  border: 2px solid rgba(255, 255, 255, 0.90);
  background: linear-gradient(160deg, #fffefb, #fff7ea);
  box-shadow: inset 0 -8px 18px rgba(255, 183, 221, 0.16), 0 7px 0 rgba(230, 213, 200, 0.95), 0 14px 20px rgba(132, 81, 150, 0.12);
  padding: 2px;
}


/* Respeta el atributo hidden aunque el elemento tenga clases con display propio */
.card-front img[hidden],
.card-placeholder[hidden] {
  display: none !important;
}

.card-front img {
  width: 90%;
  height: 90%;
  object-fit: contain;
  object-position: center center;
  display: block;
  filter: drop-shadow(0 3px 6px rgba(110, 88, 126, 0.10));
}

.card-placeholder {
  display: grid;
  place-items: center;
  width: 82%;
  aspect-ratio: 1;
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255, 231, 243, 0.98), rgba(229, 255, 247, 0.98));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
  filter: drop-shadow(0 8px 10px rgba(255, 120, 183, 0.18));
}

.card-placeholder svg {
  width: 96%;
  height: 96%;
  display: block;
}

.memory-card.is-preview .card-front {
  box-shadow: 0 0 0 4px rgba(255, 196, 79, 0.22), inset 0 -8px 18px rgba(255, 183, 221, 0.18);
}

.memory-card.is-matched {
  animation: matched-bounce 520ms ease both;
}

.memory-card.is-matched .card-front {
  border-color: rgba(125, 228, 194, 0.96);
  box-shadow: 0 0 0 4px rgba(125, 228, 194, 0.22), 0 12px 24px rgba(74, 173, 142, 0.2);
}

.secondary-actions {
  justify-content: center;
  flex-wrap: wrap;
  margin-top: auto;
}


.level-intro {
  position: absolute;
  top: 54px;
  left: 50%;
  z-index: 4;
  width: min(88vw, 420px);
  transform: translateX(-50%);
  pointer-events: auto;
  opacity: 0;
}

.level-intro[hidden] {
  display: none;
}

.level-intro-card {
  width: 100%;
  padding: 16px 18px 18px;
  text-align: center;
  border-radius: 28px;
  border: 2px solid rgba(255,255,255,0.88);
  background: linear-gradient(180deg, rgba(255,250,252,0.98), rgba(255,238,246,0.96));
  box-shadow: 0 16px 28px rgba(97, 63, 91, 0.22), inset 0 2px 0 rgba(255,255,255,0.7);
}

.level-intro-kicker {
  margin: 0 0 4px;
  color: #ff4f86;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.level-intro-title {
  margin: 0;
  font-size: clamp(1.55rem, 7vw, 2.25rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
  color: #ff3f69;
  text-shadow: 0 3px 0 #fff, 0 0 16px rgba(255, 88, 121, 0.38), 0 8px 18px rgba(255, 88, 121, 0.18);
}

.level-intro-text {
  margin: 8px 0 0;
  color: #7b6177;
  font-weight: 800;
  line-height: 1.25;
}


.level-intro-ok {
  margin-top: 12px;
  min-height: 40px;
  padding: 9px 18px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #ff6fae, #ff8f7b);
  box-shadow: 0 10px 18px rgba(255, 112, 156, 0.26);
  font-weight: 900;
  cursor: pointer;
}

.level-intro-ok:focus-visible {
  outline: 3px solid rgba(255, 79, 134, 0.35);
  outline-offset: 3px;
}

.level-intro.is-visible {
  animation: intro-pop 260ms cubic-bezier(.2,.8,.25,1.2) forwards;
}

.level-intro.is-hiding {
  animation: intro-fade 220ms ease forwards;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(85, 65, 91, 0.34);
  backdrop-filter: blur(12px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  max-width: 440px;
  padding: 28px;
  text-align: center;
}

.modal-badge {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 10px;
  border-radius: 28px;
  font-size: 2.3rem;
  background: linear-gradient(135deg, #fff2bf, #ffd5ec);
  box-shadow: var(--soft-shadow);
}

.modal-card p {
  color: var(--muted);
  font-weight: 700;
}

.modal-actions {
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
}

.sparkle {
  position: fixed;
  z-index: 0;
  color: rgba(255, 105, 180, 0.42);
  font-size: 2rem;
  animation: floaty 4s ease-in-out infinite;
  pointer-events: none;
}

.sparkle-one { top: 9%; left: 8%; }
.sparkle-two { top: 20%; right: 9%; animation-delay: -1.3s; }
.sparkle-three { bottom: 13%; left: 12%; animation-delay: -2.1s; }

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(8deg); }
}

@keyframes matched-bounce {
  0%, 100% { transform: scale(1); }
  42% { transform: scale(1.06) rotate(-1deg); }
}

@keyframes intro-pop {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px) scale(.95); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

@keyframes intro-fade {
  0% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-6px) scale(.97); }
}

@media (min-width: 700px) {
  .app-shell {
    padding-block: 34px;
  }

  .board-wrap {
    padding: 14px;
  }
}

@media (max-width: 520px) {
  .home-actions .btn {
    width: 100%;
    min-width: 0;
  }

  .quick-stats {
    gap: 8px;
  }

  .stat-pill {
    padding: 9px 12px;
    font-size: 0.9rem;
  }
}

@media (max-width: 390px) {
  .app-shell {
    padding-inline: 12px;
  }

  .dashboard {
    gap: 8px;
  }

  .dash-item {
    padding: 10px;
  }

  .dash-item > span {
    width: 34px;
    height: 34px;
  }
}

/* Ajustes v4: juego más compacto en celular */
.screen-game {
  gap: 6px;
}

.screen-game .game-header {
  grid-template-columns: 34px 1fr 34px;
  gap: 6px;
  padding-top: 0;
}

.screen-game h2 {
  font-size: clamp(1.25rem, 4.6vw, 1.7rem);
  line-height: 1;
}

.screen-game .eyebrow.mini {
  font-size: 0.58rem;
  margin-bottom: 1px;
}

.screen-game .mode-label {
  margin-top: 0;
  font-size: 0.72rem;
}

.screen-game .icon-button,
.screen-game .sound-chip {
  width: 34px;
  height: 34px;
  min-height: 34px;
  font-size: 0.95rem;
}

.screen-game .dashboard {
  gap: 6px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.screen-game .dash-item {
  gap: 6px;
  padding: 7px 8px;
  min-height: 46px;
}

.screen-game .dash-item > span {
  width: 26px;
  height: 26px;
  border-radius: 10px;
  font-size: 0.85rem;
}

.screen-game .dash-item small {
  font-size: 0.56rem;
}

.screen-game .dash-item strong {
  font-size: 0.92rem;
}

.screen-game .game-progress {
  padding: 7px 10px;
}

.screen-game .reward-heading {
  margin-bottom: 4px;
  font-size: 0.7rem;
}

.screen-game .progress-track {
  height: 9px;
  padding: 2px;
}

.screen-game .reward-status.small {
  margin-top: 5px;
  font-size: 0.68rem;
}

.screen-game .game-message {
  min-height: 18px;
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.2;
}

.screen-game .board-wrap {
  padding: 4px;
  border-radius: 16px;
}

.screen-game .memory-board {
  gap: clamp(4px, 1vw, 8px);
}

.screen-game .memory-card {
  aspect-ratio: 1 / 1;
  border-radius: clamp(10px, 2.8vw, 16px);
}

.screen-game .card-back::before {
  width: 48%;
  border-radius: 12px;
  font-size: clamp(0.95rem, 4.5vw, 1.6rem);
}

.screen-game .card-placeholder {
  width: 72%;
  border-radius: 18px;
}

.screen-game .secondary-actions {
  margin-top: 0;
  gap: 8px;
}

.screen-game .secondary-actions .btn.small {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 0.78rem;
}

@media (max-width: 520px) {
  .level-intro {
    top: 44px;
    width: min(92vw, 360px);
  }

  .level-intro-card {
    padding: 13px 14px 14px;
    border-radius: 22px;
  }

  .level-intro-kicker {
    font-size: 0.64rem;
  }

  .level-intro-text {
    font-size: 0.82rem;
  }

  .app-shell {
    padding: 10px 10px calc(12px + var(--safe-bottom));
  }

  .screen {
    min-height: calc(100vh - 22px - var(--safe-bottom));
  }

  .hero-card {
    padding: 24px 18px;
  }

  .subtitle {
    margin: 12px auto 18px;
    font-size: 0.98rem;
    line-height: 1.35;
  }

  .screen-game .game-progress .reward-status.small {
    display: none;
  }

  .screen-game .dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .screen-game .memory-card {
    min-height: 0;
  }
}

@media (max-width: 390px) {
  .screen-game {
    gap: 5px;
  }

  .screen-game .dashboard {
    gap: 5px;
  }

  .screen-game .dash-item {
    padding: 6px;
  }

  .screen-game .dash-item > span {
    width: 22px;
    height: 22px;
    border-radius: 8px;
    font-size: 0.75rem;
  }

  .screen-game .dash-item small {
    font-size: 0.5rem;
  }

  .screen-game .dash-item strong {
    font-size: 0.82rem;
  }

  .screen-game .board-wrap {
    padding: 4px;
  }

  .screen-game .memory-board {
    gap: 4px;
  }

  .screen-game .card-placeholder {
    width: 70%;
    border-radius: 14px;
  }
}


/* ===== V16: visual más adictivo / arcade ===== */
:root {
  --pink: #ff4fd8;
  --pink-deep: #c832ff;
  --peach: #ffb44a;
  --mint: #65ffd6;
  --aqua: #43d8ff;
  --lavender: #7164ff;
  --cream: #fff8d8;
  --paper: rgba(255, 255, 255, 0.94);
  --ink: #2c1242;
  --muted: #6f5390;
  --shadow: 0 20px 46px rgba(49, 15, 74, 0.28);
  --soft-shadow: 0 12px 24px rgba(59, 20, 81, 0.18);
}

html {
  background: #13081d;
}

body {
  background:
    radial-gradient(circle at 14% 8%, rgba(255, 255, 255, 0.22) 0 2%, transparent 10%),
    radial-gradient(circle at 88% 18%, rgba(255, 223, 91, 0.28) 0 3%, transparent 12%),
    radial-gradient(circle at 80% 86%, rgba(59, 255, 205, 0.24) 0 3%, transparent 14%),
    radial-gradient(circle at 20% 76%, rgba(255, 97, 175, 0.22) 0 2.4%, transparent 12%),
    linear-gradient(140deg, #2a0a4b 0%, #531177 24%, #8a1f8a 48%, #ff7e37 74%, #ffdc57 100%);
}

.hero-card,
.modal-card {
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 249, 255, 0.82));
  box-shadow:
    0 26px 60px rgba(48, 13, 67, 0.28),
    inset 0 2px 0 rgba(255, 255, 255, 0.82),
    inset 0 -2px 0 rgba(156, 57, 255, 0.08);
}

.eyebrow,
.eyebrow.mini {
  color: #ff4ec8;
  text-shadow: 0 0 12px rgba(255, 78, 200, 0.26);
}

h1 {
  color: #ffe24b;
  text-shadow:
    0 4px 0 #8f2c1a,
    0 8px 0 #6f1f76,
    0 14px 20px rgba(78, 13, 92, 0.35);
}

.subtitle,
.reward-status,
.daily-message,
.game-message,
.mode-label,
.reward-note,
.reward-heading,
.level-intro-text {
  color: #654a88;
}

.stat-pill,
.dash-item,
.reward-card,
.game-progress {
  border: 2px solid rgba(255, 255, 255, 0.52);
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(246,239,255,0.88));
  box-shadow:
    0 10px 20px rgba(55, 19, 80, 0.16),
    inset 0 1px 0 rgba(255,255,255,0.9),
    inset 0 -3px 0 rgba(109, 67, 172, 0.12);
}

.progress-track {
  height: 18px;
  padding: 3px;
  background: linear-gradient(180deg, rgba(86, 33, 127, 0.18), rgba(255,255,255,0.66));
  box-shadow: inset 0 2px 6px rgba(77, 24, 102, 0.18);
}

.progress-fill {
  background: linear-gradient(90deg, #ff4fd8 0%, #ff9a2f 34%, #ffe34e 65%, #3ef0e1 100%);
  box-shadow: 0 0 18px rgba(255, 108, 227, 0.45);
}

.btn,
.icon-button,
.sound-chip,
.level-intro-ok {
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.btn-primary,
.level-intro-ok {
  color: #fff;
  background: linear-gradient(180deg, #ff84e6 0%, #ff49c4 46%, #ff982f 100%);
  box-shadow:
    0 6px 0 #c63f84,
    0 15px 24px rgba(184, 44, 131, 0.34),
    inset 0 2px 0 rgba(255,255,255,0.5);
}

.btn-soft,
.btn-ghost,
.icon-button,
.sound-chip {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(240,231,255,0.88));
  box-shadow:
    0 5px 0 rgba(127, 84, 182, 0.34),
    0 12px 18px rgba(61, 21, 85, 0.16),
    inset 0 1px 0 rgba(255,255,255,0.92);
}

@media (hover: hover) {
  .btn:hover,
  .icon-button:hover,
  .sound-chip:hover,
  .memory-card:hover {
    transform: translateY(-2px) scale(1.02);
    filter: saturate(1.08);
  }
}

.screen-game {
  background:
    radial-gradient(circle at 8% 16%, rgba(255, 255, 255, 0.28) 0 10px, transparent 11px),
    radial-gradient(circle at 86% 12%, rgba(255, 208, 66, 0.26) 0 10px, transparent 11px),
    radial-gradient(circle at 16% 82%, rgba(255, 78, 200, 0.2) 0 12px, transparent 13px),
    radial-gradient(circle at 88% 78%, rgba(73, 255, 213, 0.2) 0 14px, transparent 15px),
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0));
}

.screen-game::before {
  opacity: 1;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0) 30%),
    radial-gradient(circle at 10% 24%, rgba(255,255,255,0.75) 0 2px, transparent 3px),
    radial-gradient(circle at 90% 30%, rgba(255,255,255,0.72) 0 2px, transparent 3px),
    radial-gradient(circle at 84% 14%, rgba(255,216,83,0.52) 0 8px, transparent 9px),
    radial-gradient(circle at 15% 84%, rgba(255,109,192,0.46) 0 8px, transparent 9px);
}

.board-wrap {
  padding: 9px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(65, 24, 95, 0.94), rgba(37, 13, 58, 0.92));
  box-shadow:
    0 16px 28px rgba(28, 4, 44, 0.34),
    inset 0 2px 0 rgba(255,255,255,0.18),
    inset 0 -4px 0 rgba(0,0,0,0.18);
}

.memory-board {
  gap: clamp(10px, 2.2vw, 15px);
}

.memory-card {
  aspect-ratio: 1 / 1.08;
}

.card-inner {
  transition: transform 360ms cubic-bezier(.2,.8,.25,1.15);
}

.card-face {
  border-radius: clamp(16px, 4vw, 24px);
}

.card-back {
  position: relative;
  border: 2px solid rgba(255,255,255,0.28);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0) 22%),
    linear-gradient(180deg, #8f46ff 0%, #ff4fcd 44%, #ffb22f 100%);
  box-shadow:
    inset 0 3px 0 rgba(255,255,255,0.32),
    inset 0 -6px 0 rgba(83, 16, 92, 0.35),
    0 7px 0 rgba(61, 13, 72, 0.82),
    0 16px 22px rgba(35, 9, 52, 0.28);
}

.card-back::before {
  content: "?";
  position: absolute;
  inset: 18% 20%;
  display: grid;
  place-items: center;
  border-radius: 22px;
  color: #fff16a;
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 1000;
  line-height: 1;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.05));
  border: 2px solid rgba(255,255,255,0.34);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.34),
    inset 0 -4px 0 rgba(87, 16, 96, 0.26),
    0 8px 16px rgba(65, 8, 83, 0.20);
  text-shadow:
    0 2px 0 #7d2f00,
    0 5px 0 rgba(98, 20, 121, 0.65),
    0 0 14px rgba(255, 241, 106, 0.34);
}

.card-back::after {
  content: "";
  position: absolute;
  inset: 10px 12px auto;
  height: 34%;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.34), rgba(255,255,255,0));
  pointer-events: none;
}

.card-front {
  border: 2px solid rgba(255,255,255,0.78);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,247,228,0.94));
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.88),
    inset 0 -8px 0 rgba(230, 215, 176, 0.68),
    0 7px 0 rgba(206, 184, 140, 0.95),
    0 14px 18px rgba(72, 32, 90, 0.16);
}

.card-front img {
  width: 92%;
  height: 92%;
  filter: drop-shadow(0 8px 10px rgba(56, 24, 70, 0.14));
}

.card-placeholder {
  width: 84%;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 236, 245, 0.98), rgba(236, 255, 248, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.86),
    inset 0 -5px 0 rgba(180, 144, 214, 0.18),
    0 10px 12px rgba(82, 19, 98, 0.12);
}

.memory-card.is-preview .card-front {
  box-shadow:
    0 0 0 4px rgba(255, 221, 77, 0.26),
    inset 0 2px 0 rgba(255,255,255,0.88),
    inset 0 -8px 0 rgba(230, 215, 176, 0.68),
    0 7px 0 rgba(206, 184, 140, 0.95),
    0 0 24px rgba(255, 193, 7, 0.28);
}

.memory-card.is-matched .card-front {
  border-color: rgba(132, 255, 196, 0.96);
  box-shadow:
    0 0 0 4px rgba(111, 255, 186, 0.22),
    0 10px 24px rgba(63, 210, 149, 0.22),
    inset 0 2px 0 rgba(255,255,255,0.88),
    inset 0 -8px 0 rgba(176, 230, 204, 0.65);
}

.level-intro-card {
  border: 2px solid rgba(255,255,255,0.74);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,236,247,0.96));
  box-shadow:
    0 18px 34px rgba(61, 18, 80, 0.26),
    inset 0 2px 0 rgba(255,255,255,0.88),
    inset 0 -4px 0 rgba(214, 82, 140, 0.12);
}

.level-intro-title {
  color: #ff4cbf;
  text-shadow:
    0 3px 0 #ffffff,
    0 6px 0 rgba(255, 149, 0, 0.55),
    0 0 16px rgba(255, 76, 191, 0.26);
}

.level-intro-kicker {
  color: #ff4cbf;
}

.modal-backdrop {
  background: rgba(25, 6, 38, 0.52);
}

@media (max-width: 520px) {
  .board-wrap {
    padding: 7px;
  }

  .card-back::before {
    inset: 17% 18%;
  }
}


/* ===== V17: signos visibles, texto más jugable y celebración ===== */
h1,
h2,
#modal-title,
.level-intro-title {
  font-family: "Cooper Black", "Arial Rounded MT Bold", "Trebuchet MS", "Comic Sans MS", ui-rounded, system-ui, sans-serif;
}

#game-title,
#modal-title,
.level-intro-title {
  letter-spacing: -0.03em;
}

.game-message {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  max-width: min(100%, 640px);
  padding: 10px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(255,241,198,0.92));
  border: 2px solid rgba(255,255,255,0.58);
  color: #fff7b4;
  color: #ffe96e;
  text-shadow: 0 2px 0 rgba(95, 43, 0, 0.65);
  box-shadow: 0 8px 18px rgba(39, 10, 60, 0.18), inset 0 1px 0 rgba(255,255,255,0.78);
  font-weight: 900;
}

.card-back {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.26), rgba(255,255,255,0) 18%),
    linear-gradient(180deg, #5f2dff 0%, #c233ff 38%, #ff5ea6 70%, #ffb22f 100%);
}

.card-back::before {
  content: none;
}

.card-question {
  position: absolute;
  inset: 18% 18%;
  display: grid;
  place-items: center;
  z-index: 2;
  border-radius: 24px;
  color: #fff16a;
  font-family: "Cooper Black", "Arial Rounded MT Bold", "Trebuchet MS", ui-rounded, sans-serif;
  font-size: clamp(2.35rem, 8.8vw, 3.5rem);
  font-weight: 1000;
  line-height: 1;
  background: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.03));
  border: 2px solid rgba(255,255,255,0.42);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.42),
    inset 0 -4px 0 rgba(87,16,96,0.22),
    0 8px 16px rgba(65,8,83,0.22);
  text-shadow:
    0 2px 0 #7d2f00,
    0 5px 0 rgba(98,20,121,0.65),
    0 0 12px rgba(255, 241, 106, 0.32);
}

.level-intro-card {
  width: min(100%, 450px);
}

.level-intro-title {
  font-size: clamp(1.8rem, 8vw, 2.8rem);
}

.level-intro-text,
#modal-message {
  font-size: 1.05rem;
  line-height: 1.35;
}

.modal-card {
  position: relative;
  overflow: visible;
  padding-top: 64px;
}

.modal-badge {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -38%);
  z-index: 2;
  box-shadow:
    0 14px 24px rgba(59,20,81,0.22),
    inset 0 2px 0 rgba(255,255,255,0.82),
    inset 0 -4px 0 rgba(163, 88, 180, 0.16);
}

.modal-card.is-trophy .modal-badge {
  width: 122px;
  height: 122px;
  border-radius: 36px;
  font-size: 4.2rem;
  transform: translate(-50%, -44%) rotate(-2deg);
  background: linear-gradient(180deg, #fff0a6 0%, #ffc34d 54%, #ff8f3a 100%);
  box-shadow:
    0 18px 26px rgba(80, 26, 93, 0.30),
    inset 0 3px 0 rgba(255,255,255,0.8),
    inset 0 -8px 0 rgba(191, 99, 17, 0.28);
}

.modal-card.is-level-win .modal-badge {
  width: 92px;
  height: 92px;
  font-size: 3rem;
  transform: translate(-50%, -42%) rotate(5deg);
}

.modal-card.is-gift .modal-badge {
  transform: translate(-50%, -40%) rotate(-4deg);
}

#modal-title {
  font-size: clamp(2rem, 7vw, 3rem);
  color: #2d1550;
}

.modal-card.is-trophy #modal-title {
  color: #33155a;
}

.celebration-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  overflow: hidden;
}

.celebration-burst {
  position: absolute;
  left: 50%;
  top: 28%;
  width: min(56vw, 320px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255,255,255,0.46) 0 6%, rgba(255,232,92,0.28) 7%, rgba(255,232,92,0.0) 46%),
    radial-gradient(circle, rgba(255,93,179,0.35) 0 10%, rgba(255,93,179,0) 58%),
    radial-gradient(circle, rgba(65,255,211,0.32) 0 8%, rgba(65,255,211,0) 60%);
  filter: blur(1px);
  animation: celebration-pop 920ms ease-out forwards;
}

.confetti-piece {
  position: absolute;
  left: var(--x);
  top: -6%;
  width: var(--size);
  height: calc(var(--size) * 1.7);
  border-radius: 6px;
  background: hsl(var(--hue) 95% 62%);
  box-shadow: 0 0 12px rgba(255,255,255,0.22);
  transform: translateX(-50%) rotate(var(--rotate));
  animation: confetti-fall var(--duration) ease-in var(--delay) forwards;
}

.confetti-piece:nth-child(3n) {
  border-radius: 999px;
}

.confetti-piece:nth-child(4n) {
  width: calc(var(--size) * 0.6);
  height: calc(var(--size) * 2);
}

@keyframes confetti-fall {
  0% {
    opacity: 0;
    transform: translate(-50%, -20px) rotate(0deg) scale(0.7);
  }
  8% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--drift)), 105vh) rotate(calc(var(--rotate) + 400deg)) scale(1);
  }
}

@keyframes celebration-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.35);
  }
  30% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.28);
  }
}

@media (max-width: 520px) {
  .card-question {
    inset: 16% 16%;
    font-size: clamp(2.2rem, 10vw, 3.3rem);
  }

  .game-message {
    font-size: 0.88rem;
    line-height: 1.25;
  }

  .modal-card {
    padding-top: 58px;
  }

  .modal-card.is-trophy .modal-badge {
    width: 106px;
    height: 106px;
    font-size: 3.7rem;
  }
}


/* ===== V18: signo de interrogación mucho más visible ===== */
.card-back {
  border: 3px solid rgba(255,255,255,0.42);
  box-shadow:
    inset 0 3px 0 rgba(255,255,255,0.34),
    inset 0 -7px 0 rgba(49, 5, 72, 0.42),
    0 8px 0 rgba(49, 5, 72, 0.90),
    0 18px 24px rgba(25, 2, 42, 0.30);
}

.card-question {
  inset: 15% 15%;
  z-index: 5;
  color: #fff !important;
  background:
    radial-gradient(circle at 35% 28%, rgba(255,255,255,0.34), rgba(255,255,255,0) 35%),
    linear-gradient(180deg, #ffe55a 0%, #ffb72e 52%, #ff7c2b 100%);
  border: 3px solid rgba(255,255,255,0.92);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.78),
    inset 0 -6px 0 rgba(162, 72, 0, 0.35),
    0 10px 0 rgba(111, 28, 116, 0.55),
    0 16px 22px rgba(39, 5, 53, 0.26);
  text-shadow:
    0 2px 0 rgba(111, 28, 0, 0.85),
    0 4px 0 rgba(111, 28, 116, 0.70),
    0 0 16px rgba(255,255,255,0.28);
  -webkit-text-stroke: 1.4px rgba(111, 28, 0, 0.65);
}

.card-question::after {
  content: "";
  position: absolute;
  inset: 10px 12px auto;
  height: 32%;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.38), rgba(255,255,255,0));
  pointer-events: none;
}

@media (max-width: 520px) {
  .card-question {
    inset: 13% 13%;
    font-size: clamp(2.4rem, 11vw, 3.5rem);
    -webkit-text-stroke: 1.2px rgba(111, 28, 0, 0.65);
  }
}


/* ===== V19: reverso asegurado en el botón base ===== */
.memory-card {
  overflow: visible;
  border-radius: clamp(16px, 4vw, 24px);
}

.memory-card:not(.is-flipped):not(.is-matched) {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.24), rgba(255,255,255,0) 18%),
    linear-gradient(180deg, #85ff56 0%, #35dc2a 55%, #16ab23 100%);
  box-shadow:
    inset 0 3px 0 rgba(255,255,255,0.45),
    inset 0 -7px 0 rgba(15, 97, 26, 0.55),
    0 8px 0 rgba(10, 79, 20, 0.92),
    0 16px 22px rgba(20, 6, 34, 0.24);
}

.memory-card:not(.is-flipped):not(.is-matched)::after {
  content: "?";
  position: absolute;
  inset: 16% 16%;
  display: grid;
  place-items: center;
  z-index: 1;
  border-radius: 24px;
  color: #fff46c;
  font-family: "Cooper Black", "Arial Rounded MT Bold", "Trebuchet MS", ui-rounded, sans-serif;
  font-size: clamp(2.6rem, 9.5vw, 3.9rem);
  font-weight: 1000;
  line-height: 1;
  background:
    radial-gradient(circle at 35% 28%, rgba(255,255,255,0.32), rgba(255,255,255,0) 35%),
    linear-gradient(180deg, #45ef39 0%, #1ec530 100%);
  border: 3px solid rgba(255,255,255,0.88);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.58),
    inset 0 -6px 0 rgba(16, 105, 30, 0.34),
    0 8px 0 rgba(10, 79, 20, 0.35),
    0 14px 18px rgba(18, 4, 31, 0.18);
  text-shadow:
    0 2px 0 rgba(11, 77, 20, 0.95),
    0 0 12px rgba(255,255,255,0.18);
  -webkit-text-stroke: 1.2px rgba(11, 77, 20, 0.95);
  pointer-events: none;
}

.memory-card:not(.is-flipped):not(.is-matched) .card-inner {
  opacity: 0;
}

.memory-card.is-flipped,
.memory-card.is-matched {
  background: transparent;
  box-shadow: none;
}

.memory-card.is-flipped .card-inner,
.memory-card.is-matched .card-inner {
  opacity: 1;
}

@media (max-width: 520px) {
  .memory-card:not(.is-flipped):not(.is-matched)::after {
    inset: 14% 14%;
    font-size: clamp(2.5rem, 11vw, 3.8rem);
  }
}


/* ===== V20: textos con más contraste y borde oscuro ===== */
.screen-game .eyebrow.mini {
  color: #ff74d6;
  text-shadow:
    0 1px 0 rgba(58, 12, 79, 0.95),
    0 0 8px rgba(255, 116, 214, 0.25);
  font-weight: 900;
}

#game-title {
  color: #ffe86a;
  text-shadow:
    0 2px 0 rgba(63, 15, 79, 1),
    0 4px 0 rgba(63, 15, 79, 0.85),
    0 10px 14px rgba(24, 4, 34, 0.18);
  -webkit-text-stroke: 1.2px rgba(63, 15, 79, 0.92);
}

.screen-game .mode-label {
  color: #8dff78;
  font-weight: 900;
  text-shadow:
    0 1px 0 rgba(28, 76, 17, 0.95),
    0 2px 0 rgba(63, 15, 79, 0.55);
}

.level-intro-kicker {
  color: #ff6ad2;
  text-shadow: 0 1px 0 rgba(76, 18, 88, 0.78);
}

.level-intro-title,
#modal-title {
  color: #ffd95c;
  text-shadow:
    0 2px 0 rgba(87, 26, 0, 0.92),
    0 4px 0 rgba(79, 21, 96, 0.85),
    0 10px 16px rgba(24, 4, 34, 0.16);
  -webkit-text-stroke: 1.6px rgba(79, 21, 96, 0.92);
  paint-order: stroke fill;
}

.level-intro-text,
#modal-message {
  color: #573f76;
  font-weight: 900;
}

.game-message {
  background: linear-gradient(180deg, rgba(255,250,197,0.98), rgba(255,228,118,0.95));
  border: 2px solid rgba(255,255,255,0.78);
  color: #5a2f00;
  text-shadow: 0 1px 0 rgba(255,255,255,0.35);
  box-shadow:
    0 8px 18px rgba(39, 10, 60, 0.18),
    inset 0 1px 0 rgba(255,255,255,0.78),
    inset 0 -3px 0 rgba(173, 115, 0, 0.20);
}

.game-message.is-success {
  background: linear-gradient(180deg, rgba(214,255,187,0.98), rgba(144,240,109,0.95));
  color: #1f5e16;
}

.game-message.is-warning {
  background: linear-gradient(180deg, rgba(255,236,180,0.98), rgba(255,181,104,0.95));
  color: #7a3500;
}

@media (max-width: 520px) {
  #game-title {
    -webkit-text-stroke: 1px rgba(63, 15, 79, 0.92);
  }

  .level-intro-title,
  #modal-title {
    -webkit-text-stroke: 1.2px rgba(79, 21, 96, 0.92);
  }
}


/* ===== V21: título del nivel blanco y copa PNG en relieve ===== */
#game-title {
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(34, 8, 51, 0.28);
  -webkit-text-stroke: 0 transparent;
}

.screen-game .mode-label {
  color: #76ff8f;
}

.modal-badge {
  overflow: visible;
}

.modal-badge-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(74, 29, 6, 0.24));
}

.modal-card.is-trophy .modal-badge {
  width: 140px;
  height: 140px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: translate(-50%, -42%) rotate(0deg);
}

.modal-card.is-trophy #modal-title {
  color: #34195a;
  text-shadow: 0 2px 8px rgba(40, 10, 56, 0.10);
  -webkit-text-stroke: 0 transparent;
}

.modal-card.is-level-win #modal-title,
.modal-card.is-gift #modal-title {
  color: #ffd95c;
  text-shadow:
    0 2px 0 rgba(87, 26, 0, 0.92),
    0 4px 0 rgba(79, 21, 96, 0.85),
    0 10px 16px rgba(24, 4, 34, 0.16);
  -webkit-text-stroke: 1.6px rgba(79, 21, 96, 0.92);
}

@media (max-width: 520px) {
  .modal-card.is-trophy .modal-badge {
    width: 122px;
    height: 122px;
    transform: translate(-50%, -40%) rotate(0deg);
  }

  .modal-card.is-level-win #modal-title,
  .modal-card.is-gift #modal-title {
    -webkit-text-stroke: 1.2px rgba(79, 21, 96, 0.92);
  }
}


/* ===== V23: portada visual en inicio + app icon ===== */
.screen-home .hero-card {
  padding: clamp(16px, 4vw, 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.home-promo {
  width: 100%;
  margin: 0;
  border-radius: clamp(18px, 4vw, 30px);
  overflow: hidden;
  box-shadow:
    0 18px 36px rgba(45, 7, 75, 0.26),
    0 0 0 2px rgba(255, 255, 255, 0.22);
  background: linear-gradient(135deg, #3b0d73, #ff40bf);
}

.home-promo img {
  display: block;
  width: 100%;
  height: auto;
}

.screen-home .eyebrow,
.screen-home #home-title,
.screen-home .subtitle {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.screen-home .quick-stats {
  margin: 0;
}

.screen-home .reward-card.compact {
  width: min(100%, 560px);
  margin: 0;
}

.screen-home .home-actions {
  margin-top: 0;
}

@media (max-width: 520px) {
  .screen-home .hero-card {
    padding: 12px;
    gap: 12px;
  }

  .home-promo {
    border-radius: 20px;
  }

  .screen-home .quick-stats {
    gap: 8px;
  }

  .screen-home .stat-pill {
    padding: 8px 10px;
    font-size: 0.86rem;
  }

  .screen-home .reward-card.compact {
    padding: 13px;
  }

  .screen-home .home-actions .btn {
    min-height: 44px;
    padding: 12px 16px;
  }
}


/* ===== V25: tablero más compacto + vista rápida visible ===== */
.screen-game {
  width: min(100%, 680px);
  margin-left: auto;
  margin-right: auto;
  gap: 6px;
}

.screen-game .game-header,
.screen-game .dashboard,
.screen-game .game-progress,
.screen-game .game-message,
.screen-game .board-wrap,
.screen-game .secondary-actions {
  width: min(100%, 600px);
  margin-left: auto;
  margin-right: auto;
}

.screen-game .board-wrap {
  padding: 5px;
  border-radius: 18px;
}

.screen-game .memory-board {
  gap: clamp(5px, 1.1vw, 8px);
}

.screen-game .memory-card {
  border-radius: clamp(12px, 2.4vw, 17px);
}

.screen-game .dashboard {
  gap: 6px;
}

.screen-game .dash-item {
  min-height: 42px;
}

.screen-game .game-progress {
  padding: 9px 12px;
}

.screen-game .game-message {
  justify-content: center;
  text-align: center;
  min-height: 0;
  padding: 8px 12px;
}

.level-intro {
  position: fixed;
  top: 72px;
  width: min(88vw, 420px);
}

.level-intro-card {
  padding: 14px 16px 15px;
}

.level-intro-title {
  font-size: clamp(1.55rem, 6vw, 2.35rem);
}

.level-intro-text {
  font-size: 0.95rem;
}

@media (min-width: 760px) {
  .screen-game .board-wrap,
  .screen-game .game-header,
  .screen-game .dashboard,
  .screen-game .game-progress,
  .screen-game .game-message,
  .screen-game .secondary-actions {
    width: 560px;
  }
}

@media (max-width: 520px) {
  .screen-game {
    width: 100%;
    gap: 5px;
  }

  .level-intro {
    top: 54px;
    width: min(92vw, 360px);
  }

  .screen-game .game-header,
  .screen-game .dashboard,
  .screen-game .game-progress,
  .screen-game .game-message,
  .screen-game .board-wrap,
  .screen-game .secondary-actions {
    width: 100%;
  }

  .screen-game .memory-board {
    gap: 5px;
  }

  .screen-game .game-message {
    font-size: 0.78rem;
    padding: 7px 10px;
  }

  .level-intro-text {
    font-size: 0.82rem;
  }
}

/* ===== V27: celular más cómodo + fuente estable ===== */
:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body,
button,
input,
select,
textarea,
h1,
h2,
#game-title,
.level-intro-title,
#modal-title,
.card-question,
.memory-card::after {
  font-family: inherit;
}

.screen-game {
  overflow: visible;
}

@media (max-width: 520px) {
  .app-shell {
    padding: 8px 10px calc(14px + var(--safe-bottom));
  }

  .screen {
    min-height: auto;
  }

  .screen-game {
    min-height: auto;
    gap: 7px;
  }

  .screen-game .memory-board {
    gap: clamp(6px, 1.6vw, 8px);
  }

  .screen-game .memory-card {
    aspect-ratio: 1 / 1.05;
    border-radius: clamp(13px, 3.6vw, 18px);
  }

  .screen-game .board-wrap {
    padding: 5px;
  }

  .screen-game .secondary-actions {
    margin-top: 4px;
    margin-bottom: 8px;
  }
}

@media (max-width: 380px) {
  .screen-game .memory-board {
    gap: 5px;
  }

  .screen-game .memory-card {
    aspect-ratio: 1 / 1.02;
  }
}
.home-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  margin: 0 0 0.9rem;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #5a2d68;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(58, 16, 76, 0.14);
}

.home-back-link:hover,
.home-back-link:focus-visible {
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .home-back-link {
    margin-left: auto;
    margin-right: auto;
    font-size: 0.9rem;
  }
}
/* Escala general en escritorio: reduce toda la app sin deformar sus partes */
@media (min-width: 760px) {
  .app-shell {
    width: min(100%, 760px);
    padding: 20px 16px calc(24px + var(--safe-bottom));
    zoom: 0.82;
  }
}

/* En pantallas de escritorio más bajas, reduce un poco más */
@media (min-width: 760px) and (max-height: 760px) {
  .app-shell {
    zoom: 0.76;
  }
}

/* En pantallas grandes, que no se vea demasiado pequeña */
@media (min-width: 1200px) and (min-height: 850px) {
  .app-shell {
    zoom: 0.88;
  }
}
.back-arrow-img {
  display: block;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
}

.back-arrow-img--game {
  width: 28px;
  height: 28px;
}

.back-arrow-img--home {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
}

.home-back-link {
  gap: 0.35rem;
}

.icon-button {
  display: grid;
  place-items: center;
}
