/* ── WiwyTablas ─────────────────────────────────────────────────────────── */

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --card: #ffffff;
  --text: #3d3d5c;
  --shadow: 0 6px 0 rgba(0, 0, 0, 0.12);
}

html, body { height: 100%; }

body {
  font-family: "Chalkboard SE", "Comic Sans MS", "Segoe UI Rounded", "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #aee6ff 0%, #d8f5ff 45%, #fff8dc 100%);
  color: var(--text);
  overflow-x: hidden;
  user-select: none;
}

/* Escena de fondo: colinas verdes y camino, tipo el mockup */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(120px 120px at 82% 12%, rgba(255,240,150,0.85), rgba(255,240,150,0) 70%),
    radial-gradient(60px 32px at 20% 20%, rgba(255,255,255,0.9), rgba(255,255,255,0) 70%),
    radial-gradient(70px 36px at 70% 26%, rgba(255,255,255,0.85), rgba(255,255,255,0) 70%),
    radial-gradient(90% 55% at 12% 100%, #86c94a 0%, rgba(134,201,74,0) 60%),
    radial-gradient(90% 55% at 88% 100%, #6cb63f 0%, rgba(108,182,63,0) 60%),
    radial-gradient(60% 40% at 50% 118%, #d9a35a 0%, rgba(217,163,90,0) 70%);
}

#app { max-width: 760px; margin: 0 auto; height: 100dvh; overflow: hidden; position: relative; }

/* App shell: cada pantalla llena la ventana; cabecera arriba, nav abajo, cuerpo en medio */
.screen { height: 100dvh; display: flex; flex-direction: column; animation: screen-in 0.3s ease; }
.scroll-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 10px 14px 12px; display: flex; flex-direction: column; }
.bottom-nav { flex-shrink: 0; }
.home-v2, .with-nav { padding-bottom: 0; }
@keyframes screen-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ── Barra superior ── */
.topbar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; flex-shrink: 0; }
.topbar .game-title { flex: 1; font-size: 20px; font-weight: bold; }
.topbar .coins-chip:first-child { margin-left: 0; }

.coins-chip {
  background: var(--card); border-radius: 999px; padding: 6px 14px;
  font-size: 17px; box-shadow: var(--shadow); white-space: nowrap;
}
.topbar .coins-chip:nth-child(2) { margin-left: auto; }

.btn-icon {
  background: var(--card); border: none; border-radius: 50%;
  width: 46px; height: 46px; font-size: 20px; cursor: pointer;
  box-shadow: var(--shadow); transition: transform 0.1s;
}
.btn-icon:active { transform: scale(0.9); }

/* ── Inicio ── */
.home-screen { text-align: center; }
.logo { font-size: clamp(38px, 9vw, 60px); margin-top: 10px; letter-spacing: 1px;
        text-shadow: 2px 3px 0 rgba(0,0,0,0.1); }
.tagline { font-size: 19px; margin: 8px 0 18px; }
.wiwy-home { display: inline-block; }
.bounce { animation: bounce 1.6s ease-in-out infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

.menu { display: flex; flex-direction: column; gap: 14px; max-width: 380px; margin: 0 auto; }

.btn-big {
  border: none; border-radius: 22px; padding: 16px 20px;
  font-size: 21px; font-weight: bold; font-family: inherit; color: #fff;
  cursor: pointer; box-shadow: var(--shadow); transition: transform 0.1s;
}
.btn-big:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(0,0,0,0.12); }
.btn-play     { background: linear-gradient(180deg, #4cd964, #2ecc71); }
.btn-smart    { background: linear-gradient(180deg, #c56cf0, #9b59b6); }
.btn-shop     { background: linear-gradient(180deg, #ffb142, #ff9f1a); }
.btn-progress { background: linear-gradient(180deg, #54a0ff, #2e86de); }

.screen-title { text-align: center; font-size: 28px; margin: 12px 0 18px; }

/* ── Bienvenida ── */
.welcome-screen { text-align: center; padding-top: 10px; }
.welcome-form { max-width: 380px; margin: 14px auto 0; display: flex; flex-direction: column; gap: 12px; }
.welcome-q { font-size: 19px; font-weight: bold; margin-top: 6px; }
.name-input {
  border: 3px solid #54a0ff; border-radius: 18px; padding: 14px 18px;
  font-size: 22px; font-family: inherit; text-align: center; color: var(--text);
  background: var(--card); box-shadow: var(--shadow); outline: none;
}
.name-input:focus { border-color: #2ecc71; }
.gender-grid { display: flex; justify-content: center; gap: 14px; }
.gender-btn {
  background: var(--card); border: 3px solid transparent; border-radius: 20px;
  padding: 12px 26px; font-size: 38px; font-family: inherit; cursor: pointer;
  box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: transform 0.12s;
}
.gender-btn span { font-size: 16px; font-weight: bold; color: var(--text); }
.gender-btn:active { transform: scale(0.94); }
.gender-btn.selected { border-color: #2ecc71; background: #eafff0; transform: scale(1.05); }
.age-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.age-btn {
  width: 54px; height: 54px; border-radius: 50%; border: 3px solid transparent;
  background: var(--card); font-size: 22px; font-weight: bold; font-family: inherit;
  color: var(--text); cursor: pointer; box-shadow: var(--shadow); transition: transform 0.12s;
}
.age-btn:active { transform: scale(0.9); }
.age-btn.selected { border-color: #ff9f1a; background: #fff3d6; transform: scale(1.12); }
.profile-chip {
  background: var(--card); border: none; border-radius: 999px; padding: 7px 16px;
  font-family: inherit; font-size: 15px; font-weight: bold; color: var(--text);
  cursor: pointer; box-shadow: var(--shadow); margin: 6px 0;
}

/* ── Mapa de tablas ── */
.tables-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px;
}
.table-card {
  background: var(--card); border: none; border-radius: 20px; padding: 18px 10px;
  font-family: inherit; color: var(--text); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  box-shadow: var(--shadow); border-bottom: 6px solid var(--tc, #ccc);
  transition: transform 0.12s;
}
.table-card:hover { transform: translateY(-4px); }
.table-card:active { transform: scale(0.96); }
.table-num { font-size: 42px; font-weight: bold; color: var(--tc, var(--text)); }
.table-label { font-size: 16px; font-weight: bold; }
.table-stars { font-size: 15px; letter-spacing: 2px; }
.challenge-card { border-bottom-color: #f1c40f; background: linear-gradient(180deg, #fff8dc, #ffeaa7); }

/* ── Modos ── */
.wiwy-small { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 16px; }
.modes-list { display: flex; flex-direction: column; gap: 12px; max-width: 460px; margin: 0 auto; }
.mode-card {
  display: flex; align-items: center; gap: 16px; text-align: left;
  background: var(--card); border: none; border-radius: 18px; padding: 14px 18px;
  font-family: inherit; color: var(--text); font-size: 18px; cursor: pointer;
  box-shadow: var(--shadow); transition: transform 0.12s;
}
.mode-card:hover { transform: translateX(6px); }
.mode-card:active { transform: scale(0.97); }
.mode-card small { display: block; font-weight: normal; opacity: 0.75; font-size: 14px; }
.mode-icon { font-size: 34px; }

/* ── Juego ── */
.game-screen { text-align: center; }
.q-progress { display: flex; justify-content: center; gap: 8px; margin: 8px 0; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 2px #bbb; }
.dot-done { background: #2ecc71; box-shadow: none; }
.dot-now  { background: #feca57; box-shadow: none; transform: scale(1.25); }

.wiwy-game { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 78px; }
.bubble {
  background: var(--card); border-radius: 16px; padding: 10px 16px; font-size: 16px;
  box-shadow: var(--shadow); position: relative; max-width: 320px;
}
.bubble::before {
  content: ''; position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
  border: 8px solid transparent; border-right-color: var(--card); border-left: none;
}
.bubble-center { margin: 10px auto; max-width: 340px; }
.bubble-center::before { display: none; }
.bubble-pop { animation: bubble-pop 0.3s ease; }
@keyframes bubble-pop { 0% { transform: scale(0.8); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }

.instruction { font-size: 18px; margin: 10px 0; }

.groups {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 14px 0;
}
.group {
  background: var(--card); border-radius: 16px; padding: 10px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px;
  max-width: 170px; min-width: 74px; min-height: 60px;
  box-shadow: var(--shadow); border: 3px solid #eee;
}
.group-pop { animation: group-pop 0.35s ease backwards; }
@keyframes group-pop { from { opacity: 0; transform: scale(0.5); } to { opacity: 1; transform: scale(1); } }

.empty-group {
  border: 3px dashed #54a0ff; background: rgba(255,255,255,0.6);
  font-size: 30px; cursor: pointer; font-family: inherit; color: #54a0ff;
  transition: transform 0.12s;
}
.empty-group:hover { transform: scale(1.06); }
.filled { border-color: #2ecc71; }

.obj { line-height: 1.15; }
.obj-img { object-fit: contain; vertical-align: middle; }
img.carrot { object-fit: contain; }
/* Si hay imagen de fondo propia, se oculta la escena dibujada por CSS */
html.has-bg-image body::before { display: none; }
.obj-in { animation: obj-in 0.3s ease backwards; }
@keyframes obj-in { from { opacity: 0; transform: scale(0) rotate(-90deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
.hidden-obj { filter: grayscale(1); opacity: 0.75; }

.missing-slot {
  border: 3px dashed #ff6b6b; border-radius: 12px; background: rgba(255,220,220,0.5);
  cursor: pointer; animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }

.big-op { font-size: clamp(30px, 7vw, 44px); font-weight: bold; margin: 16px 0; }

/* Modo Contar: pregunta y revelación de la multiplicación */
.count-q { font-size: clamp(24px, 6vw, 34px); font-weight: bold; margin: 16px 0 10px; }
.eq-reveal { min-height: 10px; }
.eq-box {
  display: inline-flex; align-items: center; gap: 10px; margin: 14px auto 0;
  background: var(--card); border-radius: 20px; padding: 12px 24px;
  box-shadow: var(--shadow); border: 3px solid #2ecc71;
  animation: eq-pop 0.5s ease backwards;
}
.eq-part { font-size: 40px; font-weight: bold; color: #54a0ff; }
.eq-op { font-size: 32px; font-weight: bold; color: var(--text); }
.eq-total { font-size: 44px; font-weight: bold; color: #2ecc71; animation: total-pop 0.5s ease 0.25s backwards; }
@keyframes eq-pop { 0% { opacity: 0; transform: scale(0.6) translateY(10px); } 60% { transform: scale(1.08); } 100% { opacity: 1; transform: scale(1); } }
@keyframes total-pop { 0% { transform: scale(0); } 60% { transform: scale(1.4); } 100% { transform: scale(1); } }
.q-mark { color: #ff6b6b; display: inline-block; animation: pulse 1.2s ease-in-out infinite; }

.choices { display: grid; grid-template-columns: repeat(2, minmax(110px, 160px)); gap: 12px; justify-content: center; margin: 10px 0; }
.choice {
  background: var(--card); border: none; border-radius: 18px; padding: 18px 10px;
  font-size: 28px; font-weight: bold; font-family: inherit; color: var(--text);
  cursor: pointer; box-shadow: var(--shadow); transition: transform 0.1s;
}
.choice:hover { transform: translateY(-3px); }
.choice:active { transform: scale(0.95); }
.choice-correct { background: #2ecc71 !important; color: #fff; animation: correct-jump 0.5s ease; }
@keyframes correct-jump { 0% { transform: scale(1); } 40% { transform: scale(1.15); } 100% { transform: scale(1); } }
.choice-wrong { background: #ffd5d5 !important; animation: shake 0.4s ease; opacity: 0.7; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* ── Modo Arrastrar ── */
.drag-groups { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 14px 0; }
.drop-zone {
  position: relative; min-width: 84px; min-height: 76px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px;
  padding: 10px 10px 22px; border-radius: 16px;
  border: 3px dashed #ff9f43; background: rgba(255,255,255,0.55);
  touch-action: none; transition: transform 0.12s, background 0.15s;
}
.drop-zone.zone-hover { background: #fff3d6; transform: scale(1.05); border-color: #ff6b6b; }
.drop-zone.zone-done { border-style: solid; border-color: #2ecc71; background: #eafff0; }
.dz-count {
  position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  font-size: 13px; font-weight: bold; color: #888; background: rgba(255,255,255,0.8);
  border-radius: 999px; padding: 1px 8px;
}
.zone-done .dz-count { color: #2ecc71; }
.tray-label { font-size: 15px; opacity: 0.7; margin: 6px 0 2px; }
.drag-tray {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
  background: rgba(255,255,255,0.5); border-radius: 18px; padding: 12px;
  min-height: 56px; margin-bottom: 10px; border: 3px solid #eee;
}
.carrot {
  cursor: grab; touch-action: none; line-height: 1.1;
  transition: transform 0.1s; user-select: none;
}
.carrot:active { cursor: grabbing; }
.carrot-sel { transform: scale(1.35); filter: drop-shadow(0 0 4px #ff9f43); }
.drag-ghost {
  position: fixed; transform: translate(-50%, -50%); pointer-events: none; z-index: 200;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

/* ── Modo Memoria: los dibujos desaparecen ── */
#memo-groups { transition: opacity 0.4s ease, max-height 0.5s ease, margin 0.4s ease; overflow: hidden; }
.memo-hide { opacity: 0; max-height: 0 !important; margin: 0 !important; }

/* ── Modo Carrera ── */
.race { display: flex; flex-direction: column; gap: 8px; max-width: 480px; margin: 6px auto; }
.lane { display: flex; align-items: center; gap: 8px; }
.lane-label { font-size: 15px; font-weight: bold; min-width: 26px; }
.track {
  position: relative; flex: 1; height: 40px; border-radius: 999px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,0.7) 0 16px, rgba(255,255,255,0.4) 16px 32px);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.06);
}
.racer {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  font-size: 28px; transition: left 0.5s cubic-bezier(.34,1.4,.6,1); z-index: 2;
}
.finish { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); font-size: 24px; }

/* ── Modo Jefe final ── */
.boss { max-width: 460px; margin: 8px auto; }
.boss-row { display: flex; align-items: center; gap: 12px; }
.boss-emoji { font-size: 44px; }
.boss-shake { animation: boss-shake 0.3s ease; }
@keyframes boss-shake { 0%,100% { transform: translateX(0) scale(1.1); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.boss-hp { flex: 1; height: 18px; background: #ffd5d5; border-radius: 999px; overflow: hidden; box-shadow: inset 0 0 0 2px rgba(0,0,0,0.06); }
.boss-hp-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #ff6b6b, #ff9f43); transition: width 0.4s ease; }
.hearts { text-align: center; font-size: 26px; letter-spacing: 4px; margin-top: 8px; }
.hearts-hit { animation: hearts-hit 0.4s ease; }
@keyframes hearts-hit { 0%,100% { transform: scale(1); } 40% { transform: scale(1.3); } }

.medal-win { text-align: center; margin: 6px 0; animation: eq-pop 0.6s ease; }
.medal-emoji { font-size: 72px; animation: star-in 0.7s ease; }
.medal-text { font-size: 24px; font-weight: bold; color: #ff9f1a; }
.lose-banner { text-align: center; font-size: 18px; background: var(--card); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); max-width: 380px; margin: 6px auto; }

/* ── Temporizadores ── */
.memo-timer, .speed-bar-track {
  height: 12px; background: rgba(255,255,255,0.7); border-radius: 999px;
  overflow: hidden; margin: 6px auto; max-width: 420px;
}
.memo-bar { height: 100%; width: 100%; background: linear-gradient(90deg, #48dbfb, #54a0ff);
            transition-property: width; transition-timing-function: linear; }
.speed-timer { display: flex; align-items: center; gap: 10px; max-width: 460px; margin: 6px auto; }
.speed-bar-track { flex: 1; margin: 0; }
.speed-bar { height: 100%; width: 100%; background: linear-gradient(90deg, #2ecc71, #feca57, #ff6b6b); }
#speed-label { font-weight: bold; font-size: 18px; min-width: 42px; }

/* ── Fin de ronda ── */
.end-screen { text-align: center; }
.end-stars { font-size: 54px; margin: 8px 0; }
.end-star { display: inline-block; filter: grayscale(1); opacity: 0.35; }
.end-star.lit { filter: none; opacity: 1; animation: star-in 0.5s ease backwards; }
@keyframes star-in { 0% { transform: scale(0) rotate(-180deg); } 70% { transform: scale(1.4); } 100% { transform: scale(1); } }
.end-stats { display: flex; justify-content: center; gap: 14px; margin: 18px 0; }
.stat { background: var(--card); border-radius: 16px; padding: 12px 18px; font-size: 15px; box-shadow: var(--shadow); }
.stat b { font-size: 24px; }

/* ── Tienda ── */
.shop-section { margin: 20px 0 10px; font-size: 20px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.shop-card {
  background: var(--card); border-radius: 18px; padding: 14px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  box-shadow: var(--shadow); opacity: 0.92;
}
.shop-card.owned { opacity: 1; }
.shop-icon { font-size: 38px; }
.btn-small {
  border: none; border-radius: 999px; padding: 7px 16px; font-family: inherit;
  font-size: 15px; font-weight: bold; cursor: pointer; background: #eee; color: var(--text);
}
.btn-buy { background: linear-gradient(180deg, #ffb142, #ff9f1a); color: #fff; }
.btn-active { background: #2ecc71; color: #fff; }

/* ── Progreso ── */
.prog-list { display: flex; flex-direction: column; gap: 10px; max-width: 520px; margin: 0 auto 20px; }
.prog-row { display: flex; align-items: center; gap: 10px; background: var(--card);
            border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow); }
.prog-label { font-weight: bold; min-width: 105px; font-size: 15px; }
.prog-track { flex: 1; height: 12px; background: #eee; border-radius: 999px; overflow: hidden; }
.prog-fill { height: 100%; border-radius: 999px; transition: width 0.6s ease; }
.prog-pct { min-width: 40px; text-align: right; font-size: 14px; }
.prog-stars { min-width: 56px; font-size: 13px; }
.weak-box { background: var(--card); border-radius: 18px; padding: 18px; text-align: center;
            max-width: 520px; margin: 0 auto; box-shadow: var(--shadow); }
.weak-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0 16px; }
.weak-chip { background: #ffeaa7; border-radius: 999px; padding: 6px 14px; font-weight: bold; font-size: 17px; }
.prog-icon { font-size: 18px; min-width: 22px; }

.today-box, .rec-box, .parent-box {
  background: var(--card); border-radius: 18px; padding: 16px 18px; box-shadow: var(--shadow);
  max-width: 520px; margin: 0 auto 16px;
}
.today-box h3, .rec-box h3, .parent-box h3 { margin-bottom: 10px; font-size: 19px; }
.today-row { font-size: 17px; padding: 3px 0; }
.rec-box { text-align: center; border: 3px solid #c56cf0; }
.rec-box p { margin-bottom: 12px; }
.rec-box .btn-big { margin-top: 8px; }
.parent-box { border: 3px solid #54a0ff; }
.parent-stats { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.parent-stats .stat { flex: 1; min-width: 110px; }

/* ── Confeti ── */
#confetti-layer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 99; }
.confetti { position: absolute; top: -20px; animation: confetti-fall linear forwards; }
@keyframes confetti-fall {
  to { transform: translateY(110vh) rotate(720deg); }
}
.spark { position: absolute; font-size: 22px; animation: spark-up 0.9s ease forwards; }
@keyframes spark-up { to { transform: translateY(-70px) scale(1.4); opacity: 0; } }

/* Felicitación grande "✅ ¡Muy bien!" */
.cheer {
  position: fixed; top: 38%; left: 50%; transform: translate(-50%, -50%);
  text-align: center; pointer-events: none; z-index: 100;
  animation: cheer-in 1.1s ease forwards;
}
.cheer-stars { font-size: 46px; letter-spacing: 6px; animation: cheer-stars 0.6s ease; }
.cheer-text {
  font-size: 40px; font-weight: bold; color: #2ecc71;
  text-shadow: 0 3px 0 #fff, 0 5px 8px rgba(0,0,0,0.2);
  background: rgba(255,255,255,0.85); border-radius: 20px; padding: 6px 22px; margin-top: 6px;
  display: inline-block;
}
@keyframes cheer-in {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  20%  { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  35%  { transform: translate(-50%, -50%) scale(1); }
  80%  { opacity: 1; transform: translate(-50%, -55%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -80%) scale(0.9); }
}
@keyframes cheer-stars { 0% { transform: scale(0) rotate(-30deg); } 60% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* ═══ Home rediseñado (responsive) ══════════════════════════════════════ */
.home-v2 { text-align: center; }

.hometop { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; flex-shrink: 0; background: linear-gradient(180deg, #8a54cf, #7343bf); }
.hometop .pc-text b, .hometop .level-chip, .hometop .coins-chip.big { color: var(--text); }
.hometop .avatar { background: #fff; }
.profile-card {
  display: flex; align-items: center; gap: 10px; background: var(--card);
  border: none; border-radius: 999px; padding: 6px 16px 6px 6px; box-shadow: var(--shadow);
  cursor: pointer; font-family: inherit; color: var(--text);
}
.avatar {
  width: 42px; height: 42px; border-radius: 50%; background: #e9dcff;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.pc-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.pc-text b { font-size: 15px; }
.pc-stars { font-size: 13px; color: #ff9f1a; font-weight: bold; }
.top-right { display: flex; align-items: center; gap: 8px; }
.coins-chip.big { display: flex; align-items: center; gap: 6px; border: none; font-family: inherit; color: var(--text); cursor: pointer; font-size: 16px; }
.coin-plus { background: #2ecc71; color: #fff; border-radius: 50%; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; font-weight: bold; }
.level-chip { background: var(--card); border-radius: 999px; padding: 7px 14px; font-size: 15px; font-weight: bold; box-shadow: var(--shadow); white-space: nowrap; }

.logo-v2 { margin: 6px 0 0; line-height: 0.9; text-shadow: 3px 4px 0 rgba(0,0,0,0.12); }
.logo-wiwy, .logo-tablas {
  display: block; font-weight: 900; letter-spacing: 2px;
  font-size: clamp(44px, 12vw, 80px);
  -webkit-text-stroke: 3px #fff; paint-order: stroke fill;
}
.logo-wiwy { color: #7b4fc4; }
.logo-tablas { color: #ffb020; }
.sublogo {
  display: inline-block; background: #7b4fc4; color: #fff; font-weight: bold;
  border-radius: 999px; padding: 4px 20px; font-size: clamp(15px, 4vw, 20px); margin: 6px 0 4px;
  box-shadow: var(--shadow);
}

.mascot-row { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.mascot-bubble { max-width: 240px; font-size: 15px; }

/* Cuadrícula de tarjetas */
.home-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.home-card {
  border: none; border-radius: 22px; padding: 16px 10px 14px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px; color: #fff;
  font-family: inherit; box-shadow: var(--shadow); transition: transform 0.12s;
  min-height: 130px; justify-content: center;
}
.home-card:hover { transform: translateY(-4px); }
.home-card:active { transform: scale(0.96); }
.hc-icon { font-size: 40px; filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2)); }
.hc-icon-img { width: 48px; height: 48px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2)); }
.hc-title { font-size: clamp(14px, 3.4vw, 19px); font-weight: 900; letter-spacing: 0.5px; }
.hc-desc { font-size: clamp(10px, 2.6vw, 13px); opacity: 0.95; line-height: 1.15; }
.c-green  { background: linear-gradient(160deg, #7ac943, #5fa829); }
.c-blue   { background: linear-gradient(160deg, #3db6f0, #2a90d4); }
.c-orange { background: linear-gradient(160deg, #ff9f2e, #f57c1f); }
.c-purple { background: linear-gradient(160deg, #a86fe0, #8a4fca); }
.c-pink   { background: linear-gradient(160deg, #ff5fa2, #e83e8c); }
.c-teal   { background: linear-gradient(160deg, #2bbfb0, #1f9e93); }

/* Panel tabla actual + progreso */
.tabla-panel {
  display: flex; gap: 14px; background: var(--card); border-radius: 22px;
  padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; flex-wrap: wrap;
}
.tp-current { flex: 1; min-width: 130px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tp-label { font-size: 15px; font-weight: bold; opacity: 0.8; }
.tp-num { font-size: 40px; font-weight: 900; }
.tp-objs { font-size: 24px; letter-spacing: 2px; }
.tp-op { font-size: 20px; font-weight: bold; color: #7b4fc4; }
.tp-progress { flex: 2; min-width: 180px; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.prog-track.big { height: 26px; position: relative; }
.prog-inline { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: bold; color: var(--text); }
.tp-progress .btn-big { font-size: 18px; padding: 12px; }
.tp-change { background: #eee; align-self: center; }

/* Tira de estadísticas */
.stats-strip { display: flex; gap: 10px; background: var(--card); border-radius: 20px; padding: 12px; box-shadow: var(--shadow); }
.ss-item { flex: 1; display: flex; align-items: center; gap: 8px; justify-content: center; }
.ss-ic { font-size: 26px; }
.ss-text { font-size: 12px; line-height: 1.2; text-align: left; }
.ss-text b { font-size: 15px; }

/* Barra de navegación inferior */
.bottom-nav {
  flex-shrink: 0; z-index: 50;
  display: flex; justify-content: space-around; align-items: center;
  background: linear-gradient(180deg, #8a54cf, #7b4fc4);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
}
.nav-item {
  background: none; border: none; cursor: pointer; font-family: inherit; color: #e6d9ff;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 10px; border-radius: 16px; font-size: 12px; transition: transform 0.1s;
  flex: 1; max-width: 110px;
}
.nav-icon { font-size: 22px; }
.nav-icon-img { width: 30px; height: 30px; object-fit: contain; }
.nav-item:active { transform: scale(0.9); }
.nav-active { background: rgba(255,255,255,0.22); color: #fff; font-weight: bold; }

.table-active { outline: 4px solid #ffd257; outline-offset: 2px; }

/* ═══ Selector de tablas rediseñado ═════════════════════════════════════ */
.tsel-title { margin: 10px 0 2px; font-size: clamp(30px, 8vw, 46px); color: #fff; text-shadow: 2px 3px 0 rgba(0,0,0,0.15); }
.tsel-title span { color: #ffd23f; }
.tsel-sub { text-align: center; color: var(--text); font-weight: bold; margin-bottom: 14px; font-size: 15px; }
.tsel-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tsel-card {
  position: relative; background: #fff; border: none; border-radius: 20px;
  padding: 12px 8px 10px; cursor: pointer; font-family: inherit; color: var(--text);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  box-shadow: var(--shadow); transition: transform 0.12s;
}
.tsel-card:hover { transform: translateY(-4px); }
.tsel-card:active { transform: scale(0.96); }
.tsel-active { outline: 4px solid #ffd23f; outline-offset: -1px; }
.tsel-check { position: absolute; top: -8px; right: -8px; font-size: 24px; }
.tsel-top { font-size: 14px; font-weight: bold; color: var(--tc); }
.tsel-num { font-size: clamp(34px, 9vw, 48px); font-weight: 900; color: var(--tc); line-height: 1; }
.tsel-objs { font-size: 20px; line-height: 1.1; min-height: 44px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1px; max-width: 130px; }
.tsel-pill {
  margin-top: 4px; width: 100%; background: var(--tc); color: #fff; border-radius: 999px;
  padding: 5px 8px; font-size: 14px; font-weight: bold;
}
.tsel-challenge { background: linear-gradient(160deg, #8a4fca, #6c3fb5); color: #fff; justify-content: center; }
.tsel-ch-title { font-size: 20px; font-weight: 900; }
.tsel-trophy { font-size: 46px; }
.tsel-ch-desc { font-size: 13px; opacity: 0.95; }

@media (max-width: 640px) { .tsel-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 420px) { .tsel-grid { grid-template-columns: repeat(2, 1fr); } .tsel-num { font-size: 40px; } }

/* ═══ Pantalla de juego rediseñada ══════════════════════════════════════ */
.game-v2 { text-align: center; }
.game-header {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  background: linear-gradient(180deg, #8a54cf, #7343bf);
  border-radius: 0 0 24px 24px; padding: 10px 14px 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.hdr-btn {
  background: rgba(255,255,255,0.2); border: none; border-radius: 50%;
  width: 46px; height: 46px; font-size: 20px; cursor: pointer; color: #fff; flex-shrink: 0;
}
.hdr-btn:active { transform: scale(0.9); }
.hdr-mid { flex: 1; text-align: left; }
.hdr-title { color: #fff; font-size: clamp(18px, 5vw, 24px); font-weight: 900; display: block; }
.level-line { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.lvl-label { color: #ffe680; font-size: 13px; font-weight: bold; white-space: nowrap; }
.lvl-bar { flex: 1; height: 12px; background: rgba(255,255,255,0.25); border-radius: 999px; overflow: hidden; max-width: 200px; }
.lvl-fill { height: 100%; background: linear-gradient(90deg, #7ac943, #a8e063); transition: width 0.4s ease; }
.coins-chip.small { display: flex; align-items: center; gap: 5px; font-size: 15px; padding: 6px 12px; flex-shrink: 0; }

.game-v2 .level-line { margin-top: 4px; }

/* Botones de respuesta de colores */
.choice.ch-green  { background: linear-gradient(180deg, #8fd94f, #6cb52f); color: #fff; }
.choice.ch-yellow { background: linear-gradient(180deg, #ffd23f, #f5b800); color: #fff; }
.choice.ch-blue   { background: linear-gradient(180deg, #45b7f0, #2a90d4); color: #fff; }
.choice.ch-pink   { background: linear-gradient(180deg, #ff6fae, #e83e8c); color: #fff; }
.choices { grid-template-columns: repeat(4, 1fr); max-width: 460px; margin: 14px auto; }
.choice { border-radius: 20px; padding: 20px 6px; font-size: 30px; }
@media (max-width: 420px) { .choices { grid-template-columns: repeat(2, 1fr); } }

/* Tira de estadísticas del juego */
.game-stats {
  display: flex; gap: 8px; background: var(--card); border-radius: 18px;
  padding: 12px; box-shadow: var(--shadow); max-width: 520px; margin: 14px auto 0;
}
.gs-item { flex: 1; display: flex; flex-direction: column; gap: 2px; border-right: 2px solid #eee; }
.gs-item:last-child { border-right: none; }
.gs-label { font-size: 12px; opacity: 0.7; }
.gs-item b { font-size: 17px; }

/* Escritorio / tablet ancho: centra y agranda un poco */
@media (min-width: 720px) {
  #app { max-width: 820px; }
  .mascot-bubble { max-width: 320px; font-size: 17px; }
}

/* Teléfonos estrechos: tarjetas en 2 columnas y estadísticas apiladas */
@media (max-width: 400px) {
  .home-grid { grid-template-columns: repeat(2, 1fr); }
  .home-card { min-height: 120px; }
  .stats-strip { flex-direction: column; }
  .ss-item { justify-content: flex-start; }
}

@media (max-width: 480px) {
  .end-stats { flex-wrap: wrap; }
  .prog-label { min-width: 88px; font-size: 13px; }
  .level-chip { font-size: 13px; padding: 6px 10px; }
}

/* ═══ Cabecera morada de app (Juegos/Perfil/Desafíos) ═══════════════════ */
.app-header {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  background: linear-gradient(180deg, #8a54cf, #7343bf);
  border-radius: 0 0 26px 26px; padding: 8px 12px 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.app-header .hdr-btn { background: rgba(255,255,255,0.2); border: none; border-radius: 50%; width: 42px; height: 42px; font-size: 18px; color: #fff; cursor: pointer; flex-shrink: 0; }
.app-header .hdr-btn:active { transform: scale(0.9); }
.hdr-owl { width: 60px; flex-shrink: 0; margin-top: -6px; }
.hdr-owl .wiwy { width: 60px !important; height: auto !important; }
.hdr-titles { flex: 1; text-align: left; line-height: 1.05; }
.hdr-big { display: block; color: #fff; font-size: clamp(24px, 6.5vw, 34px); font-weight: 900; }
.hdr-sub { color: #e6d9ff; font-size: 13px; }
.app-header .coins-chip.small { flex-shrink: 0; }

/* ═══ JUEGOS ════════════════════════════════════════════════════════════ */
.games-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.game-card { background: #fff; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.gc-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; color: #fff; }
.c-green .gc-head { background: linear-gradient(180deg,#7ac943,#5fa829); }
.c-blue .gc-head { background: linear-gradient(180deg,#3db6f0,#2a90d4); }
.c-orange .gc-head { background: linear-gradient(180deg,#ff9f2e,#f57c1f); }
.c-purple .gc-head { background: linear-gradient(180deg,#a86fe0,#8a4fca); }
.c-pink .gc-head { background: linear-gradient(180deg,#ff6fae,#e83e8c); }
.c-teal .gc-head { background: linear-gradient(180deg,#2bbfb0,#1f9e93); }
.gc-title { font-size: clamp(12px, 3.2vw, 15px); font-weight: 900; letter-spacing: 0.3px; }
.gc-badge { font-size: 18px; background: rgba(255,255,255,0.85); border-radius: 50%; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; }
.gc-preview { background: #f5efe0; margin: 8px; border-radius: 14px; padding: 10px 6px; min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.pv-op { font-size: 22px; font-weight: 900; color: #3d3d5c; }
.pv-op.pink { color: #e83e8c; }
.pv-x { color: #5fa829; }
.pv-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; max-width: 130px; }
.pv-obj { font-size: 20px; }
.pv-instr { font-size: 13px; font-weight: bold; }
.pv-circles { display: flex; gap: 6px; }
.pv-circle { width: 34px; height: 34px; border: 2px dashed #3db6f0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.pv-rows { font-size: 20px; line-height: 1.5; text-align: left; }
.pv-q { display: inline-flex; width: 26px; height: 26px; border: 2px dashed #999; border-radius: 8px; align-items: center; justify-content: center; font-size: 15px; color: #999; margin: 0 2px; vertical-align: middle; }
.pv-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.pv-tile { width: 34px; height: 34px; border-radius: 8px; background: linear-gradient(180deg,#5b8def,#3f6fd8); display: flex; align-items: center; justify-content: center; font-size: 16px; color: #cfe0ff; }
.pv-tile-open { background: #fff7d6; }
.pv-speed { display: flex; align-items: center; gap: 12px; }
.pv-timer { font-size: 16px; font-weight: bold; }
.pv-opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
.pv-opt { background: #fff; border-radius: 8px; padding: 3px 12px; font-weight: bold; font-size: 15px; box-shadow: 0 2px 0 rgba(0,0,0,0.08); }
.pv-opt-hi { background: #ff6fae; color: #fff; }
.pv-ops { display: flex; gap: 6px; }
.pv-mini-op { background: #fff; border-radius: 8px; padding: 4px 8px; font-weight: bold; font-size: 15px; color: #5f27cd; box-shadow: 0 2px 0 rgba(0,0,0,0.08); }
.pv-stats { font-size: 12px; font-weight: bold; color: #1f9e93; }
.gc-foot { display: flex; align-items: center; gap: 8px; padding: 4px 12px 12px; }
.gc-desc { flex: 1; font-size: 12px; text-align: left; line-height: 1.2; }
.gc-play { flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; border: none; background: linear-gradient(180deg,#9a63e0,#7343bf); color: #fff; font-size: 18px; cursor: pointer; box-shadow: var(--shadow); }
.gc-play:active { transform: scale(0.9); }

.play-banner {
  display: flex; align-items: center; gap: 10px; margin-top: 14px;
  background: linear-gradient(180deg,#ffe066,#ffd23f); border-radius: 20px; padding: 12px; box-shadow: var(--shadow);
}
.pb-owl { width: 60px; flex-shrink: 0; }
.pb-owl .wiwy { width: 60px !important; height: auto !important; }
.pb-text { font-size: 15px; color: #6b4e00; flex: 1; }
.pb-progress { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.pb-label { font-size: 12px; font-weight: bold; color: #6b4e00; }
.pb-bar { width: 90px; height: 12px; background: rgba(255,255,255,0.7); border-radius: 999px; overflow: hidden; }
.pb-fill { height: 100%; background: linear-gradient(90deg,#7ac943,#5fa829); }
.pb-num { font-size: 12px; font-weight: bold; color: #6b4e00; }
.pb-chest { font-size: 34px; }

/* ═══ PERFIL ════════════════════════════════════════════════════════════ */
.pf-top { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 22px; padding: 14px; box-shadow: var(--shadow); margin-bottom: 12px; }
.pf-avatar { position: relative; width: 84px; height: 84px; border-radius: 50%; border: 4px solid #ffd23f; background: #cfe0ff; display: flex; align-items: center; justify-content: center; font-size: 44px; cursor: pointer; flex-shrink: 0; }
.pf-edit { position: absolute; bottom: -2px; right: -2px; background: #fff; border-radius: 50%; width: 26px; height: 26px; font-size: 13px; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); }
.pf-info { flex: 1; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.pf-name { font-size: 26px; font-weight: 900; color: #5f27cd; }
.pf-xp-bar { position: relative; height: 22px; background: #2d2140; border-radius: 999px; overflow: hidden; }
.pf-xp-fill { height: 100%; background: linear-gradient(90deg,#ffd23f,#ff9f1a); }
.pf-xp-txt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: bold; }
.pf-chest { font-size: 40px; flex-shrink: 0; }
.pf-cards { display: flex; gap: 12px; margin-bottom: 12px; }
.pf-mini { flex: 1; display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 18px; padding: 12px; box-shadow: var(--shadow); }
.pf-mini-ic { font-size: 30px; }
.pf-mini-l { font-size: 12px; opacity: 0.7; }
.pf-mini b { font-size: 17px; }

.panel { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }
.panel-head { background: linear-gradient(180deg,#8a54cf,#7343bf); color: #fff; font-weight: 900; padding: 10px 16px; font-size: 16px; display: flex; align-items: center; justify-content: space-between; }
.panel-head.light { background: #f0eaff; color: #5f27cd; }
.panel-head.orange { background: linear-gradient(180deg,#ff9f2e,#f57c1f); }
.mp-panel { border: 3px solid #7343bf; }
.mp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 14px; }
.mp-card { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mp-title { font-size: 12px; font-weight: bold; }
.mp-num { font-size: 34px; font-weight: 900; }
.mp-stars { font-size: 13px; letter-spacing: 1px; }
.mp-pill { color: #fff; border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: bold; }
.mp-all { display: block; margin: 0 auto 14px; background: #f0eaff; border: none; border-radius: 999px; padding: 10px 20px; font-family: inherit; font-weight: bold; color: #5f27cd; cursor: pointer; box-shadow: var(--shadow); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 14px; }
.stat-tile { border-radius: 16px; padding: 12px 6px; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
.st-blue { background: #e4f0ff; } .st-green { background: #e6f8ea; } .st-yellow { background: #fdf6dd; } .st-pink { background: #ffe6ef; }
.st-ic { font-size: 26px; }
.st-label { font-size: 11px; opacity: 0.8; line-height: 1.1; }
.st-val { font-size: 18px; }

.ach-count { font-size: 12px; font-weight: normal; }
.badges-row { display: flex; gap: 6px; padding: 14px; overflow-x: auto; }
.badge { flex: 1; min-width: 90px; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
.badge-ic { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 26px; color: #fff; box-shadow: var(--shadow); }
.badge-name { font-size: 12px; font-weight: bold; }
.badge-desc { font-size: 10px; opacity: 0.7; line-height: 1.1; }
.badge-lock { opacity: 0.7; }
.badge-check { color: #2ecc71; font-size: 16px; }
.badge-prog { background: #7343bf; color: #fff; border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: bold; }

.pf-banner { display: flex; align-items: center; gap: 10px; background: linear-gradient(180deg,#ffe066,#ffd23f); border-radius: 20px; padding: 12px; box-shadow: var(--shadow); }
.pf-banner .pb-owl { width: 70px; }
.pf-banner .pb-owl .wiwy { width: 70px !important; height: auto !important; }
.pf-banner-txt { font-size: 14px; color: #6b4e00; text-align: left; }

/* ═══ DESAFÍOS ══════════════════════════════════════════════════════════ */
.ch-hero { display: flex; align-items: center; gap: 12px; background: #efe6ff; border-radius: 20px; padding: 14px; box-shadow: var(--shadow); margin-bottom: 12px; }
.ch-trophy { font-size: 54px; }
.ch-hero-txt { font-size: 13px; color: #5f27cd; text-align: left; }
.ch-hero-txt b { font-size: 16px; }
.ch-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.ch-tab { flex: 1; background: var(--card); border: none; border-radius: 14px; padding: 12px 4px; font-family: inherit; font-weight: bold; font-size: 13px; color: #7343bf; cursor: pointer; box-shadow: var(--shadow); }
.ch-tab-active { background: linear-gradient(180deg,#8a54cf,#7343bf); color: #fff; }
.ch-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.ch-card { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 18px; padding: 12px; box-shadow: var(--shadow); }
.ch-icon { width: 54px; height: 54px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 26px; color: #fff; flex-shrink: 0; box-shadow: var(--shadow); }
.ch-mid { flex: 1; text-align: left; min-width: 0; }
.ch-name { font-size: 17px; font-weight: 900; display: flex; align-items: center; gap: 6px; }
.ch-new { background: #e0342a; color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 10px; }
.ch-desc { font-size: 12px; opacity: 0.8; line-height: 1.15; margin: 2px 0 6px; }
.ch-bar { position: relative; height: 18px; background: #eee; border-radius: 999px; overflow: hidden; }
.ch-bar.big { height: 22px; }
.ch-fill { height: 100%; background: linear-gradient(90deg,#3db6f0,#2a90d4); }
.ch-fill-done { background: linear-gradient(90deg,#7ac943,#5fa829); }
.ch-bar-txt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: bold; color: #fff; }
.ch-rewards { display: flex; flex-direction: column; gap: 3px; font-size: 13px; font-weight: bold; flex-shrink: 0; }
.ch-btn { flex-shrink: 0; border: none; border-radius: 14px; padding: 12px 14px; font-family: inherit; font-weight: 900; cursor: pointer; color: #fff; font-size: 14px; }
.ch-go { background: linear-gradient(180deg,#3db6f0,#2a90d4); }
.ch-claim { background: linear-gradient(180deg,#7ac943,#5fa829); }
.ch-claimed { background: #bbb; }
.ch-bottom { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
.ch-progress-panel, .ch-chest-panel { padding-bottom: 12px; text-align: center; }
.chp-body { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 8px 8px; }
.chp-star { font-size: 30px; }
.chp-num { font-size: 30px; }
.chp-chest { font-size: 34px; }
.ch-progress-panel .ch-bar, .ch-chest-panel .ch-bar { margin: 0 14px; }
.ch-fill { }
.ch-progress-panel .ch-fill, .chp-body + .ch-bar .ch-fill { background: linear-gradient(90deg,#ffd23f,#ff9f1a); }
.chp-note { font-size: 11px; opacity: 0.8; padding: 8px 12px 0; }
.big-chest { font-size: 60px; display: block; margin: 8px 0; }

/* Aviso flotante */
.wiwy-toast { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%); background: #7343bf; color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: bold; z-index: 120; box-shadow: var(--shadow); animation: toast-in 0.3s ease; max-width: 90%; text-align: center; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Responsive de las pantallas nuevas */
@media (max-width: 420px) {
  .mp-grid, .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .badges-row .badge { min-width: 80px; }
  .ch-bottom { grid-template-columns: 1fr; }
  .ch-rewards { font-size: 12px; }
}

.ch-empty { text-align:center; opacity:0.7; padding:24px; }

/* ═══ Home compacta (cabe sin scroll) ══════════════════════════════════ */
.home-body { gap: 10px; }
.home-hero { display: flex; align-items: center; gap: 10px; }
.home-hero .wiwy-home { flex-shrink: 0; }
.home-hero .wiwy-home .wiwy { width: 92px !important; height: auto !important; }
.logo-mini { line-height: 0.82; text-shadow: 2px 2px 0 rgba(0,0,0,0.12); }
.logo-mini .logo-wiwy, .logo-mini .logo-tablas { font-size: clamp(24px, 7vw, 34px); -webkit-text-stroke: 2px #fff; letter-spacing: 1px; }
.home-hero .mascot-bubble { margin-top: 6px; font-size: 14px; max-width: none; }
.home-body .home-grid { gap: 10px; }
.home-body .home-card { min-height: 84px; padding: 10px 8px; border-radius: 18px; }
.home-body .hc-icon { font-size: 30px; }
.home-body .hc-icon-img { width: 34px; height: 34px; }
.home-body .hc-title { font-size: clamp(12px, 3.2vw, 16px); }
.home-body .hc-desc { display: none; }
.tabla-panel { padding: 10px 12px; margin-bottom: 0; gap: 10px; }
.tp-num { font-size: 30px; }
.tp-btns { display: flex; gap: 8px; }
.tp-btns .btn-big { flex: 1; font-size: 15px; padding: 10px; }
.tp-change { align-self: center; }
.stats-strip { padding: 8px 10px; }
.ss-ic { font-size: 22px; }

/* Título compacto en cabeceras tipo hometop */
.hdr-title-sm { color: #fff; font-weight: 900; font-size: 20px; flex: 1; text-align: left; }
.hometop .hdr-btn { background: rgba(255,255,255,0.25); }
/* Pantallas sin barra inferior: permiten scroll propio si hiciera falta */
.welcome-screen, .end-screen { overflow-y: auto; padding: 12px 16px; text-align: center; }
