body { background: #f5f2ff; min-height: 100vh; }
.muted { color: var(--muted); }
.block { width: 100%; }
.loading { min-height: 100vh; display: grid; place-content: center; grid-auto-flow: column; gap: 10px; }
.loading span { width: 18px; height: 18px; border-radius: 50%; background: var(--green); animation: dot .9s ease-in-out infinite; }
.loading span:nth-child(2) { background: var(--pink); animation-delay: .15s; } .loading span:nth-child(3) { background: var(--sun); animation-delay: .3s; }
@keyframes dot { 50% { transform: translateY(-14px); } }
@keyframes float { 50% { transform: translateY(-10px); } }
@keyframes popin { from { opacity: 0; transform: translateY(24px) scale(.96); } }

/* ---------- Entrar / Crear cuenta ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { position: relative; overflow: hidden; background: radial-gradient(ellipse at 30% 0%, #2b2373, var(--navy) 65%); color: #e9e6ff; padding: 40px clamp(20px, 5vw, 64px); display: flex; flex-direction: column; }
.auth-art h1 { color: #fff; font-size: clamp(38px, 4.6vw, 64px); margin: 50px 0 10px; line-height: 1; }
.auth-art p { color: var(--lav); font-size: 19px; max-width: 420px; line-height: 1.5; }
.auth-friends { position: relative; z-index: 2; margin-top: auto; display: flex; align-items: flex-end; justify-content: center; max-width: 560px; }
.auth-friends > div { width: 20%; margin: 0 -1%; animation: popin .8s cubic-bezier(.3, 1.6, .5, 1) backwards; animation-delay: calc(var(--i) * .12s + .2s); }
.auth-hill { position: absolute; left: -10%; right: -10%; bottom: -60px; height: 150px; border-radius: 50% 50% 0 0; background: radial-gradient(ellipse at 50% 0, #4ade80, #16a34a); box-shadow: inset 0 10px 0 #86efac; }
.auth-balloons span { position: absolute; width: 46px; height: 56px; border-radius: 50% 50% 46% 46%; background: var(--c); right: calc(8% + var(--i) * 15%); top: calc(14% + (var(--i) * 37 % 5) * 9%); animation: float 3.4s ease-in-out infinite; animation-delay: calc(var(--i) * -.7s); opacity: .9; box-shadow: inset -7px -8px 0 #0000001f; }
.auth-balloons span::after { content: ''; position: absolute; top: 100%; left: 50%; width: 2px; height: 40px; background: #ffffff55; }
.auth-side { display: grid; place-items: center; padding: 30px 16px; background: linear-gradient(160deg, #fff, #f3efff); }
.auth-card { width: min(100%, 440px); animation: popin .6s backwards; }
.tabs { display: flex; gap: 6px; background: #ebe6fb; border-radius: 16px; padding: 6px; margin-bottom: 26px; }
.tab { flex: 1; border: 0; background: transparent; padding: 12px; border-radius: 12px; font: 800 17px Outfit, sans-serif; color: var(--muted); transition: background .2s, color .2s; }
.tab.on { background: #fff; color: var(--ink); box-shadow: 0 3px 0 #0000000d; }
.auth-card h2 { font-size: 28px; margin: 0 0 20px; }
.form-error { color: #d61f45; font-weight: 700; min-height: 1.2em; margin: 4px 0 10px; }
.auth-foot { text-align: center; color: var(--muted); }
.auth-foot a { color: var(--green-dark); font-weight: 800; }
.back-home { display: block; text-align: center; margin-top: 24px; color: var(--muted); font-weight: 700; text-decoration: none; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { min-height: 380px; padding-bottom: 0; }
  .auth-art h1 { margin-top: 26px; }
  .auth-friends { max-width: 360px; margin: 20px auto 0; }
}

/* ---------- Marco ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; padding: 14px clamp(16px, 4vw, 40px); background: var(--navy); box-shadow: 0 4px 0 #00000014; }
.top-nav { display: flex; gap: 8px; margin-left: 20px; }
.top-nav a { color: var(--lav); text-decoration: none; font-weight: 700; padding: 8px 14px; border-radius: 99px; transition: background .2s, color .2s; }
.top-nav a.on, .top-nav a:hover { background: #ffffff14; color: #fff; }
.top-nav .play-link { color: var(--green); }
.me { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.me-name { color: #fff; font-weight: 700; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) { .top-nav { display: none; } .me-name { display: none; } }
.main { max-width: 1180px; margin: 0 auto; padding: 30px clamp(16px, 4vw, 40px) 80px; }

/* ---------- Inicio ---------- */
.hello h1 { font-size: clamp(30px, 4vw, 46px); margin: 8px 0 4px; }
.hello p { margin: 0 0 26px; color: var(--muted); font-size: 18px; }
.wave-hand { display: inline-block; transform-origin: 70% 80%; animation: hand 1.6s ease-in-out infinite; }
@keyframes hand { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(18deg); } 20%, 40% { transform: rotate(-8deg); } }

.kid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.kid-card { position: relative; background: #fff; border-radius: 30px; padding: 18px; box-shadow: var(--shadow); overflow: hidden; animation: popin .6s cubic-bezier(.3, 1.4, .5, 1) backwards; animation-delay: calc(var(--i, 0) * .08s); transition: transform .25s; }
.kid-card:hover { transform: translateY(-6px); }
.kid-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 128px; background: linear-gradient(135deg, var(--bg), color-mix(in srgb, var(--c) 35%, white)); border-radius: 0 0 50% 50% / 0 0 26% 26%; }
.kid-top { position: relative; display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.kid-pic { width: 110px; flex: none; }
.kid-name b { display: block; font: 900 28px Outfit, sans-serif; color: var(--ink); line-height: 1.05; }
.kid-name small { color: #4b4478; font-weight: 700; }
.kid-stats { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.kid-stats div { background: #f7f5ff; border-radius: 16px; padding: 10px 6px; text-align: center; }
.kid-stats b { display: block; font: 800 20px Outfit, sans-serif; color: var(--ink); }
.kid-stats small { color: var(--muted); font-weight: 600; font-size: 12px; }
.today-row { display: flex; justify-content: space-between; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.today-row b { color: var(--ink); }
.meter { height: 12px; background: #eee9fb; border-radius: 99px; overflow: hidden; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--c)); border-radius: 99px; animation: grow-w 1s cubic-bezier(.3, 1.3, .5, 1) backwards .3s; }
@keyframes grow-w { from { width: 0 !important; } }
.kid-actions { display: flex; gap: 10px; margin-top: 16px; }
.kid-actions .btn { flex: 1; }
.kid-card.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 300px; text-decoration: none; color: var(--muted); background: repeating-linear-gradient(-45deg, #fff, #fff 14px, #faf8ff 14px, #faf8ff 28px); border: 3px dashed #d9d2f5; box-shadow: none; }
.kid-card.add::before { display: none; }
.kid-card.add .plus { width: 76px; height: 76px; border-radius: 50%; background: var(--green); color: var(--ink); font: 900 50px/76px Outfit, sans-serif; text-align: center; box-shadow: 0 6px 0 var(--green-dark); margin-bottom: 10px; animation: float 3s ease-in-out infinite; }
.kid-card.add b { font: 800 22px Outfit, sans-serif; color: var(--ink); }

.tips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 34px; }
.tip { display: flex; gap: 14px; background: #fff; border-radius: 22px; padding: 18px; box-shadow: 0 6px 0 #14102a0a; border-left: 8px solid var(--c); }
.tip > span { font-size: 34px; }
.tip b { font-family: Outfit, sans-serif; font-size: 18px; color: var(--ink); }
.tip p { margin: 4px 0 0; color: var(--muted); line-height: 1.45; }
@media (max-width: 860px) { .tips { grid-template-columns: 1fr; } }

/* ---------- Nuevo niño / ajustes ---------- */
.new-kid { max-width: 820px; margin: 0 auto; background: #fff; border-radius: 34px; padding: clamp(22px, 4vw, 44px); box-shadow: var(--shadow); animation: popin .5s backwards; }
.new-kid h1 { font-size: clamp(28px, 3.6vw, 40px); margin: 0 0 6px; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row .grow { flex: 1; min-width: 220px; }
select.input { appearance: none; padding-right: 40px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%236b6593' stroke-width='2.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 16px center; }
.label-big { display: block; font: 800 20px Outfit, sans-serif; color: var(--ink); margin: 18px 0 12px; }
.mascot-pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.mp { position: relative; cursor: pointer; text-align: center; background: var(--bg); border-radius: 24px; padding: 12px 8px 14px; border: 4px solid transparent; transition: transform .2s, border-color .2s, box-shadow .2s; }
.mp input { position: absolute; opacity: 0; pointer-events: none; }
.mp:hover { transform: translateY(-4px); }
.mp:has(input:checked) { border-color: var(--c); box-shadow: 0 8px 0 color-mix(in srgb, var(--c) 40%, transparent); transform: translateY(-4px) scale(1.03); }
.mp:has(input:checked)::after { content: '✓'; position: absolute; top: -10px; right: -10px; width: 32px; height: 32px; border-radius: 50%; background: var(--c); color: #fff; font-weight: 900; display: grid; place-items: center; box-shadow: 0 3px 0 #0002; }
.mp:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 3px; }
.mp-pic { width: 80%; margin: 0 auto; }
.mp b { display: block; font: 800 22px Outfit, sans-serif; color: var(--ink); }
.mp small { color: var(--muted); font-weight: 600; }
.mascot-pick.small .mp-pic { width: 62%; }
.mascot-pick.small .mp b { font-size: 18px; }
@media (max-width: 640px) { .mascot-pick { grid-template-columns: repeat(3, 1fr); } }
.import { display: flex; gap: 10px; align-items: flex-start; background: #ecfdf3; border-radius: 16px; padding: 14px 16px; margin-top: 18px; font-weight: 600; cursor: pointer; }
.import input { width: 20px; height: 20px; accent-color: var(--green-dark); margin-top: 2px; }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }

/* ---------- Detalle ---------- */
.crumb { display: inline-block; margin-bottom: 16px; color: var(--muted); font-weight: 700; text-decoration: none; }
.kid-hero { position: relative; display: flex; align-items: center; gap: 24px; padding: 24px clamp(18px, 3vw, 36px); border-radius: 34px; overflow: hidden; background: linear-gradient(120deg, var(--bg), color-mix(in srgb, var(--c) 45%, white)); box-shadow: var(--shadow); animation: popin .5s backwards; }
.kid-hero::after { content: ''; position: absolute; width: 300px; height: 300px; border-radius: 50%; background: #ffffff40; right: -80px; top: -120px; }
.kh-pic { width: clamp(120px, 16vw, 180px); flex: none; position: relative; z-index: 1; }
.kh-info { position: relative; z-index: 1; }
.kh-info h1 { font-size: clamp(34px, 5vw, 58px); margin: 0; line-height: 1; }
.kh-info p { font-size: 18px; color: #3d3570; margin: 8px 0 16px; }
.kh-ring { position: relative; z-index: 1; margin-left: auto; width: 150px; height: 150px; border-radius: 50%; flex: none; background: conic-gradient(var(--sun) calc(var(--p) * 1%), #ffffff99 0); display: grid; place-items: center; animation: spin-in 1s cubic-bezier(.3, 1.4, .5, 1) backwards .2s; }
.kh-ring > div { width: 112px; height: 112px; border-radius: 50%; background: #fff; display: grid; place-content: center; text-align: center; }
.kh-ring b { font: 900 36px Outfit, sans-serif; color: var(--ink); line-height: 1; }
.kh-ring small { color: var(--muted); font-weight: 700; }
@keyframes spin-in { from { transform: rotate(-120deg) scale(.6); opacity: 0; } }
@media (max-width: 760px) { .kid-hero { flex-wrap: wrap; justify-content: center; text-align: center; } .kh-ring { margin: 0 auto; } }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 22px 0; }
.tile { background: #fff; border-radius: 24px; padding: 18px; box-shadow: 0 6px 0 #14102a0a; position: relative; overflow: hidden; animation: popin .5s backwards; }
.tile:nth-child(2) { animation-delay: .06s; } .tile:nth-child(3) { animation-delay: .12s; } .tile:nth-child(4) { animation-delay: .18s; }
.tile::before { content: ''; position: absolute; width: 90px; height: 90px; border-radius: 50%; background: var(--c); opacity: .22; right: -20px; top: -20px; }
.tile span { font-size: 28px; }
.tile b { display: block; font: 900 34px Outfit, sans-serif; color: var(--ink); margin-top: 4px; }
.tile small { color: var(--muted); font-weight: 700; }
@media (max-width: 760px) { .tiles { grid-template-columns: repeat(2, 1fr); } }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }
.card { background: #fff; border-radius: 28px; padding: clamp(18px, 3vw, 28px); box-shadow: 0 6px 0 #14102a0a; margin-bottom: 22px; }
.card h2 { margin: 0; font-size: 26px; }
.card > .muted { margin: 4px 0 18px; }
h3.mini { font: 800 16px Outfit, sans-serif; color: var(--muted); margin: 16px 0 10px; }

.chart { position: relative; display: flex; align-items: flex-end; gap: 10px; height: 220px; padding-top: 22px; margin-top: 34px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.bar { position: relative; width: 100%; max-width: 52px; height: max(6px, var(--h)); border-radius: 12px 12px 6px 6px; background: linear-gradient(#a78bfa, #7c3aed); animation: grow-h .9s cubic-bezier(.3, 1.4, .5, 1) backwards; animation-delay: calc(var(--i) * .07s); }
.bar-col:nth-child(3n) .bar { background: linear-gradient(#ffd23f, #ff9f1a); }
.bar-col:nth-child(3n+1) .bar { background: linear-gradient(#5cc8ff, #2b8fe0); }
.bar-col.today .bar { background: linear-gradient(var(--green), var(--green-dark)); }
.bar em { position: absolute; top: -22px; left: 0; right: 0; text-align: center; font-style: normal; font-weight: 800; font-size: 13px; color: var(--ink); }
.bar-col small { font-weight: 700; color: var(--muted); text-transform: capitalize; }
.bar-col.today small { color: var(--green-dark); }
@keyframes grow-h { from { height: 0; } }
.limit-line { position: absolute; left: 0; right: 0; border-top: 2px dashed #ff8fb1; margin-bottom: 26px; }
.limit-line span { position: absolute; right: 0; top: -22px; font-size: 12px; font-weight: 800; color: #e0457b; background: #fff; padding: 0 4px; }

.words { display: flex; flex-wrap: wrap; gap: 8px; }
.word { font: 800 16px Outfit, sans-serif; padding: 6px 14px; border-radius: 99px; background: #f1eff6; color: #b3aec8; transition: transform .2s; }
.word.got { background: var(--c, var(--green)); color: #fff; box-shadow: 0 3px 0 #0000001f; }
.word.got:hover { transform: scale(1.08) rotate(-3deg); }
.word.got[style*="#facc15"] { color: #5c4300; }
.word small { opacity: .8; }
.word.num { display: inline-flex; align-items: center; gap: 6px; }
.word.num i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; background: #ffffff55; display: grid; place-items: center; font-size: 13px; }
.word.num.got { --c: #3b82f6; }

.games { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { .games { grid-template-columns: 1fr; } }
.game-row { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 18px; transition: background .2s; }
.game-row:hover { background: #f7f5ff; }
.game-thumb { width: 58px; height: 58px; flex: none; background: #f7f5ff; border-radius: 16px; display: grid; place-items: center; padding: 6px; }
.game-thumb svg { width: 100%; height: auto; }
.game-thumb .thumb-splats { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; width: 80%; }
.game-thumb .thumb-splats i { aspect-ratio: 1; border-radius: 50%; display: block; }
.game-thumb .thumb-balloons { display: flex; }
.game-thumb .thumb-balloons svg { width: 50%; }
.game-thumb .thumb-digits { font: 900 18px Outfit, sans-serif; display: flex; }
.game-thumb .thumb-digits b:nth-child(1) { color: #3b82f6; } .game-thumb .thumb-digits b:nth-child(2) { color: #ef4444; } .game-thumb .thumb-digits b:nth-child(3) { color: #22c55e; }
.game-name { flex: 1; font-weight: 700; color: var(--ink); }
.stars { display: block; color: #ffb800; font-size: 20px; letter-spacing: 2px; }
.stars i { font-style: normal; color: #e6e1f0; }
.sticker { font-size: 30px; filter: grayscale(1); opacity: .25; }
.sticker.got { filter: none; opacity: 1; animation: float 3s ease-in-out infinite; }

.switches { display: grid; gap: 12px; margin: 20px 0 6px; }
.switch { display: flex; align-items: center; gap: 14px; cursor: pointer; background: #f9f8fd; border-radius: 18px; padding: 14px 16px; }
.switch input { position: absolute; opacity: 0; }
.sw { position: relative; width: 56px; height: 32px; flex: none; border-radius: 99px; background: #d9d4ea; transition: background .2s; }
.sw::after { content: ''; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px #0003; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.switch input:checked + .sw { background: var(--green); }
.switch input:checked + .sw::after { transform: translateX(24px); }
.switch input:focus-visible + .sw { outline: 3px solid var(--ink); outline-offset: 2px; }
.switch b { font-family: Outfit, sans-serif; font-size: 17px; color: var(--ink); }
.switch small { display: block; color: var(--muted); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; background: #f1eff8; padding: 6px; border-radius: 16px; }
.seg label { flex: 1; cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; text-align: center; padding: 10px 8px; border-radius: 12px; font-weight: 800; color: var(--muted); transition: background .2s, color .2s; white-space: nowrap; }
.seg input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 3px 0 #0000000f; }
.seg input:focus-visible + span { outline: 3px solid var(--ink); }
.danger-zone { margin-top: 24px; border-top: 2px solid #f1eff8; padding-top: 14px; }
.danger-zone summary { cursor: pointer; color: var(--muted); font-weight: 700; }
.danger-btns { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* ---------- Avisos y confeti ---------- */
#toast { position: fixed; left: 50%; bottom: 28px; translate: -50% 40px; opacity: 0; background: var(--ink); color: #fff; padding: 14px 22px; border-radius: 16px; font-weight: 700; z-index: 90; transition: opacity .3s, translate .3s cubic-bezier(.3, 1.6, .5, 1); pointer-events: none; box-shadow: 0 10px 30px #0004; }
#toast.show { opacity: 1; translate: -50% 0; }
#toast.err { background: #c0262d; }
.confetti { position: fixed; z-index: 100; width: 10px; height: 14px; border-radius: 3px; pointer-events: none; animation: confetti 1.3s cubic-bezier(.2, .7, .4, 1) forwards; }
@keyframes confetti { to { transform: translate(var(--dx), calc(var(--dy) + 200px)) rotate(var(--r)); opacity: 0; } }

/* ¡Listo! después de crear el perfil */
.ready { max-width: 640px; margin: 10px auto; text-align: center; background: linear-gradient(160deg, var(--bg), #fff 60%); border-radius: 34px; padding: 26px clamp(18px, 4vw, 40px) 30px; box-shadow: var(--shadow); animation: popin .5s backwards; }
.ready-pic { width: 180px; margin: 0 auto; }
.ready h1 { font-size: clamp(30px, 5vw, 44px); margin: 6px 0; }
.ready > p { font-size: 18px; color: #3d3570; margin: 0 0 18px; }
.ready-play { font-size: 24px; padding: 18px 34px; border-radius: 20px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.05); } }
.ready-tips { text-align: left; margin: 24px 0 10px; padding-left: 22px; line-height: 1.55; color: #3d3570; }
.ready-tips li { margin-bottom: 8px; }
.ready-link { color: var(--green-dark); font-weight: 800; }
