:root { color-scheme: dark; --navy: #0b1740; --gold: #f5b800; --muted: #b7c5e0; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: radial-gradient(ellipse at 85% 0, #26366a60, transparent 55%), #0b1530; color: #fff; font-family: 'Open Sans', sans-serif; min-height: 100vh; }
a { color: var(--gold); }
button, input { font: inherit; }
button, .play-link { cursor: pointer; border: 1px solid #7182a6; border-radius: 10px; padding: 10px 16px; background: #192e59; color: #fff; font-weight: 700; }
button:disabled { cursor: default; opacity: .65; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.primary { background: linear-gradient(110deg, #ffdb66, var(--gold)); color: var(--navy); border-color: var(--gold); box-shadow: 0 4px 16px #f5b80018; }
.primary:not(:disabled):hover { filter: brightness(1.12); }
.games-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 14px max(24px, calc((100% - 980px) / 2)); border-bottom: 1px solid #ffffff16; background: #091530bb; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: .9rem; }
.brand img { object-fit: contain; width: 36px; height: 36px; }
.games-header nav, .languages { display: flex; align-items: center; gap: 12px; font-size: .85rem; }
.languages button { padding: 6px 9px; }
.languages [aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
main { max-width: 1028px; margin: auto; padding: 28px 24px; }
.intro { margin-bottom: 24px; }
h1, h2, h3, h4 { font-family: 'Montserrat', sans-serif; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.65rem, 3.2vw, 2.2rem); line-height: 1.2; margin: 10px 0; letter-spacing: -.8px; }
h1 span { color: var(--gold); }
.intro > p:last-child { margin: 0; font-size: .92rem; }
.intro p, .game-card p, #game-description, .prize p { color: var(--muted); line-height: 1.5; }
.eyebrow { color: var(--gold) !important; font-size: .68rem; letter-spacing: 1.5px; text-transform: uppercase; margin: 0; }
#games-status:empty { display: none; }
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 18px; align-items: start; }
.game-card { display: flex; flex-direction: column; background: linear-gradient(140deg, #1d2c50, #111e3b); border: 1px solid #ffffff22; border-radius: 18px; padding: 18px; overflow: hidden; min-width: 0; }
.game-card > img { width: 100%; height: 112px; object-fit: cover; border-radius: 10px; margin-bottom: 14px; }
.game-art { position: relative; height: 88px; border-radius: 10px; overflow: hidden; margin-bottom: 16px; background: radial-gradient(ellipse at 65% 100%, #f5b80035, transparent 65%), #0b1630; }
.game-art::before, .game-art::after { content: ''; position: absolute; width: 130px; height: 130px; border: 1px solid #f5b80025; border-radius: 50%; left: 55%; top: -25px; }
.game-art::after { width: 170px; height: 170px; left: 50%; top: -45px; }
.art-label { position: absolute; left: 18px; top: 33px; color: var(--gold); font-size: .75rem; font-weight: 900; letter-spacing: 2px; }
.art-ball { position: absolute; display: grid; place-items: center; border-radius: 50%; width: 58px; height: 58px; right: 24%; top: 10px; color: #35260a; background: radial-gradient(circle at 30% 25%, #fff8cc, #f8c530 45%, #af6700); box-shadow: inset -4px -6px 10px #48260045, 0 8px 15px #0005; font-weight: 900; transform: rotate(-15deg); }
.art-ball:nth-last-child(2) { right: 12%; top: 29px; width: 48px; height: 48px; background: radial-gradient(circle at 30% 25%, #fff, #b9d1ff 50%, #526591); transform: rotate(12deg); }
.art-ball:last-child { right: 2%; top: 1px; width: 42px; height: 42px; background: radial-gradient(circle at 30% 25%, #ffd1cf, #fb8e78 50%, #c34a39); transform: rotate(20deg); }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.game-card h2 { font-size: 1.3rem; line-height: 1.25; margin: 12px 0 6px; }
.game-card .game-kind { font-size: .75rem; margin: 0 0 8px; }
.game-card .game-description { font-size: .86rem; margin: 0 0 14px; }
.game-card h3, .prize-preview h3 { font-size: .73rem; letter-spacing: 1px; text-transform: uppercase; margin: 0 0 8px; color: var(--muted); }
.game-card > button:last-child, .game-card > .play-link { width: 100%; text-align: center; margin-top: 14px; }
.game-card .play-link { display: inline-block; text-decoration: none; font-size: .86rem; }
.badge { border-radius: 20px; border: 1px solid #ffffff40; padding: 4px 9px; font-size: .68rem; white-space: nowrap; }
.badge.open { color: #8bf0b1; border-color: #8bf0b160; background: #46d5860c; }
.badge.open::before { content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 5px; background: #8bf0b1; border-radius: 50%; vertical-align: middle; }
.notice { margin-top: 20px; padding: 12px 14px; border-left: 2px solid #f5b80075; background: #ffffff04; color: var(--muted); line-height: 1.5; font-size: .74rem; }
dialog { background: #101e3b; color: #fff; border: 1px solid #5a709980; border-radius: 20px; width: min(800px, calc(100% - 24px)); max-height: 94dvh; padding: 22px; overflow-y: auto; box-shadow: 0 30px 100px #0008; }
dialog::backdrop { background: #020817df; backdrop-filter: blur(5px); }
body:has(dialog[open]) { overflow: hidden; }
.dialog-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dialog-top h2 { font-size: 1.3rem; margin: 7px 0 0; }
.dialog-top button { padding: 7px 11px; font-size: .76rem; flex-shrink: 0; }
.access-locked { width: min(440px, calc(100% - 24px)); }
.game-access { padding-top: 6px; }
.game-access > p:first-child { color: var(--muted); font-size: .85rem; line-height: 1.5; margin: 0 0 18px; }
.game-access label { display: block; font-size: .85rem; font-weight: 700; margin-bottom: 8px; }
#game-password { width: 100%; padding: 12px; font-size: 1rem; border: 1px solid #697eab; border-radius: 10px; background: #091530; color: #fff; }
.game-access .primary { width: 100%; margin-top: 12px; }
#game-prediction { display: inline-block; text-decoration: none; }
#prediction-form > label { display: block; font-size: .85rem; font-weight: 700; margin-bottom: 8px; }
#prediction-team-name { width: 100%; padding: 12px; border: 1px solid #697eab; border-radius: 10px; background: #091530; color: #fff; }
#prediction-name-help { color: var(--muted); font-size: .76rem; margin: 8px 0; line-height: 1.5; }
#prediction-form fieldset { min-width: 0; border: 0; padding: 0; margin: 20px 0 16px; }
#prediction-help { font-weight: 700; font-size: .9rem; }
#prediction-count { margin: 6px 0 12px; color: var(--gold); font-size: .8rem; }
.prediction-teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.prediction-team { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 12px; border: 1px solid #697eab; border-radius: 10px; background: #091530; cursor: pointer; overflow-wrap: anywhere; font-size: .85rem; }
.prediction-team input { width: 19px; height: 19px; flex-shrink: 0; margin: 0; accent-color: var(--gold); }
.prediction-team.chosen { background: #f5b80018; border-color: var(--gold); color: #ffdb6a; }
.prediction-team:has(input:disabled):not(.chosen) { opacity: .6; cursor: default; }
#prediction-submit { width: 100%; }
#prediction-status { color: var(--muted); font-size: .85rem; line-height: 1.5; }
#prediction-status:empty { display: none; }
#prediction-status.prediction-saved { color: #8bf0b1; padding: 12px; background: #46d5860c; border: 1px solid #8bf0b160; border-radius: 10px; }
.final-draw { margin-top: 16px; padding-top: 16px; border-top: 1px solid #ffffff24; }
.final-draw p { font-size: .8rem; margin: 8px 0; }
.final-draw .error { color: #ffb1b1; }
.final-draw h4 { font-size: .82rem; margin: 14px 0 8px; }
.final-draw ul { list-style: none; padding: 0; margin: 0 0 12px; max-height: 240px; overflow-y: auto; }
.final-draw li { display: flex; justify-content: space-between; gap: 12px; padding: 8px; border-bottom: 1px solid #ffffff12; font-size: .8rem; overflow-wrap: anywhere; }
.final-draw small { color: var(--muted); font-variant-numeric: tabular-nums; }
.final-draw li.final-draw-won { color: var(--gold); background: #f5b80012; }
.final-draw-winner { text-align: center; padding: 18px 12px; margin: 14px 0; border: 1px solid var(--gold); border-radius: 12px; background: radial-gradient(ellipse at 50% 0, #f5b80030, transparent), #091530; animation: ball-arrive .6s both; }
.final-draw-winner p { text-transform: uppercase; letter-spacing: 1px; color: var(--gold); }
.final-draw-winner strong { display: block; font-size: 1.4rem; overflow-wrap: anywhere; }
.final-draw-winner small { display: block; margin-top: 6px; }
[data-final-refresh] { font-size: .75rem; padding: 7px 10px; }
.final-draw-admin { margin-top: 14px; font-size: .78rem; }
.final-draw-admin summary { cursor: pointer; color: var(--muted); }
.final-draw-admin label { display: block; margin: 12px 0 0; }
.final-draw-admin label span { display: block; margin-bottom: 6px; }
.final-draw-admin select, .final-draw-admin input { display: block; min-width: 0; width: 100%; padding: 10px; border: 1px solid #697eab; border-radius: 8px; background: #091530; color: #fff; font: inherit; }
.final-draw-admin .primary { width: 100%; font-size: .8rem; }
.final-draw-selectors { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 0 10px; }
#game-description { margin: 10px 0 14px; font-size: .85rem; }
.draw-steps { display: flex; justify-content: space-between; gap: 8px; padding: 10px 0 14px; margin: 0; list-style: none; border-top: 1px solid #ffffff12; color: #a7b6d2; font-size: .72rem; }
.draw-steps li { display: flex; align-items: center; gap: 6px; }
.draw-steps li > span:first-child { display: grid; place-items: center; width: 22px; height: 22px; flex-shrink: 0; border: 1px solid #5c6e90; border-radius: 50%; font-weight: 700; }
.draw-steps .active { color: #ffda6d; }
.draw-steps .active > span:first-child { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.draw-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: center; }
.draw-stage { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 340px; padding: 16px 12px; border: 1px solid #ffffff15; border-radius: 16px; background: radial-gradient(ellipse at 50% 45%, #34558c55, transparent 75%), #0a142d; overflow: hidden; }
.draw-animation { position: relative; display: grid; place-items: center; width: 100%; height: 238px; }
.machine-glow { position: absolute; width: 180px; height: 180px; border-radius: 50%; box-shadow: 0 0 55px #f5b80018; }
.lottery-machine { position: absolute; top: 50%; left: 50%; width: 190px; height: 231px; margin: -116px 0 0 -95px; }
.machine-cap { position: relative; width: 70px; height: 12px; margin: auto auto -5px; z-index: 2; background: linear-gradient(#fff0ac, #d79b10); border-radius: 8px 8px 2px 2px; box-shadow: 0 2px 6px #0005; }
.machine-globe { position: relative; width: 190px; height: 180px; overflow: hidden; border-radius: 48%; border: 3px solid #b5d8ff80; background: radial-gradient(ellipse at 30% 20%, #ffffff24, #7aafe50a 45%, #09132845); box-shadow: inset 6px 0 16px #a5dbff18, inset -5px -5px 16px #0005, 0 0 0 5px #ffffff04; }
.machine-globe::after { content: ''; position: absolute; left: 18px; top: 15px; width: 20px; height: 68px; border-radius: 50%; transform: rotate(32deg); background: linear-gradient(#ffffff50, #ffffff00); pointer-events: none; }
.lottery-ball { position: absolute; display: grid; place-items: center; bottom: var(--y); left: var(--x); width: 39px; height: 39px; border-radius: 50%; background: radial-gradient(circle at 30% 25%, #fff6cf, #f7c332 50%, #bd7906); box-shadow: inset -3px -4px 6px #6b380060, 1px 4px 6px #0004; color: #49320b; font-size: .8rem; font-weight: 900; }
.lottery-ball:nth-child(3n) { background: radial-gradient(circle at 30% 25%, #fff, #afc8f4 50%, #687ba4); color: #152447; }
.lottery-ball:nth-child(4n) { background: radial-gradient(circle at 30% 25%, #ffd8cf, #f5927d 50%, #b24b44); color: #521d1d; }
.lottery-ball:nth-child(1) { --x: 13%; --y: 10%; --dx: 68px; --dy: -81px; --delay: -.3s; }
.lottery-ball:nth-child(2) { --x: 35%; --y: 5%; --dx: -40px; --dy: -112px; --delay: -.6s; }
.lottery-ball:nth-child(3) { --x: 58%; --y: 10%; --dx: -82px; --dy: -48px; --delay: -.1s; }
.lottery-ball:nth-child(4) { --x: 4%; --y: 30%; --dx: 99px; --dy: -40px; --delay: -.8s; }
.lottery-ball:nth-child(5) { --x: 26%; --y: 28%; --dx: 49px; --dy: -65px; --delay: -.2s; }
.lottery-ball:nth-child(6) { --x: 49%; --y: 32%; --dx: -73px; --dy: -44px; --delay: -.5s; }
.lottery-ball:nth-child(7) { --x: 73%; --y: 28%; --dx: -92px; --dy: -31px; --delay: -.7s; }
.lottery-ball:nth-child(8) { --x: 14%; --y: 51%; --dx: 85px; --dy: 41px; --delay: -.4s; }
.lottery-ball:nth-child(9) { --x: 37%; --y: 53%; --dx: 35px; --dy: 35px; --delay: -.9s; }
.lottery-ball:nth-child(10) { --x: 60%; --y: 50%; --dx: -61px; --dy: 57px; --delay: -.15s; }
.machine-base { position: relative; z-index: 2; margin: -7px auto 0; height: 46px; width: 154px; border-radius: 12px 12px 15px 15px; background: linear-gradient(110deg, #f7d367, #dca015 60%, #9e6d11); border: 1px solid #ffe39490; text-align: center; box-shadow: 0 10px 18px #0006; }
.machine-base > span { display: block; color: #49330e; font-weight: 900; letter-spacing: 2px; font-size: .55rem; margin: 7px 0 4px; }
.machine-slot { background: #0b142d; border: 2px solid #a87c1c; border-radius: 12px; width: 62px; height: 12px; margin: auto; }
[data-draw-state="mixing"] .lottery-ball { animation: ball-tumble .68s var(--delay) ease-in-out infinite alternate; }
[data-draw-state="mixing"] .lottery-machine { animation: machine-rumble .15s ease-in-out infinite alternate; }
[data-draw-state="mixing"] .machine-glow { box-shadow: 0 0 65px #f5b80045; }
[data-draw-state="choosing"] .draw-animation { height: 190px; }
[data-draw-state="choosing"] .lottery-machine { transform: scale(.8); }
#draw-progress { text-align: center; color: #ffdb6a; font-size: .86rem; font-weight: 700; line-height: 1.4; margin: 10px 0 0; }
.draw-choices { display: flex; justify-content: center; gap: 16px; padding: 20px 8px 5px; }
.choice-ball { display: grid; place-items: center; width: 58px; height: 58px; padding: 0; border-radius: 50%; border: 2px solid #ffebac; color: #49320b; background: radial-gradient(circle at 30% 25%, #fff9d8, #f5c13a 55%, #c18014); box-shadow: 0 7px 18px #0005, 0 0 20px #f5b80020; font-size: 1.6rem; transition: transform .18s, box-shadow .18s; animation: ball-arrive .4s backwards; }
.choice-ball:nth-child(2) { animation-delay: .08s; }
.choice-ball:nth-child(3) { animation-delay: .16s; }
.choice-ball:hover { transform: translateY(-7px) scale(1.08); box-shadow: 0 10px 25px #f5b80055; }
.draw-controls { min-width: 0; }
.prizes { display: grid; gap: 8px; }
.prize { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 12px; border: 1px solid #ffffff18; background: #ffffff03; padding: 10px; border-radius: 10px; overflow-wrap: anywhere; }
.prize img { grid-row: span 2; width: 96px; height: 60px; object-fit: contain; border-radius: 7px; }
.prize h4, .prize p { grid-column: 2; margin: 0; }
.prize:not(:has(img)) h4, .prize:not(:has(img)) p { grid-column: 1 / -1; }
.prize h4 { font-size: .8rem; line-height: 1.4; }
.prize p { font-size: .74rem; margin-top: 3px; }
.prizes > p { font-size: .8rem; margin: 0; color: var(--muted); }
.prizes-compact { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); align-items: stretch; gap: 8px; }
.prize-compact { display: flex; gap: 4px; padding: 4px; }
.prize-compact img, .prize-placeholder { flex-shrink: 0; }
.prize-count { flex: 1; min-width: 0; text-align: right; font-variant-numeric: tabular-nums; color: #ffdb6a; font-size: .85rem; font-weight: 700; white-space: nowrap; }
.prize-placeholder { display: grid; place-items: center; width: 96px; height: 60px; color: var(--gold); background: #ffffff08; border-radius: 7px; font-size: 1.5rem; }
.prize-preview { margin-bottom: 20px; }
#game-form label { display: block; font-size: .8rem; margin-bottom: 8px; font-weight: 700; }
#game-code { width: 100%; min-width: 0; border: 1px solid #697eab; border-radius: 10px; background: #091530; color: #fff; padding: 12px; font-size: 1rem; text-transform: uppercase; letter-spacing: 1px; }
#game-code:disabled { opacity: .65; }
#game-submit { width: 100%; }
.error { color: #ffb1b1; font-size: .76rem; margin: 8px 0; }
.error:empty { display: none; }
#game-form .primary { margin-top: 10px; }
.stage-disclaimer { color: #a6b5d0; font-size: .68rem; line-height: 1.5; margin: 12px 0 0; }
.result { position: relative; width: 100%; padding: 8px; text-align: center; }
.result:focus-visible { outline: 1px solid #ffdb6a80; outline-offset: 3px; border-radius: 12px; }
.result h3 { font-size: 1.55rem; margin: 8px 0 14px; }
.result > p { color: var(--muted); font-size: .75rem; line-height: 1.5; margin: 12px 0 0; }
.result.win h3 { color: #ffdb6a; }
.result .prize { display: flex; flex-direction: column; border: 0; background: none; padding: 0; }
.result .prize img { width: min(100%, 260px); height: 156px; margin-bottom: 12px; }
.result .prize h4 { font-size: .95rem; }
.result-emblem { display: grid; place-items: center; width: 68px; height: 68px; margin: auto; border-radius: 50%; background: #ffffff10; font-size: 2rem; color: #bdcbe5; }
.win .result-emblem { color: #48310c; background: radial-gradient(circle at 30% 25%, #fff8cb, #f5b800); box-shadow: 0 0 40px #f5b80035; }
.confetti { position: absolute; inset: -20px 0 0; pointer-events: none; overflow: hidden; }
.confetti span { position: absolute; left: calc(var(--i) * 8%); top: -15px; width: 7px; height: 13px; background: #ffce42; animation: confetti-fall 1.6s calc(var(--i) * .06s) both; }
.confetti span:nth-child(3n) { background: #f18d7d; }
.confetti span:nth-child(2n) { background: #a9ccff; width: 5px; height: 8px; }
footer { text-align: center; padding: 16px 20px; color: var(--muted); border-top: 1px solid #ffffff14; font-size: .73rem; }
footer p { margin: 0 0 6px; }
@keyframes ball-tumble { to { transform: translate(var(--dx), var(--dy)) rotate(240deg); } }
@keyframes machine-rumble { to { transform: translate(1px, -1px) rotate(.6deg); } }
@keyframes ball-arrive { from { opacity: 0; transform: translateY(-16px) scale(.5); } to { opacity: 1; transform: none; } }
@keyframes confetti-fall { from { opacity: 1; transform: translateY(0) rotate(0); } to { opacity: 0; transform: translateY(350px) rotate(420deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .confetti { display: none; }
}
@media (max-width: 600px) {
  .brand span { max-width: 205px; font-size: .78rem; }
  .games-header { padding: 12px 18px; }
  main { padding: 22px 16px; }
  h1 span { display: block; }
  .game-card { padding: 16px; }
  .prizes-compact { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .prize-compact img, .prize-placeholder { width: 80px; height: 50px; }
  dialog { padding: 16px; max-height: 94dvh; }
  .draw-layout { grid-template-columns: 1fr; gap: 16px; }
  .draw-stage { min-height: 260px; padding: 12px; }
  .draw-animation { height: 185px; }
  .lottery-machine { transform: scale(.78); }
  [data-draw-state="mixing"] .lottery-machine { animation: none; }
  [data-draw-state="choosing"] .draw-animation { height: 140px; }
  [data-draw-state="choosing"] .lottery-machine { transform: scale(.6); }
  .draw-choices { padding-top: 16px; }
  .draw-steps { font-size: .65rem; }
  .draw-steps li { gap: 4px; }
  .draw-steps li > span:first-child { width: 19px; height: 19px; }
  .prize-preview { margin-bottom: 14px; }
}
