@charset "UTF-8";

:root {
  --ink: #15315c;
  --ink-2: #284777;
  --muted: #6980a5;
  --paper: #f8fbff;
  --surface: #ffffff;
  --bg: #d6f1ff;
  --bg-2: #ebf7ff;
  --panel: #edf5fd;
  --line: rgba(21, 49, 92, 0.16);
  --line-strong: rgba(21, 49, 92, 0.26);
  --shadow-xs: 0 2px 0 rgba(21, 49, 92, 0.08);
  --shadow-sm: 0 12px 28px rgba(22, 55, 108, 0.12);
  --shadow-md: 0 22px 60px rgba(19, 48, 95, 0.16);
  --shadow-lg: 0 28px 90px rgba(19, 48, 95, 0.2);
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius: 28px;
  --radius-lg: 34px;
  --scene-accent: #3693ea;
  --scene-soft: rgba(54, 147, 234, 0.18);
  --good: #67c53a;
  --good-soft: #e8f8df;
  --warn: #ff9248;
  --warn-soft: #fff0e3;
  --danger: #ff7b6b;
  --danger-soft: #ffe9e6;
  --yellow: #f7c739;
  --yellow-soft: #fff2ca;
  --purple: #9f78ff;
  --purple-soft: #f1ebff;
  --cyan: #4cc3dd;
  --cyan-soft: #dff7fd;
  --blue-deep: #15274d;
  --ease: cubic-bezier(.2,.75,.2,1);
}

body[data-theme-accent="gold"] { --scene-accent: #f2c12f; --scene-soft: rgba(242, 193, 47, 0.18); }
body[data-theme-accent="blue"] { --scene-accent: #3693ea; --scene-soft: rgba(54, 147, 234, 0.18); }
body[data-theme-accent="green"] { --scene-accent: #55ba41; --scene-soft: rgba(85, 186, 65, 0.18); }
body[data-theme-accent="orange"] { --scene-accent: #ff8d43; --scene-soft: rgba(255, 141, 67, 0.18); }
body[data-theme-accent="cyan"] { --scene-accent: #46c7d1; --scene-soft: rgba(70, 199, 209, 0.18); }

html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  overflow-x: hidden;
  font-family: 'Nunito', Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% 8%, rgba(255, 255, 255, 0.55), transparent 18rem),
    radial-gradient(circle at 90% 15%, rgba(122, 223, 255, 0.48), transparent 20rem),
    linear-gradient(180deg, #95e1fb 0%, #cdeeff 30%, #e9f8ff 100%);
  color: var(--ink);
}

body[data-scene="calle"], body[data-scene="transporte"] { --scene-accent: #ff9248; --scene-soft: rgba(255, 146, 72, 0.18); }
body[data-scene="parque"], body[data-scene="comunidad"], body[data-scene="meta"] { --scene-accent: #56bb4a; --scene-soft: rgba(86, 187, 74, 0.18); }
body[data-scene="oficina"], body[data-scene="registro"], body[data-scene="centro"] { --scene-accent: #9270ff; --scene-soft: rgba(146, 112, 255, 0.18); }
body[data-scene="evento"], body[data-scene="cancha"], body[data-scene="taller"] { --scene-accent: #ff7d76; --scene-soft: rgba(255, 125, 118, 0.18); }

.ambient-layer { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }
.ambient-grid {
  position: absolute; inset: 0; opacity: .28;
  background-image: linear-gradient(rgba(21,49,92,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(21,49,92,.04) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}
.ambient-orb { position: absolute; border-radius: 50%; filter: blur(3px); opacity: .75; animation: ambientFloat 18s ease-in-out infinite alternate; }
.ambient-orb-a { width: 340px; height: 340px; left: -120px; top: 4%; background: radial-gradient(circle, rgba(255,255,255,.7), transparent 68%); }
.ambient-orb-b { width: 460px; height: 460px; right: -120px; top: 30%; background: radial-gradient(circle, rgba(114,209,255,.45), transparent 70%); animation-delay: -5s; }
.ambient-orb-c { width: 380px; height: 380px; left: 35%; bottom: -180px; background: radial-gradient(circle, rgba(255,230,132,.35), transparent 70%); animation-delay: -10s; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  min-height: 86px;
  margin: 0;
  padding: 18px max(18px, calc((100vw - 1160px) / 2 + 18px));
  border: 0;
  border-radius: 0;
  background: var(--blue-deep);
  box-shadow: 0 8px 25px rgba(8, 23, 54, 0.18);
  backdrop-filter: none;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand-mark {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px;
  background: linear-gradient(180deg, #ffd04d, #ffb325); color: #17305f; font-size: 20px; font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65), 0 5px 0 rgba(0,0,0,.14);
}
.brand-copy { display: grid; line-height: .94; }
.brand-copy strong { font-size: 18px; letter-spacing: .02em; }
.brand-small { font-size: 11px; color: #c1d5ff; letter-spacing: .14em; }
.brand-edition { padding: 6px 8px; border-radius: 999px; background: rgba(255,255,255,.14); color: #ffe27b; font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.record {
  min-height: 42px; padding: 0 14px; display: flex; align-items: center; gap: 8px;
  border: 1px solid rgba(255,255,255,.1); border-radius: 999px; background: rgba(255,255,255,.08); color: #d9e7ff;
}
.record strong { color: #fff; font-size: 16px; }
.record-dot { width: 8px; height: 8px; border-radius: 50%; background: #67d870; box-shadow: 0 0 0 5px rgba(103,216,112,.12); }

.button {
  position: relative; overflow: hidden;
  min-height: 48px; border-radius: 18px; border: 2px solid var(--ink);
  font-weight: 900; letter-spacing: .02em; color: var(--ink);
  box-shadow: 0 5px 0 rgba(21,49,92,.15);
  transition: transform .18s var(--ease), box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:active:not(:disabled) { transform: translateY(0) scale(.985); }
.button-primary {
  color: var(--ink); background: linear-gradient(180deg, #ffd148 0%, #ffbf2d 100%);
  border-color: #18325e; box-shadow: 0 6px 0 #18325e, 0 16px 28px rgba(255, 193, 55, 0.24);
}
.button-secondary { background: #fff; }
.button-quiet {
  color: #eff5ff; background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.18); box-shadow: none;
}
.button-small { min-height: 42px; padding-inline: 14px; border-radius: 14px; }
.button:disabled { opacity: .58; cursor: not-allowed; box-shadow: none; }

main { width: min(1160px, calc(100% - 28px)); margin: 22px auto 0; }

.welcome-auth { min-height: calc(100vh - 170px); display: grid; align-items: center; padding: 12px 0 36px; }
.auth-browser {
  width: 100%; padding: 18px; border-radius: 30px; background: rgba(255,255,255,.42); box-shadow: var(--shadow-md);
}
.browser-shell, .app-browser {
  border: 3px solid #2b436d; border-radius: 26px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow-lg);
}
.browser-bar {
  min-height: 48px; display: flex; align-items: center; gap: 14px; padding: 0 16px;
  background: #f4f4f4; border-bottom: 2px solid #2b436d;
}
.browser-dots { display: inline-flex; gap: 7px; }
.browser-dots i { width: 10px; height: 10px; display: block; border-radius: 50%; }
.browser-dots i:nth-child(1) { background: #ff6b6b; }
.browser-dots i:nth-child(2) { background: #f0c93c; }
.browser-dots i:nth-child(3) { background: #5fca59; }
.browser-url {
  min-width: 0; flex: 1; max-width: 420px; padding: 8px 14px; border-radius: 999px; background: #fff; color: #98a1b2;
  font-size: 13px; font-weight: 800;
}
.auth-stage {
  position: relative; min-height: 640px; display: grid; place-items: center;
  background: linear-gradient(180deg, #52c7f0 0%, #47a9f7 100%);
}
.auth-corner { position: absolute; bottom: 24px; }
.auth-corner-left { left: 24px; }
.auth-corner-right { right: 24px; }
.welcome-logo-badge, .welcome-mascot-badge {
  width: 190px; height: 190px; border-radius: 28px; border: 3px solid rgba(255,255,255,.16);
  background: linear-gradient(180deg, rgba(21,39,77,.18), rgba(255,255,255,.12));
  display: grid; place-items: center; text-align: center; color: #fff; box-shadow: var(--shadow-md);
}
.welcome-logo-badge span, .welcome-mascot-badge span { font-size: 58px; }
.welcome-logo-badge strong, .welcome-mascot-badge strong { font-size: 26px; line-height: 1.05; }
.auth-card {
  width: min(420px, calc(100% - 26px)); padding: 26px 26px 24px; border-radius: 28px;
  background: #fffefb; border: 3px solid #233d69; box-shadow: 10px 10px 0 rgba(21, 49, 92, 0.15);
}
.auth-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: var(--yellow-soft); font-weight: 900; color: #8a6510; }
.auth-badge-icon { font-size: 18px; }
.auth-card h1 { margin-top: 14px; font-size: clamp(32px, 5vw, 44px); line-height: 1.02; letter-spacing: -.04em; }
.auth-subtitle { margin-top: 8px; color: var(--muted); line-height: 1.55; }
.auth-form {
  margin-top: 18px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none;
}
.auth-form label { display: block; margin-top: 14px; margin-bottom: 8px; font-size: 12px; font-weight: 900; letter-spacing: .04em; color: var(--ink); text-transform: uppercase; }
.input-shell {
  display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 15px;
  border: 2px solid #d6e1f1; border-radius: 16px; background: #f5f8fd;
}
.input-shell:focus-within { border-color: #59a6f7; box-shadow: 0 0 0 4px rgba(89,166,247,.14); }
.input-shell > span {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 12px; background: #dff2ff;
}
.input-shell input { flex: 1; min-width: 0; padding: 0; border: 0; background: transparent; outline: 0; font-weight: 800; color: var(--ink); }
.auth-actions, .start-actions { display: grid; gap: 10px; margin-top: 18px; grid-template-columns: 1fr; }
.session-summary, .saved-summary { margin-top: 12px; color: var(--muted); font-size: 13px; text-align: center; }

.game { padding-bottom: 24px; }
.app-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 760px; background: #f4f9ff; }
.app-sidebar {
  display: flex; flex-direction: column; gap: 22px; padding: 20px 14px; background: #fff;
  border-right: 2px solid #d8e3f3;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 16px; }
.sidebar-brand-mark {
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; background: linear-gradient(180deg, #2ca6f4, #4fd0e6); color: #fff; font-size: 24px;
  border: 2px solid #2b436d; box-shadow: 0 5px 0 rgba(43,67,109,.12);
}
.sidebar-brand strong { display: block; color: var(--ink); font-size: 18px; }
.sidebar-brand span { display: block; color: #ef7d33; font-size: 16px; font-weight: 900; }
.sidebar-nav { display: grid; gap: 12px; }
.nav-item, .nav-logout {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px;
  padding: 0 14px; border-radius: 18px; border: 0; background: transparent; color: #7a8eb1;
  font-weight: 900; text-align: left; transition: transform .18s var(--ease), background .18s ease, color .18s ease;
}
.nav-item:hover, .nav-logout:hover { transform: translateX(2px); background: #eff6fe; color: var(--ink); }
.nav-item.active { background: #dff0fc; color: #3073b6; }
.nav-icon {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: 12px; background: #fff; border: 2px solid #e3edf8;
  box-shadow: 0 3px 0 rgba(21,49,92,.06);
}
.nav-logout { margin-top: auto; color: #9badc7; }

.app-main { padding: 22px 28px 28px; }
.app-header { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.app-header h1 { margin: 0; font-size: clamp(28px, 4vw, 42px); line-height: 1.02; letter-spacing: -.04em; }
.view-subtitle, .view-mini-subtitle { margin-top: 4px; color: var(--muted); }
.player-chip {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 999px; background: #fff; border: 2px solid #d7e4f2; box-shadow: var(--shadow-xs);
}
.player-chip > span {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(180deg, var(--scene-accent), #8fd7ff); color: white; font-weight: 900;
}
.player-chip small { display: block; color: var(--muted); font-size: 10px; letter-spacing: .1em; }
.player-chip strong { font-size: 14px; }

.app-view { display: none; animation: screenSlide .48s var(--ease); }
.app-view.is-active { display: block; }
.screen-card, .home-card, .board-panel, .mission-card, .badges-card {
  border: 2px solid #2b436d; border-radius: 24px; background: #fff; box-shadow: var(--shadow-sm);
}
.section-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chip-soft, .link-chip, .mission-status, .event-label, .status-pill, .map-tag, .keyboard-hint {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 0 12px;
  border-radius: 999px; font-size: 11px; font-weight: 900;
}
.link-chip {
  border: 2px solid #b8ddff; background: #eef8ff; color: #2f7dc2;
}
.chip-soft { background: #e9f3fe; color: var(--ink-2); }
.mission-status, .status-pill, .keyboard-hint { border: 2px solid #d7e5f4; background: #fff; color: var(--muted); }
.mission-status i, .status-pill i { width: 8px; height: 8px; border-radius: 50%; background: #61d96d; box-shadow: 0 0 0 4px rgba(97,217,109,.12); }
.event-label { background: var(--yellow-soft); color: #915d12; }
.map-tag { background: var(--blue-deep); color: #fff; }

.home-stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.home-stat {
  display: flex; align-items: center; gap: 12px; min-height: 88px; padding: 16px 18px;
  border: 2px solid #2b436d; border-radius: 20px; background: #fff; box-shadow: var(--shadow-xs);
}
.home-stat > span {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; font-size: 20px; background: #eef6ff;
}
.home-stat strong { display: block; font-size: 28px; line-height: 1; }
.home-stat small { color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .07em; }
.home-stat-points { background: #f8ecc3; }
.home-stats-grid .home-stat:nth-child(2) { background: #fbe7db; }
.home-stats-grid .home-stat:nth-child(3) { background: #dff4fa; }
.home-stats-grid .home-stat:nth-child(4) { background: #e5f2d8; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, .95fr); gap: 16px; margin-top: 16px; }
.home-card { padding: 18px; }
.route-summary-list, .weekly-summary-list, .profile-badge-goals, .leaderboard-list, .reward-grid { display: grid; gap: 12px; }
.route-summary-item, .metric-row, .goal-row, .leaderboard-row {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px; border-radius: 18px;
  border: 2px solid #d9e6f3; background: #fff;
}
.route-summary-item.done { background: #edf9e8; border-color: #88cf75; }
.route-summary-item.current { background: #eef8ff; border-color: #7bbef5; }
.route-summary-item.locked { background: #f6f9fc; }
.route-summary-icon, .metric-icon, .goal-icon, .leaderboard-avatar {
  width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 14px; background: #eef5ff; font-weight: 900;
}
.route-summary-copy, .metric-copy, .goal-copy { display: grid; gap: 3px; }
.route-summary-copy small, .metric-copy small, .goal-copy small { color: var(--muted); }
.mentor-note {
  display: flex; align-items: start; gap: 12px; margin-top: 14px; padding: 14px; border: 2px dashed #62b0ff; border-radius: 18px; background: #eef8ff;
}
.mentor-note > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: #fff; border: 2px solid #9dd1ff; }
.mentor-note p { margin: 3px 0 0; color: var(--ink-2); }

.stats { display: grid; grid-template-columns: 1.15fr repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat {
  position: relative; min-height: 86px; display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  border: 2px solid #2b436d; border-radius: 22px; background: #fff; box-shadow: var(--shadow-xs);
}
.stat > span {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 14px; background: var(--scene-soft); color: var(--scene-accent); font-weight: 900;
}
.stat strong { font-size: 26px; line-height: 1; }
.stat small { color: var(--muted); font-size: 10px; letter-spacing: .1em; font-weight: 900; }
.stat-points { background: #16284d; color: #fff; }
.stat-points > span { background: rgba(255,255,255,.14); color: #ffd860; }
.stat-points small { color: #c8d8f6; }
.good-text { color: var(--good); }
.bad-text { color: var(--danger); }

.game-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(310px, .85fr); gap: 16px; }
.board-panel { padding: 22px; background: #f8fcff; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.panel-heading h2 { font-size: clamp(24px, 3vw, 34px); letter-spacing: -.04em; }
.panel-meta { display: flex; align-items: center; gap: 8px; }
.panel-meta > span:first-child { background: var(--scene-soft); color: var(--scene-accent); }
.board {
  position: relative; min-height: 520px; margin-top: 18px; padding: 28px; border: 2px solid #d5e2f1; border-radius: 22px;
  background: linear-gradient(180deg, #f7fdff 0%, #e4f6ff 100%);
}
.board::after { content: ""; position: absolute; inset: 16px; border: 2px dashed rgba(21,49,92,.08); border-radius: 18px; pointer-events: none; }
.node-circle {
  border-width: 2px !important; border-color: #2b436d !important; background: #fff !important;
  box-shadow: 0 5px 0 rgba(21,49,92,.14), 0 14px 24px rgba(21,49,92,.08);
}
.map-node.current .node-circle {
  border-color: var(--scene-accent) !important; box-shadow: 0 0 0 7px var(--scene-soft), 0 5px 0 rgba(21,49,92,.13), 0 16px 30px rgba(21,49,92,.12);
}
.map-node.done .node-circle { background: linear-gradient(180deg, var(--good), #56a730) !important; color: #fff !important; }
.node-name {
  margin-top: 8px; padding: 6px 8px; border-radius: 10px; background: rgba(255,255,255,.84); font-size: 10px; font-weight: 900;
  color: var(--ink);
}
#route-base { stroke: rgba(21,49,92,.18); }
#route-progress { stroke: var(--scene-accent); filter: drop-shadow(0 2px 3px var(--scene-soft)); }
.map-legend { padding-top: 14px; border-top: 2px solid #d9e6f3; }
.legend-dot { border-radius: 50%; }
.progress-heading { margin-top: 18px; }
progress { height: 12px; border-radius: 999px; overflow: hidden; }
progress::-webkit-progress-bar { background: #dfeaf6; }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--scene-accent), #88d5ff); }
.player-token { filter: drop-shadow(0 12px 10px rgba(21,49,92,.24)); }

.side-panel { display: grid; gap: 14px; }
.mission-card, .badges-card { padding: 18px; }
.mission-card { position: relative; overflow: hidden; background: #fffefb; }
.mission-card::before {
  content: ""; position: absolute; width: 220px; height: 220px; top: -110px; right: -100px; border-radius: 50%; background: radial-gradient(circle, var(--scene-soft), transparent 70%);
}
.mission-top { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.hearts { padding: 8px 10px; border-radius: 14px; background: #fff; border: 2px solid #d7e4f2; box-shadow: var(--shadow-xs); }
.mission-icon {
  width: 74px; height: 74px; margin: 18px 0 12px; display: grid; place-items: center; border-radius: 24px;
  background: linear-gradient(180deg, var(--scene-soft), #fff); border: 2px solid #cfe1f3; font-size: 36px;
}
.mission-card h2 { font-size: 28px; letter-spacing: -.04em; }
.mission-card p { color: var(--muted); line-height: 1.6; }
#mission-button { width: 100%; margin-top: 18px; }
.mission-reward { display: flex; justify-content: center; margin-top: 12px; color: var(--muted); font-size: 11px; }
.badges { display: grid; gap: 10px; margin-top: 12px; }
.badge {
  display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 12px; border-radius: 18px; border: 2px solid #d8e4f2; background: #fff;
}
.badge-icon {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: #eef7ff; font-size: 22px;
}
.badge.unlocked { background: #f0fff1; border-color: #a5de82; }
.gentle-note {
  padding: 14px 15px; border: 2px solid #ffd98d; border-radius: 18px; background: #fff6d8; color: #7d5a11;
}

.ranking-screen, .rewards-screen { padding: 20px; }
.podium-icon { font-size: 34px; }
.leaderboard-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: end; margin-top: 20px; }
.podium-card {
  min-height: var(--podium-height, 150px); padding: 18px 14px; display: grid; place-items: center; gap: 8px;
  border-radius: 20px; border: 2px solid #2b436d; text-align: center; box-shadow: var(--shadow-xs);
}
.podium-card:nth-child(1) { background: #4fc4e0; }
.podium-card:nth-child(2) { background: #f7c83c; }
.podium-card:nth-child(3) { background: #68c73f; }
.podium-card.you { outline: 4px solid rgba(255,255,255,.55); }
.podium-avatar { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 18px; background: rgba(255,255,255,.72); font-size: 28px; }
.leaderboard-list { margin-top: 20px; }
.leaderboard-row { display: grid; grid-template-columns: 32px 38px 1fr auto; }
.leaderboard-position { text-align: center; font-weight: 900; color: var(--muted); }
.leaderboard-row.is-user { background: #fff2cd; border-color: #efc041; }
.leaderboard-score { color: #2d7fca; font-weight: 900; }

.profile-grid { display: grid; grid-template-columns: minmax(300px, .85fr) minmax(0, 1.15fr); gap: 16px; }
.profile-card-main, .profile-card-side { padding: 20px; }
.profile-emblem-wrap { display: grid; justify-items: center; margin-top: 18px; text-align: center; }
.profile-emblem {
  width: 190px; height: 190px; display: grid; place-items: center; border-radius: 32px; border: 3px solid #2b436d; background: linear-gradient(180deg, #fff, #e8f6ff); box-shadow: var(--shadow-sm);
}
.profile-explorer { width: 120px; }
.profile-rank { margin-top: 4px; color: #2d7fca; font-weight: 900; }
.profile-color-swatches { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }
.swatch {
  width: 34px; height: 34px; border-radius: 12px; border: 3px solid transparent; box-shadow: 0 4px 0 rgba(21,49,92,.12);
}
.swatch[data-color="gold"] { background: #f2c12f; }
.swatch[data-color="blue"] { background: #3693ea; }
.swatch[data-color="green"] { background: #55ba41; }
.swatch[data-color="orange"] { background: #ff8d43; }
.swatch[data-color="cyan"] { background: #46c7d1; }
.swatch.active { border-color: #1f3c6c; transform: translateY(-2px); }
.goal-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; }
.goal-row.unlocked { background: #effdee; border-color: #9cdc88; }
.goal-value { color: var(--muted); font-size: 12px; font-weight: 900; }
.week-streak-title { margin: 18px 0 10px; font-size: 18px; }
.profile-week {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; padding: 14px; border: 2px solid #2b436d; border-radius: 22px; background: #fff;
}
.week-day { display: grid; justify-items: center; gap: 6px; }
.week-ball {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 2px solid #d9e5f4; background: #f4f9fd; color: #9ca8bf; font-weight: 900;
}
.week-day.done .week-ball { background: #73cc43; border-color: #459c23; color: #fff; }
.week-day.current .week-ball { background: #f2c431; border-color: #946b14; color: var(--ink); }
.week-day small { color: var(--muted); font-weight: 900; }

.reward-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.reward-tab {
  min-height: 40px; padding: 0 14px; border-radius: 999px; border: 2px solid #2b436d; background: #fff; color: var(--muted); font-weight: 900;
}
.reward-tab.active { background: var(--blue-deep); color: #fff; }
.reward-grid { margin-top: 18px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.reward-card {
  position: relative; padding: 16px; border-radius: 22px; border: 2px solid #2b436d; background: #fff; box-shadow: var(--shadow-xs); text-align: center;
}
.reward-card.locked { background: #f7f9fc; filter: grayscale(.2); }
.reward-status {
  position: absolute; top: 10px; right: 10px; padding: 4px 10px; border-radius: 999px; font-size: 10px; font-weight: 900;
}
.reward-status.ready { background: #eafce7; color: #2a7c1f; }
.reward-status.off { background: #edf2f7; color: #7c8aa6; }
.reward-avatar {
  width: 78px; height: 78px; margin: 8px auto 12px; display: grid; place-items: center; border-radius: 24px; background: #eef6ff; font-size: 38px; border: 2px solid #d7e4f2;
}
.reward-copy strong { display: block; font-size: 18px; }
.reward-copy small { color: #4f8fd3; font-weight: 900; }
.reward-button {
  width: 100%; margin-top: 14px; min-height: 44px; border-radius: 14px; border: 2px solid #2b436d; background: #3d95e7; color: #fff; font-weight: 900;
}
.reward-button.disabled { background: transparent; color: #a8b2c5; border-style: dashed; }

.sanction-screen {
  max-width: 560px; margin: 40px auto 0; padding: 28px; text-align: center; background: #f7fbff;
}
.sanction-logo {
  width: 96px; height: 96px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 28px; background: #e8f3ff; border: 3px solid #2b436d; font-size: 42px;
}
.sanction-screen h2 { font-size: clamp(30px, 5vw, 44px); color: #ff8a46; letter-spacing: -.04em; }
.sanction-copy { max-width: 42ch; margin: 10px auto 0; color: var(--muted); line-height: 1.65; }
.sanction-metrics {
  display: grid; gap: 10px; margin-top: 22px; padding: 18px; border-radius: 20px; border: 2px solid #2b436d; background: #fff;
}
.sanction-metrics > div { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed #d3deeb; }
.sanction-metrics > div:last-child { border-bottom: 0; }
.sanction-metrics strong { color: #ff8a46; font-size: 18px; }
#sanction-return { margin-top: 18px; min-width: 260px; }

.dialog {
  width: min(760px, calc(100vw - 24px)); padding: 22px; border: 3px solid #2b436d; border-radius: 26px; background: #fffefc; box-shadow: var(--shadow-lg);
}
.dialog::backdrop { background: rgba(11, 25, 56, 0.38); backdrop-filter: blur(6px); }
.question-dialog { width: min(780px, calc(100vw - 24px)); }
.dialog-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.close-button {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; border: 2px solid #2b436d; background: #fff; font-size: 24px;
}
.question-hero-art {
  position: relative; display: grid; place-items: center; min-height: 160px; margin-top: 16px; border-radius: 24px; border: 2px solid #2b436d; background: #eff8ff; overflow: hidden;
}
.question-art-icon {
  position: relative; z-index: 2; width: 82px; height: 82px; display: grid; place-items: center; border-radius: 22px; background: #fff; border: 2px solid #d6e5f3; font-size: 42px;
}
.question-art-shape { position: absolute; border-radius: 20px; }
.question-art-box { width: 120px; height: 58px; left: 24%; bottom: 30px; background: #3b91df; }
.question-art-coin { width: 58px; height: 58px; right: 18%; bottom: 26px; border-radius: 50%; background: #ffe3cc; }
.question-art-star { width: 16px; height: 16px; right: 12%; top: 32px; background: #62cae9; border-radius: 50%; }
.character-line {
  display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px; border-radius: 18px; border: 2px solid #d7e4f2; background: #f7fbff;
}
.character-emoji { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 16px; background: #fff; border: 2px solid #dbe7f4; font-size: 24px; }
.question-dialog h2 { margin-top: 16px; font-size: clamp(28px, 4vw, 40px); letter-spacing: -.04em; }
.scenario {
  margin-top: 10px; padding: 15px 16px; border-radius: 16px; border: 2px solid #b9d8f8; background: #eef7ff; color: var(--ink); line-height: 1.68;
}
.choice-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.choice-prompt { margin: 0; font-size: 12px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.options { display: grid; gap: 10px; margin-top: 12px; }
.choice {
  min-height: 64px; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 18px; border: 2px solid #2b436d; background: #fff; color: var(--ink); box-shadow: var(--shadow-xs); text-align: left;
}
.choice-letter {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 2px solid #d9e5f4; background: #f5f9fd; font-weight: 900;
}
.choice:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(34,79,133,.12); }
.choice.is-correct { background: var(--good-soft); border-color: #69bc4a; }
.choice.is-wrong { background: var(--warn-soft); border-color: #ff994d; }
.feedback {
  margin-top: 14px; padding: 14px 16px; border-radius: 18px; border: 2px solid #2b436d; background: #16284d; color: #fff;
}
.feedback.incorrect { background: #fff5ef; color: var(--ink); border-color: #ff994d; }
.feedback p { margin: 6px 0; line-height: 1.6; }
.feedback-button { width: 100%; margin-top: 14px; }

.small-dialog { max-width: 520px; text-align: center; }
.dialog-illustration {
  width: 74px; height: 74px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 22px; background: #fff7d4; border: 2px solid #2b436d; font-size: 34px;
}

.victory {
  margin-top: 20px; padding: 38px 24px 44px; border: 3px solid #2b436d; border-radius: 30px; background: #fffefb; box-shadow: var(--shadow-lg); text-align: center;
}
.victory-seal {
  width: max-content; margin: 0 auto 16px; padding: 10px 14px; display: flex; align-items: center; gap: 8px; border-radius: 999px; background: #eef8ff; border: 2px solid #b9dcfe;
}
.victory h1 { font-size: clamp(52px, 8vw, 88px); letter-spacing: -.06em; }
.rank {
  display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 16px; border-radius: 999px; background: #e5f3e3; border: 2px solid #acd883; color: #2d7a21; font-weight: 900;
}
.final-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.final-stats > div {
  padding: 16px; border-radius: 20px; border: 2px solid #d7e4f2; background: #fff;
}
.final-stats strong { display: block; font-size: 34px; }
.final-stats span { color: var(--muted); font-size: 12px; font-weight: 900; }
.final-badges { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.earned-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px; border-radius: 999px; background: #eef8ff; border: 2px solid #b9dcfe; color: var(--ink); font-weight: 900;
}
.victory-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 22px; }

.toast {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 60;
  max-width: min(560px, calc(100vw - 24px)); padding: 14px 18px; border-radius: 16px; border: 2px solid rgba(255,255,255,.18);
  background: rgba(21, 39, 77, .96); color: #fff; box-shadow: 0 18px 50px rgba(0,0,0,.22);
}
footer { width: min(1160px, calc(100% - 28px)); margin: 0 auto; padding: 20px 0 40px; color: #5d7ca2; font-size: 12px; }

.fx-ripple {
  position: absolute; width: 16px; height: 16px; border-radius: 50%; background: rgba(255,255,255,.48); transform: translate(-50%, -50%); animation: ripple .65s ease-out forwards; pointer-events: none;
}

@keyframes ambientFloat { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(40px,-26px,0) scale(1.08); } }
@keyframes screenSlide { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes ripple { to { opacity: 0; transform: translate(-50%, -50%) scale(11); } }

@media (max-width: 1100px) {
  .home-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-grid, .game-layout, .profile-grid { grid-template-columns: 1fr; }
  .reward-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-points { grid-column: span 2; }
}

@media (max-width: 860px) {
  .topbar { padding-inline: 14px; min-height: 82px; }
  main { width: calc(100% - 16px); margin-top: 14px; }
  .auth-stage { min-height: 540px; }
  .auth-corner { display: none; }
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar { border-right: 0; border-bottom: 2px solid #d8e3f3; }
  .sidebar-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav-item { justify-content: center; flex-direction: column; min-height: 72px; gap: 8px; padding: 8px; }
  .nav-item span:last-child { font-size: 11px; }
  .nav-logout { margin-top: 0; justify-content: center; }
  .app-main { padding: 18px; }
  .app-header { flex-direction: column; }
  .player-chip { align-self: flex-start; }
  .leaderboard-podium, .final-stats { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .brand-copy strong { font-size: 15px; }
  .brand-small, .brand-edition, .help-label { display: none; }
  .record { display: none; }
  .home-stats-grid, .reward-grid, .sidebar-nav { grid-template-columns: 1fr 1fr; }
  .home-stat strong { font-size: 22px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-points { grid-column: span 2; }
  .board { min-height: 440px; padding: 18px; }
  .profile-week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dialog { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* =========================================================
   LAYOUT FIX — elimina herencias del layout original
   ========================================================= */
.topbar {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}

main {
  max-width: none;
  width: min(1320px, calc(100% - 32px));
  padding: 0;
  box-sizing: border-box;
}

.welcome.welcome-auth {
  grid-template-columns: minmax(0, 1fr);
  min-height: auto;
  border: 0;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
  background: transparent;
}

.welcome-auth .auth-browser {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  box-sizing: border-box;
}

.welcome-auth .browser-shell {
  width: 100%;
}

.welcome-auth .auth-stage {
  width: 100%;
  min-height: 650px;
  padding: 42px 260px;
  box-sizing: border-box;
}

.welcome-auth .auth-card {
  position: relative;
  z-index: 3;
  width: min(440px, 100%);
  box-sizing: border-box;
}

.welcome-auth .auth-form {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.welcome-auth .auth-form small {
  color: var(--muted);
}

.welcome-auth .auth-corner {
  z-index: 1;
}

.game {
  max-width: none;
  width: 100%;
  padding: 0 0 24px;
}

.app-browser {
  width: 100%;
  box-sizing: border-box;
}

.app-main,
.app-sidebar,
.app-shell,
.browser-shell,
.browser-bar,
.auth-stage,
.screen-card,
.home-card,
.board-panel,
.mission-card,
.badges-card {
  box-sizing: border-box;
}

@media (max-width: 1050px) {
  .welcome-auth .auth-stage {
    padding-inline: 180px;
  }
  .welcome-logo-badge,
  .welcome-mascot-badge {
    width: 150px;
    height: 150px;
  }
  .welcome-logo-badge span,
  .welcome-mascot-badge span { font-size: 48px; }
  .welcome-logo-badge strong,
  .welcome-mascot-badge strong { font-size: 21px; }
}

@media (max-width: 820px) {
  main {
    width: calc(100% - 18px);
  }
  .welcome-auth .auth-stage {
    min-height: 570px;
    padding: 34px 24px;
  }
  .welcome-auth .auth-corner {
    display: none;
  }
}

@media (max-width: 520px) {
  .auth-browser { padding: 8px; border-radius: 20px; }
  .browser-shell, .app-browser { border-radius: 18px; }
  .browser-bar { min-height: 42px; padding-inline: 10px; }
  .browser-url { font-size: 11px; }
  .welcome-auth .auth-stage { min-height: 525px; padding: 22px 12px; }
  .auth-card { padding: 22px 18px 20px; border-radius: 22px; }
}

/* Ajustes de contraste heredados del tema oscuro anterior */
.mission-card { color: var(--ink); }
.mission-card .eyebrow { color: #83b900; }
.mission-card h2 { color: var(--ink); }
.mission-card p { color: var(--muted); }
.mission-card .mission-reward { color: var(--muted); }

/* Mobile layout: navegación compacta y CTA dentro de la tarjeta */
@media (max-width: 620px) {
  #game { padding-bottom: 24px; }
  #mission-button {
    position: static;
    inset: auto;
    width: 100%;
    min-height: 50px;
    margin-top: 18px;
    box-shadow: 0 5px 0 #18325e, 0 12px 24px rgba(255, 193, 55, .2);
  }
  .mission-card { padding-bottom: 18px; }
  .mission-reward { text-align: center; margin-top: 10px; }

  .app-sidebar {
    gap: 10px;
    padding: 12px 10px;
  }
  .sidebar-brand {
    padding: 0 4px 8px;
  }
  .sidebar-brand-mark { width: 42px; height: 42px; }
  .sidebar-brand strong { font-size: 15px; }
  .sidebar-brand span { font-size: 13px; }
  .sidebar-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }
  .nav-item {
    min-height: 62px;
    padding: 5px 2px;
    gap: 4px;
    border-radius: 14px;
  }
  .nav-icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    font-size: 13px;
  }
  .nav-item span:last-child {
    font-size: 8px;
    letter-spacing: 0;
  }
  .nav-logout {
    min-height: 38px;
    padding: 6px 10px;
    font-size: 11px;
  }
}


h1, h2, h3,
.brand-copy strong,
.sidebar-brand strong,
.welcome-logo-badge strong,
.auth-badge span,
#welcome-title,
#game-title,
#victory-title,
#mission-title,
#question-title {
  font-family: 'Fredoka', 'Nunito', sans-serif;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.button, .button-primary, .button-secondary , .start-button,
.nav-item{
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
}