:root {
  color-scheme: dark;
  --bg: #07110f;
  --surface: #0c1916;
  --surface-2: #11231f;
  --line: #244239;
  --line-soft: #18332c;
  --text: #eef9f5;
  --muted: #9bb4ab;
  --accent: #53e3ae;
  --accent-dark: #123f32;
  --warn: #f6c565;
  --danger: #ff8f8f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 75% -10%, #174c3b 0, transparent 33rem), var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.site-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px clamp(18px, 4vw, 64px); border-bottom: 1px solid var(--line-soft); background: rgba(7, 17, 15, .88); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 20; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 760; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #062018; background: var(--accent); font-weight: 900; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.text-link, .text-button { color: var(--muted); background: none; border: 0; padding: 8px; cursor: pointer; }
.text-link:hover, .text-button:hover { color: var(--text); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 17px; border: 1px solid transparent; border-radius: 11px; cursor: pointer; font-weight: 720; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button-primary { color: #062018; background: var(--accent); }
.button-primary:hover { background: #76edc1; }
.button-secondary { color: var(--text); border-color: var(--line); background: rgba(17, 35, 31, .82); }
.button-secondary:hover { border-color: #3b6659; background: var(--surface-2); }
.button-large { min-height: 50px; padding: 0 22px; }
.button-small { min-height: 36px; padding: 0 13px; font-size: 14px; }
.full-button { width: 100%; margin-top: 10px; }

.hero { max-width: 1220px; margin: 0 auto; padding: clamp(76px, 10vw, 150px) 24px 92px; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); align-items: center; gap: clamp(44px, 8vw, 110px); }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 800; margin: 0 0 16px; }
h1, h2, h3, p { margin-top: 0; }
.hero h1 { max-width: 850px; font-size: clamp(44px, 7vw, 86px); line-height: .99; letter-spacing: -.055em; margin-bottom: 26px; }
.hero-text { max-width: 720px; color: #bfd0ca; font-size: clamp(18px, 2vw, 22px); line-height: 1.58; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 34px 0 24px; }
.live-note { color: var(--muted); font-size: 14px; }
.snapshot-card { border: 1px solid var(--line); background: linear-gradient(150deg, rgba(18, 46, 38, .96), rgba(9, 23, 19, .95)); border-radius: 24px; padding: 30px; box-shadow: 0 28px 80px rgba(0, 0, 0, .28); }
.snapshot-label { color: var(--muted); margin-bottom: 10px; }
.snapshot-number { display: block; color: var(--accent); font-size: 74px; line-height: 1; letter-spacing: -.06em; }
.snapshot-card > span { color: #c7d7d1; }
.snapshot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 34px 0 20px; }
.snapshot-grid div { border-top: 1px solid var(--line); padding-top: 14px; }
.snapshot-grid dt { font-size: 25px; font-weight: 800; }
.snapshot-grid dd { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.snapshot-time { margin: 0; color: var(--muted); font-size: 13px; }
.feature-section, .home-cta { max-width: 1220px; margin: 0 auto; padding: 70px 24px; }
.feature-section > h2, .home-cta h2 { max-width: 750px; font-size: clamp(31px, 4vw, 50px); letter-spacing: -.035em; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 42px; }
.feature-grid article { min-height: 260px; padding: 26px; border: 1px solid var(--line-soft); border-radius: 18px; background: rgba(12, 25, 22, .78); }
.feature-index { color: var(--accent); font-weight: 800; font-size: 13px; }
.feature-grid h3 { margin-top: 60px; font-size: 23px; }
.feature-grid p, .home-cta p { color: var(--muted); line-height: 1.6; }
.home-cta { margin-bottom: 70px; display: flex; justify-content: space-between; align-items: center; gap: 30px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); }
.home-cta h2 { margin-bottom: 10px; }
.home-cta p:last-child { margin-bottom: 0; }
.site-footer { display: flex; justify-content: space-between; gap: 24px; padding: 26px clamp(18px, 4vw, 64px); border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 13px; }

.markets-header { position: relative; }
.header-status { margin-left: auto; color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 4px rgba(246, 197, 101, .09); }
.status-dot.good { background: var(--accent); box-shadow: 0 0 0 4px rgba(83, 227, 174, .1); }
.status-dot.bad { background: var(--danger); box-shadow: 0 0 0 4px rgba(255, 143, 143, .1); }
.account-label { color: var(--muted); max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.markets-shell { max-width: 1440px; margin: 0 auto; padding: 38px 24px 70px; }
.markets-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.markets-heading h1 { font-size: clamp(34px, 5vw, 58px); letter-spacing: -.045em; margin-bottom: 0; }
.view-switch { width: min(520px, 100%); margin: 32px auto 28px; padding: 5px; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 14px; background: #081512; position: sticky; top: 84px; z-index: 10; }
.view-switch button { min-height: 46px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 800; cursor: pointer; }
.view-switch button.active { color: #062018; background: var(--accent); }
.notice-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 22px; padding: 18px; border: 1px solid #806b3b; border-radius: 14px; background: #2b2415; }
.notice-banner p { color: #ddcfae; margin: 4px 0 0; }
.notice-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.summary-grid article { padding: 17px 19px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--surface); }
.summary-grid span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.summary-grid strong { font-size: 21px; }
.filter-card { border: 1px solid var(--line); border-radius: 18px; padding: 20px; background: rgba(12, 25, 22, .92); }
.filter-card-head, .filter-head-actions { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.filter-card-head h2 { margin-bottom: 4px; }
.filter-card-head p { color: var(--muted); font-size: 13px; margin: 0; }
.danger-text { color: var(--danger); }
.filter-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr) auto; gap: 12px; align-items: end; margin-top: 20px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field span { color: var(--muted); font-size: 12px; font-weight: 700; }
.field input, .field select { width: 100%; min-height: 42px; padding: 0 11px; color: var(--text); border: 1px solid var(--line); border-radius: 10px; outline: none; background: #07130f; }
.field input:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(83, 227, 174, .1); }
.check-field { grid-column: 1 / -2; display: flex; gap: 18px; flex-wrap: wrap; padding-top: 4px; }
.check-field label { color: #c4d5cf; display: flex; align-items: center; gap: 7px; font-size: 13px; }
.check-field input { accent-color: var(--accent); }
.filter-apply { grid-column: -2 / -1; grid-row: 2; }
.active-filters { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 16px; }
.filter-chip { padding: 6px 9px; color: #bfead9; background: var(--accent-dark); border-radius: 999px; font-size: 12px; }
.filter-chip.paused { color: #e7d49f; background: #342b17; }
.save-status { min-height: 18px; margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.save-status.error { color: var(--danger); }
.list-toolbar { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin: 34px 2px 14px; }
.list-toolbar h2 { margin-bottom: 5px; }
.list-toolbar p { color: var(--muted); margin: 0; font-size: 13px; }
.environment-badge { color: #0d2b21; background: var(--warn); border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 800; }
.match-list { display: grid; gap: 10px; min-height: 120px; }
.match-card { border: 1px solid var(--line-soft); border-radius: 15px; background: var(--surface); overflow: hidden; }
.match-card:hover { border-color: #315649; }
.match-main { display: grid; grid-template-columns: minmax(165px, .8fr) minmax(260px, 1.6fr) repeat(4, minmax(135px, 1fr)) auto; gap: 16px; align-items: center; padding: 16px; }
.match-meta { color: var(--muted); font-size: 12px; line-height: 1.55; }
.match-meta strong { color: var(--text); font-size: 13px; display: block; }
.status-pill { display: inline-flex; margin-top: 5px; padding: 3px 7px; border-radius: 999px; color: #bdd4cb; background: #162d27; font-weight: 800; }
.status-pill.live { color: #092219; background: var(--accent); }
.teams { min-width: 0; }
.team-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; font-weight: 730; }
.team-line span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score { color: var(--accent); font-size: 18px; }
.market-cell { min-width: 0; }
.market-cell span { color: var(--muted); font-size: 11px; display: block; margin-bottom: 4px; }
.market-cell strong { display: block; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.unavailable { color: #7f958d; font-weight: 600; }
.match-actions { display: flex; gap: 7px; }
.favorite-button, .detail-button, .icon-button { border: 1px solid var(--line); color: var(--text); background: #0a1714; border-radius: 9px; min-width: 38px; min-height: 38px; cursor: pointer; }
.favorite-button.active { color: var(--warn); border-color: #7d6738; }
.detail-button { padding: 0 11px; }
.match-detail { padding: 0 16px 16px; border-top: 1px solid var(--line-soft); }
.detail-tabs { display: flex; gap: 7px; padding: 14px 0 2px; overflow-x: auto; scrollbar-width: thin; }
.detail-tab { flex: 0 0 auto; min-height: 36px; padding: 0 13px; border: 1px solid var(--line); border-radius: 8px; color: #b7cec5; background: #091713; cursor: pointer; font-size: 12px; font-weight: 760; }
.detail-tab:hover { border-color: #3a6658; color: var(--text); }
.detail-tab.active { color: #062018; border-color: var(--accent); background: var(--accent); }
.detail-panel { padding-top: 12px; }
.detail-panel-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .8fr); gap: 12px; }
.detail-panel-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.detail-card { min-width: 0; padding: 14px; border: 1px solid var(--line-soft); border-radius: 12px; background: #081512; }
.detail-card-wide { grid-column: 1 / -1; }
.detail-card h3 { margin: 0 0 11px; color: #76edc1; font-size: 14px; }
.detail-card h3 span { color: var(--muted); font-size: 11px; font-weight: 650; }
.detail-table-wrap { width: 100%; overflow-x: auto; }
.detail-table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 12px; }
.detail-table th, .detail-table td { padding: 8px 9px; border: 1px solid #1d3a32; text-align: center; }
.detail-table thead th { color: #a7c9bc; background: #0d211c; }
.detail-table tbody th { color: var(--muted); text-align: left; font-weight: 600; }
.detail-table td { color: var(--text); font-weight: 720; }
.detail-kv-list { margin: 0; display: grid; }
.detail-kv-list div { display: grid; grid-template-columns: minmax(135px, .9fr) minmax(0, 1.1fr); gap: 12px; padding: 8px 2px; border-bottom: 1px solid var(--line-soft); }
.detail-kv-list div:last-child { border-bottom: 0; }
.detail-kv-list dt { color: var(--muted); font-size: 12px; }
.detail-kv-list dd { margin: 0; color: var(--text); text-align: right; font-size: 12px; font-weight: 720; overflow-wrap: anywhere; }
.bookmaker-list { display: flex; gap: 7px; flex-wrap: wrap; margin: 0; color: var(--muted); font-size: 12px; }
.bookmaker-list span { padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; color: #cce1d9; background: #0d211c; }
.detail-empty { margin: 0; padding: 14px 2px; color: var(--muted); font-size: 12px; }
.empty-state { text-align: center; padding: 54px 20px; border: 1px dashed var(--line); border-radius: 16px; background: rgba(12, 25, 22, .7); }
.empty-state p { color: var(--muted); }
.load-more-wrap { display: flex; justify-content: center; padding: 20px; }
.modal-backdrop { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(1, 7, 5, .76); z-index: 50; }
.modal-backdrop[hidden] { display: none; }
.auth-modal { width: min(430px, 100%); padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #0d1b17; box-shadow: 0 30px 100px rgba(0, 0, 0, .48); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-head h2 { margin: 0; }
.icon-button { font-size: 22px; }
.auth-modal .field { margin-bottom: 14px; }
.auth-message { min-height: 22px; color: var(--danger); font-size: 13px; }

@media (max-width: 1180px) {
  .filter-grid { grid-template-columns: repeat(3, 1fr); }
  .check-field { grid-column: 1 / 3; }
  .filter-apply { grid-column: 3; grid-row: auto; }
  .match-main { grid-template-columns: minmax(150px, .8fr) minmax(240px, 1.5fr) repeat(2, minmax(130px, 1fr)) auto; }
  .match-main .market-asian, .match-main .market-total { display: none; }
}

@media (max-width: 820px) {
  .site-header { min-height: 64px; padding: 12px 16px; flex-wrap: wrap; }
  .site-header .header-actions .text-link { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 68px; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-grid article { min-height: 210px; }
  .home-cta { margin-left: 16px; margin-right: 16px; flex-direction: column; align-items: start; }
  .markets-header .header-status { order: 3; width: 100%; margin-left: 44px; }
  .account-label { display: none; }
  .markets-shell { padding: 26px 14px 60px; }
  .view-switch { top: 72px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .check-field { grid-column: 1 / -1; }
  .filter-apply { grid-column: 1 / -1; }
  .notice-banner, .filter-card-head, .home-cta { flex-direction: column; align-items: stretch; }
  .match-main { grid-template-columns: 1fr auto; gap: 13px; }
  .match-meta { grid-column: 1; }
  .teams { grid-column: 1 / -1; grid-row: 2; }
  .match-main .market-cell { display: block !important; grid-column: 1 / -1; }
  .match-actions { grid-column: 2; grid-row: 1; }
  .detail-panel-grid, .detail-panel-grid-three { grid-template-columns: 1fr; }
  .detail-card-wide { grid-column: 1; }
}

@media (max-width: 520px) {
  .brand span:last-child { display: none; }
  .header-actions { gap: 5px; }
  .auth-actions .button { padding: 0 10px; }
  .hero h1 { font-size: 43px; }
  .hero-actions .button { width: 100%; }
  .snapshot-card { padding: 22px; }
  .summary-grid, .filter-grid { grid-template-columns: 1fr; }
  .filter-card { padding: 16px; }
  .filter-head-actions { width: 100%; }
  .check-field, .filter-apply { grid-column: 1; }
  .summary-grid strong { font-size: 17px; }
  .view-switch { top: 66px; }
  .match-detail { padding: 0 11px 12px; }
  .detail-tabs { margin-right: -11px; padding-right: 11px; }
  .detail-tab { min-height: 40px; }
  .detail-card { padding: 11px; }
  .detail-kv-list div { grid-template-columns: 1fr; gap: 4px; }
  .detail-kv-list dd { text-align: left; }
  .site-footer { flex-direction: column; }
}
