:root {
    color-scheme: dark;
    --bg: #130c24;
    --card: #221636;
    --line: #4b3465;
    --text: #fff8ff;
    --muted: #d5c5e4;
    --accent: #ffce82;
    --accent-ink: #26142c;
    --secondary: #392455;
}
.theme-neon { --accent: #72efc3; }
.theme-ocean { --accent: #93d1ff; }
.theme-ruby { --accent: #ff9fbc; }
* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(ellipse at 70% -5%, #382059 0, transparent 58rem), var(--bg);
    color: var(--text);
    font-family: system-ui, sans-serif;
}
header {
    padding: 16px max(20px, calc((100vw - 1120px) / 2));
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px 24px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--line);
    background: #160d28;
}
a { color: inherit; text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 23px; font-weight: 850; white-space: nowrap; }
.brand b, .accent { color: var(--accent); }
nav { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; }
nav a { padding: 9px 10px; color: var(--muted); font-size: 14px; font-weight: 650; border-radius: 8px; }
nav a:hover { color: var(--text); background: var(--secondary); }
nav .nav-cta { color: var(--accent); background: var(--secondary); }
main { max-width: 1160px; margin: 32px auto; padding: 0 20px; min-height: 65vh; }
h1, h2, h3 { line-height: 1.13; overflow-wrap: anywhere; }
h1 { font-size: clamp(2rem, 5vw, 3.15rem); margin: 0 0 14px; letter-spacing: -.035em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); margin: 24px 0 16px; letter-spacing: -.025em; }
p { color: var(--muted); line-height: 1.55; }
.badge, .pill {
    display: inline-block;
    border-radius: 999px;
    padding: 6px 11px;
    background: var(--secondary);
    color: var(--text);
    font-size: 12px;
    font-weight: 650;
}
.badge { color: var(--accent); margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; }
#salas { scroll-margin-top: 16px; }
.card { min-width: 0; padding: clamp(16px, 3vw, 26px); border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.card h2:first-child, .card h3 { margin-top: 0; }
.card p { overflow-wrap: anywhere; }
.room-tile { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.room-art { min-height: 110px; display: flex; align-items: center; justify-content: center; gap: 7px; }
.tile-bingo .room-art { background: radial-gradient(ellipse at bottom, #9a4d9d, #512f7e); }
.tile-milhar .room-art { background: radial-gradient(ellipse at bottom, #346f9e, #332867); }
.room-art .ball:nth-child(2) { transform: translateY(-8px); }
.room-art .ball:last-child { transform: translateY(6px); }
.digit {
    display: grid; place-items: center; width: 36px; height: 47px; border-radius: 8px;
    background: linear-gradient(#d6fbff, #a8cdfa); color: #24204c; font-weight: 850; font-size: 23px;
    box-shadow: 0 5px 0 #25204e, 0 8px 14px #130c2470;
}
.room-copy { flex: 1; display: flex; flex-direction: column; align-items: flex-start; padding: 21px; }
.room-copy h3 { margin: 12px 0 0; font-size: 1.25rem; }
.room-copy p { margin: 8px 0 16px; }
.room-copy .btn { margin-top: auto; }
.btn, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border: 1px solid transparent;
    background: var(--accent);
    color: var(--accent-ink);
    padding: 10px 16px;
    border-radius: 10px;
    margin-top: 8px;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    text-align: center;
    cursor: pointer;
}
.btn.secondary, button.secondary { background: var(--secondary); color: var(--text); border-color: var(--line); }
.btn:hover, button:not(:disabled):hover { filter: brightness(1.13); }
button:disabled { opacity: .55; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
input, select, textarea {
    display: block;
    width: 100%;
    margin: 8px 0 18px;
    padding: 12px;
    color: var(--text);
    background: #160f28;
    border: 1px solid #6b507e;
    border-radius: 10px;
    font: inherit;
    font-size: 16px;
}
input[type=hidden] { display: none; }
textarea { resize: vertical; }
img { max-width: 100%; }
label { font-weight: 650; font-size: 14px; }
.form { max-width: 480px; margin-inline: auto; }
.notice { background: #224e48; padding: 14px; border-radius: 12px; margin-bottom: 20px; }
.balls { display: flex; gap: 9px; flex-wrap: wrap; margin: 20px 0; }
.ball {
    display: grid; place-items: center; flex: 0 0 46px; width: 46px; height: 46px;
    border-radius: 50%; background: radial-gradient(circle at 32% 25%, #fff8dc, var(--accent) 50%, #ed9779);
    color: var(--accent-ink); font-weight: 850; box-shadow: 0 4px 12px #0a061f66;
}
.ball:nth-child(3n+2) { background: radial-gradient(circle at 32% 25%, #f6d8ff, #c7a3fd 53%, #a47ce9); }
.ball:nth-child(3n) { background: radial-gradient(circle at 32% 25%, #d6fff9, #8ce9dc 53%, #5dc6be); }
.number { font-size: clamp(2.8rem, 11vw, 6rem); font-weight: 850; letter-spacing: .08em; color: var(--accent); }
.card-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; max-width: 350px; }
.cell { padding: 9px 2px; background: var(--secondary); text-align: center; border-radius: 6px; font-weight: 750; }
.cell.hit { background: var(--accent); color: var(--accent-ink); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
td, th { text-align: left; padding: 11px; border-bottom: 1px solid var(--line); }
th { background: var(--secondary); }
.scroll { overflow-x: auto; }
footer { border-top: 1px solid var(--line); color: var(--muted); text-align: center; padding: 24px 18px; font-size: 12px; }
.small { font-size: 12px; }
@media (max-width: 680px) {
    main { margin-top: 20px; padding-inline: 14px; }
    header { padding-inline: 14px; gap: 8px 12px; }
    nav a { padding-inline: 8px; }
}

[hidden] { display: none !important; }
.brand-mark { object-fit: contain; }
.home-raffle {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 20px;
    background: linear-gradient(115deg, #4a225f, #261937 75%);
}
.home-raffle h2, .home-raffle p { margin: 0; }
.home-raffle p { margin-top: 5px; }
.home-raffle .btn { margin: 0 0 0 auto; }
.section-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0 16px; }
.category-filters { display: flex; gap: 6px; margin-bottom: 12px; }
.category-filters button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.raffle-panel { max-width: 820px; margin-inline: auto; }
.raffle-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.raffle-logo { width: clamp(54px, 14vw, 90px); height: auto; flex-shrink: 0; }
.raffle-meta { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 14px; margin: 18px 0; }
.raffle-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; }
.raffle-option { position: relative; cursor: pointer; }
.raffle-option input { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; opacity: 0; }
.raffle-option span, .raffle-number {
    display: grid;
    place-items: center;
    min-height: 42px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #382753;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    font-size: 14px;
    font-weight: 750;
}
.raffle-option:hover span { border-color: var(--accent); }
.raffle-option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.raffle-option input:checked + span, .raffle-number.is-winner { background: var(--accent); color: var(--accent-ink); }
.raffle-number.is-taken { background: #211831; color: #b5a3c5; text-decoration: line-through; }
.raffle-number.is-mine { background: #206254; }
.raffle-result strong { display: inline-block; margin-left: 8px; color: var(--accent); font-size: 1.4em; }
.raffle-form > button { margin-top: 18px; }
.raffle-admin { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--line); }
.raffle-admin summary { cursor: pointer; }
@media (max-width: 590px) {
    .raffle-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .home-raffle .btn { margin-left: 0; }
}
.winners-grid { align-items: start; margin-top: 22px; }
.winner-card h2 { margin: 0 0 12px; font-size: clamp(1.25rem, 3vw, 1.6rem); }
.bingo-results { border-top: 3px solid #c8a4ff; }
.raffle-results { border-top: 3px solid #ffce82; }
@media (max-width: 620px) {
    .winners-grid { grid-template-columns: 1fr; }
}
.winner-list { padding: 0; margin: 0; list-style: none; }
.winner-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    color: var(--muted);
    font-size: 14px;
    overflow-wrap: anywhere;
}
.winner-list li + li { border-top: 1px solid var(--line); }
.winner-list strong { color: var(--text); font-size: 16px; }

.home-carousel {
    overflow: hidden;
    border: 1px solid #724c91;
    border-radius: 26px;
    margin-bottom: 24px;
    background: #20122f;
    box-shadow: 0 20px 55px #09051466;
}
.promo {
    --promo-bg: #251037;
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    min-height: 466px;
    background: var(--promo-bg);
}
.promo-bingo { --promo-bg: #221041; }
.promo-rifa { --promo-bg: #0d3039; }
.promo-art { position: absolute; inset: 0; z-index: -2; }
.promo-art img { width: 100%; height: 100%; object-fit: contain; object-position: right center; display: block; }
.promo::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, var(--promo-bg) 12%, var(--promo-bg) 27%, transparent 72%);
}
.promo-copy { width: min(100%, 510px); padding: 38px clamp(24px, 5vw, 62px); }
.promo-copy h1, .promo-copy h2 {
    max-width: 10ch;
    margin: 0;
    font-size: clamp(2.65rem, 6.25vw, 5.25rem);
    line-height: .98;
    letter-spacing: -.055em;
    text-wrap: balance;
}
.promo-copy p { max-width: 34ch; color: #fff3ff; margin-bottom: 12px; }
.promo-controls { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 7px; padding: 9px 12px; }
.promo-controls button { min-height: 36px; margin: 0; padding: 7px 11px; }
.promo-dots { display: flex; gap: 5px; }
.promo-dots [aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 680px) {
    .home-carousel { border-radius: 18px; }
    .promo { display: grid; grid-template-rows: auto 1fr; min-height: 0; align-items: stretch; }
    .promo::after { display: none; }
    .promo-art { position: relative; aspect-ratio: 16 / 11; overflow: hidden; z-index: 0; }
    .promo-art img { object-fit: cover; object-position: center 55%; }
    .promo-art::after {
        content: "";
        position: absolute;
        inset: 65% 0 0;
        background: linear-gradient(transparent, var(--promo-bg));
    }
    .promo-copy { width: 100%; min-height: 220px; padding: 8px 18px 16px; display: flex; flex-direction: column; align-items: flex-start; }
    .promo-copy .badge { margin-bottom: 8px; }
    .promo-copy h1, .promo-copy h2 { max-width: none; font-size: clamp(1.8rem, 7vw, 2.85rem); }
    .promo-copy p { margin: 9px 0 12px; font-size: .92rem; }
    .promo-copy .btn { margin-top: auto; width: 100%; min-height: 44px; }
    .promo-controls { gap: 5px; padding: 6px; }
    .promo-controls button { min-width: 40px; min-height: 44px; padding-inline: 8px; }
}

.brand-mark, .carousel-brand, .feature-brand, .raffle-logo {
    display: block;
    height: auto;
    border-radius: 8px;
}
.brand-mark { width: clamp(160px, 24vw, 234px); }
.home-carousel { position: relative; }
.carousel-brand {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 1;
    width: clamp(94px, 15vw, 180px);
    pointer-events: none;
}
.raffle-logo { width: clamp(105px, 19vw, 150px); }
@media (max-width: 680px) {
    .carousel-brand { top: 8px; right: 8px; }
}

.bingo-cards {
    display: flex;
    justify-content: center;
    gap: clamp(6px, 2vw, 16px);
    max-width: 900px;
    margin-inline: auto;
}
.bingo-card {
    flex: 1 1 0;
    width: 100%;
    max-width: 280px;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: clamp(4px, 1.5vw, 12px);
}
.bingo-card h3 { margin: 4px 0 8px; }
.bingo-card .card-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(2px, .7vw, 5px);
}
.bingo-card .cell {
    font-size: clamp(.7rem, 2.8vw, 1rem);
    padding-inline: 0;
}

.bingo-card .card-grid { margin-inline: auto; }
@media (max-width: 680px) {
    .bingo-cards { flex-direction: column; align-items: center; }
    .bingo-card { flex: none; max-width: 350px; }
}
