:root {
  --ink: #0d100f;
  --ink-soft: #171b19;
  --paper: #f3f1e8;
  --paper-soft: #e7e4d9;
  --muted: #929a94;
  --line: rgba(255, 255, 255, 0.12);
  --lime: #c9ff45;
  --teal: #69e4ca;
  --orange: #ff7048;
  --shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--ink);
  color: var(--paper);
}

* { box-sizing: border-box; }
html { max-width: 100%; overflow-x: hidden; }
body { width: 100%; max-width: 100%; margin: 0; overflow-x: hidden; background: var(--ink); }
body.tools-open, body.modal-open { overflow: hidden; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

.app-shell { width: 100%; max-width: 988px; margin: 0 auto; padding-inline: 24px; }
.site-header { min-width: 0; min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.brand { min-width: 0; display: inline-flex; flex: 0 1 auto; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand > span:last-child { display: grid; gap: 2px; }
.brand strong { font-family: Georgia, "Times New Roman", serif; font-size: 18px; font-weight: 400; letter-spacing: -0.02em; white-space: nowrap; }
.brand-mark { position: relative; width: 31px; height: 31px; display: block; transform: rotate(-8deg); }
.brand-mark i { position: absolute; left: 3px; display: block; width: 25px; height: 6px; border-radius: 999px; background: var(--lime); }
.brand-mark i:nth-child(1) { top: 3px; }
.brand-mark i:nth-child(2) { top: 12px; width: 18px; background: var(--teal); }
.brand-mark i:nth-child(3) { top: 21px; width: 11px; background: var(--orange); }
.sport-picker { position: relative; min-width: 108px; min-height: 36px; display: inline-flex; flex: 0 0 auto; align-items: stretch; }
.sport-picker select { position: absolute; inset: 0; z-index: 2; width: 100%; min-width: 0; max-width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.sport-picker-face { width: 100%; min-height: 36px; display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 0 2px 0 8px; color: var(--paper); font-family: Georgia, "Times New Roman", serif; font-size: 17px; font-weight: 400; letter-spacing: -0.02em; transition: color 140ms ease; }
.sport-picker-face i { width: 7px; height: 7px; flex: 0 0 auto; border-right: 1px solid var(--muted); border-bottom: 1px solid var(--muted); transform: translateY(-2px) rotate(45deg); }
.sport-picker:hover .sport-picker-face { color: #fff; }
.sport-picker select:focus-visible + .sport-picker-face { border-radius: 2px; outline: 2px solid rgba(105, 228, 202, 0.55); outline-offset: 3px; }

.site-footer { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 2px 22px; border-top: 1px solid rgba(255, 255, 255, 0.07); color: var(--muted); }
.footer-copyright { font-size: 9px; letter-spacing: 0.01em; opacity: 0.48; }
.footer-links { display: flex; align-items: center; gap: 4px; }
.footer-link { min-height: 28px; padding: 5px 7px; border: 0; outline: 0; background: transparent; color: inherit; cursor: pointer; font-size: 9px; opacity: 0.48; transition: color 140ms ease, opacity 140ms ease; }
.footer-link:hover:not(:disabled), .demo-link.active { color: var(--paper); opacity: 0.82; }
.footer-link:focus-visible { border-radius: 4px; box-shadow: 0 0 0 2px rgba(105, 228, 202, 0.4); opacity: 1; }
.demo-link:disabled { cursor: wait; }

.feed-controls { display: flex; align-items: center; gap: 24px; padding: 23px 0; border-bottom: 1px solid var(--line); }
.stake-control { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.stake-input { position: relative; display: block; width: 102px; }
.stake-input i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-style: normal; font-size: 13px; }
.stake-input input { width: 100%; padding: 9px 9px 9px 23px; border: 1px solid var(--line); border-radius: 7px; outline: 0; background: var(--ink-soft); color: var(--paper); font-size: 13px; }
.stake-input input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(105, 228, 202, 0.09); }
.form-error { flex: 1; margin: 0; color: #ff9d81; font-size: 10px; }
.toggle-control { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; color: var(--paper); cursor: pointer; font-size: 10px; font-weight: 750; letter-spacing: 0.09em; text-transform: uppercase; }
.toggle-control input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.toggle-track { position: relative; width: 43px; height: 24px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; background: var(--ink-soft); transition: 160ms ease; }
.toggle-track i { position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; border-radius: 50%; background: var(--muted); transition: 160ms ease; }
.toggle-control input:checked + .toggle-track { border-color: var(--lime); background: rgba(201, 255, 69, 0.14); }
.toggle-control input:checked + .toggle-track i { transform: translateX(19px); background: var(--lime); }
.toggle-control input:focus-visible + .toggle-track { outline: 3px solid rgba(105, 228, 202, 0.28); outline-offset: 3px; }

main, .game-feed, .draft-list, .match-day, .day-cards, .draft-card { min-width: 0; max-width: 100%; }
.game-feed { width: 100%; max-width: 560px; margin-inline: auto; padding: 26px 0 56px; }
.draft-list { width: 100%; display: block; }
.match-day + .match-day { margin-top: 22px; }
.day-heading { display: flex; align-items: center; gap: 12px; margin: 0 2px 8px; }
.day-heading::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.day-heading h2 { margin: 0; color: var(--paper); font-family: Georgia, serif; font-size: 18px; font-weight: 400; letter-spacing: -0.02em; }
.day-cards { display: grid; gap: 8px; }
.loading-card, .empty-state { min-height: 180px; display: grid; place-items: center; padding: 30px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); text-align: center; }
.empty-state b { display: block; margin-bottom: 7px; color: var(--paper); font-family: Georgia, serif; font-size: 22px; font-weight: 400; }
.empty-state span { font-size: 11px; line-height: 1.5; }

.draft-card { overflow: hidden; border-radius: 9px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
.post-card { border: 1px solid #cfd5d9; background: #fff; box-shadow: none; color: #0f1419; }
.post-card.simulation { border-style: dashed; border-color: rgba(174, 105, 23, 0.5); background: #fffaf0; }
.post-row { width: 100%; min-width: 0; max-width: 100%; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 14px; }
.post-avatar { width: 34px; height: 34px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--ink); }
.post-avatar .brand-mark { transform: rotate(-8deg) scale(0.7); }
.post-content { min-width: 0; }
.post-author-line { min-width: 0; min-height: 20px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; color: #536471; font-size: 12px; line-height: 1.2; }
.post-author-line strong { color: #0f1419; font-size: 13px; }
.post-author-line .x-post-button { margin-left: auto; }
.post-copy { margin-top: 7px; color: #0f1419; font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.35; letter-spacing: -0.01em; overflow-wrap: anywhere; white-space: pre-wrap; }
.x-post-button { min-width: 58px; height: 20px; display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 4px; padding: 0 8px; border-radius: 999px; background: #0f1419; color: #fff; font: 700 12px/20px Arial, sans-serif; text-decoration: none; }
.x-post-button:hover { background: #272c30; }
.x-post-button:focus-visible { outline: 2px solid #1d9bf0; outline-offset: 2px; }
.x-post-button svg { width: 11px; height: 11px; fill: currentColor; }
.card-accent { height: 3px; background: #aeb3ad; }
.draft-card.interesting .card-accent { background: linear-gradient(90deg, var(--lime), var(--teal)); }
.draft-card.in_progress .card-accent { background: var(--orange); }
.draft-card.upcoming .card-accent { background: var(--teal); }
.draft-main { padding: 14px 16px 15px; }
.draft-card.fixture-only .draft-main { padding-block: 13px 14px; }
.match-heading { display: grid; }
.match-topline { min-height: 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.match-topline .x-post-button { flex: 0 0 auto; }
.match-state { min-width: 0; display: inline-flex; align-items: center; gap: 5px; color: #676d69; font-size: 9px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.scoreline { max-width: 100%; margin: 5px 0 0; overflow-wrap: break-word; font-family: Georgia, serif; font-size: clamp(25px, 4vw, 37px); font-weight: 400; line-height: 1.05; letter-spacing: -0.04em; text-wrap: balance; }
.scoreline span { color: #737975; }

.button { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 13px; border: 0; border-radius: 7px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform 140ms ease, background 140ms ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: 0.45; cursor: not-allowed; }
.button-primary { background: var(--ink); color: var(--paper); font-size: 10px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.button-secondary { border: 1px solid rgba(13, 16, 15, 0.16); background: transparent; color: #333a35; font-size: 10px; font-weight: 750; }
.button-quiet { min-height: 29px; padding: 6px 9px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; }
.load-more { display: block; min-width: 150px; margin: 22px auto 0; border: 1px solid var(--line); background: var(--ink-soft); color: var(--paper); font-size: 10px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }

.tools-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, 0.58); }
.tools-drawer { position: fixed; inset: 0 0 0 auto; z-index: 21; width: min(560px, 94vw); display: grid; grid-template-rows: auto minmax(0, 1fr); transform: translateX(102%); background: #f4f2ea; color: var(--ink); box-shadow: -25px 0 80px rgba(0, 0, 0, 0.44); transition: transform 180ms ease; }
.tools-drawer.open { transform: translateX(0); }
.tools-drawer > header { display: flex; align-items: center; justify-content: space-between; padding: 19px 21px; border-bottom: 1px solid rgba(13, 16, 15, 0.12); }
.tools-drawer > header div { display: grid; gap: 2px; }
.tools-drawer > header span { color: #707671; font-size: 8px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.tools-drawer > header strong { font-family: Georgia, serif; font-size: 24px; font-weight: 400; }
.icon-button { width: 36px; height: 36px; border: 1px solid rgba(13, 16, 15, 0.13); border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; font-size: 23px; line-height: 1; }
.tools-content { overflow-y: auto; padding: 14px 21px 30px; }
.quota-tools { margin: 0 0 5px; padding: 15px; border: 1px solid rgba(13, 16, 15, 0.12); border-radius: 8px; background: var(--ink); color: var(--paper); }
.quota-tools > span { display: block; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; }
.quota-tools > strong { display: block; margin-top: 5px; font-family: Georgia, serif; font-size: 27px; font-weight: 400; }
.quota-tools > strong i { color: #737b76; font-size: 16px; font-style: normal; }
.quota-tools > p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.tool-game { border-bottom: 1px solid rgba(13, 16, 15, 0.12); }
.tool-game > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; cursor: pointer; list-style: none; }
.tool-game > summary::-webkit-details-marker { display: none; }
.tool-game > summary b { font-family: Georgia, serif; font-size: 17px; font-weight: 400; }
.tool-game > summary span { color: #707671; font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; }
.tool-body { display: grid; gap: 13px; padding: 0 0 19px; }
.tool-note, .tool-panel { padding: 12px; border: 1px solid rgba(13, 16, 15, 0.1); border-radius: 7px; background: rgba(13, 16, 15, 0.025); }
.tool-note b, .tool-panel > b { display: block; font-size: 9px; letter-spacing: 0.09em; text-transform: uppercase; }
.tool-note p, .tool-panel > p { margin: 5px 0 0; color: #686e69; font-size: 10px; line-height: 1.5; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.refresh-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.refresh-grid div { min-width: 0; }
.refresh-grid span { display: block; color: #747a76; font-size: 8px; letter-spacing: 0.08em; text-transform: uppercase; }
.refresh-grid b { display: block; margin-top: 4px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.what-if-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 9px; }
.what-if-grid article { padding: 9px; border: 1px solid rgba(13, 16, 15, 0.1); border-radius: 6px; background: rgba(255, 255, 255, 0.62); }
.what-if-grid strong { display: block; font-family: Georgia, serif; font-size: 19px; font-weight: 400; }
.what-if-grid span { display: block; margin-top: 3px; color: #747a76; font-size: 8px; }
.evidence-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 9px; }
.evidence-table th { padding: 6px 4px; color: #747a76; text-align: left; font-size: 8px; text-transform: uppercase; }
.evidence-table td { padding: 8px 4px; border-top: 1px solid rgba(13, 16, 15, 0.09); vertical-align: top; }
.evidence-table th:last-child, .evidence-table td:last-child { text-align: right; }
.unavailable-note { display: grid; gap: 4px; color: #6b5149; font-size: 9px; }

.about-backdrop { position: fixed; inset: 0; z-index: 22; display: grid; place-items: center; padding: 22px; background: rgba(0, 0, 0, 0.78); }
.about-dialog { width: min(680px, 100%); max-height: min(820px, calc(100dvh - 44px)); display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; border: 1px solid #2f3336; border-radius: 16px; outline: 0; background: #000; color: #e7e9ea; box-shadow: 0 28px 100px rgba(0, 0, 0, 0.68); }
.about-dialog:focus-visible { box-shadow: 0 0 0 2px rgba(231, 233, 234, 0.34), 0 28px 100px rgba(0, 0, 0, 0.68); }
.about-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 19px 21px 17px; border-bottom: 1px solid #2f3336; }
.about-header > div { display: grid; gap: 2px; }
.about-header span { color: #71767b; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.about-header h2 { margin: 0; color: #f2f2f2; font-family: Georgia, "Times New Roman", serif; font-size: 31px; font-weight: 400; letter-spacing: -0.035em; }
.about-header .icon-button { width: 38px; height: 38px; border: 0; color: #e7e9ea; font-size: 28px; transition: background 140ms ease; }
.about-header .icon-button:hover { background: rgba(239, 243, 244, 0.1); }
.about-header .icon-button:focus-visible { outline: 2px solid #e7e9ea; outline-offset: 2px; }
.about-content { overflow-y: auto; padding: 23px 23px 32px; scrollbar-color: #536471 transparent; scrollbar-gutter: stable; }
.about-content > section { padding-top: 25px; }
.about-content > section + section { margin-top: 25px; border-top: 1px solid #2f3336; }
.about-intro { max-width: 55ch; margin: 0; color: #e7e9ea; font-family: Georgia, "Times New Roman", serif; font-size: 20px; line-height: 1.48; letter-spacing: -0.015em; }
.about-content h3 { margin: 0 0 13px; color: #f2f2f2; font-family: Georgia, "Times New Roman", serif; font-size: 22px; font-weight: 400; letter-spacing: -0.025em; }
.about-content p { margin: 0; color: #b6b9bb; font-size: 14px; line-height: 1.58; }
.about-content section > p + p { margin-top: 11px; }
.sport-docs { display: grid; overflow: hidden; border: 1px solid #2f3336; border-radius: 12px; }
.sport-docs article { min-width: 0; padding: 14px 15px; border-bottom: 1px solid #2f3336; background: transparent; }
.sport-docs article:last-child { border-bottom: 0; }
.sport-docs strong { display: block; color: #e7e9ea; font-size: 15px; }
.sport-docs span { display: block; margin-top: 4px; color: #8b98a5; font-size: 13px; line-height: 1.48; }
.about-note { margin-top: 14px !important; padding-left: 13px; border-left: 2px solid #71767b; }
.anomaly-table-wrap { margin-top: 15px; overflow-x: auto; border: 1px solid #2f3336; border-radius: 12px; }
.anomaly-table { width: 100%; min-width: 590px; border-collapse: collapse; color: #e7e9ea; font-size: 13px; }
.anomaly-table th, .anomaly-table td { padding: 12px 13px; border-bottom: 1px solid #2f3336; text-align: left; white-space: nowrap; }
.anomaly-table thead th { color: #71767b; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.anomaly-table tbody th { color: #e7e9ea; font-size: 13px; }
.anomaly-table tbody td { color: #b6b9bb; }
.anomaly-table tbody tr:last-child th, .anomaly-table tbody tr:last-child td { border-bottom: 0; }
.algorithm-steps { display: grid; gap: 15px; margin: 0; padding: 0; counter-reset: about-step; list-style: none; }
.algorithm-steps li { position: relative; min-height: 30px; padding-left: 43px; color: #b6b9bb; font-size: 14px; line-height: 1.58; counter-increment: about-step; }
.algorithm-steps li::before { content: counter(about-step); position: absolute; top: 0; left: 0; width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid #536471; border-radius: 50%; color: #e7e9ea; font-family: Georgia, serif; font-size: 14px; }
.algorithm-steps strong { color: #e7e9ea; }

.token-backdrop { position: fixed; inset: 0; z-index: 24; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, 0.7); }
.token-dialog { width: min(400px, 100%); padding: 25px; border-radius: 11px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
.token-dialog form { display: grid; gap: 11px; }
.token-dialog form > span { color: #737975; font-size: 8px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.token-dialog h2 { margin: -4px 0 0; font-family: Georgia, serif; font-size: 29px; font-weight: 400; letter-spacing: -0.03em; }
.token-dialog p { margin: 0; color: #676d69; font-size: 10px; line-height: 1.45; }
.token-dialog label { margin-top: 5px; color: #555c57; font-size: 9px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; }
.token-dialog input { width: 100%; padding: 10px 11px; border: 1px solid rgba(13, 16, 15, 0.2); border-radius: 7px; outline: 0; background: #fffef8; color: var(--ink); }
.token-dialog input:focus { border-color: #1c6659; box-shadow: 0 0 0 3px rgba(105, 228, 202, 0.2); }
.token-dialog .form-error { color: #a33c21; }
.token-dialog form > div { display: flex; justify-content: flex-end; gap: 8px; margin-top: 5px; }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 30; transform: translateY(16px); opacity: 0; pointer-events: none; padding: 11px 14px; border-radius: 7px; background: var(--lime); color: var(--ink); box-shadow: var(--shadow); font-size: 11px; font-weight: 750; transition: 170ms ease; }
.toast.visible { transform: translateY(0); opacity: 1; }
@media (max-width: 620px) {
  .app-shell { padding-inline: 14px; }
  .site-header { min-height: 67px; gap: 16px; }
  .sport-picker { min-width: 102px; min-height: 34px; }
  .sport-picker-face { min-height: 34px; font-size: 16px; }
  .feed-controls { align-items: flex-end; gap: 12px; padding: 17px 0; }
  .stake-control { display: grid; gap: 5px; }
  .form-error { position: absolute; left: 14px; right: 14px; margin-top: 70px; }
  .toggle-control { margin-left: auto; padding-bottom: 5px; }
  .game-feed { padding-top: 17px; }
  .match-day + .match-day { margin-top: 20px; }
  .day-heading { margin-bottom: 7px; }
  .day-cards { gap: 8px; }
  .post-row { grid-template-columns: 31px minmax(0, 1fr); gap: 9px; padding: 12px; }
  .post-avatar { width: 31px; height: 31px; }
  .post-copy { margin-top: 6px; font-size: 14px; line-height: 1.36; }
  .draft-main { padding: 13px 14px 14px; }
  .match-topline { gap: 12px; }
  .scoreline { font-size: clamp(24px, 8vw, 31px); }
  .what-if-grid { grid-template-columns: 1fr; }
  .site-footer { padding-bottom: 18px; }
  .about-backdrop { align-items: end; padding: 10px; }
  .about-dialog { max-height: calc(100dvh - 20px); border-radius: 15px; }
  .about-header { padding: 17px 17px 15px; }
  .about-header h2 { font-size: 28px; }
  .about-content { padding: 20px 17px 27px; scrollbar-gutter: auto; }
  .about-intro { font-size: 19px; }
  .about-content h3 { font-size: 21px; }
  .about-content p, .algorithm-steps li { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
