:root {
  color-scheme: light;
  --ink: #1b2444;
  --muted: #53607a;
  --line: #e2e7f2;
  --paper: #f3f5fb;
  --navy: #242440;
  --royal: #4e2bd3;
  --gold: #e0d830;
  font-family: 'Pretendard Variable', Pretendard, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
h1, h2, p { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:where(a, button, input, select):focus-visible { outline: 2px solid var(--royal); outline-offset: 3px; }
.wrap { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.visually-hidden, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip:focus { position: fixed; z-index: 3; background: white; padding: 12px; top: 8px; left: 8px; }

.topbar { background: var(--navy); color: #fff; }
.topbar-inner { height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { text-decoration: none; font-size: 21px; font-weight: 820; letter-spacing: -.035em; white-space: nowrap; }
.brand span { color: var(--gold); }
.top-links { display: flex; align-items: center; gap: 26px; }
.top-link { text-decoration: none; color: #dedeee; padding: 10px 0; font-size: 14px; font-weight: 630; }
.top-link:hover, .top-link[aria-current] { color: white; }
.top-link[aria-current] { box-shadow: 0 2px var(--gold); }
.topbar a:focus-visible { outline-color: var(--gold); }

.hero-inner { padding: 31px 0 23px; }
.hero h1 { font-size: clamp(38px, 4.8vw, 62px); line-height: 1.05; font-weight: 820; letter-spacing: -.055em; }
.tour-year { display: block; color: var(--royal); font-size: .61em; letter-spacing: -.035em; margin-bottom: 5px; }
.hero-events { color: var(--muted); font-weight: 550; font-size: 15px; margin-top: 11px; line-height: 1.4; }
.hero-meta { color: var(--muted); font-size: 13px; margin-top: 7px; }

.board-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.level-list, .event-controls { display: flex; align-items: center; gap: 2px; }
.level-list { background: white; border: 1px solid var(--line); padding: 3px; border-radius: 999px; }
.level-list button, .event-controls button {
  border: 0; background: transparent; color: var(--muted); padding: 8px 13px;
  min-height: 37px; font-size: 14px; font-weight: 690; white-space: nowrap; border-radius: 999px;
}
.level-list button:hover, .event-controls button:hover { color: var(--ink); background: #f1eefc; }
.level-list button[aria-pressed=true] { background: var(--royal); color: white; }
.level-list .team-link { margin-left: 4px; }
.search-form { display: flex; gap: 7px; width: min(100%, 350px); }
.input-wrap { position: relative; flex: 1; min-width: 0; }
.input-wrap input, .team-filters select {
  height: 43px; width: 100%; border: 1px solid #d5dcec; border-radius: 8px; color: var(--ink); background: white;
}
.input-wrap input { padding: 0 12px 0 36px; font-size: 15px; }
.search-icon { position: absolute; top: 13px; left: 12px; width: 13px; height: 13px; border: 1.6px solid var(--muted); border-radius: 50%; }
.search-icon::after { content: ''; position: absolute; width: 6px; height: 1.6px; background: var(--muted); transform: rotate(45deg); top: 10px; left: 8px; }
.primary, .outline { padding: 9px 14px; border-radius: 8px; font-size: 14px; font-weight: 690; white-space: nowrap; }
.primary { background: var(--royal); color: white; border: 1px solid var(--royal); }
.primary:hover { background: #3d20ae; }
.outline { background: white; border: 1px solid #d5dcec; color: var(--ink); }
.outline:hover { background: #f5f3fc; }

.leaderboard, .results { background: white; border: 1px solid var(--line); border-radius: 14px; }
.leaderboard { overflow: hidden; }
.board-head { padding: 18px 24px 14px; }
.board-heading, .board-options { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.board-heading h2 { font-size: clamp(20px, 2.6vw, 28px); letter-spacing: -.045em; font-weight: 780; }
.row-count { color: var(--muted); font-size: 13px; }
.board-heading .scoring-entry { margin-left: auto; }
.board-options { margin-top: 10px; justify-content: space-between; }
.event-controls { border-radius: 999px; background: #f0f1f8; padding: 2px; }
.event-controls button { min-height: 34px; padding: 6px 11px; font-size: 13px; }
.event-controls button[aria-pressed=true] { background: #fff; color: var(--royal); box-shadow: 0 1px 3px #1b244422; }
.scoring-entry { color: var(--royal); font-size: 13px; font-weight: 700; text-decoration: none; }
.scoring-entry:hover { text-decoration: underline; }
.scoring-entry span { padding-left: 3px; }

.table-area { padding-inline: 24px; }
.table-area table, .detail-table, .rules-table table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table-area th { background: #f3f5fb; color: var(--muted); font-size: 13px; text-align: left; }
.table-area th, .table-area td { border-bottom: 1px solid var(--line); padding: 10px 12px; }
.table-area th:first-child, .table-area td:first-child { width: 94px; }
.table-area th:last-child, .table-area td:last-child { width: 106px; text-align: right; white-space: nowrap; }
.table-area td:last-child { font-weight: 760; }
.player-table td:first-child, .player-table .points-part, .table-area td:last-child { font-variant-numeric: tabular-nums; }
.player-table .points-part { width: 107px; text-align: right; white-space: nowrap; }
.player-table td { min-height: 43px; }
.player-table tr:hover td { background: #f8f8fd; }
.player-table .highlight td { background: #efebfd; }
.player-link { border: 0; padding: 0; background: transparent; color: var(--ink); font-weight: 730; text-align: left; overflow-wrap: anywhere; }
.player-link:hover { color: var(--royal); text-decoration: underline; text-underline-offset: 3px; }
.player-events, .team-status { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; font-weight: 500; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-block: 12px; color: var(--muted); font-size: 13px; }
.source-note { color: var(--muted); font-size: 13px; margin: 14px 0 24px; line-height: 1.55; }
.footer { display: flex; justify-content: space-between; gap: 12px; padding: 14px 0 23px; color: var(--muted); border-top: 1px solid var(--line); font-size: 13px; }
.footer a { text-underline-offset: 3px; }

.team-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.team-filters label { display: grid; gap: 5px; font-size: 13px; font-weight: 700; min-width: 0; }
.team-filters select { padding: 0 9px; min-width: 0; max-width: 100%; }
.team-table td { line-height: 1.45; overflow-wrap: anywhere; }
.team-point-label { display: none; }
.team-note { color: var(--muted); font-size: 13px; line-height: 1.55; padding: 12px 0; }

.results { margin-bottom: 12px; padding: 15px 20px; }
.results-head, .dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.results h2, .dialog-head h2 { font-size: 21px; letter-spacing: -.025em; }
.results p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.results ul { list-style: none; padding: 0; margin: 9px 0 0; max-height: 315px; overflow: auto; }
.results li + li { border-top: 1px solid var(--line); }
.results li button {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 12px; width: 100%;
  text-align: left; background: white; border: 0; color: var(--ink); padding: 8px 6px;
}
.results li button:hover { background: #f5f3fc; }
.results li small { grid-column: 1; grid-row: 2; color: var(--muted); font-size: 12px; }
.results li strong { overflow-wrap: anywhere; }
.results li span { grid-column: 2; grid-row: 1 / span 2; font-weight: 700; font-size: 13px; }

dialog { width: min(650px, calc(100% - 26px)); border: 1px solid var(--line); padding: 19px; border-radius: 14px; color: var(--ink); }
dialog::backdrop { background: #15163199; }
#detail-total { margin: 9px 0 13px; color: var(--muted); font-size: 14px; }
.detail-table th, .detail-table td, .rules-table th, .rules-table td { padding: 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
.detail-table thead, .rules-table thead { color: var(--muted); background: var(--paper); }
.detail-table th, .rules-table th { text-align: left; }
.detail-table td:last-child, .rules-table td { text-align: right; font-variant-numeric: tabular-nums; }
.detail-table td:nth-child(1), .detail-table td:nth-child(3), .detail-table td:nth-child(4) { white-space: nowrap; }
.rules-table { overflow: auto; margin-top: 10px; }
.rules-table thead th:not(:first-child) { text-align: right; }
.reference-page { max-width: 920px; padding-bottom: 22px; }
.reference-title { padding: 32px 0 18px; }
.reference-title h1 { font-size: clamp(30px, 5vw, 43px); letter-spacing: -.05em; }
.reference-title p { color: var(--muted); font-size: 14px; line-height: 1.55; margin-top: 7px; }
.reference-section { padding: 16px 20px; }
.reference-section + .reference-section { margin-top: 12px; }
.reference-section h2 { font-size: 20px; letter-spacing: -.025em; }
.reference-section p, .reference-section ul { font-size: 15px; line-height: 1.6; }
.reference-section h2 + p, .reference-note { margin-top: 8px; }
.reference-section ul { padding-inline-start: 18px; }
.reference-section li + li { margin-top: 5px; }
.reference-note { color: var(--muted); }
.rule-jumps { display: flex; flex-wrap: wrap; gap: 9px 16px; margin-top: 12px; }
.rule-jumps a { color: var(--royal); font-size: 14px; font-weight: 670; text-underline-offset: 3px; }

@media (max-width: 700px) {
  .wrap { width: calc(100% - 32px); }
  .hero-inner { padding-top: 24px; }
  .board-controls { align-items: start; flex-direction: column; }
  .search-form { width: 100%; }
}

@media (max-width: 480px) {
  .wrap { width: calc(100% - 28px); }
  .brand { font-size: 18px; }
  .topbar-inner { height: 52px; }
  .top-links { gap: 14px; }
  .top-link { font-size: 13px; }
  .hero-inner { padding: 23px 0 17px; }
  .hero h1 { font-size: 41px; }
  .hero-events { font-size: 12px; margin-top: 8px; }
  .board-controls { gap: 8px; margin-bottom: 10px; }
  .divisions, .level-list { width: 100%; }
  .level-list { justify-content: space-around; }
  .level-list button { padding-inline: 8px; font-size: 13px; }
  .board-head { padding: 13px 11px 10px; }
  .board-options { margin-top: 8px; }
  .scoring-entry { font-size: 12px; }
  .table-area { padding-inline: 10px; }
  .table-area th, .table-area td { padding: 8px 4px; font-size: 13px; }
  .table-area th:first-child, .table-area td:first-child { width: 42px; }
  .table-area th:last-child, .table-area td:last-child, .player-table .points-part { width: 47px; }
  .player-events, .team-status { font-size: 11px; }
  .team-filters { flex-direction: column; }
  .table-footer, .footer, .source-note { font-size: 12px; }
  .reference-section { padding: 14px 11px; }
  .rules-table th, .rules-table td, .detail-table th, .detail-table td { font-size: 12px; padding: 6px 4px; }
}

@media (max-width: 600px) {
  .level-list { flex-wrap: wrap; }
  #team-board .board-heading { gap: 4px 10px; }
  #team-board .board-heading .scoring-entry { margin-left: 0; }
  #team-board .row-count { white-space: nowrap; }
  .team-table, .team-table tbody { display: block; }
  .team-table thead {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .team-table tbody tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline; gap: 4px 12px; padding-block: 10px;
    border-bottom: 1px solid var(--line);
  }
  .team-table tbody tr:first-child { border-top: 1px solid var(--line); }
  .table-area .team-table td { width: auto; min-width: 0; padding: 0; border: 0; }
  .team-table .team-stage { font-weight: 750; }
  .team-table .team-roster { grid-column: 1 / -1; grid-row: 2; font-size: 14px; }
  .table-area .team-table .team-points { grid-column: 2; grid-row: 1; max-width: 47vw; white-space: normal; }
  .team-point-label {
    display: inline; margin-inline-end: 6px;
    color: var(--muted); font-size: 11px; font-weight: 600;
  }
}

/* Keep the result labels readable while the division columns scroll. */
.rules-table table:has(#matrix) { min-width: 28rem; }
.rules-table:has(#matrix) th:first-child {
  position: sticky; left: 0; z-index: 1; width: 7.5rem; min-width: 7.5rem;
  max-width: 7.5rem; white-space: normal; overflow-wrap: anywhere;
  background: var(--white);
}
.rules-table:has(#matrix) thead th:first-child { z-index: 2; background: var(--paper); }
@media (max-width: 600px) {
  .table-footer { flex-wrap: wrap; }
  .rules-table th, .rules-table td { font-size: 14px; }
  #player-detail {
    width: min(650px, calc(100vw - 24px)); max-width: none;
    max-height: calc(100dvh - 24px); padding: 16px; background: var(--white);
  }
  #player-detail .dialog-head {
    position: sticky; top: -16px; z-index: 2;
    padding-block: 8px; background: var(--white);
  }
  #player-detail .dialog-head h2 { min-width: 0; overflow-wrap: anywhere; }
  #player-detail .detail-table, #player-detail .detail-table tbody { display: block; }
  #player-detail .detail-table thead {
    position: absolute; width: 1px; height: 1px; padding: 0;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  #player-detail .detail-table tbody tr {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
    align-items: baseline; gap: 5px 10px; padding-block: 12px;
    border-bottom: 1px solid var(--line);
  }
  #player-detail .detail-table td {
    min-width: 0; padding: 0; border: 0; font-size: 14px; white-space: normal;
  }
  #player-detail .detail-table td:nth-child(2) {
    grid-column: 1 / -1; grid-row: 2; color: var(--muted); overflow-wrap: anywhere;
  }
  #player-detail .detail-table td:nth-child(3) { text-align: right; }
  #player-detail .detail-table .detail-points { white-space: nowrap; font-weight: 750; }
  #player-detail .detail-points::before {
    content: attr(data-label) ' '; color: var(--muted); font-size: 12px; font-weight: 500;
  }
}

/* 2026 시즌 카드 진입 보드 — 홈 feature-board(전광판)와 같은 언어 */
.season-card-board { position: relative; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 22px; margin: 18px 0 20px; padding: 15px 22px 17px; border-block-start: 1px solid var(--tour-rule, #ffffff34); border-inline-start: 3px solid var(--tour-red, #ff5147); background: #222220; color: #f5f2eb; text-decoration: none; }
.season-card-board .scb-year { color: var(--tour-red, #ff5147); font: 700 clamp(44px, 5vw, 64px)/.9 var(--tour-heading); font-variant-numeric: tabular-nums; }
.season-card-board .scb-copy { display: grid; gap: 3px; min-width: 0; }
.season-card-board .scb-label { color: #d0cbc2; font: 700 13px/1 var(--tour-heading); letter-spacing: .1em; }
.season-card-board strong { font-size: clamp(18px, 2vw, 22px); font-weight: 780; letter-spacing: -.03em; }
.season-card-board .scb-sub { color: #d0cbc2; font-size: 13px; }
.season-card-board .scb-cta { border-radius: 0; border-color: var(--tour-red, #ff5147); background: var(--tour-red, #ff5147); color: var(--dark, #171715); }
.season-card-board:hover .scb-cta { background: #ff756e; }
.detail-card-actions { display: flex; margin: 2px 0 12px; }
.detail-card-actions .primary { flex: 1; text-align: center; text-decoration: none; padding-block: 12px; }
@media (max-width: 640px) {
  .season-card-board { grid-template-columns: max-content minmax(0, 1fr); gap: 10px 16px; padding: 12px 14px 14px; }
  .season-card-board .scb-cta { grid-column: 1 / -1; min-height: 44px; }
  .season-card-board .scb-sub { display: none; }
}
.season-card-board .scb-thumb { width: 54px; height: 96px; margin: -6px 0 -10px; border: 1px solid #ffffff40; transform: rotate(4deg); }
@media (max-width: 640px) { .season-card-board .scb-thumb { position: absolute; right: 14px; top: 12px; width: 44px; height: 78px; } .season-card-board .scb-copy { padding-right: 52px; } }
