 :root {
  color-scheme: dark;
  --navy: #031a30;
  --blue: #082b4a;
  --line: #17618a;
  --gold: #f3c94f;
  --white: #f7f8fb;
  --muted: #b7c8d8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: #020d18;
  color: var(--white);
  font-family: Arial, Helvetica, sans-serif;
}

.deck { display: grid; width: 100vw; height: 100vh; height: 100dvh; place-items: center; }
.slide {
  position: relative;
  width: min(100vw, 177.78vh);
  height: min(56.25vw, 100vh);
  padding: 4.2% 5%;
  overflow: hidden;
  border: 1px solid #185177;
  background: radial-gradient(ellipse at 50% 110%, #10517b 0, transparent 48%), linear-gradient(140deg, #041426, #052746 60%, #031321);
}
.slide[hidden] { display: none; }
.slide.active { display: flex; flex-direction: column; animation: appear .5s ease both; }
@keyframes appear { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.eyebrow { color: var(--gold); font-size: clamp(12px, 1.2vw, 20px); font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin: 2.5vh 0 1.5vh; font-size: clamp(40px, 7vw, 104px); line-height: .96; }
h2 { margin: 0 0 2.3vh; font-size: clamp(26px, 3.2vw, 48px); }

.cover { justify-content: center; }
.cover h1 { position: relative; z-index: 1; margin: 0; }
.cover h1 span { color: var(--gold); }
.cover::after { position: absolute; right: 8%; bottom: -14%; color: #ffffff08; content: "♠"; font-size: 34vw; transform: rotate(-15deg); pointer-events: none; }

.podium-slide .eyebrow { margin-bottom: 1.2vh; }
.podium-slide h2 { margin-bottom: 4vh; }
.podium { display: grid; flex: 1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2%; align-items: end; }
.card {
  display: flex;
  min-height: 44%;
  flex-direction: column;
  justify-content: center;
  padding: 2vw 1.5vw;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(160deg, #0b3152, #04182a);
  box-shadow: 0 12px 35px #0005;
  text-align: center;
}
.card.place-1 { min-height: 82%; padding: 2.5vw 1.8vw; border: 2px solid var(--gold); background: linear-gradient(160deg, #705b1d, #132942 78%); box-shadow: 0 16px 42px #0008, 0 0 28px #f3c94f30; }
.card.place-2 { min-height: 62%; border-color: #b7c8d8; }
.card.place-3 { min-height: 48%; border-color: #a76b43; }
.medal { margin-bottom: 1vh; font-size: clamp(42px, 6vw, 84px); line-height: 1; }
.place-1 .medal { font-size: clamp(58px, 7vw, 100px); }
.rank { font-size: clamp(22px, 2.6vw, 38px); font-weight: 800; }
.name { margin: 1.4vh 0; font-size: clamp(16px, 1.55vw, 23px); font-weight: 700; overflow-wrap: anywhere; }
.place-1 .rank { font-size: clamp(28px, 3.1vw, 46px); }
.place-1 .name { font-size: clamp(20px, 2vw, 30px); }
.place-1 .points { font-size: clamp(22px, 2vw, 30px); }
.place-2 .rank { font-size: clamp(24px, 2.8vw, 40px); }
.points { color: var(--gold); font-size: clamp(17px, 1.7vw, 25px); font-weight: 800; }

.highlights-slide .eyebrow { margin-bottom: 2.4em; }
.highlights-slide h2 { margin-bottom: 2.3vh; }
.six-grid { display: grid; flex: 1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2vw; }
.six-card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 1vw; padding: 1.3vw; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(145deg, #0b3152, #04182a); }
.six-card:nth-child(-n+3) { border-color: #b69135; }
.six-num { color: var(--gold); font-size: clamp(28px, 3.5vw, 52px); font-weight: 800; }
.six-card .name { margin: 0 0 .7vh; font-size: clamp(13px, 1.3vw, 19px); }
.six-card .points { font-size: clamp(13px, 1.2vw, 18px); }

.ranking-slide { padding-top: 2.8%; padding-bottom: 4.5%; }
.ranking-slide h2 { margin-bottom: 1.2vh; text-align: center; }
.eyebrow-centered { text-align: center; }
.columns { display: grid; min-height: 0; flex: 1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1%; }
.ranking-column { min-width: 0; }
.rank-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.rank-table th, .rank-table td { padding: .36vh .42vw; border: 1px solid #1b5276; font-size: clamp(8px, .75vw, 11px); line-height: 1.13; overflow-wrap: anywhere; }
.rank-table th { background: #0b3152; color: var(--gold); letter-spacing: .04em; text-transform: uppercase; }
.rank-table td:first-child, .rank-table th:first-child { width: 12%; text-align: center; }
.rank-table td:last-child, .rank-table th:last-child { width: 17%; font-weight: 700; text-align: center; }
.rank-table tbody tr:nth-child(even) td { background: #ffffff08; }
.rank-table tbody tr:last-child td { border-bottom-color: var(--gold); }

.footer { position: absolute; right: 5%; bottom: 1.3%; left: 5%; display: flex; justify-content: space-between; color: var(--muted); font-size: clamp(9px, .8vw, 12px); letter-spacing: .1em; }
.controls { position: fixed; right: 18px; bottom: 14px; z-index: 5; display: flex; gap: 8px; }
button { min-height: 40px; padding: 8px 14px; border: 1px solid #39749a; border-radius: 20px; background: #0b3152; color: var(--white); cursor: pointer; font: inherit; touch-action: manipulation; }
button:hover { background: #174a70; }
button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.counter { position: fixed; bottom: 21px; left: 18px; z-index: 5; color: #a9bdcd; font-size: 13px; }
.pdf-button { position: fixed; top: 16px; right: 18px; z-index: 10; display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; padding: 9px 14px; border-color: var(--gold); border-radius: 999px; background: #082b4a; color: var(--white); font-size: 14px; font-weight: 700; box-shadow: 0 4px 18px #0005; }
.pdf-button:hover { background: #174a70; }
.pdf-button svg { width: 18px; height: 18px; fill: none; stroke: var(--gold); stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }

@media (max-aspect-ratio: 4/3) and (min-width: 701px) { .slide { width: 100vw; height: 56.25vw; } }

@media (max-width: 700px) {
  body { min-height: 100%; overflow: hidden; }
  .deck { display: block; width: 100%; height: 100vh; height: 100dvh; }
  .slide, .slide.active { width: 100%; height: 100vh; height: 100dvh; min-height: 0; padding: max(76px, calc(env(safe-area-inset-top) + 60px)) 20px calc(88px + env(safe-area-inset-bottom)); overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; border: 0; }
  .slide.active { display: flex; flex-direction: column; }
  .cover { justify-content: center; padding-top: max(76px, calc(env(safe-area-inset-top) + 60px)); }
  .cover h1 { font-size: clamp(42px, 12vw, 66px); line-height: 1; }
  .cover::after { right: -9%; bottom: -2%; font-size: 62vw; }
  .eyebrow { font-size: 11px; letter-spacing: .13em; }
  h2 { margin-bottom: 20px; font-size: clamp(25px, 7vw, 34px); line-height: 1.12; }
  .podium-slide .eyebrow { margin-bottom: 10px; }
  .podium-slide h2 { margin-bottom: 30px; }
  .podium { grid-template-columns: 1fr; flex: initial; gap: 12px; align-items: stretch; }
  .card, .card.place-1, .card.place-2, .card.place-3 { min-height: 0; padding: 18px 16px; border-radius: 14px; }
  .card.place-1 { padding: 24px 18px; border-width: 2px; }
  .medal { margin-bottom: 8px; font-size: 42px; }
  .place-1 .medal { font-size: 54px; }
  .rank, .place-2 .rank { font-size: 21px; }
  .place-1 .rank { font-size: 25px; }
  .card .name { margin: 10px 0; font-size: 17px; line-height: 1.35; }
  .place-1 .name { font-size: 21px; }
  .card .points { font-size: 17px; }
  .place-1 .points { font-size: 20px; }

  .highlights-slide .eyebrow { margin-bottom: 2.4em; }
  .six-grid { grid-template-columns: 1fr; flex: initial; gap: 10px; }
  .six-card { min-height: 76px; gap: 14px; padding: 14px; border-radius: 12px; }
  .six-num { min-width: 42px; font-size: 30px; }
  .six-card .name { margin: 0 0 6px; font-size: 15px; line-height: 1.35; }
  .six-card .points { font-size: 14px; }

  .ranking-slide { padding-top: max(76px, calc(env(safe-area-inset-top) + 60px)); }
  .ranking-slide h2 { margin-bottom: 18px; text-align: left; }
  .eyebrow-centered { text-align: left; }
  .columns { grid-template-columns: 1fr; flex: initial; gap: 16px; }
  .rank-table th, .rank-table td { padding: 9px 8px; font-size: 13px; line-height: 1.35; }
  .rank-table td:first-child, .rank-table th:first-child { width: 15%; }
  .rank-table td:last-child, .rank-table th:last-child { width: 22%; }
  .footer { position: static; gap: 12px; margin-top: 24px; padding-top: 14px; border-top: 1px solid #ffffff20; font-size: 9px; line-height: 1.4; }
  .footer span:last-child { flex: 0 0 auto; }

  .pdf-button { top: max(12px, env(safe-area-inset-top)); right: 12px; min-height: 40px; padding: 8px 12px; font-size: 13px; }
  .controls { right: 0; bottom: 0; left: 0; justify-content: flex-end; gap: 10px; padding: 10px 16px max(10px, env(safe-area-inset-bottom)); border-top: 1px solid #39749a; background: #020d18f2; backdrop-filter: blur(12px); }
  .controls button { min-height: 44px; padding: 10px 16px; font-size: 14px; }
  .counter { top: max(16px, env(safe-area-inset-top)); right: auto; bottom: auto; left: 16px; z-index: 6; padding: 6px 10px; border: 1px solid #39749a; border-radius: 999px; background: #020d18d9; font-size: 12px; }
}

@media (max-width: 360px) {
  .slide, .slide.active { padding-right: 16px; padding-left: 16px; }
  .pdf-button { right: 8px; gap: 6px; padding-right: 10px; padding-left: 10px; }
  .counter { left: 10px; }
  .controls { justify-content: center; padding-right: 8px; padding-left: 8px; }
  .controls button { padding-right: 12px; padding-left: 12px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }

@page { size: landscape; margin: 10mm; }
@media print {
  html, body { width: auto; height: auto; min-height: 0; overflow: visible; background: #fff; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .deck { display: block; width: auto; height: auto; }
  .slide, .slide[hidden], .slide.active { display: flex !important; position: relative; width: 100%; height: 180mm; min-height: 180mm; padding: 12mm; overflow: visible; animation: none; break-after: page; page-break-after: always; }
  .slide:last-child { break-after: auto; page-break-after: auto; }
  .cover { justify-content: center; }
  .podium-slide h2 { margin-bottom: 10mm; }
  .columns { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3mm; }
  .rank-table th, .rank-table td { padding: 1.2mm; font-size: 7.5pt; line-height: 1.15; }
  .footer { bottom: 4mm; }
  .controls, .counter, .pdf-button, noscript { display: none !important; }
}
