/* Public fourth-tournament surface only. The operator keeps its existing layout. */
@font-face { font-family: "Fourth Pretendard"; src: url("assets/fourth-tournament-2026/ui/PretendardVariable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
body[data-page="fourth-view"] {
  --fourth-bg: #001326;
  --fourth-card: #0b2042;
  --fourth-control: #061a36;
  --fourth-status-bg: #102a50;
  --fourth-control-line: #38547e;
  --fourth-accent: #87b9ff;
  /* Shared header/link rules still consume the legacy token name. */
  --fourth-teal: var(--fourth-accent);
  --fourth-line: #253e64;
  --fourth-muted: #b2cedc;
  background: var(--fourth-bg);
  color: #f1f8ff;
  font-family: "Fourth Pretendard", "Pretendard", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  line-height: 1.5;
}
.fv-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body[data-page="fourth-view"] button,
body[data-page="fourth-view"] select,
body[data-page="fourth-view"] input { font: inherit; }
body[data-page="fourth-view"] button { cursor: pointer; }
body[data-page="fourth-view"] :is(button, input, select):focus-visible { outline: 3px solid var(--fourth-teal); outline-offset: 3px; }
body[data-page="fourth-view"] button:hover { filter: brightness(1.14); }
body[data-page="fourth-view"] .fourth-topbar { padding: 14px max(32px, calc((100vw - 1344px) / 2)); gap: 28px; grid-template-columns: 164px 1fr auto; background: var(--fourth-bg); border-color: var(--fourth-line); }
body[data-page="fourth-view"] .fourth-brand { min-height: 56px; border-right: 1px solid var(--fourth-line); }
body[data-page="fourth-view"] .fourth-brand strong { font-size: 23px; }
body[data-page="fourth-view"] .fourth-eyebrow { font-size: 13px; letter-spacing: -.02em; }
body[data-page="fourth-view"] .fourth-topbar h1 { font-size: 27px; font-weight: 850; }
body[data-page="fourth-view"] .fourth-date { font-size: 13px; color: #d0e5ef; }
body[data-page="fourth-view"] .fourth-shell { max-width: 1440px; padding: 28px 42px 48px; }
body[data-page="fourth-view"] .fourth-grade-tabs { width: 690px; max-width: 100%; gap: 8px; }
body[data-page="fourth-view"] .fourth-grade-tab { min-height: 64px; border-radius: 10px; background: var(--fourth-card); font-size: 16px; }
body[data-page="fourth-view"] .fourth-grade-tab span { font-size: 12px; font-weight: 500; color: #c3deea; }
body[data-page="fourth-view"] .fourth-grade-tab.is-active { border: 2px solid var(--fourth-accent); background: #102c54; }
.fv-nav { display: flex; gap: 8px; margin: 8px 0 14px; border-bottom: 1px solid var(--fourth-line); }
.fv-nav button { color: var(--fourth-muted); border: 0; border-bottom: 3px solid transparent; padding: 14px 25px; min-height: 52px; background: transparent; font-weight: 600; }
.fv-nav button[aria-pressed="true"] { color: var(--fourth-teal); border-bottom-color: var(--fourth-teal); font-weight: 800; }
.fv-surface { padding: 24px 0; border: 0; border-radius: 0; background: transparent; }
.fv-heading { display: flex; gap: 20px; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--fourth-line); }
.fv-heading > div:first-child { display: flex; align-items: center; gap: 24px; }
.fv-heading h2 { margin: 0; font-size: 32px; line-height: 1.3; font-weight: 850; letter-spacing: -.055em; }
.fv-heading span { color: #d2e5ef; font-size: 15px; }
.fv-date-control select { min-height: 44px; min-width: 212px; padding: 8px 22px; color: #edf7ff; background: var(--fourth-control); border: 1px solid var(--fourth-control-line); border-radius: 28px; font-weight: 750; text-align: center; cursor: pointer; color-scheme: dark; }
.fv-date-control { position: relative; }
.fv-date-control > img { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.fv-date-control select { padding-left: 50px; }
.fv-icon { filter: invert(92%) sepia(9%) saturate(461%) hue-rotate(160deg); flex: 0 0 auto; }
.fv-filters { display: flex; justify-content: space-between; gap: 18px; margin: 12px 0 16px; align-items: center; }
.fv-group-filter { display: flex; gap: 8px; }
.fv-group-filter button { min-height: 46px; min-width: 86px; padding: 8px 18px; border: 1px solid var(--fourth-line); border-radius: 10px; color: #d5e9f4; background: var(--fourth-card); }
.fv-group-filter button[aria-pressed="true"], .fv-final-switch button[aria-pressed="true"] { color: #fff; background: #2456a6; border-color: var(--fourth-accent); font-weight: 800; }
.fv-search { width: 310px; max-width: 100%; position: relative; }
.fv-search > img { position: absolute; top: 50%; right: 16px; transform: translateY(-50%); pointer-events: none; }
.fv-search input { width: 100%; min-height: 46px; padding: 10px 20px; color: #f3fbff; background: var(--fourth-control); border: 1px solid var(--fourth-control-line); border-radius: 28px; }
.fv-search input::placeholder { color: var(--fourth-muted); }
.fv-search input { padding-right: 48px; }
.fv-search input::-webkit-search-cancel-button { cursor: pointer; }
.fv-prelim-layout { display: grid; grid-template-columns: minmax(0, 1fr) 264px; gap: 24px; align-items: start; }
.fv-list-title { color: #c2d8ff; margin: 0 0 12px; font-size: 20px; letter-spacing: -.03em; }
.fv-match-list { border: 0; border-radius: 0; overflow: hidden; }
.fv-match { display: grid; grid-template-columns: 153px minmax(0, 1fr); align-items: center; min-height: 60px; padding: 10px 18px; border-bottom: 1px solid var(--fourth-line); background: transparent; position: relative; }
.fv-match:last-child { border-bottom: 0; }
.fv-match-meta { display: flex; align-items: center; gap: 18px; color: var(--fourth-muted); font-size: 13px; }
.fv-match-meta time { font-size: 16px; font-weight: 750; color: #f4f9ff; font-variant-numeric: tabular-nums; }
.fv-match-meta small { position: absolute; right: 20px; bottom: 10px; font-size: 10px; color: #b8d0da; }
.fv-status { position: absolute; right: 14px; top: 12px; color: #d1e5ef; border: 1px solid var(--fourth-control-line); background: var(--fourth-status-bg); font-size: 11px; border-radius: 20px; padding: 1px 10px; }
.fv-status.is-complete { color: var(--fourth-accent); border-color: #456ea8; }
.fv-pair { display: grid; grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr); align-items: center; gap: 12px; padding-right: 57px; padding-left: 20px; border-left: 1px solid var(--fourth-line); }
.fv-team { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 15px; font-weight: 750; line-height: 1.45; }
.fv-team img { flex: 0 0 32px; width: 32px; height: 32px; object-fit: contain; }
.fv-team span { overflow-wrap: anywhere; word-break: keep-all; min-width: 0; }
.fv-versus { color: #f1f8ff; font-size: 28px; line-height: 1.2; font-weight: 850; white-space: nowrap; text-align: center; font-variant-numeric: tabular-nums; }
.fv-match:not(:has(.is-complete)) .fv-versus { font-size: 14px; color: var(--fourth-muted); }
.fv-side-score { display: none; }
.fv-score { color: #f1f8ff; font-weight: inherit; }
.fv-score.is-score-winner { color: var(--fourth-gold); }
.fv-score.is-score-loser { opacity: .5; }
.fv-group { border: 0; background: transparent; padding: 20px 0; border-radius: 0; min-width: 0; }
.fv-group header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.fv-group h3 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.fv-group header > span { font-size: 12px; color: var(--fourth-muted); }
.fv-roster { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.fv-group-status { padding-top: 20px; border-top: 1px solid var(--fourth-line); margin: 24px 0 12px; font-size: 13px; color: var(--fourth-muted); }
.fv-outline { border: 1px solid var(--fourth-teal); color: var(--fourth-teal); border-radius: 7px; background: transparent; padding: 8px 12px; min-height: 44px; font-weight: 750; }
.fv-group .fv-outline { width: 100%; }
.fv-group-hint { color: var(--fourth-muted); font-size: 14px; }
.fv-group-summary { display: grid; gap: 8px; margin-bottom: 20px; }
.fv-group-summary button { display: flex; justify-content: space-between; min-height: 48px; padding: 10px 12px; color: var(--fourth-ink); background: var(--fourth-card); border: 1px solid var(--fourth-line); border-radius: 6px; }
.fv-group-summary strong { color: var(--fourth-teal); }
.fv-group-summary span { color: var(--fourth-muted); }
.fv-empty { padding: 48px 20px; text-align: center; border: 0; border-radius: 0; }
.fv-empty h3 { margin: 0; font-size: 19px; }
.fv-empty p { color: var(--fourth-muted); }
.fv-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; margin-top: 18px; border: 0; border-radius: 0; font-size: 14px; }
.fv-footer p { margin: 0; }
.fv-footer .fourth-source-button { min-height: 44px; padding: 8px 12px; border: 0; text-decoration: underline; text-underline-offset: 4px; font-size: 13px; flex-shrink: 0; }
.fv-rules { color: var(--fourth-muted); font-size: 12px; margin: 14px 4px 0; }
.fv-standings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.fv-standings { width: 100%; border-collapse: collapse; font-size: 13px; }
.fv-standings caption { text-align: left; }
.fv-standings th, .fv-standings td { padding: 10px 4px; border-bottom: 1px solid var(--fourth-line); text-align: center; }
.fv-standings thead th { color: var(--fourth-muted); font-size: 12px; white-space: nowrap; }
.fv-standings th[scope="row"] { text-align: left; }
.fv-standings .fv-team { font-size: 13px; gap: 6px; }
.fv-standings .fv-team img { width: 26px; height: 26px; flex-basis: 26px; }
.fv-sidebar .fv-standings .fv-team img { display: none; }
.fv-sidebar .fv-standings .fv-team { font-size: 12px; }
.fv-final-switch { display: flex; border: 1px solid var(--fourth-control-line); border-radius: 28px; overflow: hidden; min-width: 320px; }
.fv-final-switch button { flex: 1; min-height: 46px; padding: 8px 22px; border: 0; border-radius: 28px; background: transparent; color: #c6e2ee; }
.fv-round-switch { display: none; }
.fv-bracket { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px; padding: 24px 0 4px; }
.fv-round { min-width: 0; }
.fv-round h3 { color: var(--fourth-teal); margin: 0 0 16px; padding-left: 8px; font-size: 22px; }
.fv-round:last-child h3 { color: var(--fourth-gold); }
.fv-round-matches { display: flex; flex-direction: column; justify-content: space-around; gap: 18px; min-height: 400px; }
.fv-final-match { padding: 15px 18px; border: 0; border-radius: 6px; background: var(--fourth-card); min-width: 0; }
.fv-final-match header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 10px; color: #c4e2ed; font-size: 12px; }
.fv-final-match header strong { font-size: 14px; }
.fv-final-status { color: var(--fourth-muted); font-size: 11px; }
.fv-final-location { display: flex; gap: 8px; flex-wrap: wrap; }
.fv-final-location > span { white-space: nowrap; }
.fv-final-side { display: grid; grid-template-columns: minmax(0, 1fr) max-content; align-items: center; gap: 12px; min-height: 46px; font-size: 15px; padding: 6px 0; }
.fv-final-side > strong { min-width: 2ch; font-size: 28px; line-height: 1.2; font-weight: 850; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fv-final-side ~ .fv-final-side { border-top: 1px solid var(--fourth-line); }
.fv-final-versus { display: none; color: var(--fourth-muted); font-size: 12px; }
.fv-final-side.is-winner { color: var(--fourth-teal); }
.fv-final-side.is-winner > strong { text-decoration: underline; text-underline-offset: 5px; }
.fv-seed { display: flex; align-items: center; gap: 10px; font-weight: 700; overflow-wrap: anywhere; word-break: keep-all; }
.fv-pk { color: var(--fourth-teal); font-size: 11px; }
.fv-round:last-child .fv-final-match header strong { color: var(--fourth-gold); }
.fv-placement { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding-top: 24px; }
body[data-page="fourth-view"] .fourth-dialog button { width: 60px; font-size: 14px; border-radius: 8px; }
@media (max-width: 1100px) {
  body[data-page="fourth-view"] .fourth-shell { padding-left: 28px; padding-right: 28px; }
  .fv-prelim-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .fv-sidebar { display: none; }
  .fv-match { grid-template-columns: 106px minmax(0, 1fr); padding-left: 12px; }
  .fv-match-meta { gap: 10px; }
  .fv-pair { padding-left: 12px; gap: 8px; }
  .fv-heading h2 { font-size: 27px; }
  .fv-heading > div:first-child { gap: 16px; }
  .fv-group-filter button { min-width: 64px; padding: 8px 12px; }
  .fv-bracket { gap: 20px; }
}
@media (max-width: 900px) {
  .fv-sidebar { display: none; }
  .fv-prelim-layout { grid-template-columns: minmax(0, 1fr); }
  body[data-page="fourth-view"] .fourth-date { display: none; }
  body[data-page="fourth-view"] .fourth-topbar { grid-template-columns: 150px 1fr; }
  .fv-placement { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  body[data-page="fourth-view"] .fourth-topbar { padding: 20px 18px; grid-template-columns: 104px minmax(0, 1fr); gap: 14px; }
  body[data-page="fourth-view"] .fourth-brand { grid-row: auto; min-height: 42px; gap: 4px; }
  body[data-page="fourth-view"] .fourth-brand strong { font-size: 16px; }
  body[data-page="fourth-view"] .fourth-brand span { font-size: 9px; }
  body[data-page="fourth-view"] .fourth-topbar h1 { font-size: 17px; line-height: 1.3; word-break: keep-all; }
  body[data-page="fourth-view"] .fourth-eyebrow { font-size: 10px; margin-bottom: 4px; }
  body[data-page="fourth-view"] .fourth-shell { padding: 16px 16px 32px; }
  body[data-page="fourth-view"] .fourth-grade-tabs { gap: 5px; width: 100%; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  body[data-page="fourth-view"] .fourth-grade-tab { min-height: 52px; border-radius: 8px; font-size: 12px; padding: 4px 2px; }
  body[data-page="fourth-view"] .fourth-grade-tab span { font-size: 10px; }
  .fv-nav { margin: 12px 0 8px; gap: 0; }
  .fv-nav button { flex: 1; padding: 10px 4px; font-size: 14px; min-height: 48px; white-space: nowrap; }
  .fv-surface { padding: 16px 0; }
  .fv-heading { display: grid; gap: 14px; border: 0; padding: 0; justify-content: stretch; }
  .fv-heading > div:first-child { display: grid; gap: 4px; }
  .fv-heading h2 { font-size: 27px; }
  .fv-heading span { font-size: 13px; }
  .fv-date-control select { width: 100%; min-height: 44px; }
  .fv-filters { display: grid; gap: 12px; margin: 12px 0 16px; justify-content: stretch; }
  .fv-group-filter { width: 100%; gap: 6px; }
  .fv-group-filter button { flex: 1; min-width: 0; padding: 8px 4px; min-height: 44px; border-radius: 8px; font-size: 13px; }
  .fv-search { width: 100%; }
  .fv-search input { min-height: 44px; font-size: 16px; padding: 8px 48px 8px 16px; }
  .fv-list-title { font-size: 18px; margin-bottom: 10px; }
  .fv-match-list { border: 0; overflow: visible; display: grid; gap: 10px; }
  .fv-match { display: block; padding: 10px 14px 8px; border: 0; border-radius: 6px; background: var(--fourth-card); min-height: 118px; }
  .fv-match-meta { gap: 14px; margin-bottom: 8px; }
  .fv-match-meta time { font-size: 15px; }
  .fv-match-meta span { font-size: 11px; }
  .fv-match-meta small { position: static; }
  .fv-status { right: 12px; top: 10px; padding: 0 9px; }
  .fv-pair { display: block; padding: 0; border: 0; }
  .fv-side { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; min-height: 36px; }
  .fv-side + .fv-versus + .fv-side { border-top: 1px solid var(--fourth-line); }
  .fv-side-score { display: block; flex: 0 0 auto; min-width: 2ch; font-size: 24px; line-height: 1.2; font-weight: 850; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
  .fv-versus { display: none; }
  .fv-team { font-size: 14px; gap: 10px; }
  .fv-team img { flex-basis: 28px; width: 28px; height: 28px; }
  .fv-footer { display: grid; gap: 8px; margin-top: 12px; padding: 14px 0; font-size: 12px; }
  .fv-footer .fourth-source-button { justify-self: start; padding: 4px 0; }
  .fv-rules { font-size: 11px; }
  .fv-standings-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .fv-group { padding: 16px 0; }
  .fv-group h3 { font-size: 20px; }
  .fv-standings { font-size: 12px; }
  .fv-standings .fv-team { font-size: 12px; }
  .fv-standings .fv-team img { width: 22px; height: 22px; flex-basis: 22px; }
  .fv-final-switch { min-width: 0; width: 100%; }
  .fv-final-switch button { min-height: 44px; padding: 8px 10px; }
  .fv-final-match { padding: 12px 14px; }
  .fv-final-side { font-size: 14px; }
  .fv-final-side > strong { font-size: 24px; }
  .fv-placement { grid-template-columns: minmax(0, 1fr); gap: 12px; padding-top: 18px; }
}
/* Narrow desktops/tablets use the same readable round-by-round cards as mobile. */
@media (max-width: 1100px) {
  .fv-round-switch { display: flex; border: 1px solid var(--fourth-control-line); border-radius: 24px; overflow: hidden; margin: 18px 0 0; }
  .fv-round-switch button { flex: 1; min-height: 44px; color: #d6ebf4; background: var(--fourth-card); border: 0; border-right: 1px solid var(--fourth-control-line); border-radius: 0; font-weight: 700; }
  .fv-round-switch button:last-child { border-right: 0; }
  .fv-round-switch button[aria-pressed="true"] { color: var(--fourth-accent); background: #102c54; box-shadow: inset 0 0 0 2px var(--fourth-accent); border-radius: 24px; }
  .fv-bracket { display: block; padding-top: 18px; }
  .fv-round { display: none; }
  .fv-round.is-selected { display: block; }
  .fv-round h3 { font-size: 20px; padding: 0; margin-bottom: 10px; }
  .fv-round-matches { min-height: 0; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
