#modal[data-dialog="results"] {
  --night: #162b42;
  --ivory: #fff8df;
  background: radial-gradient(ellipse at 38% 46%, #10394379, #101b35df);
  padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}
#modal[data-dialog="results"] .dialog {
  position: relative; z-index: 1; isolation: isolate;
  width: min(920px, 100%); max-height: 100%; padding: 0;
  background: var(--night); color: var(--ivory);
  border: 3px solid #131f34; border-radius: 19px;
  box-shadow: 0 0 0 2px #e6cb8a, 0 7px 0 #0c172c, 0 16px 54px #050f217a;
  animation: results-arrive .48s cubic-bezier(.16,.87,.32,1) both;
}
#modal[data-dialog="results"] .standings-board { overflow: hidden; border-radius: inherit; }
#modal[data-dialog="results"] .standings-head {
  position: relative; display: flex; align-items: center; gap: 16px;
  padding: 21px 26px 19px; background: linear-gradient(108deg,#24445a,#1b304b 70%);
  border-bottom: 2px solid #0a1d31;
}
#modal[data-dialog="results"] .result-flag {
  flex: none; display: block; width: 37px; height: 35px;
  transform: rotate(-9deg) skewX(-9deg);
  background: repeating-conic-gradient(#183447 0 25%,#fff6d4 0 50%) 0 0/13px 13px;
  border: 2px solid #fff6d4; border-radius: 2px 6px 4px 2px; box-shadow: -3px 4px 0 #f9b640;
}
#modal[data-dialog="results"] .standings-head h2 {
  font-size: clamp(32px,4.9vw,60px); line-height: .98; margin: 0;
  color: #fffae6; text-shadow: 0 3px 0 #101d32;
}
#modal[data-dialog="results"] .result-course {
  margin-left: auto; padding-left: 13px; border-left: 3px solid var(--course);
  display: grid; color: #fff7e2; font: 700 21px/1.06 Barlow,sans-serif;
}
#modal[data-dialog="results"] .result-course span { color: #c1d4db; margin-top: 3px; font: 600 12px/1.2 DM,sans-serif; }
#modal[data-dialog="results"] .standings-main { display: grid; grid-template-columns: .94fr 1.06fr; }
#modal[data-dialog="results"] .result-hero {
  position: relative; isolation: isolate; overflow: hidden; min-height: 342px; color: #193548;
  background: radial-gradient(ellipse at 52% 65%, #fffbda 0, #ffeb9a 46%, #ffce58 77%, #ffb13f);
  border-right: 3px solid #102336;
}
#modal[data-dialog="results"] .result-hero::before {
  content: ""; position: absolute; z-index:-1; inset: 0; pointer-events: none;
  background: radial-gradient(circle,#9e561342 1px,transparent 1.7px) 0 0/7px 7px;
  mask-image: linear-gradient(120deg,#000,transparent 44%,transparent 73%,#000);
}
#modal[data-dialog="results"] .winner-copy { position: relative; z-index: 2; padding: 20px 23px 0; }
#modal[data-dialog="results"] .winner-ribbon {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 16px 4px 8px;
  clip-path: polygon(0 0,100% 0,92% 100%,0 100%); color: #ffe078; background: #1a3844;
  font: 700 15px/1 Barlow,sans-serif; letter-spacing: .12em; text-transform: uppercase;
  animation: results-stamp .42s .14s cubic-bezier(.21,.85,.28,1.18) both;
}
#modal[data-dialog="results"] .winner-ribbon b {
  margin-left:2px; padding-left:7px; border-left:1px solid #ffdb764c;
  color:#fff9dc; font:700 .9em/1 Barlow,sans-serif; letter-spacing:.02em;
}
#modal[data-dialog="results"] .winner-ribbon svg { width: 17px; height: 17px; }
#modal[data-dialog="results"] .winner-copy h3 {
  margin: 4px 0 0; color: #173444;
  font: italic 900 clamp(37px,4.45vw,62px)/.96 Race,sans-serif; letter-spacing: -.025em;
  text-transform: uppercase; text-shadow: 0 2px 0 #fff1b1;
}
#modal[data-dialog="results"] .podium-stage { position:absolute; inset: 82px 0 0; }
#modal[data-dialog="results"] .podium-block {
  position: absolute; left: 8%; right: 8%; bottom: -17px; height: 28%;
  background: linear-gradient(90deg,#db7d21,#fca731 20%,#ffc74a 45%,#ffba35 78%,#d77819);
  border: 2px solid #9c641e; border-radius: 48% / 23%;
  box-shadow: 0 8px 16px #824b2b60; animation: results-lift .55s .06s cubic-bezier(.19,.86,.27,1) both;
}
#modal[data-dialog="results"] .podium-block::before {
  content:""; position:absolute; left:-2px; right:-2px; top:-7px; height:41%;
  border-radius:50%; background: linear-gradient(#f6a62d,#ffdd63);
  border: 2px solid #b57423; box-shadow: 0 2px 0 #fff19b;
}
#modal[data-dialog="results"] .podium-block b {
  position:absolute; top:27%; left:50%; transform:translateX(-50%); padding: 0 12px;
  font: italic 900 28px/.95 Race,sans-serif; color:#473825; background:#fff4ad; border:1px solid #cb8a24; border-radius:3px;
}
#modal[data-dialog="results"] .winner-kart {
  position:absolute; bottom:19%; left:10%; width:80%; height:84%; object-fit:contain; object-position:50% 100%;
  animation: results-kart .72s .07s cubic-bezier(.16,.88,.24,1.05) both;
}
#modal[data-dialog="results"] .result-classification { padding: 20px 21px 18px; align-self: center; min-width:0; }
#modal[data-dialog="results"] .result-columns {
  display:flex; justify-content:space-between; margin-bottom:9px; padding:0 7px;
  color:#c8d9df; font:700 13px/1 Barlow,sans-serif; text-transform:uppercase; letter-spacing:.115em;
}
#modal[data-dialog="results"] .rank-list { list-style:none; padding:0; margin:0; display:grid; gap:6px; }
#modal[data-dialog="results"] .result-row {
  position:relative; display:grid; grid-template-columns:25px 39px minmax(0,1fr) auto; align-items:center; gap:9px;
  min-height:50px; padding:5px 11px; border:1px solid #426176; border-radius:8px;
  background:#233e53; color:#fff7e4; box-shadow:0 2px 0 #0f2438;
  animation: results-rank .37s calc(.16s + var(--row) * .085s) cubic-bezier(.2,.85,.27,1) both;
}
#modal[data-dialog="results"] .result-row:first-child {
  background:linear-gradient(105deg,#fff1a4,#ffd15a); border-color:#ffdd7d; color:#253745;
}
#modal[data-dialog="results"] .rank-number { font:italic 900 25px/1 Race,sans-serif; text-align:center; }
#modal[data-dialog="results"] .rank-portrait { width:38px; height:38px; border:2px solid var(--driver); border-radius:50%; background:#fff; object-fit:cover; }
#modal[data-dialog="results"] .rank-driver { display:flex; align-items:center; flex-wrap:wrap; gap:5px 7px; font:700 24px/.95 Barlow,sans-serif; }
#modal[data-dialog="results"] .rank-driver small {
  padding:2px 4px; color:#d4e3e7; background:#173145; border:1px solid #617888;
  border-radius:3px; font:700 10px/1 Barlow,sans-serif; letter-spacing:.03em;
}
#modal[data-dialog="results"] .human .rank-driver small { color:#102e38; background:#8af0d7; border-color:#8af0d7; }
#modal[data-dialog="results"] .rank-time { font:700 17px/1 DM,sans-serif; font-variant-numeric:tabular-nums; white-space:nowrap; }
#modal[data-dialog="results"] .result-record {
  display:flex; align-items:center; gap:6px; margin:12px 6px 0;
  color:#9df4d9; font:700 15px/1 Barlow,sans-serif;
}
#modal[data-dialog="results"] .result-record svg { width:15px; height:15px; }
#modal[data-dialog="results"] .result-record strong { margin-left:auto; font:700 13px/1 DM,sans-serif; font-variant-numeric:tabular-nums; }
#modal[data-dialog="results"] .dialog-actions {
  display:flex; align-items:center; justify-content:flex-start; gap:9px; margin:0; padding:15px 21px 17px;
  border-top:2px solid #132436; background:#203a4d;
}
#modal[data-dialog="results"] .dialog-actions .quiet {
  background:#20384b; color:#f1f6ed; border:1px solid #657b88; border-radius:7px; font:700 16px/1.1 Barlow,sans-serif; padding:9px 12px;
}
#modal[data-dialog="results"] .dialog-actions .quiet:hover { background:#304d61; }
#modal[data-dialog="results"] .dialog-actions .cta {
  margin-left:auto; color:#183240; background:#ffd553; border:2px solid #071e30; box-shadow:0 3px 0 #0d2133;
  padding:10px 18px; border-radius:8px; font:700 20px/1.1 Barlow,sans-serif;
}
#modal[data-dialog="results"] .dialog-actions button:focus-visible { outline:3px solid #9cefe1; outline-offset:2px; }
@keyframes results-arrive { from { opacity:0; transform:translateY(16px) scale(.98); } }
@keyframes results-rank { from { opacity:0; transform:translateX(22px); } }
@keyframes results-lift { from { transform:translateY(64%); } }
@keyframes results-kart { from { opacity:0; transform:translateX(7%) translateY(-8%) rotate(-4deg); } }
@keyframes results-stamp { from { opacity:0; transform:scale(1.2) rotate(-6deg); } }
@media (max-height: 580px) and (orientation: landscape) {
  #modal[data-dialog="results"] { padding-top: max(7px, env(safe-area-inset-top)); padding-bottom: max(9px, env(safe-area-inset-bottom)); }
  #modal[data-dialog="results"] .dialog { width: min(810px, 100%); border-radius:12px; }
  #modal[data-dialog="results"] .standings-head { padding:8px 17px; gap:11px; }
  #modal[data-dialog="results"] .standings-head h2 { font-size:clamp(29px,7.7dvh,42px); }
  #modal[data-dialog="results"] .result-flag { width:24px; height:22px; background-size:9px 9px; }
  #modal[data-dialog="results"] .result-course { font-size:16px; }
  #modal[data-dialog="results"] .result-course span { font-size:10px; margin-top:1px; }
  #modal[data-dialog="results"] .standings-main { grid-template-columns: .82fr 1.18fr; }
  #modal[data-dialog="results"] .result-hero { min-height:clamp(155px,54dvh,250px); }
  #modal[data-dialog="results"] .winner-copy { padding:9px 14px 0; }
  #modal[data-dialog="results"] .winner-ribbon { font-size:12px; padding:3px 11px 3px 5px; gap:4px; }
  #modal[data-dialog="results"] .winner-ribbon svg { width:13px; height:13px; }
  #modal[data-dialog="results"] .winner-copy h3 { font-size:clamp(28px,9.5dvh,46px); margin-top:2px; }
  #modal[data-dialog="results"] .podium-stage { top:29px; }
  #modal[data-dialog="results"] .podium-block { left:14%; right:14%; bottom:-9px; }
  #modal[data-dialog="results"] .podium-block b { font-size:17px; padding:0 6px; }
  #modal[data-dialog="results"] .winner-kart { left:15%; width:76%; height:76%; }
  #modal[data-dialog="results"] .result-classification { padding:8px 13px; }
  #modal[data-dialog="results"] .result-columns { margin-bottom:5px; font-size:10px; }
  #modal[data-dialog="results"] .rank-list { gap:4px; }
  #modal[data-dialog="results"] .result-row { grid-template-columns:17px 26px minmax(0,1fr) auto; min-height:30px; padding:2px 8px; gap:8px; border-radius:5px; }
  #modal[data-dialog="results"] .rank-number { font-size:18px; }
  #modal[data-dialog="results"] .rank-portrait { width:25px; height:25px; }
  #modal[data-dialog="results"] .rank-driver { font-size:19px; }
  #modal[data-dialog="results"] .rank-time { font-size:13px; }
  #modal[data-dialog="results"] .rank-driver small { font-size:11px; }
  #modal[data-dialog="results"] .result-record { margin-top:7px; font-size:14px; }
  #modal[data-dialog="results"] .result-record strong { font-size:12px; }
  #modal[data-dialog="results"] .dialog-actions { padding:7px 14px 8px; }
  #modal[data-dialog="results"] .dialog-actions .quiet { padding:7px 9px; font-size:14px; }
  #modal[data-dialog="results"] .dialog-actions .cta { padding:6px 14px; font-size:16px; }
}
@media (max-width: 660px) and (orientation:portrait) {
  #modal[data-dialog="results"] .dialog { width:min(100%,450px); }
  #modal[data-dialog="results"] .standings-head { gap:9px; padding:13px; }
  #modal[data-dialog="results"] .standings-head h2 { font-size:clamp(24px,7vw,34px); }
  #modal[data-dialog="results"] .result-flag { width:23px; height:22px; background-size:10px 10px; }
  #modal[data-dialog="results"] .result-course { font-size:15px; padding-left:6px; }
  #modal[data-dialog="results"] .result-course span { font-size:10px; }
  #modal[data-dialog="results"] .standings-main { grid-template-columns:1fr; }
  #modal[data-dialog="results"] .result-hero { min-height:clamp(110px,20dvh,180px); border:0; }
  #modal[data-dialog="results"] .winner-copy { padding:18px 13px; }
  #modal[data-dialog="results"] .winner-copy h3 { font-size:clamp(30px,8.2vw,45px); }
  #modal[data-dialog="results"] .winner-ribbon { font-size:12px; gap:3px; padding-right:13px; }
  #modal[data-dialog="results"] .winner-ribbon svg { width:14px; height:14px; }
  #modal[data-dialog="results"] .podium-stage { inset:0 0 0 40%; }
  #modal[data-dialog="results"] .winner-kart { height:69%; bottom:24%; left:3%; width:94%; }
  #modal[data-dialog="results"] .podium-block { height:23%; bottom:-2px; left:2%; right:2%; }
  #modal[data-dialog="results"] .podium-block b { font-size:17px; }
  #modal[data-dialog="results"] .result-classification { padding:12px; }
  #modal[data-dialog="results"] .result-row { min-height:39px; grid-template-columns:18px 31px minmax(0,1fr) auto; padding:3px 7px; }
  #modal[data-dialog="results"] .rank-portrait { width:30px; height:30px; }
  #modal[data-dialog="results"] .rank-number { font-size:19px; }
  #modal[data-dialog="results"] .rank-driver { font-size:20px; }
  #modal[data-dialog="results"] .rank-time { font-size:13px; }
  #modal[data-dialog="results"] .dialog-actions { padding:11px 9px; gap:5px; }
  #modal[data-dialog="results"] .dialog-actions .quiet { padding:8px; font-size:13px; gap:2px; }
  #modal[data-dialog="results"] .dialog-actions .cta { padding:8px; font-size:15px; gap:3px; }
}
@media (max-width: 370px) and (orientation:portrait) {
  #modal[data-dialog="results"] .podium-block { height:25%; bottom:0; }
  #modal[data-dialog="results"] .podium-block b { top:29%; font-size:13px; }
  #modal[data-dialog="results"] .dialog-actions { padding:11px 6px; gap:4px; flex-wrap:nowrap; }
  #modal[data-dialog="results"] .dialog-actions .quiet { padding:7px 5px; font-size:12px; }
  #modal[data-dialog="results"] .dialog-actions .cta { padding:7px; font-size:14px; }
}
@media (prefers-reduced-motion:reduce) {
  #modal[data-dialog="results"] .dialog,
  #modal[data-dialog="results"] .winner-ribbon,
  #modal[data-dialog="results"] .result-row,
  #modal[data-dialog="results"] .podium-block,
  #modal[data-dialog="results"] .winner-kart { animation:none; }
}
