:root {
  --bg: #070709;
  --panel: #111115;
  --panel-2: #19191f;
  --paper: #f5f5f2;
  --ink: #0a0a0d;
  --muted: #aaaab3;
  --line: #2b2b33;
  --red: #e9002b;
  --red-dark: #92001a;
  --green: #25d07d;
  --radius: 20px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: white; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background:
  radial-gradient(circle at 84% 7%, rgba(233,0,43,.22), transparent 29rem),
  linear-gradient(135deg, transparent 0 58%, rgba(255,255,255,.022) 58% 60%, transparent 60%), var(--bg); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.page-shell { width: min(920px, 100%); margin: 0 auto; padding: 22px 18px 40px; }
.brand-header { display: flex; align-items: center; gap: 13px; margin-bottom: 42px; }
.language-switch { display: flex; gap: 4px; margin-left: auto; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: #111115; }
.language-switch a { padding: 7px 9px; border-radius: 7px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 900; }
.language-switch a.is-active { color: white; background: var(--red); }
.brand-header.compact { margin-bottom: 24px; }
.brand-logo { width: clamp(125px, 28vw, 170px); height: auto; object-fit: contain; }
.brand-copy { display: flex; flex-direction: column; gap: 3px; }
.brand-copy strong { font-size: clamp(18px, 4vw, 26px); letter-spacing: -.035em; }
.eyebrow { color: var(--red); font-size: 11px; font-weight: 900; letter-spacing: .15em; }

.hero { padding: clamp(25px, 6vw, 54px); border: 1px solid var(--line); border-radius: 28px; background:
  linear-gradient(125deg, rgba(255,255,255,.06), transparent 40%),
  linear-gradient(160deg, #18181e, #0e0e12); overflow: hidden; position: relative; }
.hero::after { content: ""; position: absolute; z-index: 0; width: 280px; height: 280px; border: 55px solid var(--red); border-radius: 50%; right: -250px; top: -170px; opacity: .16; pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.season-pill { display: inline-block; padding: 7px 10px; border-radius: 100px; color: var(--ink); background: white; font-size: 11px; font-weight: 900; letter-spacing: .1em; }
.hero h1 { max-width: 680px; margin: 18px 0 12px; font-size: clamp(38px, 9vw, 76px); line-height: .92; letter-spacing: -.065em; text-transform: uppercase; }
.hero p { max-width: 620px; color: #c9c9ce; font-size: clamp(16px, 3vw, 20px); line-height: 1.5; }
.primary-button, .secondary-button { display: inline-flex; justify-content: center; align-items: center; border: 0; border-radius: 12px; cursor: pointer; text-decoration: none; font-weight: 900; letter-spacing: .04em; }
.primary-button { min-height: 54px; padding: 0 24px; background: var(--red); color: white; box-shadow: 0 12px 28px rgba(233,0,43,.25); }
.primary-button:hover { background: #ff1238; transform: translateY(-1px); }
.primary-button:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.secondary-button { min-height: 42px; padding: 0 16px; color: white; background: #292932; }

.vote-form { padding-top: 25px; }
.progress-wrap { position: sticky; top: 0; z-index: 20; margin: 0 -18px 26px; padding: 12px 18px 15px; background: rgba(7,7,9,.93); backdrop-filter: blur(16px); }
.progress-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 800; margin-bottom: 7px; }
.progress-track { height: 5px; border-radius: 10px; overflow: hidden; background: #27272e; }
.progress-bar { width: 0; height: 100%; border-radius: inherit; background: var(--red); transition: width .25s ease; }
.vote-section { margin: 48px 0 70px; }
.section-heading { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.section-title-copy { min-width: 0; }
.section-total { display: flex; flex-direction: column; align-items: flex-end; margin-left: auto; padding: 8px 11px; border: 1px solid var(--line); border-radius: 11px; background: #131318; }
.section-total span { color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.section-total strong { margin-top: 2px; color: white; font-size: 15px; }
.section-number { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--red); font-size: 12px; font-weight: 900; }
.section-heading h2 { margin: 0; font-size: 25px; letter-spacing: -.04em; }
.section-heading p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

.score-card, .choice-card { position: relative; display: grid; grid-template-columns: 34px 64px 1fr 54px; align-items: center; gap: 12px; padding: 18px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(17,17,21,.94); transition: border-color .2s ease, background .2s ease; }
.score-card.is-complete, .choice-card.is-complete { border-color: rgba(233,0,43,.65); background: #151419; }
.player-index { color: #696972; font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.player-photo { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; object-position: center top; background: #25252c; }
.player-photo.is-placeholder { padding: 14px; object-fit: contain; opacity: .45; }
.player-copy h3, .choice-card h3 { margin: 0; font-size: clamp(18px, 4vw, 23px); letter-spacing: -.035em; }
.player-copy p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.transfer-fee { display: inline-block; margin-top: 6px; padding: 4px 7px; border-radius: 7px; background: rgba(233,0,43,.12); color: #ff6b85; font-size: 10px; letter-spacing: .05em; }
.transfer-terms { display: block; margin-top: 6px; color: #9d9da6; font-size: 9px; font-weight: 700; line-height: 1.3; }
.score-value { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--paper); color: var(--ink); font-size: 25px; font-weight: 950; }
.score-options { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(11, minmax(34px, 1fr)); gap: 5px; padding-top: 8px; overflow-x: auto; scrollbar-width: none; }
.score-button { min-width: 34px; height: 38px; border: 1px solid #35353e; border-radius: 9px; background: #202027; color: #d8d8dd; font-size: 13px; font-weight: 850; cursor: pointer; }
.score-button:hover { border-color: #73737e; }
.score-button.is-selected { border-color: var(--red); background: var(--red); color: white; }
.market-card { grid-template-columns: 1fr 54px; }
.choice-card { display: block; padding: 20px; }
.choice-card h3 { margin-bottom: 16px; }
.choice-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.choice-options button { min-height: 46px; padding: 8px; border: 1px solid #35353e; border-radius: 11px; background: #202027; color: white; font-weight: 800; cursor: pointer; }
.choice-options button.is-selected { border-color: var(--red); background: var(--red); }
.submit-wrap { text-align: center; padding: 0 0 40px; }
.submit-button { width: min(100%, 480px); }
.privacy-note { color: #777782; font-size: 11px; line-height: 1.5; }
.form-error { min-height: 24px; color: #ff8298; font-size: 14px; font-weight: 750; }
.closed-card, .loading-card { padding: 45px 25px; border: 1px solid var(--line); border-radius: 24px; text-align: center; background: var(--panel); }
.closed-card h1 { font-size: clamp(31px, 7vw, 55px); letter-spacing: -.055em; }
.closed-card p { color: var(--muted); }
.status-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--red); }
footer { margin-top: 50px; color: #62626b; text-align: center; font-size: 10px; letter-spacing: .12em; }

.results-root { min-height: 450px; }
.result-hero { display: grid; grid-template-columns: repeat(3, 1fr) .75fr; gap: 14px; margin-bottom: 14px; }
.market-score-panel, .participant-panel, .result-panel { border-radius: 22px; background: var(--paper); color: var(--ink); }
.market-score-panel { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; padding: 28px; }
.market-score-panel .label { font-size: 12px; font-weight: 900; letter-spacing: .1em; }
.market-score-panel .big-score { display: block; margin-top: 8px; font-size: clamp(72px, 16vw, 130px); line-height: .92; font-weight: 950; letter-spacing: -.09em; }
.market-score-panel .out-of { display: block; margin-top: 12px; color: #777; font-weight: 900; line-height: 1.2; }
.deco-score-panel { background: #deded9; }
.masia-score-panel { background: #f0c400; }
.participant-panel { display: flex; flex-direction: column; justify-content: flex-end; padding: 25px; background: var(--red); color: white; }
.participant-panel strong { font-size: clamp(35px, 8vw, 65px); letter-spacing: -.06em; }
.participant-panel span { font-weight: 900; letter-spacing: .08em; font-size: 11px; }
.result-panel { padding: 22px; margin-bottom: 14px; }
.result-panel.dark { background: var(--panel); color: white; border: 1px solid var(--line); }
.result-panel h2 { margin: 0 0 16px; font-size: 22px; letter-spacing: -.04em; }
.result-panel-heading { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; margin-bottom: 16px; }
.result-panel-heading h2 { margin: 0; }
.result-panel-heading > span { color: #666; font-size: 11px; font-weight: 800; text-align: right; }
.dark .result-panel-heading > span { color: var(--muted); }
.result-panel-heading strong { color: var(--red); }
.ranking-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 11px 0; border-top: 1px solid rgba(120,120,130,.22); }
.ranking-row:first-of-type { border-top: 0; }
.ranking-row .rank { color: var(--red); font-size: 12px; font-weight: 950; }
.ranking-row .name { font-weight: 800; }
.ranking-row .name small { display: block; margin-top: 3px; color: #777; font-size: 10px; font-weight: 650; }
.dark .ranking-row .name small { color: var(--muted); }
.ranking-row .average { min-width: 46px; padding: 6px 8px; border-radius: 8px; background: var(--ink); color: white; text-align: center; font-weight: 950; }
.dark .ranking-row .average { background: var(--paper); color: var(--ink); }
.choice-result { margin-top: 12px; }
.choice-label { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 13px; font-weight: 800; }
.choice-track { height: 9px; overflow: hidden; border-radius: 99px; background: #303038; }
.choice-fill { height: 100%; border-radius: inherit; background: var(--red); }
.waiting-card { padding: 55px 25px; text-align: center; border: 1px solid var(--line); border-radius: 24px; background: var(--panel); }
.waiting-card h1 { font-size: clamp(30px, 7vw, 56px); margin: 10px 0; letter-spacing: -.055em; }
.waiting-card p { color: var(--muted); }
.loader { display: inline-block; width: 30px; height: 30px; border: 3px solid #333; border-top-color: var(--red); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.control-body { background: #0c0c10; }
.control-shell { width: min(1300px, 100%); margin: auto; padding: 30px; }
.control-header { display: flex; justify-content: space-between; align-items: end; margin-bottom: 25px; }
.control-header h1 { margin: 3px 0 0; font-size: 34px; letter-spacing: -.04em; }
.live-count { display: flex; align-items: baseline; gap: 9px; }
.live-count strong { font-size: 39px; color: var(--red); }
.live-count span { color: var(--muted); }
.control-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.control-card { grid-column: span 6; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #15151a; }
.control-card h2 { margin: 0 0 18px; font-size: 19px; }
.qr-card { grid-column: span 4; }
.ranking-card { grid-column: span 8; }
.danger-card { grid-column: span 12; }
.roster-card { grid-column: span 12; }
.roster-heading, .roster-group-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.roster-heading h2 { margin: 4px 0 0; }
.roster-count { padding: 8px 11px; border-radius: 999px; background: rgba(233,0,43,.14); color: #ff6b85; font-size: 12px; font-weight: 900; }
.roster-lock-copy { margin: 12px 0 0; }
.roster-lock-copy.is-ready { color: var(--green); }
.roster-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.roster-actions button { min-height: 38px; padding: 0 13px; border: 1px solid #383841; border-radius: 9px; background: #25252c; color: white; font-size: 12px; font-weight: 850; cursor: pointer; }
.roster-actions button:hover { border-color: #686873; }
.roster-actions .roster-save { margin-left: auto; border-color: var(--red); background: var(--red); }
.roster-actions button:disabled { opacity: .35; cursor: not-allowed; }
.roster-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.roster-group { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #101014; }
.roster-group-title { margin-bottom: 7px; padding: 0 4px 8px; border-bottom: 1px solid var(--line); }
.roster-group-title h3 { margin: 0; font-size: 15px; }
.roster-group-title span { color: var(--muted); font-size: 11px; font-weight: 800; }
.roster-list { display: grid; gap: 4px; }
.roster-item { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto 42px; align-items: center; gap: 10px; min-height: 58px; padding: 7px; border-radius: 10px; cursor: pointer; transition: background .18s ease, opacity .18s ease; }
.roster-item:hover { background: #1b1b21; }
.roster-item:has(input:not(:checked)) { opacity: .48; }
.roster-item img { width: 42px; height: 42px; border-radius: 9px; object-fit: cover; object-position: center top; background: #25252c; }
.roster-item-copy { min-width: 0; }
.roster-item-copy strong, .roster-item-copy small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.roster-item-copy strong { font-size: 13px; }
.roster-item-copy small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.squad-badge { padding: 4px 7px; border-radius: 99px; background: #2b2b33; color: #d7d7dc; font-size: 9px; font-weight: 850; }
.squad-badge.is-atletic { background: rgba(233,0,43,.13); color: #ff7892; }
.roster-item input { position: absolute; opacity: 0; }
.roster-item i { position: relative; width: 38px; height: 22px; border-radius: 40px; background: #393942; }
.roster-item i::after { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; border-radius: 50%; background: white; transition: transform .18s ease; }
.roster-item input:checked + i { background: var(--red); }
.roster-item input:checked + i::after { transform: translateX(16px); }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 13px 0; border-top: 1px solid var(--line); cursor: pointer; }
.toggle-row:first-of-type { border-top: 0; }
.toggle-row span { display: flex; flex-direction: column; }
.toggle-row small, .field-row small, .control-hint { color: var(--muted); }
.toggle-row input { position: absolute; opacity: 0; }
.toggle-row i { position: relative; flex: 0 0 48px; width: 48px; height: 27px; border-radius: 50px; background: #393942; transition: .2s; }
.toggle-row i::after { content: ""; position: absolute; width: 21px; height: 21px; border-radius: 50%; background: white; left: 3px; top: 3px; transition: .2s; }
.toggle-row input:checked + i { background: var(--red); }
.toggle-row input:checked + i::after { transform: translateX(21px); }
.field-row { display: grid; grid-template-columns: 1fr 90px; gap: 7px; align-items: center; padding-top: 16px; border-top: 1px solid var(--line); }
.field-row input { width: 90px; padding: 10px; border: 1px solid #3b3b45; border-radius: 8px; background: #09090c; color: white; }
.field-row small { grid-column: 1 / -1; }
.scene-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.scene-buttons button { min-height: 43px; border: 1px solid #383841; border-radius: 10px; background: #25252c; color: white; cursor: pointer; }
.scene-buttons button.is-active { border-color: var(--red); background: var(--red); font-weight: 900; }
.copy-field { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 18px; }
.copy-field span { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.copy-field code, .qr-card code { padding: 12px; overflow: hidden; border-radius: 8px; background: #08080b; color: #ccc; white-space: nowrap; text-overflow: ellipsis; }
.copy-field button { border: 0; border-radius: 8px; background: white; color: black; font-weight: 800; cursor: pointer; }
.qr-card { text-align: center; }
.qr-card img { display: block; width: min(220px, 100%); margin: 0 auto 14px; border-radius: 13px; }
.qr-card code { display: block; margin-bottom: 10px; }
.quick-results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 16px; }
.quick-stat { padding: 15px; border-radius: 12px; background: #222229; }
.quick-stat span { display: block; color: var(--muted); font-size: 11px; }
.quick-stat strong { display: block; margin-top: 4px; font-size: 22px; }
.danger-card p { color: var(--muted); }
.danger-button { padding: 11px 15px; border: 1px solid #742237; border-radius: 9px; background: transparent; color: #ff7892; cursor: pointer; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 25px); padding: 12px 18px; border-radius: 10px; background: white; color: black; font-weight: 800; opacity: 0; pointer-events: none; transition: .25s; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 720px) {
  .brand-header { margin-bottom: 24px; }
  .section-heading { align-items: flex-start; flex-wrap: wrap; }
  .section-total { width: 100%; margin-left: 56px; align-items: flex-start; }
  .hero { border-radius: 22px; }
  .hero::after { width: 220px; height: 220px; border-width: 44px; right: -205px; top: -145px; opacity: .13; }
  .score-card { grid-template-columns: 34px 1fr 48px; padding: 14px 12px; }
  .score-card.market-card { grid-template-columns: minmax(0, 1fr) 48px; align-items: start; }
  .market-card .player-copy { min-width: 0; padding: 3px 4px 0 0; }
  .market-card .player-copy h3 { font-size: clamp(19px, 5.4vw, 24px); line-height: 1.12; overflow-wrap: normal; }
  .market-card .score-value { align-self: start; }
  .score-card:not(.market-card) { grid-template-columns: 24px 66px minmax(0, 1fr) 48px; gap: 10px; }
  .score-card:not(.market-card) .player-copy h3 { font-size: 20px; line-height: 1.1; }
  .score-card:not(.market-card) .player-copy p { font-size: 14px; line-height: 1.3; }
  .score-card:not(.market-card) .transfer-fee { font-size: 11px; }
  .score-card:not(.market-card) .transfer-terms { font-size: 10px; }
  .player-photo { width: 66px; height: 66px; border-radius: 14px; }
  .score-value { width: 46px; height: 46px; }
  .score-options { gap: 4px; margin: 0 -3px; }
  .score-options { grid-template-columns: repeat(6, minmax(0, 1fr)); overflow: visible; }
  .score-button { min-width: 0; }
  .result-hero { grid-template-columns: 1fr 1fr; gap: 10px; }
  .market-score-panel { min-height: 178px; padding: 20px; }
  .market-score-panel .label { max-width: 100%; font-size: 10px; line-height: 1.35; }
  .market-score-panel .big-score { margin-top: auto; font-size: clamp(60px, 18vw, 82px); line-height: .9; }
  .market-score-panel .out-of { margin-top: 8px; font-size: 13px; }
  .deco-score-panel { grid-column: 1 / -1; min-height: 160px; }
  .participant-panel { grid-column: 1 / -1; }
  .control-shell { padding: 18px; }
  .control-header { align-items: flex-start; gap: 16px; }
  .control-header h1 { font-size: 26px; }
  .control-card, .qr-card, .ranking-card, .danger-card { grid-column: span 12; }
  .roster-groups { grid-template-columns: 1fr; }
  .roster-actions .roster-save { margin-left: 0; }
  .quick-results { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .page-shell { padding-inline: 12px; }
  .brand-header.compact { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
  .brand-header.compact .brand-logo { width: 112px; }
  .brand-header.compact .brand-copy { grid-column: 1 / -1; grid-row: 2; }
  .brand-header.compact .language-switch { grid-column: 2; grid-row: 1; }
  .result-hero { grid-template-columns: 1fr; }
  .deco-score-panel, .participant-panel { grid-column: 1; }
  .market-score-panel { min-height: 155px; }
  .market-score-panel .big-score { font-size: 68px; }
  .score-card:not(.market-card) { grid-template-columns: 20px 62px minmax(0, 1fr) 46px; gap: 8px; }
  .score-card:not(.market-card) .player-copy h3 { font-size: 19px; }
  .score-card:not(.market-card) .player-copy p { font-size: 13px; }
  .player-photo { width: 62px; height: 62px; }
  .result-panel-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .result-panel-heading > span { text-align: left; }
}
