:root {
  --bg: #0b0a14;
  --ink: #f4f1ea;
  --mute: #a49fb3;
  --line: rgba(255, 255, 255, .12);
  --red: #d7262f;
  --red2: #9e1018;
  --gold: #f4c542;
  --gold2: #b8860b;
  --panel: rgba(18, 16, 32, .82);
  --t0: #5b6270; --t1: #e9edf3; --t2: #3b82f6; --t3: #22c55e; --t4: #ef4444; --t5: #f5b301;
  --cond: "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", "Helvetica Neue", system-ui, sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans JP", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* Fondo: estadio de noche */
.stadium { position: fixed; inset: 0; overflow: hidden; z-index: 0;
  background: radial-gradient(120% 70% at 50% -10%, #2a1e46 0%, #120f22 45%, #07060d 100%); }
.stadium .light { position: absolute; top: -18vh; width: 70vw; height: 60vh; filter: blur(30px); opacity: .45;
  background: radial-gradient(closest-side, rgba(255, 244, 214, .55), transparent); }
.stadium .l1 { left: -25vw; } .stadium .l2 { right: -25vw; }
.stadium .pitch { position: absolute; left: -20%; right: -20%; bottom: -30vh; height: 60vh; transform: perspective(600px) rotateX(55deg);
  background: repeating-linear-gradient(90deg, #0f3a22 0 60px, #12442a 60px 120px); opacity: .55;
  mask-image: linear-gradient(to top, #000 30%, transparent); -webkit-mask-image: linear-gradient(to top, #000 30%, transparent); }

#app { position: relative; z-index: 1; max-width: 460px; margin: 0 auto; min-height: 100%; min-height: 100dvh; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
.screen { display: none; flex-direction: column; min-height: calc(100dvh - 32px); animation: in .35s ease; }
.screen.active { display: flex; }
@keyframes in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Inicio */
.badge { align-self: center; margin: 8px 0 14px; padding: 5px 14px; border: 1px solid rgba(244, 197, 66, .45); border-radius: 99px; font-size: 12px; letter-spacing: .04em; color: var(--gold); background: rgba(244, 197, 66, .08); }
.logo { margin: 0; padding-top: .12em; text-align: center; font-family: var(--cond); font-weight: 900; font-stretch: condensed; line-height: 1; font-size: clamp(54px, 17vw, 82px); letter-spacing: -.01em; text-transform: uppercase; }
.logo span { display: block; background: linear-gradient(180deg, #fff6d6 0%, var(--gold) 45%, #e0861a 80%, #a8510b 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #5a0d12) drop-shadow(0 10px 22px rgba(215, 38, 47, .45)); }
.logo span:last-child { font-style: italic; }
:lang(ja) .logo { font-size: clamp(48px, 14vw, 70px); font-family: var(--sans); }
.sub { text-align: center; color: var(--mute); font-size: 14px; margin: 12px 0 18px; }
.field { display: block; font-size: 12px; color: var(--mute); margin-bottom: 14px; }
.field input { display: block; width: 100%; margin-top: 6px; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); color: var(--ink); font-size: 16px; }
.field input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.field-label { font-size: 12px; color: var(--mute); margin: 4px 0 6px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.seg button, .chips button { padding: 11px 6px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); font-weight: 700; font-size: 14px; }
.seg button.on, .chips button.on { border-color: var(--gold); background: linear-gradient(180deg, rgba(244, 197, 66, .25), rgba(244, 197, 66, .08)); color: #fff; box-shadow: 0 0 0 1px rgba(244, 197, 66, .4) inset; }
.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 16px; }
.chips button { padding: 9px 2px; font-size: 13px; }
.chips button small { display: block; font-weight: 400; font-size: 10px; color: var(--mute); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cta { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 17px; border: 0; border-radius: 14px; margin-top: 6px;
  background: linear-gradient(180deg, #ef3b44, var(--red) 50%, var(--red2)); box-shadow: 0 6px 0 #5a0d12, 0 12px 30px rgba(215, 38, 47, .35); font-size: 20px; font-weight: 900; letter-spacing: .06em; }
.cta small { font-size: 12px; font-weight: 600; opacity: .85; letter-spacing: 0; }
.cta:active { transform: translateY(3px); box-shadow: 0 3px 0 #5a0d12; }
.foot { margin-top: auto; padding-top: 22px; display: flex; justify-content: space-between; align-items: center; }
.link { background: none; border: 0; color: var(--mute); text-decoration: underline; font-size: 13px; padding: 6px 0; }
.link.center { align-self: center; margin-top: 12px; }
select { background: rgba(255, 255, 255, .06); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 13px; }

/* Juego */
.g-head { display: flex; justify-content: space-between; align-items: flex-start; }
.g-head h2 { margin: 0; font-size: 28px; font-family: var(--cond); font-weight: 900; font-stretch: condensed; }
.g-head p { margin: 2px 0 0; font-size: 12px; color: var(--mute); }
.g-tools { display: flex; gap: 8px; align-items: center; }
.chip { font-size: 12px; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); }
.chip:empty { display: none; }
.chip.tit { border-color: rgba(34, 197, 94, .6); color: #86efac; }
.icon { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); font-size: 15px; }
.progress { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; margin: 14px 0 4px; }
.progress i { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .12); }
.progress i.cur { background: rgba(255, 255, 255, .55); }
.progress i.t2 { background: var(--t2); } .progress i.t3 { background: var(--t3); } .progress i.t4 { background: var(--t4); } .progress i.t5 { background: var(--t5); }
.progress i.t6 { background: linear-gradient(90deg, #f43f5e, #f59e0b, #22c55e, #3b82f6, #a855f7); }
.progress i.t0, .progress i.t1 { background: #8b90a0; }
.stages { display: grid; grid-template-columns: 1fr 2fr 2fr 2fr 2fr 3fr; gap: 3px; font-size: 9px; color: var(--mute); margin-bottom: 12px; text-align: left; }
.panel { position: relative; border-radius: 16px; padding: 12px; border: 1px solid rgba(244, 197, 66, .35); background: var(--panel); box-shadow: 0 0 0 1px rgba(0, 0, 0, .5) inset, 0 20px 50px rgba(0, 0, 0, .45); }
.panel.rush { border-color: #f59e0b; box-shadow: 0 0 24px rgba(245, 158, 11, .45), 0 0 0 1px rgba(245, 158, 11, .4) inset; }
.panel.injury { border-color: #64748b; filter: saturate(.6); }
.banner { text-align: center; font-size: 13px; font-weight: 700; color: var(--gold); padding: 2px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 10px; min-height: 27px; }
.panel.rush .banner { background: linear-gradient(90deg, #f43f5e, #f59e0b, #facc15); -webkit-background-clip: text; background-clip: text; color: transparent; }
.reels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.reel .rh { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; margin-bottom: 4px; gap: 4px; }
.reel .rh span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reel .rh em { font-style: normal; font-size: 9px; padding: 0 4px; border-radius: 3px; border: 1px solid var(--gold); color: var(--gold); margin-left: 3px; }
.reel .rh em.weak { border-color: #64748b; color: #94a3b8; }
.reel .rh b { font-size: 15px; font-family: var(--cond); white-space: nowrap; }
.reel .rh b i { font-style: normal; font-size: 11px; color: var(--mute); margin-left: 2px; }
.face { position: relative; height: 92px; border-radius: 10px; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(180deg, #1b1930, #0d0c18); border: 1px solid rgba(255, 255, 255, .08); font-family: var(--cond); font-weight: 900; font-size: 40px; color: rgba(255, 255, 255, .25); }
.face.spin { color: rgba(255, 255, 255, .7); animation: blur .12s linear infinite; }
@keyframes blur { 50% { transform: translateY(-3px); } }
.face.t0 { color: #6b7280; }
.face.t1 { color: #fff; }
.face.t2 { color: #93c5fd; border-color: var(--t2); box-shadow: 0 0 14px rgba(59, 130, 246, .45) inset; }
.face.t3 { color: #86efac; border-color: var(--t3); box-shadow: 0 0 16px rgba(34, 197, 94, .5) inset; }
.face.t4 { color: #fecaca; border-color: var(--t4); background: linear-gradient(180deg, #4a1218, #1c0b10); box-shadow: 0 0 22px rgba(239, 68, 68, .6) inset; }
.face.t5 { color: #3a2500; border-color: #ffe08a; background: linear-gradient(160deg, #fff3b0, #f5b301 45%, #b77900); box-shadow: 0 0 26px rgba(245, 179, 1, .8); }
.face.t6 { color: #fff; border-color: #fff; background: linear-gradient(120deg, #f43f5e, #f59e0b, #22c55e, #3b82f6, #a855f7, #f43f5e); background-size: 300% 100%; animation: rainbow 1.2s linear infinite; box-shadow: 0 0 30px rgba(255, 255, 255, .7); text-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
@keyframes rainbow { to { background-position: 300% 0; } }
.face.pop { animation: pop .35s ease; }
.face.t6.pop { animation: pop .35s ease, rainbow 1.2s linear infinite; }
@keyframes pop { 40% { transform: scale(1.12); } }
.face .tag { position: absolute; top: 4px; left: 0; right: 0; font-size: 10px; font-family: var(--sans); font-weight: 800; color: #fff; text-align: center; }
.reel .bar { height: 3px; border-radius: 2px; margin-top: 5px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.reel .bar i { display: block; height: 100%; background: var(--gold); width: 0; transition: width .5s ease; }
.g-foot { margin-top: auto; padding-top: 16px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.g-total small, .g-rank small { display: block; font-size: 11px; color: var(--mute); }
.g-total b { font-family: var(--cond); font-size: 46px; font-weight: 900; line-height: 1; }
.g-rank { text-align: right; }
.g-rank b { font-family: var(--cond); font-size: 28px; font-weight: 900; color: var(--gold); }
.ball { position: relative; width: 108px; height: 108px; border-radius: 50%; border: 3px solid #ffe08a; display: grid; place-items: center; align-content: center; gap: 2px;
  background: radial-gradient(circle at 35% 30%, #ff6a6f, var(--red) 45%, var(--red2)); box-shadow: 0 6px 0 #5a0d12, 0 0 30px rgba(215, 38, 47, .55); font-size: 17px; font-weight: 900; letter-spacing: .06em; }
.ball:disabled { filter: grayscale(.6) brightness(.7); cursor: default; }
.ball:not(:disabled) { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 6px 0 #5a0d12, 0 0 46px rgba(244, 197, 66, .7); } }
.ball:active:not(:disabled) { transform: translateY(3px); }
.ball-ico { width: 34px; height: 34px; border-radius: 50%; background:
  radial-gradient(circle at 50% 50%, #111 0 22%, transparent 23%),
  radial-gradient(circle at 50% 6%, #111 0 13%, transparent 14%), radial-gradient(circle at 92% 38%, #111 0 13%, transparent 14%),
  radial-gradient(circle at 78% 92%, #111 0 13%, transparent 14%), radial-gradient(circle at 22% 92%, #111 0 13%, transparent 14%),
  radial-gradient(circle at 8% 38%, #111 0 13%, transparent 14%), #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .4); }
.ball.spinning .ball-ico { animation: roll .5s linear infinite; }
@keyframes roll { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 150px; transform: translate(-50%, 20px); max-width: 420px; width: calc(100% - 40px); padding: 12px 14px; border-radius: 12px; text-align: center;
  background: rgba(10, 10, 18, .95); border: 1px solid var(--gold); font-size: 14px; font-weight: 700; opacity: 0; pointer-events: none; transition: .3s; z-index: 5; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Fichaje y torneo */
.kicker { text-align: center; font-size: 12px; color: var(--gold); margin: 18px 0 2px; letter-spacing: .08em; }
.big { text-align: center; margin: 0; font-family: var(--cond); font-weight: 900; font-stretch: condensed; font-size: 34px; }
.offers { display: grid; gap: 12px; }
.offer { text-align: left; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); display: grid; gap: 8px; }
.offer.top { border-color: var(--gold); box-shadow: 0 0 24px rgba(244, 197, 66, .25); }
.offer h3 { margin: 0; font-size: 18px; }
.offer h3 small { display: block; font-size: 12px; color: var(--mute); font-weight: 400; margin-top: 2px; }
.offer dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; }
.offer dt { color: var(--mute); } .offer dd { margin: 0; font-weight: 700; }
.offer .go { justify-self: stretch; padding: 12px; border-radius: 10px; border: 0; font-weight: 900; font-size: 16px; background: linear-gradient(180deg, #ef3b44, var(--red2)); }
.offer:not(.top) .go { background: rgba(255, 255, 255, .1); }
.ladder { list-style: none; padding: 0; margin: 14px 0 10px; display: grid; gap: 5px; }
.ladder li { padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); font-size: 13px; color: var(--mute); display: flex; justify-content: space-between; transition: .25s; }
.ladder li.win { color: #fff; background: rgba(34, 197, 94, .14); border-color: rgba(34, 197, 94, .5); }
.ladder li.loss { color: #fff; background: rgba(239, 68, 68, .18); border-color: rgba(239, 68, 68, .6); }
.ladder li.champ { color: #3a2500; background: linear-gradient(90deg, #fff3b0, #f5b301); border-color: #ffe08a; font-weight: 800; }
.t-res { text-align: center; margin: 8px 0 14px; min-height: 54px; opacity: 0; transition: .4s; }
.t-res.show { opacity: 1; }
.t-res b { display: block; font-family: var(--cond); font-size: 30px; font-weight: 900; }
.t-res small { color: var(--mute); }
#t-next { margin-top: auto; visibility: hidden; }
#t-next.show { visibility: visible; }

/* Resultado */
.card { position: relative; border-radius: 18px; padding: 16px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .18);
  background: linear-gradient(160deg, #23203a, #12101f 60%); box-shadow: 0 20px 60px rgba(0, 0, 0, .55); }
.card.o-primera { border-color: #ffe08a; background: linear-gradient(160deg, #3a2a05, #17120a 55%, #0f0d14); box-shadow: 0 0 40px rgba(245, 179, 1, .45); }
.card.o-segunda { border-color: #fca5a5; background: linear-gradient(160deg, #3a0d12, #160a10 60%); }
.card.o-semi { border-color: #86efac; background: linear-gradient(160deg, #0d2c1a, #0d1512 60%); }
.card.o-tercera { border-color: #93c5fd; background: linear-gradient(160deg, #0f1f3d, #0c0f1d 60%); }
.c-top { display: flex; justify-content: space-between; font-size: 11px; color: var(--mute); }
.c-top span:last-child { border: 1px solid var(--line); padding: 1px 8px; border-radius: 99px; }
.c-title { margin: 12px 0 2px; font-family: var(--cond); font-weight: 900; font-stretch: condensed; font-size: 32px; line-height: 1.05; }
.card.o-primera .c-title { background: linear-gradient(180deg, #fff6d6, var(--gold), #c77a0a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.c-name { font-size: 14px; }
.c-name span { font-size: 11px; padding: 1px 6px; margin-left: 6px; border-radius: 4px; border: 1px solid var(--line); color: var(--mute); }
.c-outcome { display: inline-block; margin-top: 8px; padding: 4px 10px; border-radius: 6px; font-size: 13px; font-weight: 800; background: rgba(255, 255, 255, .1); }
.card.o-primera .c-outcome { background: var(--gold); color: #2a1a00; }
.c-nums { display: grid; grid-template-columns: 1fr 1.6fr; gap: 1px; margin: 12px 0; background: var(--line); border-radius: 10px; overflow: hidden; }
.c-nums div { background: rgba(10, 10, 18, .7); padding: 8px 12px; }
.c-nums small { display: block; font-size: 10px; color: var(--mute); }
.c-nums b { font-family: var(--cond); font-size: 34px; font-weight: 900; line-height: 1.05; }
.c-nums b i { font-size: 22px; font-style: normal; color: var(--mute); margin-left: 4px; }
.c-mid { display: grid; grid-template-columns: 116px 1fr; gap: 12px; align-items: center; }
.c-mid svg { width: 116px; height: 116px; }
.c-stats { display: grid; grid-template-columns: 1fr; gap: 3px; font-size: 13px; }
.c-stats div { display: flex; justify-content: space-between; gap: 4px; align-items: baseline; }
.c-stats span { color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g { font-family: var(--cond); font-weight: 900; font-size: 15px; white-space: nowrap; }
.c-stats .g small { font-size: 13px; color: var(--ink); margin-left: 4px; }
.g-S, .g-Sp { color: #fde047; } .g-A { color: #fb923c; } .g-B { color: #f472b6; } .g-C { color: #c084fc; } .g-D { color: #60a5fa; } .g-E { color: #4ade80; } .g-F, .g-G { color: #94a3b8; }
.c-tl { margin: 12px 0 0; padding: 0; list-style: none; font-size: 12px; display: grid; gap: 4px; }
.c-tl li { display: grid; grid-template-columns: 52px 1fr auto; gap: 8px; align-items: center; }
.c-tl li > span:first-child { font-size: 10px; text-align: center; border: 1px solid var(--line); border-radius: 4px; padding: 1px 0; color: var(--gold); }
.c-tl li > span:last-child { color: var(--mute); }
.c-season { display: flex; justify-content: space-between; margin-top: 12px; padding: 8px 12px; border-radius: 8px; background: rgba(255, 255, 255, .05); font-size: 12px; }
.c-season b { font-family: var(--cond); font-size: 20px; margin: 0 3px 0 10px; }
.c-foot { display: flex; justify-content: space-between; margin-top: 10px; font-size: 11px; color: var(--mute); }
.c-foot .meter { display: inline-flex; gap: 2px; margin: 0 6px; vertical-align: middle; }
.c-foot .meter i { width: 6px; height: 10px; border-radius: 1px; background: rgba(255, 255, 255, .15); }
.c-foot .meter i.on { background: var(--gold); }
.after { text-align: center; font-size: 14px; margin: 14px 4px; color: var(--ink); }
.after b { color: var(--gold); font-weight: 700; margin-right: 6px; }
.appcta { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; text-decoration: none; color: #fff; margin-bottom: 12px;
  background: linear-gradient(90deg, #1d4ed8, #2563eb); box-shadow: 0 8px 24px rgba(37, 99, 235, .35); }
.appcta-ico { width: 44px; height: 44px; border-radius: 10px; background: #fff; display: grid; place-items: center; font-size: 24px; }
.appcta small { display: block; font-size: 11px; opacity: .85; } .appcta b { display: block; font-size: 17px; }
.appcta em { font-style: normal; font-size: 10px; padding: 1px 6px; border-radius: 4px; background: rgba(255, 255, 255, .2); }
.share { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.sh { padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); font-weight: 800; font-size: 14px; }
.sh.wa { background: #1fa855; border-color: #1fa855; } .sh.x { background: #000; border-color: #333; }

/* Modal */
dialog { width: min(92vw, 460px); max-height: 86vh; padding: 0; border: 1px solid var(--line); border-radius: 16px; background: #13111f; color: var(--ink); }
dialog::backdrop { background: rgba(0, 0, 0, .7); }
.m-head { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: #13111f; border-bottom: 1px solid var(--line); }
.m-head h3 { margin: 0; font-size: 17px; }
#m-body { padding: 4px 16px 18px; font-size: 13px; line-height: 1.55; }
#m-body h4 { margin: 18px 0 6px; font-size: 14px; color: var(--gold); }
#m-body table { width: 100%; border-collapse: collapse; font-size: 12px; }
#m-body td, #m-body th { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
#m-body th { color: var(--mute); font-weight: 600; }
#m-body td:last-child, #m-body th:last-child { text-align: right; }
#m-body .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; }
#m-body .tag { display: inline-block; font-size: 10px; padding: 0 5px; border-radius: 3px; margin-left: 4px; background: rgba(255, 255, 255, .1); }
#m-body .tag.m { background: rgba(34, 197, 94, .25); } #m-body .tag.a { background: rgba(245, 158, 11, .25); }
#m-body p.note { color: var(--mute); font-size: 12px; }

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