/* Memorízalo · Millo Games */
@font-face { font-family: 'LilitaOne'; src: url(../assets/fonts/LilitaOne.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Fredoka'; src: url(../assets/fonts/Fredoka.woff2) format('woff2'); font-weight: 300 700; font-display: swap; }
:root {
  --bg: #1a1240; --bg2: #2a1d63; --ink: #fff; --mut: #c9c0ff; --yel: #ffd34a; --pink: #ff6aa8; --cy: #5ad4ff; --gr: #7ee06a; --vi: #7b5cff; --ol: #1c1238;
  --p0: #ff6aa8; --p1: #5ad4ff; --p2: #7ee06a; --p3: #ffb340;
  --r: 14px; --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Fredoka, system-ui, sans-serif; color: var(--ink); background: var(--bg);
  background-image: radial-gradient(circle at 15% 10%, rgba(123,92,255,.35), transparent 45%), radial-gradient(circle at 90% 85%, rgba(255,106,168,.22), transparent 45%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.05' stroke-width='3'%3E%3Crect x='8' y='10' width='22' height='30' rx='5' transform='rotate(-12 19 25)'/%3E%3Crect x='48' y='44' width='22' height='30' rx='5' transform='rotate(14 59 59)'/%3E%3C/g%3E%3C/svg%3E");
  background-attachment: fixed; -webkit-tap-highlight-color: transparent; overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--yel); outline-offset: 2px; }
[hidden] { display: none !important; }
.app { min-height: 100%; display: flex; flex-direction: column; padding-left: var(--safe-l); padding-right: var(--safe-r); }
body.scr-play { overflow: hidden; }
body.scr-play .app { height: 100%; height: 100dvh; }

/* ---------- cabecera ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; background: rgba(15,9,40,.6); backdrop-filter: blur(6px); border-bottom: 2px solid rgba(255,255,255,.08); position: relative; z-index: 5; }
.brand { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; text-align: left; min-width: 0; }
.logo { width: 40px; height: 40px; flex: none; filter: drop-shadow(0 2px 0 rgba(0,0,0,.35)); }
.bt { display: flex; flex-direction: column; line-height: 1; min-width: 0; }
.bt b { font-family: LilitaOne, Fredoka, sans-serif; font-weight: 400; font-size: 24px; letter-spacing: .5px; color: var(--yel); text-shadow: 0 2px 0 var(--ol); white-space: nowrap; }
.bt small { font-size: 11px; color: var(--mut); letter-spacing: 1.5px; text-transform: uppercase; margin-top: 2px; }
.tools { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.ib { width: 40px; height: 40px; border-radius: 12px; border: 2px solid rgba(255,255,255,.14); background: rgba(255,255,255,.07); display: grid; place-items: center; padding: 0; flex: none; transition: background .15s, transform .1s; }
.ib:hover { background: rgba(255,255,255,.16); } .ib:active { transform: scale(.94); }
.ib svg { width: 22px; height: 22px; fill: currentColor; }
.ib.sm { width: 32px; height: 32px; }
#bSound .off { display: none; } #bSound[aria-pressed="true"] .on { display: none; } #bSound[aria-pressed="true"] .off { display: inline; }
#bFs .c { display: none; } #bFs[aria-pressed="true"] .e { display: none; } #bFs[aria-pressed="true"] .c { display: inline; }
body.scr-themes #bHome { display: none; }
.langs { display: flex; border-radius: 12px; overflow: hidden; border: 2px solid rgba(255,255,255,.14); }
.langs button { background: rgba(255,255,255,.05); border: 0; padding: 0 8px; height: 36px; font-weight: 700; font-size: 13px; color: var(--mut); }
.langs button[aria-pressed="true"] { background: var(--yel); color: var(--ol); }

/* ---------- comunes ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.screen { width: 100%; max-width: 1180px; margin: 0 auto; padding: 14px 14px calc(24px + var(--safe-b)); }
.sub { font-family: LilitaOne, Fredoka, sans-serif; font-weight: 400; font-size: 22px; margin: 18px 0 10px; letter-spacing: .4px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 3px solid var(--ol); border-radius: 14px; background: var(--vi); color: #fff; font-weight: 700; font-size: 17px; padding: 10px 18px; box-shadow: 0 4px 0 var(--ol); transition: transform .08s, box-shadow .08s; min-height: 46px; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ol); }
.btn.yel { background: var(--yel); color: var(--ol); }
.btn.ghost { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); box-shadow: none; }
.btn.sm { font-size: 15px; padding: 6px 12px; min-height: 38px; }
.note { color: var(--mut); font-size: 14px; margin: 10px 0 0; }

/* portada mini de una temática */
.tc { display: block; aspect-ratio: 1; border-radius: 12px; overflow: hidden; container-type: inline-size; position: relative; }
.tc > .face, .tc .collage { position: absolute; inset: 0; }
.tc.sm { width: 54px; flex: none; } .tc.xs { width: 34px; flex: none; border-radius: 8px; }
.collage { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--ol); }
.collage .face { position: relative; container-type: inline-size; }

/* ---------- temáticas ---------- */
.hero { text-align: center; padding: 6px 0 4px; }
.hero h1 { font-family: LilitaOne, Fredoka, sans-serif; font-weight: 400; font-size: clamp(38px, 8vw, 64px); margin: 0; color: var(--yel); text-shadow: 0 4px 0 var(--ol), 0 0 30px rgba(255,211,74,.3); letter-spacing: 1px; }
.hero p { margin: 4px 0 0; color: var(--mut); font-size: 17px; }
.daily-banner { width: 100%; margin-top: 14px; display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 16px; border-radius: 18px; border: 3px solid var(--ol); background: linear-gradient(100deg, #ff6aa8, #ffb340); color: var(--ol); box-shadow: 0 5px 0 var(--ol); }
.daily-banner.done { background: linear-gradient(100deg, #7ee06a, #5ad4ff); }
.db-ico { font-size: 30px; } .db-txt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.db-txt b { font-family: LilitaOne, Fredoka, sans-serif; font-weight: 400; font-size: 21px; } .db-txt small { font-weight: 600; font-size: 14px; opacity: .85; }
.db-streak { background: rgba(28,18,56,.85); color: #fff; border-radius: 12px; padding: 6px 10px; font-size: 18px; white-space: nowrap; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 18px; border: 3px solid var(--ol); background: #fff; color: var(--ol); text-align: left; box-shadow: 0 5px 0 var(--ol); transition: transform .12s; position: relative; }
.tile:hover { transform: translateY(-3px) rotate(-.6deg); } .tile:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ol); }
.tile .tt { display: flex; flex-direction: column; padding: 0 2px 2px; }
.tile b { font-family: LilitaOne, Fredoka, sans-serif; font-weight: 400; font-size: 19px; line-height: 1.05; }
.tile small { font-size: 13px; color: #6a5f8f; font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tg { font-style: normal; font-size: 11px; font-weight: 700; border-radius: 8px; padding: 2px 6px; background: #efeaff; color: #4b3a99; }
.tg.big { background: #ffe9a8; color: #7a4f00; } .tg.mix { background: #ffd6e8; color: #a0225a; }
.tile.mundo { grid-column: span 2; flex-direction: row; align-items: center; background: linear-gradient(120deg, #fff 40%, #ffe9a8); }
.tile.mundo .tc { width: 46%; flex: none; }
.tile.mundo b { font-size: 26px; }
.tile.played::after { content: '✓'; position: absolute; top: 6px; right: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--gr); color: var(--ol); font-weight: 800; font-size: 13px; display: grid; place-items: center; border: 2px solid var(--ol); }
.tfoot { display: flex; gap: 10px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.by { text-align: center; color: var(--mut); font-size: 13px; margin-top: 18px; }

/* ---------- modos ---------- */
.mhead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mtheme { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.08); border-radius: 16px; padding: 6px 14px 6px 6px; }
.mtheme b { font-family: LilitaOne, Fredoka, sans-serif; font-weight: 400; font-size: 22px; display: block; } .mtheme small { color: var(--mut); font-size: 13px; }
.modes-g { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.mode { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left; padding: 14px; border-radius: 18px; border: 3px solid var(--ol); box-shadow: 0 5px 0 var(--ol); color: var(--ol); transition: transform .1s; }
.mode:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ol); }
.mode i { grid-row: span 2; font-style: normal; font-size: 34px; }
.mode b { font-family: LilitaOne, Fredoka, sans-serif; font-weight: 400; font-size: 21px; } .mode small { font-size: 14px; font-weight: 600; opacity: .8; }
.m-solo { background: #b8a6ff; } .m-time { background: #5ad4ff; } .m-daily { background: #ffb340; } .m-versus { background: #7ee06a; } .m-party { background: #ff8cc0; }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin-top: 18px; }
.tog { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.07); border: 2px solid rgba(255,255,255,.12); border-radius: 14px; padding: 10px 12px; cursor: pointer; }
.tog input { position: absolute; opacity: 0; pointer-events: none; }
.tog .sw { width: 46px; height: 26px; border-radius: 14px; background: rgba(255,255,255,.2); position: relative; flex: none; transition: background .15s; }
.tog .sw::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.tog input:checked + .sw { background: var(--gr); } .tog input:checked + .sw::after { transform: translateX(20px); }
.tog input:focus-visible + .sw { outline: 3px solid var(--yel); outline-offset: 2px; }
.tog b { display: block; font-size: 16px; } .tog small { color: var(--mut); font-size: 13px; }

/* ---------- partida ---------- */
.screen.play { flex: 1; display: flex; flex-direction: column; min-height: 0; max-width: none; padding: 8px 10px calc(8px + var(--safe-b)); gap: 8px; }
.hud { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chip.th { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.08); border-radius: 12px; padding: 4px 10px 4px 4px; font-weight: 700; font-size: 15px; line-height: 1.1; }
.chip.th small { display: block; color: var(--mut); font-weight: 500; font-size: 12px; }
.stats { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.st { position: relative; display: flex; flex-direction: column; align-items: center; background: rgba(0,0,0,.25); border-radius: 12px; padding: 3px 10px; min-width: 58px; line-height: 1.1; }
.st small { font-size: 11px; color: var(--mut); text-transform: uppercase; letter-spacing: .5px; } .st b { font-size: 18px; font-variant-numeric: tabular-nums; }
.st.big b { font-size: 24px; color: var(--yel); } .st.warn b { color: #ff5a5a; animation: pulse .5s infinite alternate; }
.st.combo { background: var(--pink); color: var(--ol); justify-content: center; } .st.combo b { font-family: LilitaOne, sans-serif; font-weight: 400; font-size: 22px; }
.st.shield { justify-content: center; font-size: 20px; }
.popt { position: absolute; right: -6px; top: -10px; color: var(--gr); font-weight: 800; font-size: 15px; animation: rise .9s forwards; pointer-events: none; }
.players { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pl { display: flex; flex-direction: column; align-items: center; min-width: 74px; padding: 3px 10px; border-radius: 12px; background: rgba(0,0,0,.25); border: 3px solid transparent; line-height: 1.15; transition: transform .2s, background .2s; position: relative; }
.pl b { font-size: 15px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .pl span { font-size: 14px; font-variant-numeric: tabular-nums; } .pl small { font-size: 11px; color: var(--mut); }
.pl.p0 b { color: var(--p0); } .pl.p1 b { color: var(--p1); } .pl.p2 b { color: var(--p2); } .pl.p3 b { color: var(--p3); }
.pl.cur { transform: scale(1.08); background: rgba(255,255,255,.14); }
.pl.cur.p0 { border-color: var(--p0); } .pl.cur.p1 { border-color: var(--p1); } .pl.cur.p2 { border-color: var(--p2); } .pl.cur.p3 { border-color: var(--p3); }
.pl.cur::before { content: '▼'; position: absolute; top: -13px; font-size: 11px; color: var(--yel); animation: bob .6s infinite alternate; }
.bwrap { position: relative; flex: 1; min-height: 0; display: flex; }
.viewport { flex: 1; min-height: 0; overflow: auto; display: flex; touch-action: pan-x pan-y; overscroll-behavior: contain; scrollbar-width: thin; border-radius: 12px; }
.board { margin: auto; padding: 6px; display: grid; gap: var(--gap, 6px); perspective: 1200px; }
.zoom { position: absolute; right: 8px; top: 8px; display: flex; gap: 4px; background: rgba(15,9,40,.85); border-radius: 14px; padding: 4px; z-index: 3; border: 2px solid rgba(255,255,255,.15); }
.zb { width: 40px; height: 40px; border-radius: 10px; border: 0; background: rgba(255,255,255,.12); font-size: 22px; font-weight: 800; }

/* ---------- carta ---------- */
.cd { width: var(--cs); height: var(--cs); padding: 0; border: 0; background: none; position: relative; border-radius: calc(var(--cs) * .14); }
.cd .in { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .42s cubic-bezier(.3,1.4,.5,1); border-radius: inherit; }
.cd.up .in { transform: rotateY(180deg); }
.fc { position: absolute; inset: 0; border-radius: inherit; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; border: max(1.5px, calc(var(--cs) * .035)) solid var(--ol); box-shadow: 0 max(2px, calc(var(--cs) * .05)) 0 var(--ol); }
.bk { background: #7b5cff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cdefs%3E%3Cpattern id='p' width='20' height='20' patternUnits='userSpaceOnUse' patternTransform='rotate(45)'%3E%3Crect width='20' height='20' fill='%237b5cff'/%3E%3Crect width='10' height='20' fill='%236a4cf0'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100' height='100' fill='url(%23p)'/%3E%3Crect x='14' y='14' width='72' height='72' rx='14' fill='none' stroke='%23ffd34a' stroke-width='4' stroke-dasharray='8 6'/%3E%3Ccircle cx='50' cy='50' r='22' fill='%23ffd34a' stroke='%231c1238' stroke-width='4'/%3E%3Cpath d='M42 44c1-6 16-6 16 1 0 5-7 5-7 10' fill='none' stroke='%231c1238' stroke-width='5' stroke-linecap='round'/%3E%3Ccircle cx='51' cy='62' r='3' fill='%231c1238'/%3E%3C/svg%3E") center/cover; }
.cd:not(.up):not(:disabled):hover .bk { filter: brightness(1.12); }
.cd:not(.up):active .in { transform: scale(.95); }
.fr { transform: rotateY(180deg); background: #fff; container-type: size; }
.face { position: absolute; inset: 0; display: grid; place-items: center; background: var(--bg, #fff); }
.face > svg, .face > img { width: 100%; height: 100%; display: block; }
.face > img { object-fit: contain; padding: 4%; }
.face.fl { background: #e9e6f5; padding: 10%; } .face.fl > svg { filter: none; }
.face.em { background: radial-gradient(circle, #fff6c8, #ffd34a); } .face.em span { font-size: 64cqw; line-height: 1; }
.face.nm { background: linear-gradient(160deg, #fffaf0, #ffe9b8); padding: 7%; text-align: center; }
.face.nm span { font-family: LilitaOne, Fredoka, sans-serif; color: var(--ol); line-height: 1; font-size: min(26cqw, calc(150cqw / var(--len))); overflow-wrap: anywhere; hyphens: auto; }
.face.el { --c: #e0e0e0; background: var(--c); color: var(--ol); grid-template-rows: auto 1fr auto; padding: 7% 6%; text-align: center; }
.face.el i { font-style: normal; font-weight: 700; font-size: 17cqw; justify-self: start; line-height: 1; }
.face.el b { font-family: LilitaOne, Fredoka, sans-serif; font-weight: 400; font-size: 42cqw; line-height: .9; align-self: center; }
.face.el small { font-weight: 700; font-size: min(13cqw, 15px); line-height: 1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.face.el.noname b { font-size: 50cqw; }
.c-alk { --c: #ff9a8a; } .c-ale { --c: #ffc98a; } .c-lan { --c: #ffb3e0; } .c-act { --c: #f0a6ff; } .c-tra { --c: #ffe08a; } .c-pos { --c: #c5d5e8; }
.c-met { --c: #b8e6a8; } .c-non { --c: #9ee8d6; } .c-hal { --c: #a8e0ff; } .c-nob { --c: #c4b5ff; } .c-syn { --c: #dcdcdc; }
.face.sp { background: radial-gradient(circle, #fff, #d9d0ff); padding: 10%; } .face.sp-wild { background: radial-gradient(circle, #fff6c8, #ff9ac8); }
.cd.wildpos .bk { background: linear-gradient(135deg, #ffd34a, #ff6aa8); }
.cd.wildpos .bk::after { content: '★'; position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--cs) * .6); color: #fff; text-shadow: 0 2px 0 var(--ol); }
.cd.ok .fr { box-shadow: 0 0 0 max(2px, calc(var(--cs) * .05)) var(--gr), 0 0 calc(var(--cs) * .3) rgba(126,224,106,.6); }
.cd.ok .in { animation: matched .5s ease; transform: rotateY(180deg); }
.cd.ok { cursor: default; } .cd.ok .fr::after { content: ''; position: absolute; inset: 0; background: rgba(26,18,64,0); transition: background .6s 1.2s; }
.cd.ok:not(:focus) .fr::after { background: rgba(26,18,64,.18); }
.cd.used .fr { opacity: .55; } .cd.used { cursor: default; }
.cd.bad .in { animation: shake .3s ease; }
.cd.peek .fr { box-shadow: 0 0 0 3px var(--cy); }
.cd.shuf .in { animation: shuf .5s ease; }
.board.boom { animation: boom .45s ease; }
.board.tiny .fc { box-shadow: none; } .board.mini .fc { border-width: 1px; }
.pop { position: absolute; left: 50%; top: 10%; transform: translateX(-50%); font-family: LilitaOne, sans-serif; font-size: max(16px, calc(var(--cs) * .32)); color: var(--yel); text-shadow: 0 2px 0 var(--ol); pointer-events: none; animation: rise .9s forwards; z-index: 4; white-space: nowrap; }
.board.deal .cd { animation: deal .4s backwards cubic-bezier(.3,1.4,.5,1); }
.board.deal .cd:nth-child(4n+1) { animation-delay: .02s; } .board.deal .cd:nth-child(4n+2) { animation-delay: .07s; } .board.deal .cd:nth-child(4n+3) { animation-delay: .12s; } .board.deal .cd:nth-child(4n) { animation-delay: .17s; }

/* anuncio central */
.announce { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.6); opacity: 0; pointer-events: none; z-index: 6; transition: opacity .2s, transform .25s cubic-bezier(.3,1.6,.5,1); }
.announce.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.announce b { display: block; white-space: nowrap; font-family: LilitaOne, sans-serif; font-weight: 400; font-size: clamp(24px, 6vw, 44px); color: #fff; background: rgba(28,18,56,.88); border: 3px solid var(--yel); border-radius: 18px; padding: 8px 22px; text-shadow: 0 3px 0 var(--ol); }
.announce.combo b { border-color: var(--pink); color: var(--yel); } .announce.ok b { border-color: var(--gr); }
.announce.turn.p0 b { border-color: var(--p0); } .announce.turn.p1 b { border-color: var(--p1); } .announce.turn.p2 b { border-color: var(--p2); } .announce.turn.p3 b { border-color: var(--p3); }
.announce.order b { white-space: normal; text-align: center; max-width: 90vw; font-size: clamp(20px, 4.5vw, 34px); }

/* dato curioso */
.factbox { pointer-events: none; position: fixed; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%); width: min(560px, calc(100% - 24px)); z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 40px 10px 10px;
  background: #fffaf0; color: var(--ol); border: 3px solid var(--ol); border-radius: 18px; box-shadow: 0 6px 0 var(--ol), 0 10px 30px rgba(0,0,0,.4); }
.factbox.in { animation: slideup .35s cubic-bezier(.3,1.5,.5,1); }
.fx-card { position: relative; width: 74px; height: 74px; flex: none; border-radius: 12px; overflow: hidden; border: 2px solid var(--ol); container-type: size; }
.fx-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.fx-txt b { font-family: LilitaOne, sans-serif; font-weight: 400; font-size: 20px; } .fx-txt small { font-weight: 700; color: #8a5a00; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.fx-txt span { font-size: 15px; }
.fx-x { pointer-events: auto; position: absolute; right: 6px; top: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(28,18,56,.1); color: var(--ol); font-weight: 800; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 30; background: rgba(10,6,28,.72); display: grid; place-items: center; padding: 14px; overflow-y: auto; animation: fade .2s; }
.modal .card { width: min(520px, 100%); max-height: calc(100dvh - 28px); overflow-y: auto; background: #2a1d63; border: 3px solid var(--ol); border-radius: 22px; box-shadow: 0 8px 0 var(--ol), 0 20px 50px rgba(0,0,0,.5); padding: 18px; animation: pop .3s cubic-bezier(.3,1.5,.5,1); }
.modal h2 { font-family: LilitaOne, sans-serif; font-weight: 400; font-size: 26px; margin: 0 0 10px; text-align: center; }
.modal h2.win { color: var(--yel); font-size: 32px; text-shadow: 0 3px 0 var(--ol); }
.sub2 { text-align: center; color: var(--mut); margin: -4px 0 8px; }
.res-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.res-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; margin: 10px 0; }
.ri { background: rgba(0,0,0,.25); border-radius: 12px; padding: 8px; text-align: center; display: flex; flex-direction: column; }
.ri small { color: var(--mut); font-size: 12px; text-transform: uppercase; } .ri b { font-size: 22px; }
.stars { text-align: center; font-size: 52px; line-height: 1; margin: 4px 0; }
.stars i { font-style: normal; color: rgba(255,255,255,.18); display: inline-block; }
.stars i.on { color: var(--yel); text-shadow: 0 3px 0 var(--ol); animation: starin .5s var(--d) backwards cubic-bezier(.3,1.8,.5,1); }
.lvls { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.lvl { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 14px; border: 3px solid var(--ol); background: #b8a6ff; color: var(--ol); box-shadow: 0 4px 0 var(--ol); }
.lvl b { font-family: LilitaOne, sans-serif; font-weight: 400; font-size: 24px; line-height: 1; } .lvl span { font-weight: 700; font-size: 14px; } .lvl em { font-style: normal; font-size: 12px; min-height: 16px; text-align: center; line-height: 1.1; }
.lvl.done { background: #ffd34a; } .lvl:disabled { background: #4a3d80; color: #a99fd8; box-shadow: 0 4px 0 #120b2a; }
.lbl { font-weight: 700; margin: 14px 0 6px; color: var(--mut); font-size: 14px; text-transform: uppercase; letter-spacing: .5px; }
.names { display: grid; gap: 6px; } .nrow { display: flex; align-items: center; gap: 8px; }
.nrow input, .rrow input { flex: 1; min-width: 0; font: inherit; font-size: 17px; padding: 9px 12px; border-radius: 12px; border: 2px solid rgba(255,255,255,.2); background: rgba(0,0,0,.25); color: #fff; }
.pdot { width: 16px; height: 16px; border-radius: 50%; flex: none; border: 2px solid var(--ol); } .pdot.p0 { background: var(--p0); } .pdot.p1 { background: var(--p1); } .pdot.p2 { background: var(--p2); } .pdot.p3 { background: var(--p3); }
#pAdd { margin-top: 8px; }
.seg, .tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button, .tabs button { flex: 1 0 auto; border: 2px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); border-radius: 12px; padding: 8px 10px; font-weight: 700; min-height: 40px; }
.seg button[aria-pressed="true"], .tabs button[aria-pressed="true"] { background: var(--yel); color: var(--ol); border-color: var(--ol); }
.seg button:disabled { opacity: .35; }
.seg.wrap button { flex: 1 0 64px; }
.tabs.small { margin-top: 6px; } .tabs.small button { min-height: 32px; padding: 4px 8px; font-size: 14px; }
.rform { margin-top: 12px; background: rgba(0,0,0,.2); border-radius: 14px; padding: 10px; } .rform label { font-size: 14px; color: var(--mut); font-weight: 600; }
.rrow { display: flex; gap: 8px; margin-top: 6px; } .rmsg { min-height: 18px; margin: 6px 0 0; font-size: 14px; color: var(--yel); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.podium { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 6px; }
.podium li { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 14px; background: rgba(0,0,0,.25); border-left: 6px solid; }
.podium li:first-child { background: rgba(255,211,74,.18); font-size: 1.1em; }
.podium li span { font-size: 24px; text-align: center; } .podium li b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .podium li em { font-style: normal; color: var(--mut); font-size: 14px; }
.podium .p0 { border-color: var(--p0); } .podium .p1 { border-color: var(--p1); } .podium .p2 { border-color: var(--p2); } .podium .p3 { border-color: var(--p3); }
.share-pre { white-space: pre-wrap; font-family: inherit; background: rgba(0,0,0,.28); border-radius: 14px; padding: 12px; font-size: 16px; line-height: 1.45; margin: 10px 0 0; }
.scores { width: 100%; border-collapse: collapse; margin-top: 10px; font-variant-numeric: tabular-nums; }
.scores th { text-align: left; color: var(--mut); font-size: 12px; font-weight: 600; text-transform: uppercase; padding: 4px 6px; }
.scores td { padding: 6px; border-top: 1px solid rgba(255,255,255,.08); } .scores td:nth-child(2) { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scores tr.me td { color: var(--yel); font-weight: 700; } .rkbody { min-height: 120px; }
.achs, .help { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.achs li { display: grid; grid-template-columns: 38px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 6px 10px; border-radius: 12px; background: rgba(0,0,0,.2); opacity: .55; }
.achs li.got { opacity: 1; background: rgba(255,211,74,.15); } .achs li span { grid-row: span 2; font-size: 26px; text-align: center; } .achs small { color: var(--mut); font-size: 13px; }
.help li { padding: 8px 10px 8px 34px; border-radius: 12px; background: rgba(0,0,0,.2); position: relative; line-height: 1.35; }
.help li::before { content: '🃏'; position: absolute; left: 9px; top: 8px; }
.toasts { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 40; display: grid; gap: 6px; justify-items: center; pointer-events: none; width: min(92vw, 420px); }
.toast { background: rgba(28,18,56,.95); border: 2px solid var(--yel); border-radius: 14px; padding: 8px 14px; font-weight: 600; text-align: center; animation: slidedown .3s ease; transition: opacity .4s, transform .4s; }
.toast.out { opacity: 0; transform: translateY(-10px); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 25; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px; animation: fall 2.2s ease-in forwards; }
.nojs { text-align: center; padding: 40px; }

@keyframes matched { 0% { transform: rotateY(180deg) scale(1); } 40% { transform: rotateY(180deg) scale(1.12); } 100% { transform: rotateY(180deg) scale(1); } }
@keyframes shake { 0%, 100% { transform: rotateY(180deg) translateX(0); } 25% { transform: rotateY(180deg) translateX(-6%); } 75% { transform: rotateY(180deg) translateX(6%); } }
@keyframes shuf { 0% { transform: scale(1); } 40% { transform: scale(.6) rotate(20deg); } 100% { transform: scale(1); } }
@keyframes boom { 0%, 100% { transform: translate(0); } 20% { transform: translate(-4px, 2px); } 40% { transform: translate(4px, -2px); } 60% { transform: translate(-3px, -2px); } 80% { transform: translate(2px, 3px); } }
@keyframes deal { from { transform: translateY(-30px) scale(.4); opacity: 0; } }
@keyframes rise { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, -140%); } }
@keyframes pulse { to { transform: scale(1.12); } }
@keyframes bob { to { transform: translateY(3px); } }
@keyframes slideup { from { transform: translate(-50%, 40px); opacity: 0; } }
@keyframes slidedown { from { transform: translateY(-14px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.8); opacity: 0; } }
@keyframes starin { from { transform: scale(0) rotate(-90deg); } }
@keyframes fall { to { transform: translate(var(--x), 105vh) rotate(540deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01s !important; transition-duration: .01s !important; } }

/* ---------- responsive ---------- */
@media (max-width: 560px) {
  .top { padding: 6px 8px; } .logo { width: 32px; height: 32px; } .bt b { font-size: 19px; } .bt small { font-size: 9px; letter-spacing: 1px; }
  .tools { gap: 4px; } .ib { width: 34px; height: 34px; border-radius: 10px; } .ib svg { width: 19px; height: 19px; }
  .langs button { padding: 0 5px; height: 32px; font-size: 12px; }
  .tgrid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .tile { padding: 5px; border-radius: 14px; gap: 4px; } .tile b { font-size: 14px; } .tile small { font-size: 11px; } .tg { font-size: 9px; padding: 1px 4px; }
  .tile.mundo { grid-column: span 3; } .tile.mundo .tc { width: 34%; }
  .daily-banner { padding: 10px 12px; } .db-txt b { font-size: 18px; } .db-ico { font-size: 24px; }
  .screen.play { padding: 6px 4px calc(6px + var(--safe-b)); gap: 6px; }
  .st { min-width: 50px; padding: 2px 7px; } .st b { font-size: 16px; } .st.big b { font-size: 20px; }
  .chip.th { font-size: 13px; } .pl { min-width: 60px; padding: 2px 6px; } .pl b { font-size: 13px; max-width: 80px; } .pl span { font-size: 12px; }
  .fx-card { width: 58px; height: 58px; } .fx-txt b { font-size: 17px; } .fx-txt span { font-size: 14px; }
}
@media (max-width: 430px) { body:not(.scr-themes) .bt { display: none; } .toast { font-size: 14px; padding: 6px 10px; } }
@media (max-width: 360px) { .bt small { display: none; } .bt b { font-size: 17px; } body:not(.scr-themes) #bHelp { display: none; } }
/* pantallas bajas en horizontal (teléfono acostado): cabecera a la izquierda, marcador a un costado */
@media (orientation: landscape) and (max-height: 520px) {
  body.scr-play .app { flex-direction: row; }
  body.scr-play .top { flex-direction: column; justify-content: flex-start; border-bottom: 0; border-right: 2px solid rgba(255,255,255,.08); padding: 6px 4px; width: 56px; flex: none; }
  body.scr-play .bt { display: none; } body.scr-play .logo { width: 34px; height: 34px; }
  body.scr-play .tools { flex-direction: column; } body.scr-play .langs { flex-direction: column; } body.scr-play .langs button { height: 26px; padding: 0 6px; }
  body.scr-play .ib { width: 36px; height: 36px; }
  body.scr-play .toasts { top: 8px; left: calc(50% + 28px); }
  body.scr-play #bHelp, body.scr-play #bShare { display: none; }
  .screen.play { flex-direction: row; padding: 4px 6px 4px 4px; }
  .hud { flex-direction: column; flex-wrap: nowrap; justify-content: flex-start; width: 132px; flex: none; overflow-y: auto; }
  .hud .stats, .hud .players { flex-direction: column; width: 100%; flex-wrap: nowrap; }
  .hud .st, .hud .pl { width: 100%; flex-direction: row; justify-content: space-between; gap: 6px; padding: 3px 8px; }
  .pl.cur { transform: none; } .pl.cur::before { content: '▶'; left: -10px; top: 50%; transform: translateY(-50%); }
  .chip.th { width: 100%; font-size: 12px; }
  .top .ib { width: 34px; height: 34px; }
  .modal .card { max-height: calc(100dvh - 16px); padding: 12px; } .modal { padding: 8px; }
  .factbox { width: min(520px, calc(100% - 200px)); left: calc(50% + 60px); bottom: 8px; }
  .announce b { font-size: 28px; }
}
@media (min-width: 900px) { .tgrid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); } }

.newach { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin: 0 0 8px; }
.newach small { width: 100%; text-align: center; color: var(--yel); font-weight: 700; font-size: 13px; }
.newach span { background: rgba(255,211,74,.16); border: 2px solid var(--yel); border-radius: 12px; padding: 3px 10px; font-weight: 600; font-size: 14px; animation: pop .4s cubic-bezier(.3,1.5,.5,1); }
body.scr-play .toasts { top: auto; bottom: calc(118px + var(--safe-b)); }

/* Espacio para el botón «Juegos» de Millo Games (millo-volver.js, arriba a la izquierda) */
.top{padding-left:60px!important}
@media (orientation: landscape) and (max-height: 520px) { body.scr-play .top { padding-left: 4px !important; padding-top: 58px !important; } }
