/* RallyX Graphics — visual-only theme layer.
   Default intentionally has ZERO overrides: display.css is unchanged.
   Themes are keyed by the graphics event ID, never global state. */
.theme-saudi-logo{display:none!important}

/* Shared cosmetic structure (non-default themes only). */
html[data-rx-theme="apex-red"] .battle-board,
html[data-rx-theme="velocity-blue"] .battle-board,
html[data-rx-theme="elite-gold"] .battle-board,
html[data-rx-theme="saudi-toyota"] .battle-board{isolation:isolate}
html[data-rx-theme="apex-red"] .battle-header,
html[data-rx-theme="velocity-blue"] .battle-header,
html[data-rx-theme="elite-gold"] .battle-header,
html[data-rx-theme="saudi-toyota"] .battle-header{position:relative}

/* THEME 1 — APEX RED. Sharp broadcast geometry, carbon and crimson. */
html[data-rx-theme="apex-red"]{--gold:#ff344c;--goldlight:#ffd1d8}
html[data-rx-theme="apex-red"] .battle-board{border:1px solid #ff344c9c;border-radius:3px;background:#08090fef;box-shadow:0 9px 35px #000d,0 0 0 2px #040408}
html[data-rx-theme="apex-red"] .battle-header{height:60px;border-top:7px solid #ed263d;background:repeating-linear-gradient(115deg,transparent 0 29px,#ffffff09 30px 32px,transparent 33px 65px),linear-gradient(100deg,#430d17,#0e1019 54%,#400d16);clip-path:polygon(0 0,100% 0,100% 100%,0 100%)}
html[data-rx-theme="apex-red"] .battle-grid{grid-template-columns:minmax(0,1fr) clamp(80px,6vw,120px) minmax(0,1fr);height:clamp(150px,12vw,240px)}
html[data-rx-theme="apex-red"] .driver{background:repeating-linear-gradient(137deg,transparent 0 43px,#ffffff07 44px 45px),linear-gradient(110deg,#2a111c,#10151fe8)}
html[data-rx-theme="apex-red"] .driver--chase{background:repeating-linear-gradient(43deg,transparent 0 43px,#ffffff07 44px 45px),linear-gradient(250deg,#2a111c,#10151fe8)}
html[data-rx-theme="apex-red"] .portrait{border:3px solid #ff344c;clip-path:polygon(0 0,100% 0,100% 90%,86% 100%,0 100%);border-radius:0;box-shadow:8px 0 0 #ff344c19}
html[data-rx-theme="apex-red"] .driver--chase .portrait{clip-path:polygon(0 0,100% 0,100% 100%,14% 100%,0 90%)}
html[data-rx-theme="apex-red"] .driver-role{color:#ff5469}
html[data-rx-theme="apex-red"] .driver-number{color:#fff;font-style:italic;text-shadow:3px 3px 0 #a71c31}
html[data-rx-theme="apex-red"] .battle-versus{background:linear-gradient(148deg,#ff3e56,#ac1028);color:#fff;text-shadow:0 2px 4px #0007}
html[data-rx-theme="apex-red"] .battle-bottom{height:31px;border-top:2px solid #e42940;background:#181b24;color:#a9b4c0}
html[data-rx-theme="apex-red"] .winner-badge{background:linear-gradient(110deg,#ff8996,#ff3049,#c1112f);color:white}
html[data-rx-theme="apex-red"] .stage--winner.winner-lead #leadCard,
html[data-rx-theme="apex-red"] .stage--winner.winner-chase #chaseCard{box-shadow:inset 0 0 0 3px #ff344c}

/* THEME 2 — VELOCITY BLUE. Cyan-glass motorsport telemetry. */
html[data-rx-theme="velocity-blue"]{--gold:#21d4ff;--goldlight:#c4f9ff}
html[data-rx-theme="velocity-blue"] .battle-board{border:1px solid #38d9ff90;border-radius:14px;background:#061827e8;box-shadow:0 0 38px #11bce43a,0 15px 36px #001626ad}
html[data-rx-theme="velocity-blue"] .battle-header{height:63px;border-top:4px solid #20d2ff;background:linear-gradient(120deg,#104e72ee,#071626f7 55%,#0a4161ea)}
html[data-rx-theme="velocity-blue"] .battle-header:before{content:"";position:absolute;inset:0;pointer-events:none;background:repeating-linear-gradient(90deg,transparent 0 58px,#49dfff15 59px 60px)}
html[data-rx-theme="velocity-blue"] .battle-grid{height:clamp(155px,12vw,240px)}
html[data-rx-theme="velocity-blue"] .driver{background:radial-gradient(circle at 0 50%,#2aa6f22d,transparent 66%),linear-gradient(110deg,#123d5edd,#07192eec)}
html[data-rx-theme="velocity-blue"] .driver--chase{background:radial-gradient(circle at 100% 50%,#2aa6f22d,transparent 66%),linear-gradient(250deg,#123d5edd,#07192eec)}
html[data-rx-theme="velocity-blue"] .driver:before{background:#3bdbff;width:2px;opacity:1;box-shadow:0 0 12px #3bdbff}
html[data-rx-theme="velocity-blue"] .portrait{border-color:#67e6ff;border-radius:10px;box-shadow:0 0 17px #1cbeff55}
html[data-rx-theme="velocity-blue"] .battle-versus{background:linear-gradient(145deg,#24e2ff,#167ec2);color:#03243b;text-shadow:0 1px 0 #a4f4ff}
html[data-rx-theme="velocity-blue"] .driver-number{color:#b0f5ff;text-shadow:0 0 20px #3acaff63}
html[data-rx-theme="velocity-blue"] .battle-bottom{height:31px;background:#071c30ee;border-top:1px solid #53b8e54f}
html[data-rx-theme="velocity-blue"] .winner-badge{background:linear-gradient(110deg,#d2faff,#39d9ff,#178ee3)}

/* THEME 3 — ELITE GOLD. Restrained premium black/gold championship. */
html[data-rx-theme="elite-gold"]{--gold:#dcbb74;--goldlight:#ffedbc}
html[data-rx-theme="elite-gold"] .battle-board{border:1px solid #cdb57a;border-radius:3px;background:#0b0c0ddf;box-shadow:0 14px 44px #000c}
html[data-rx-theme="elite-gold"] .battle-header{height:63px;border-top:3px solid #d4b675;background:linear-gradient(90deg,#22211d,#0b0c0d 47%,#26241e)}
html[data-rx-theme="elite-gold"] .battle-grid{height:clamp(155px,12vw,240px)}
html[data-rx-theme="elite-gold"] .driver{background:linear-gradient(135deg,#282724ed,#111214ee 67%,#292720ec)}
html[data-rx-theme="elite-gold"] .driver--chase{background:linear-gradient(225deg,#282724ed,#111214ee 67%,#292720ec)}
html[data-rx-theme="elite-gold"] .portrait{border:1px solid #e0c88e;border-radius:1px;box-shadow:0 0 0 5px #b4984930}
html[data-rx-theme="elite-gold"] .driver-role{color:#e1c484;letter-spacing:.22em}
html[data-rx-theme="elite-gold"] .driver-number{font-weight:800;color:#efdab0;text-shadow:0 3px 10px #000}
html[data-rx-theme="elite-gold"] .battle-versus{background:linear-gradient(155deg,#f4dfb2,#b69143);color:#241c10}
html[data-rx-theme="elite-gold"] .battle-bottom{height:31px;border-top:1px solid #b59a5b;background:#121313}
html[data-rx-theme="elite-gold"] .winner-badge{background:linear-gradient(110deg,#ffecba,#d8b575,#b68b3d)}

/* THEME 4 — SAUDI TOYOTA DRIFT. Based on the supplied championship artwork.
   Official logo/partner assets are from the user-supplied PDFs.
   No static driver photos/judges/scores: competition content stays dynamic. */
html[data-rx-theme="saudi-toyota"]{--gold:#ee1c35;--goldlight:#fff0f0}
html[data-rx-theme="saudi-toyota"] .battle-board{border:2px solid #f2f5f4;border-radius:3px;background:linear-gradient(180deg,#fafafa,#1c1d20 25%,#13161a);box-shadow:0 13px 32px #000b,0 0 0 2px #114e37}
html[data-rx-theme="saudi-toyota"] .battle-header{height:100px;padding:0 24px;border-top:7px solid #00673e;background:linear-gradient(113deg,#075a38 0%,#06482f 27%,#f9f9f8 27.1%,#f9f9f8 69%,#242427 69.1%,#15171a 100%)}
html[data-rx-theme="saudi-toyota"] .battle-header:before{content:"";pointer-events:none;position:absolute;inset:0;background:repeating-conic-gradient(from 45deg at 8px 8px,#f31c3726 0 25%,transparent 0 50%) 0 0/16px 16px;clip-path:polygon(0 0,27% 0,27% 100%,0 100%);opacity:.7}
html[data-rx-theme="saudi-toyota"] .battle-brand{position:relative;z-index:1}
html[data-rx-theme="saudi-toyota"] .battle-brand .live-pill{color:white;font-size:clamp(10px,.88vw,17px);background:#083d31cc;border:1px solid #ffffff50;border-radius:3px;padding:9px 14px;letter-spacing:.12em}
html[data-rx-theme="saudi-toyota"] .battle-event{position:relative;z-index:1;color:#f4f6f4;font-size:clamp(11px,.87vw,18px);max-width:24%;text-align:right}
html[data-rx-theme="saudi-toyota"] .theme-saudi-logo{display:block!important;position:absolute;z-index:2;left:50%;top:50%;height:83%;width:32%;max-width:360px;object-fit:contain;transform:translate(-50%,-50%);filter:drop-shadow(0 1px 1px #0002)}
html[data-rx-theme="saudi-toyota"] .battle-grid{grid-template-columns:minmax(0,1fr) clamp(78px,6.3vw,120px) minmax(0,1fr);height:clamp(170px,14vw,250px);background:#11171b}
html[data-rx-theme="saudi-toyota"] .driver{background:radial-gradient(ellipse at 30% 109%,#d3d5d524 2%,transparent 67%),repeating-linear-gradient(115deg,transparent 0 85px,#ffffff06 86px 87px),linear-gradient(112deg,#2a2d30eb,#0b1016f5 70%);padding-bottom:16px}
html[data-rx-theme="saudi-toyota"] .driver--chase{background:radial-gradient(ellipse at 70% 109%,#d3d5d524 2%,transparent 67%),repeating-linear-gradient(65deg,transparent 0 85px,#ffffff06 86px 87px),linear-gradient(248deg,#2a2d30eb,#0b1016f5 70%)}
html[data-rx-theme="saudi-toyota"] .driver:before{width:5px;opacity:1;background:linear-gradient(#c30025,#ec2337,#005b39)}
html[data-rx-theme="saudi-toyota"] .portrait{width:clamp(97px,9.1vw,174px);height:clamp(125px,11vw,212px);border:0;border-radius:0;box-shadow:0 0 0 2px #b6b8b9,7px 6px 0 #e91935;clip-path:polygon(12% 0,100% 0,100% 100%,0 100%,0 15%)}
html[data-rx-theme="saudi-toyota"] .driver--chase .portrait{box-shadow:0 0 0 2px #b6b8b9,-7px 6px 0 #e91935;clip-path:polygon(0 0,88% 0,100% 15%,100% 100%,0 100%)}
html[data-rx-theme="saudi-toyota"] .driver-role{color:#f8f8f8;text-transform:uppercase;letter-spacing:.17em;font-size:clamp(11px,.9vw,19px)}
html[data-rx-theme="saudi-toyota"] .driver-name{color:#f8f8f7;text-shadow:0 2px 4px #000}
html[data-rx-theme="saudi-toyota"] .driver-number{color:#fff;font-style:italic;font-weight:950;text-shadow:0 2px 5px #0007;background:linear-gradient(110deg,#d9152b,#f42a38);clip-path:polygon(17% 0,100% 0,85% 100%,0 100%);padding:5px clamp(12px,.95vw,20px);min-width:clamp(59px,5.3vw,100px);text-align:center}
html[data-rx-theme="saudi-toyota"] .driver--chase .driver-number{clip-path:polygon(15% 0,100% 0,83% 100%,0 100%)}
html[data-rx-theme="saudi-toyota"] .battle-versus{background:linear-gradient(150deg,#ee233a,#9a001a);color:#fff;border-left:5px solid #e8e8e8;border-right:5px solid #e8e8e8;box-shadow:0 0 15px #0008}

/* Saudi Toyota - RallyX Logo + Checkered Bottom */

html[data-rx-theme="saudi-toyota"] .battle-bottom {
  --rx-saudi-square: clamp(10px, 1.13vw, 21px);
  height: 44px;
  padding: 0 0 0 16px;
  border-top: 3px solid #ef2a3e;
  background: #006c40;
  color: #fff;
  gap: 16px;
  overflow: hidden;
}

/* Keep RallyX logo visible */

html[data-rx-theme="saudi-toyota"] .battle-bottom .brand {
  display: block;
  flex: 0 0 auto;
  font-size: clamp(11px, .9vw, 17px);
  color: #fff;
}

/* Green and white checkered pattern after RallyX */

html[data-rx-theme="saudi-toyota"] .battle-bottom::after {
  content: "";
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  align-self: stretch;

  background-image: conic-gradient(
    #087344 0 25%,
    #ffffff 0 50%,
    #087344 0 75%,
    #ffffff 0 100%
  );

  background-size: calc(var(--rx-saudi-square) * 2) 100%;
  background-repeat: repeat-x;
}

html[data-rx-theme="saudi-toyota"] .stage--winner.winner-lead #leadCard,
html[data-rx-theme="saudi-toyota"] .stage--winner.winner-chase #chaseCard{box-shadow:inset 0 0 0 3px #ef3042}
html[data-rx-theme="saudi-toyota"] .winner-badge{background:linear-gradient(120deg,#fff,#f03040,#ba001e);color:#161616}

/* Small OBS preview and laptop viewport tuning; never affects Default. */
@media(max-width:1100px){
 html[data-rx-theme="saudi-toyota"] .battle-header{height:62px;padding:0 13px;border-top-width:4px}
 html[data-rx-theme="saudi-toyota"] .theme-saudi-logo{height:88%;width:27%}
 html[data-rx-theme="saudi-toyota"] .battle-brand .live-pill{font-size:9px;padding:5px 8px}
 html[data-rx-theme="saudi-toyota"] .battle-grid{height:clamp(110px,14vw,165px);grid-template-columns:minmax(0,1fr) 63px minmax(0,1fr)}
 html[data-rx-theme="saudi-toyota"] .portrait{width:clamp(60px,8vw,100px);height:clamp(88px,11vw,130px)}
 html[data-rx-theme="saudi-toyota"] .driver-number{font-size:clamp(19px,3vw,35px);min-width:50px;padding:4px 9px}
 html[data-rx-theme="saudi-toyota"] .battle-bottom{height:29px}

 html[data-rx-theme="apex-red"] .battle-header,
 html[data-rx-theme="velocity-blue"] .battle-header,
 html[data-rx-theme="elite-gold"] .battle-header{height:40px}
 html[data-rx-theme="apex-red"] .battle-grid,
 html[data-rx-theme="velocity-blue"] .battle-grid,
 html[data-rx-theme="elite-gold"] .battle-grid{height:clamp(110px,13vw,160px)}
}
@media(max-width:650px){
 html[data-rx-theme="saudi-toyota"] .battle-header{height:38px}
 html[data-rx-theme="saudi-toyota"] .theme-saudi-logo{height:90%;width:27%}
 html[data-rx-theme="saudi-toyota"] .battle-brand .live-pill{font-size:7px;padding:3px 5px;letter-spacing:0}
 html[data-rx-theme="saudi-toyota"] .battle-grid{height:95px;grid-template-columns:minmax(0,1fr) 39px minmax(0,1fr)}
 html[data-rx-theme="saudi-toyota"] .portrait{height:72px;width:48px}
 html[data-rx-theme="saudi-toyota"] .driver-number{min-width:25px;font-size:17px;padding:3px 5px}
 html[data-rx-theme="saudi-toyota"] .battle-bottom{height:20px}
 
}
