/* 대회 결과 화면: 상단바 → 예선·본선 탭 → 대회 제목 → 본선은 수상자 카드와 목록, 예선은 순위표 */
:root {
  color-scheme: dark;
  --bg: #130b2e;
  --bar: rgba(23, 15, 54, 0.85);
  --panel: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f1f0fa;
  --muted: #a8a3c7;
  --llm: #8f73ff;
  --judge: #ff3d8b;
  --gold: #ffb020;
  --soft: #c9bcff;
  --bronze: rgba(201, 188, 255, 0.5);
  --display: "Jua", "Noto Sans KR", system-ui, sans-serif;
  --body: "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 15px; }
.bg, .grid { position: fixed; inset: 0; pointer-events: none; }
.bg {
  background:
    radial-gradient(1100px 560px at 50% -12%, rgba(124, 92, 255, 0.42), transparent 62%),
    radial-gradient(900px 700px at 100% 55%, rgba(200, 40, 140, 0.22), transparent 65%),
    radial-gradient(700px 480px at 0% 100%, rgba(70, 60, 220, 0.22), transparent 62%),
    linear-gradient(120deg, #120a2e 0%, #1a0e3c 55%, #2a0f40 100%);
}
.grid {
  background-image: linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 80%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 80%);
}
a { color: inherit; }

.top {
  position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  background: var(--bar); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px);
}
.brand { font-weight: 800; font-size: 19px; color: var(--soft); text-decoration: none; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; }
.tabs button {
  border: 0; border-radius: 999px; padding: 8px 20px; background: transparent; color: var(--muted);
  font: 700 15px var(--body); cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--llm); color: #fff; }
.tabs button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

main {
  position: relative; max-width: 1120px; margin: 0 auto; display: grid; gap: 32px;
  padding-block: 40px 56px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
[hidden] { display: none !important; }
header.title { display: grid; gap: 10px; justify-items: center; text-align: center; }
h1, .round { font-family: var(--display); font-weight: 400; word-break: keep-all; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(28px, 4.6vw, 52px); line-height: 1.2; letter-spacing: 0.01em; color: #fff; text-shadow: 0.07em 0.07em 0 var(--judge); }
.round { font-size: clamp(22px, 3vw, 32px); color: var(--gold); letter-spacing: 0.04em; }
.theme { margin: 0; font-size: 18px; color: var(--muted); }
.theme b { color: #fff; font-weight: 700; }
.view { display: grid; gap: 28px; }
/* 앱 이름 링크: 화살표로 새 탭에서 열리는 것을 알린다 */
.open { display: inline-flex; align-items: center; gap: 7px; color: var(--gold); font-weight: 700; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.open svg { flex: none; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.seat.grand .open svg, .seat.gold .open svg { width: 22px; height: 22px; }
.open:hover { color: #ffd06b; text-decoration-thickness: 2.5px; }
.open:hover svg { transform: translate(2px, -2px); }
.open svg { transition: transform 0.15s; }
.open:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 3px; }
.no-app { color: var(--muted); font-weight: 500; }
.row:hover, tbody tr:not(.cut):hover td { background: rgba(255, 255, 255, 0.05); }

/* 본선 수상자 */
.awards { list-style: none; margin: 0; padding: 0 9px 9px 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px 20px; }
.seat {
  --tier: var(--bronze);
  grid-column: span 3; min-width: 0; display: grid; gap: 10px; align-content: space-between; padding: 18px 18px 18px; background: #1d1244;
  border: 2px solid var(--tier); border-radius: 14px; box-shadow: 6px 6px 0 var(--tier);
}
.seat.silver { --tier: var(--llm); }
.seat.grand, .seat.gold { padding: 26px 28px 24px; gap: 12px; }
.seat.grand { --tier: var(--judge); grid-column: span 7; background: #27144f; box-shadow: 9px 9px 0 var(--tier); }
.seat.gold { --tier: var(--gold); grid-column: span 5; box-shadow: 8px 8px 0 var(--tier); }
.seat .head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.seat .award { font-family: var(--display); font-size: 24px; color: var(--soft); }
.seat.grand .award, .seat.gold .award { font-size: 32px; color: var(--gold); }
.seat .place { font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.seat .name { font-family: var(--display); font-size: 29px; line-height: 1.15; color: #fff; }
.seat.gold .name { font-size: clamp(34px, 4vw, 44px); }
.seat.grand .name { font-size: clamp(38px, 4.8vw, 52px); }
.seat .app { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.seat.grand .app, .seat.gold .app { font-size: 18px; }
.seat .total { font-size: 32px; font-weight: 900; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.seat.gold .total { font-size: clamp(38px, 4.4vw, 46px); }
.seat.grand .total { font-size: clamp(44px, 5.4vw, 60px); }
.seat .total small { font-size: 0.38em; font-weight: 700; color: var(--muted); margin-left: 4px; }
.meter { display: grid; gap: 7px; }

/* 점수 막대 */
.bar { display: flex; height: 9px; border-radius: 3px; background: rgba(255, 255, 255, 0.09); overflow: hidden; }
.bar i { display: block; height: 100%; }
.bar .l { background: var(--llm); }
.bar .j { background: var(--judge); }
.parts { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.parts b { color: var(--text); font-weight: 700; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: flex-end; font-size: 13px; font-weight: 500; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; }

/* 본선 7위부터 */
.list { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.row { display: grid; grid-template-columns: 44px 72px minmax(0, 1.2fr) minmax(0, 1.3fr) 66px; align-items: center; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .place { font-family: var(--display); font-size: 22px; color: var(--muted); text-align: center; }
.row .name { font-family: var(--display); font-size: 20px; color: #fff; }
.row .app, .app-cell { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-weight: 700; overflow-wrap: anywhere; }
.row .score { min-width: 0; display: grid; gap: 5px; }
.row .total { font-size: 22px; font-weight: 900; text-align: right; font-variant-numeric: tabular-nums; }

/* 예선 순위표 */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 12px 14px; text-align: right; border-top: 1px solid var(--line); }
thead th { position: sticky; top: 61px; z-index: 2; border-top: 0; background: #241750; color: var(--muted); font-size: 13px; font-weight: 700; }
thead th:first-child { border-top-left-radius: 13px; }
thead th:last-child { border-top-right-radius: 13px; }
th:nth-child(-n+3), td:nth-child(-n+3) { text-align: left; }
td.rank { width: 64px; font-family: var(--display); font-size: 20px; text-align: center; color: var(--soft); }
th.rank { text-align: center; }
td.who { width: 84px; font-family: var(--display); font-size: 19px; color: #fff; }
td.app { font-weight: 700; overflow-wrap: anywhere; }
td.sum { font-size: 18px; font-weight: 900; color: #fff; }
td.sub { color: var(--muted); font-weight: 500; }
tr.cut td { padding: 8px 14px; background: rgba(255, 176, 32, 0.12); color: var(--gold); text-align: center; font-weight: 700; font-size: 13px; }
tbody tr.final td.rank { color: var(--gold); }

@media (max-width: 980px) { .seat { grid-column: span 6; } }
@media (max-width: 760px) {
  main { gap: 24px; padding-block: 24px 40px; }
  .top { grid-template-columns: auto 1fr; }
  .tabs { justify-self: end; }
  .tabs button { padding: 7px 14px; font-size: 14px; }
  .seat, .seat.grand, .seat.gold { grid-column: 1 / -1; }
  .legend { justify-content: flex-start; }
  .row { grid-template-columns: 36px 52px minmax(0, 1fr) auto; gap: 6px 10px; padding: 12px 14px; }
  .row .score { grid-column: 1 / -1; order: 6; }
  .row .total { font-size: 20px; }
  th, td { padding: 10px 8px; }
  th.opt, td.opt { display: none; }
  td.rank { width: 42px; font-size: 18px; }
  td.who { width: 58px; font-size: 17px; }
  thead th { top: 57px; }
}
