:root {
  color-scheme: dark;
  --bg: #191d2b;
  --topbar: #1d2332;
  --panel: #282f40;
  --inset: #202737;
  --line: #404b60;
  --row-alt: #252c3d;
  --odd-bg: #344054;
  --odd-line: #536179;
  --text: #f5f2ed;
  --muted: #bdc5d2;
  --accent: #ffae7d;
  --accent-hover: #ffc59f;
  --green: #8be2c8;
  --red: #ff9da9;
  --focus: #ffce9b;
}
* { box-sizing: border-box; }
html { min-height: 100%; scrollbar-color: var(--line) var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse 850px 520px at 88% -170px, #314356 0%, transparent 75%), var(--bg); color: var(--text); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .52; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--bg); }
input, select, textarea { accent-color: var(--accent); caret-color: var(--accent); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }

.topbar { height: 66px; border-bottom: 1px solid var(--line); background: var(--topbar); }
.topbar-inner { max-width: 1320px; height: 100%; margin: auto; padding: 0 26px; display: flex; align-items: center; gap: 40px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--accent); font-size: 22px; font-weight: 850; letter-spacing: -.045em; white-space: nowrap; }
.brand-mark { position: relative; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; border: 2px solid var(--accent); border-radius: 6px; font-size: 12px; letter-spacing: -.14em; }
.brand-mark::after { content: ""; position: absolute; inset: 3px auto 3px -10px; width: 5px; background: var(--accent); transform: skewX(-18deg); animation: ticket-scan 560ms 90ms both cubic-bezier(.16, 1, .3, 1); pointer-events: none; }
.brand-mark span { margin: 0 2px; color: var(--text); }
.main-nav { display: flex; align-items: stretch; align-self: stretch; gap: 24px; margin-left: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a { display: inline-flex; align-items: center; border-bottom: 2px solid transparent; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; transition: color 150ms ease, border-color 150ms ease; }
.main-nav a:hover, .main-nav a.active { color: var(--text); }
.main-nav a.active { border-bottom-color: var(--accent); }
.account-strip { display: flex; align-items: center; gap: 13px; padding-left: 20px; border-left: 1px solid var(--line); font-size: 12px; white-space: nowrap; }
.account-balance { padding: 6px 9px; background: var(--inset); border-radius: 5px; font-variant-numeric: tabular-nums; }
.account-strip form { margin: 0; }
.sign-in { color: var(--muted); font-weight: 650; }
.sign-in:hover { color: var(--text); }
.sign-out { border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.sign-out:hover { color: var(--accent); }
.account-entry { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 7px 13px; border-radius: 7px; background: var(--accent); color: #28202a; font-weight: 750; transition: background-color 150ms ease, transform 150ms cubic-bezier(.16, 1, .3, 1); }
.account-entry:hover, .account-entry.active { background: var(--accent-hover); }
.account-entry:active { transform: scale(.975); }
.service-notice { border-bottom: 1px solid #536179; background: #253246; }
.service-notice-inner { max-width: 1320px; min-height: 49px; margin: auto; padding: 10px 26px; display: flex; align-items: center; gap: 18px; }
.service-notice-label { flex: none; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .09em; }
.service-notice p { margin: 0; color: var(--text); font-size: 12px; line-height: 1.45; }

.page-layout { max-width: 1320px; margin: auto; padding: 30px 26px 64px; }
.narrow-page { max-width: 1100px; }
.page-heading { min-height: 80px; display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; }
.page-heading h1 { margin: 2px 0 0; font-size: 29px; line-height: 1.15; font-weight: 720; letter-spacing: -.045em; }
.landing-heading { min-height: 0; margin-bottom: 20px; align-items: center; }
.landing-heading h1 { font-size: clamp(30px, 3.2vw, 40px); }
.landing-heading p { max-width: 65ch; margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.section-kicker, .panel-overline { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.round-label { display: inline-flex; align-items: center; gap: 8px; margin-top: 7px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.round-label i { width: 7px; height: 7px; background: var(--green); border-radius: 50%; }
.panel { border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.panel h2 { margin: 12px 0 9px; font-size: 20px; line-height: 1.25; letter-spacing: -.025em; }
.panel p { color: var(--muted); }
.primary, .button { min-height: 45px; display: inline-flex; align-items: center; justify-content: center; padding: 10px 17px; border: 0; border-radius: 8px; color: #28202a; background: var(--accent); font-weight: 750; text-align: center; transition: background-color 150ms ease, transform 150ms cubic-bezier(.16, 1, .3, 1); }
.primary:hover:enabled, .button:hover { background: var(--accent-hover); }
.primary:active:enabled, .button:active { transform: scale(.975); }
.button.secondary { color: var(--text); background: #374358; border: 1px solid #5c6a80; }
.button.secondary:hover { background: #45546a; }

.auth-layout { min-height: calc(100vh - 66px); display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: min(100%, 390px); padding: 31px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 16px 36px #0f132249; }
.auth-card h1 { margin: 11px 0 4px; font-size: 25px; letter-spacing: -.04em; }
.auth-intro { margin: 0 0 22px; color: var(--muted); font-size: 12px; }
.auth-switch { margin: 20px 0 0; color: var(--muted); font-size: 12px; }
.auth-switch a { margin-left: 4px; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.stacked-form { display: flex; flex-direction: column; }
.stacked-form label { margin: 12px 0 6px; color: var(--muted); font-size: 11px; font-weight: 600; }
.stacked-form input, .stacked-form select, .stacked-form textarea { width: 100%; min-height: 44px; padding: 10px 11px; border: 1px solid #566277; border-radius: 5px; outline: 0; color: var(--text); background: var(--inset); transition: border-color 150ms ease, background-color 150ms ease; }
.stacked-form textarea { resize: vertical; line-height: 1.45; font-family: ui-monospace, Consolas, monospace; font-size: 11px; }
.stacked-form input:focus, .stacked-form select:focus, .stacked-form textarea:focus { border-color: var(--accent); }
.stacked-form input::placeholder, .stacked-form textarea::placeholder { color: #aeb8c8; }
.stacked-form .primary { width: 100%; margin-top: 21px; }
.notice { padding: 10px 12px; border-radius: 6px; font-size: 12px; }
.notice.error { color: var(--red); background: #49333d; }
.form-message { min-height: 19px; margin: 12px 0 0; font-size: 11px; }
.form-message.good { color: var(--green); }
.form-message.bad { color: var(--red); }
.inline-flag { display: block; margin-top: 10px; padding: 10px 12px; border: 1px solid #559a85; border-radius: 6px; background: #1c403e; color: var(--green); font-family: ui-monospace, Consolas, monospace; overflow-wrap: anywhere; animation: ticket-reveal 320ms cubic-bezier(.16, 1, .3, 1) both; }

.sport-nav { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; overflow-x: auto; }
.sport-nav a { display: inline-flex; align-items: center; gap: 12px; min-height: 37px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 7px; background: var(--inset); font-size: 12px; font-weight: 700; white-space: nowrap; transition: border-color 150ms ease, background-color 150ms ease; }
.sport-nav a:hover, .sport-nav a:focus-visible { border-color: var(--accent); background: var(--panel); }
.sport-nav span { color: var(--accent); font-variant-numeric: tabular-nums; }
.sports-layout { display: grid; grid-template-columns: minmax(0, 1fr) 285px; gap: 14px; align-items: start; }
.fixture-stack { display: grid; gap: 16px; min-width: 0; }
.fixture-board { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.fixture-board:target { border-color: var(--accent); }
.fixture-board { scroll-margin-top: 20px; }
.sport-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 18px 12px; }
.sport-head h2 { margin: 0; font-size: 21px; line-height: 1.2; letter-spacing: -.025em; }
.sport-head span { color: var(--muted); font-size: 11px; }
.sport-head > div > span { display: inline-block; margin-top: 3px; }
.sport-head .sport-head-status { color: var(--green); }
.board-head { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 72px); gap: 8px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; text-align: center; text-transform: uppercase; letter-spacing: .09em; }
.board-head.two-way { grid-template-columns: minmax(0, 1fr) repeat(2, 72px); }
.board-head span:first-child { text-align: left; }
.fixture-row { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 72px); gap: 8px; align-items: center; min-height: 110px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.fixture-row.two-way { grid-template-columns: minmax(0, 1fr) repeat(2, 72px); }
.fixture-row:nth-child(odd) { background: var(--row-alt); }
.fixture-main { min-width: 0; }
.fixture-meta { display: flex; gap: 8px; margin-bottom: 8px; color: var(--muted); font-size: 11px; }
.fixture-meta b { color: var(--accent); font-weight: 700; }
.fixture-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; letter-spacing: -.025em; }
.fixture-main strong span { margin: 0 3px; color: var(--muted); font-size: 12px; font-weight: 400; }
.odd-box { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 56px; border: 1px solid var(--odd-line); border-radius: 6px; background: var(--odd-bg); font-variant-numeric: tabular-nums; }
.odd-box small { color: var(--muted); font-size: 9px; }
.odd-box b { font-size: 16px; }
.odd-box.empty { color: var(--muted); }
.board-foot { padding: 13px 18px; color: var(--muted); font-size: 10px; }
.side-stack { display: grid; gap: 13px; }
.ticket-panel, .small-panel { padding: 22px; }
.ticket-panel p, .small-panel p { margin: 0 0 20px; font-size: 12px; }
.receipt-lines { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px dashed #607084; color: var(--muted); font-size: 11px; }
.receipt-lines b { color: var(--text); font-variant-numeric: tabular-nums; }
.ticket-panel .button { width: 100%; margin-top: 18px; }
.ticket-panel .ticket-secondary { margin: 15px 0 0; text-align: center; }
.ticket-secondary a { color: var(--accent); text-decoration: underline; }
.small-panel a { color: var(--accent); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.featured-panel h2 { margin: 13px 0 5px; font-size: 17px; }
.featured-panel p { margin-bottom: 16px; color: var(--text); font-size: 13px; }
.featured-panel p span { color: var(--muted); font-size: 11px; }
.featured-meta { display: flex; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.featured-meta strong { color: var(--accent); font-variant-numeric: tabular-nums; }

.document-panel { overflow: hidden; }
.list-head, .document-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 80px; gap: 18px; align-items: center; padding: 13px 22px; }
.list-head { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .09em; border-bottom: 1px solid var(--line); }
.document-row { min-height: 76px; border-bottom: 1px solid var(--line); font-size: 12px; }
.document-row:last-child { border-bottom: 0; }
.document-row > div:first-child { min-width: 0; display: flex; align-items: center; gap: 14px; }
.document-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.document-row code { color: var(--muted); font-family: ui-monospace, Consolas, monospace; }
.document-row a { color: var(--accent); text-align: right; font-weight: 650; }
.file-icon { min-width: 45px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--odd-line); border-radius: 5px; color: var(--accent); background: var(--inset); font-size: 10px; font-weight: 800; letter-spacing: .04em; }

.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.account-panel { padding: 24px; }
.account-panel p { margin: 8px 0 0; font-size: 12px; }
.big-balance { margin: 18px 0 2px; color: var(--text); font-size: 42px; font-weight: 700; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.linked-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px 12px; max-width: 430px; margin-top: 13px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--inset); }
.linked-card span { color: var(--muted); font-size: 11px; }
.linked-card strong { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; letter-spacing: .04em; white-space: nowrap; }
.text-action { margin-top: 12px; padding: 0; border: 0; background: none; color: var(--accent); font-size: 12px; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.text-action:hover { color: var(--accent-hover); }
.deposit-card { margin-bottom: 6px; }
.deposit-panel { grid-column: span 2; }
.deposit-panel .stacked-form { max-width: 430px; }

.terminal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 14px; align-items: start; }
.terminal-screen { min-height: 510px; overflow: hidden; background: #222a39; }
.terminal-screen-head { display: flex; justify-content: space-between; gap: 12px; padding: 18px 23px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.terminal-match { display: grid; grid-template-columns: 1fr 125px; align-items: center; gap: 4px 18px; padding: 26px 23px; border-bottom: 1px solid var(--line); }
.terminal-match small { grid-column: span 2; color: var(--accent); font-size: 10px; }
.terminal-match strong { font-size: 19px; }
.terminal-match em { margin: 0 7px; color: var(--muted); font-size: 11px; font-style: normal; }
.terminal-match > span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }
.terminal-match > span b { margin: 0 6px; color: var(--muted); }
.terminal-controls { padding: 24px; }
.terminal-controls h2 { margin: 10px 0 18px; }
.terminal-balance { display: flex; justify-content: space-between; gap: 8px; margin: 19px 0 0; padding-top: 13px; border-top: 1px dashed #607084; font-size: 11px; }
.terminal-balance strong { color: var(--text); font-variant-numeric: tabular-nums; }
.screen-failed { position: relative; filter: grayscale(1); }
.screen-failed::after { content: "GUICHET HORS SERVICE"; position: absolute; inset: 0; display: grid; place-items: center; background: #191d2bf2; color: var(--red); font: 800 22px ui-monospace, Consolas, monospace; letter-spacing: .08em; animation: terminal-blackout 320ms steps(4, end) both; }
.bets-head, .bets-row { grid-template-columns: minmax(0, 1fr) 105px 110px 90px; }
.bets-row > div:first-child { display: grid; gap: 3px; }
.bets-row small { color: var(--muted); font-family: ui-monospace, Consolas, monospace; font-size: 10px; }
.status-chip { display: inline-block; width: fit-content; padding: 5px 9px; border-radius: 4px; color: var(--muted); background: #384457; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.status-chip.broken { color: var(--red); background: #49333d; }
.empty-state { margin: 0; padding: 25px; color: var(--muted); font-size: 12px; }

.incident-panel { padding: 24px; }
.incident-panel > p:first-child { margin: 0 0 22px; max-width: 65ch; font-size: 13px; }
.incident-files { display: grid; gap: 8px; }
.incident-files a { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--inset); transition: border-color 150ms ease, background-color 150ms ease; }
.incident-files a:hover { border-color: var(--accent); background: #2b3547; }
.incident-files a > span:nth-child(2) { display: grid; gap: 2px; }
.incident-files small { color: var(--muted); font-size: 10px; }
.incident-files b { margin-left: auto; color: var(--accent); font-size: 11px; transition: transform 150ms cubic-bezier(.16, 1, .3, 1); }
.incident-files a:hover b { transform: translateX(3px); }
.incident-reference { margin: 18px 0 0; font-size: 11px; }
.incident-reference code { color: var(--muted); }

.backoffice-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 14px; align-items: start; }
.detail-line { display: flex; justify-content: space-between; gap: 12px; margin-top: 15px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.detail-line span { color: var(--muted); }
.detail-line code { color: var(--text); }
.flag-box { display: grid; gap: 6px; margin-top: 30px; padding: 14px; border: 1px solid #559a85; border-radius: 6px; background: #1c403e; }
.flag-box span { color: var(--green); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.flag-box code { color: var(--text); overflow-wrap: anywhere; }
.backoffice-grid p code { color: var(--text); }

@keyframes ticket-scan {
  from { transform: translateX(0) skewX(-18deg); opacity: .65; }
  to { transform: translateX(48px) skewX(-18deg); opacity: 0; }
}
@keyframes ticket-reveal {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0); }
}
@keyframes terminal-blackout {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .brand-mark::after { animation: none; opacity: 0; }
  .inline-flag, .screen-failed::after { animation: none; }
  .primary, .button, .account-entry, .incident-files b { transform: none !important; }
}

@media (max-width: 1120px) {
  .topbar { height: auto; }
  .topbar-inner { height: auto; flex-wrap: wrap; gap: 10px 18px; padding: 11px 17px; }
  .main-nav { order: 3; width: 100%; height: 34px; margin-left: 0; overflow-x: auto; gap: 20px; }
  .account-strip { margin-left: auto; }
  .sports-layout, .terminal-layout { grid-template-columns: minmax(0, 1fr) 260px; }
}
@media (max-width: 800px) {
  .brand { font-size: 18px; }
  .service-notice-inner { align-items: flex-start; flex-direction: column; gap: 3px; padding: 10px 17px; }
  .page-layout { padding: 22px 17px 42px; }
  .sports-layout, .terminal-layout, .backoffice-grid { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .terminal-screen { min-height: 0; }
}
@media (max-width: 540px) {
  .account-strip { gap: 8px; padding-left: 10px; }
  .account-balance { display: none; }
  .sign-in { display: none; }
  .account-entry { min-height: 33px; padding: 6px 10px; }
  .account-grid, .side-stack { grid-template-columns: 1fr; }
  .deposit-panel { grid-column: auto; }
  .page-heading h1 { font-size: 25px; }
  .round-label { display: none; }
  .board-head { display: none; }
  .fixture-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; padding: 16px 12px; }
  .fixture-row.two-way { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sport-head { padding: 15px 12px 11px; }
  .sport-head .sport-head-status { display: none; }
  .fixture-main { grid-column: 1 / -1; }
  .fixture-main strong { font-size: 14px; white-space: normal; overflow: visible; }
  .fixture-meta { font-size: 9px; }
  .odd-box { min-height: 48px; }
  .odd-box b { font-size: 12px; }
  .list-head, .document-row { grid-template-columns: minmax(0, 1fr) 64px 48px; gap: 7px; padding-left: 11px; padding-right: 11px; }
  .bets-head, .bets-row { grid-template-columns: minmax(0, 1fr) 65px 52px 43px; }
  .file-icon { min-width: 35px; width: 35px; }
  .document-row > div:first-child { gap: 7px; }
  .document-row strong { font-size: 10px; }
}
