/* Racing theme (REQ-0009): carbon fibre, F1 red, kerb stripes, chequered flag. */

[data-theme="racing"] {
  --ez-paper: #121316;
  --ez-paper-2: #1c1d22;
  --ez-surface: #18191d;
  --ez-ink: #f2f2f0;
  --ez-ink-2: #c9cad0;
  --ez-muted: #a3a5ad;           /* 7.1:1 on carbon */
  --ez-line: #33353d;
  --ez-red: #e10600;
  --ez-red-text: #ff4d45;        /* red text on carbon: 5.0:1 */
  --ez-signal: #e10600;
  --ez-signal-ink: #ffffff;      /* white on F1 red: 4.9:1 */
  --ez-accent: #8fb4ff;
  --ez-ok: #3ddc84;
  --ez-danger: #ff6b63;
  --ez-font-display: "Titillium Web", "Segoe UI", sans-serif;
  --ez-stripes: repeating-linear-gradient(-55deg, var(--ez-red) 0 10px, transparent 10px 20px);
  --ez-chequer: repeating-conic-gradient(#f2f2f0 0 25%, #121316 0 50%) 0 0 / 14px 14px;
  --ez-kerb: repeating-linear-gradient(90deg, var(--ez-red) 0 28px, #f2f2f0 28px 56px);
  /* Bootstrap resolves these at :root (light paper); re-point them so tables etc. follow the theme. */
  --bs-body-bg: var(--ez-paper);
  --bs-body-color: var(--ez-ink);
  --bs-emphasis-color: var(--ez-ink);
  --bs-secondary-color: var(--ez-muted);
  --bs-border-color: var(--ez-line);

  color: var(--ez-ink);
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(225, 6, 0, .22), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.025) 0 2px, transparent 2px 6px),
    repeating-linear-gradient(-45deg, rgba(0,0,0,.35) 0 2px, transparent 2px 6px),
    var(--ez-paper);
  min-height: calc(100vh - 140px);
  padding-bottom: 1px;
}
[data-theme="racing"] a { color: var(--ez-accent); }
[data-theme="racing"] .ez-title { font-weight: 900; font-style: italic; text-transform: uppercase; letter-spacing: -.01em; }
[data-theme="racing"] .ez-kicker { color: var(--ez-muted); }
[data-theme="racing"] .ez-lead { color: var(--ez-ink-2); }
[data-theme="racing"] .form-control, [data-theme="racing"] .form-select {
  background-color: #0e0f12; color: var(--ez-ink); border-color: #4a4d57;
}
[data-theme="racing"] .form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23f2f2f0' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
[data-theme="racing"] .form-control:focus, [data-theme="racing"] .form-select:focus { border-color: var(--ez-ink); background-color: #0e0f12; color: var(--ez-ink); }
[data-theme="racing"] .form-text { color: var(--ez-muted); }
[data-theme="racing"] .ez-btn-ink { background: var(--ez-ink); color: #121316; border-color: var(--ez-ink); }
[data-theme="racing"] .ez-btn-ink:hover { background: #fff; color: var(--ez-red); }
[data-theme="racing"] .ez-btn-signal { background: var(--ez-red); color: #fff; border-color: var(--ez-red); box-shadow: 0 0 0 0 transparent; text-transform: uppercase; font-style: italic; font-family: var(--ez-font-display); font-weight: 900; letter-spacing: .04em; clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); border-radius: 0; padding-inline: 2rem; }
[data-theme="racing"] .ez-btn-signal:hover, [data-theme="racing"] .ez-btn-signal:focus { background: #ff1e14; color: #fff; box-shadow: none; }
[data-theme="racing"] .ez-btn-line { color: var(--ez-ink); border-color: #4a4d57; }
[data-theme="racing"] .ez-btn-line:hover { background: var(--ez-ink); color: #121316; }
[data-theme="racing"] .ez-btn-ghost { color: var(--ez-ink); border-color: var(--ez-ink); }
[data-theme="racing"] .ez-btn-ghost:hover { background: var(--ez-ink); color: #121316; }
[data-theme="racing"] .ez-badge-tier { background: var(--ez-ink); color: #121316; border-color: var(--ez-ink); }
[data-theme="racing"] .ez-badge-go { background: var(--ez-red); color: #fff; border-color: var(--ez-red); }
[data-theme="racing"] .ez-badge-done { background: #1f7a45; border-color: #1f7a45; }
[data-theme="racing"] .ez-badge-ok { color: var(--ez-ok); }
[data-theme="racing"] .alert-danger { background: #3a1210; color: #ffd9d6; border-color: #ff6b63; }
[data-theme="racing"] .alert-success { background: #0f2e1d; color: #c8f5d9; border-color: #3ddc84; }
[data-theme="racing"] .alert-secondary { background: #24262c; color: var(--ez-ink); border-color: #4a4d57; }
[data-theme="racing"] .modal-content { background: var(--ez-surface); color: var(--ez-ink); border: 1px solid var(--ez-line); }
[data-theme="racing"] .btn-close { filter: invert(1); }
[data-theme="racing"] .table { --bs-table-color: var(--ez-ink); --bs-table-hover-color: var(--ez-ink); --bs-table-hover-bg: rgba(255,255,255,.04); }
[data-theme="racing"] .ez-admin-table td { border-color: var(--ez-line); }

/* tabs */
[data-theme="racing"] .ez-tabs { border-bottom: 3px solid var(--ez-red); }
[data-theme="racing"] .ez-tabs .nav-link { color: var(--ez-ink-2); text-transform: uppercase; font-family: var(--ez-font-display); font-weight: 700; letter-spacing: .04em; }
[data-theme="racing"] .ez-tabs .nav-link:hover { background: var(--ez-paper-2); color: #fff; }
[data-theme="racing"] .ez-tabs .nav-link.active { background: var(--ez-red); color: #fff; }

/* heroes */
[data-theme="racing"] .ez-group-hero, [data-theme="racing"] .ez-race-hero { position: relative; padding-bottom: 1.5rem; }
[data-theme="racing"] .ez-group-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 10px; background: var(--ez-chequer); opacity: .9; }
.ez-kerb { height: 10px; margin-top: 1.25rem; background: var(--ez-kerb); transform: skewX(-20deg); transform-origin: left; }
.ez-type-chip { background: var(--ez-red); color: #fff; padding: .15rem .5rem; font-style: italic; }
.ez-lock-line { font-family: var(--ez-font-mono); font-size: .92rem; }
.ez-lock-line.is-locked { color: var(--ez-muted); }
.ez-live-dot { display: inline-block; margin-right: .5rem; vertical-align: 1px; width: .6rem; height: .6rem; border-radius: 50%; background: var(--ez-ok); box-shadow: 0 0 0 0 rgba(61,220,132,.7); animation: ez-pulse 1.6s infinite; }
@keyframes ez-pulse { 70% { box-shadow: 0 0 0 10px rgba(61,220,132,0); } 100% { box-shadow: 0 0 0 0 rgba(61,220,132,0); } }

/* cards */
[data-theme="racing"] .ez-card { background: linear-gradient(180deg, #1d1e23, #16171b); border-color: var(--ez-line); box-shadow: 0 30px 60px -30px rgba(0,0,0,.8); }
[data-theme="racing"] .ez-subcard { border-color: #3b3e47; }
.ez-card-carbon { margin-top: 1.5rem; position: relative; overflow: hidden; }

/* podium picker */
.ez-podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; align-items: end; }
.ez-pod { display: flex; flex-direction: column; gap: .75rem; animation: ez-rise .6s cubic-bezier(.2,.8,.2,1) both; }
.ez-pod-p1 { animation-delay: .1s; } .ez-pod-p2 { animation-delay: .2s; } .ez-pod-p3 { animation-delay: .3s; }
.ez-pod-block {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem;
  background: linear-gradient(180deg, #2a2c33, #1a1b20); border: 1px solid #3b3e47; border-top: 4px solid var(--ez-ink);
  clip-path: polygon(6% 0, 94% 0, 100% 100%, 0 100%);
}
.ez-pod-p1 .ez-pod-block { height: 11rem; border-top-color: var(--ez-red); background: linear-gradient(180deg, #3a1210, #1a1b20); }
.ez-pod-p2 .ez-pod-block { height: 8.5rem; }
.ez-pod-p3 .ez-pod-block { height: 6.5rem; }
.ez-pod-code { font: 900 italic clamp(1.6rem, 4vw, 2.8rem)/1 var(--ez-font-display); letter-spacing: .02em; color: var(--ez-ink); }
.ez-pod-place { font: 600 .8rem/1 var(--ez-font-mono); color: var(--ez-muted); letter-spacing: .15em; }
.ez-pod-p1 .ez-pod-place { color: #ffb3ae; }
.ez-awards { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.ez-award { display: flex; gap: 1rem; align-items: center; padding: 1rem; border: 1px solid var(--ez-line); border-radius: var(--ez-radius-sm); background: #141519; }
.ez-award .mb-3 { margin-bottom: 0 !important; }
.ez-award-icon { width: 2.6rem; height: 2.6rem; flex-shrink: 0; border-radius: 6px; }
.ez-award-pole .ez-award-icon { background: var(--ez-chequer); }
.ez-award-fastest_lap .ez-award-icon { background: conic-gradient(from 200deg, #a855f7, #6d28d9 60%, #2a2c33 60%); border-radius: 50%; }
.ez-readonly { display: flex; flex-direction: column; gap: .2rem; }
.ez-readonly strong { font-family: var(--ez-font-display); font-size: 1.05rem; }
.ez-save-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px dashed var(--ez-line); color: var(--ez-muted); }
@media (max-width: 575.98px) {
  /* Stack the pickers full width (P1, P2, P3), keep a compact podium graphic underneath. */
  .ez-podium { gap: .4rem; row-gap: .75rem; }
  .ez-pod { display: contents; }
  .ez-pod-control { grid-column: 1 / -1; }
  .ez-pod-p1 .ez-pod-control { order: 1; } .ez-pod-p2 .ez-pod-control { order: 2; } .ez-pod-p3 .ez-pod-control { order: 3; }
  .ez-pod-block { order: 4; align-self: end; }
  .ez-pod-p1 .ez-pod-block { height: 7rem; } .ez-pod-p2 .ez-pod-block { height: 5.5rem; } .ez-pod-p3 .ez-pod-block { height: 4.5rem; }
  .ez-awards { grid-template-columns: 1fr; }
}

/* timing tower */
[data-theme="racing"] .ez-tower { border: 0; background: #0d0e11; box-shadow: 0 30px 60px -30px rgba(0,0,0,.9); }
[data-theme="racing"] .ez-tower-table thead th { background: var(--ez-red); }
[data-theme="racing"] .ez-tower-table td { border-color: #24262c; font-family: var(--ez-font-display); font-weight: 700; text-transform: uppercase; }
[data-theme="racing"] .ez-pos { background: #f2f2f0; color: #121316; border-radius: 3px; }
[data-theme="racing"] .ez-tower-row:nth-child(1) .ez-pos { background: var(--ez-red); color: #fff; box-shadow: none; }
[data-theme="racing"] .ez-tower-row.is-me td { background: rgba(225, 6, 0, .18); }
[data-theme="racing"] .ez-tower-row td:first-child { border-left: 4px solid transparent; }
[data-theme="racing"] .ez-tower-row.is-me td:first-child { border-left-color: var(--ez-red); }

/* events & chat on carbon */
[data-theme="racing"] .ez-event-row { background: #17181c; }
[data-theme="racing"] .ez-event-row.is-open { border-color: var(--ez-red); box-shadow: inset 4px 0 0 var(--ez-red); }
[data-theme="racing"] .ez-round-no { color: var(--ez-red-text); font-weight: 700; }
[data-theme="racing"] .ez-chat-scroll { background: #0e0f12; border: 1px solid var(--ez-line); }
[data-theme="racing"] .ez-chat-msg { background: #1f2026; border-color: #2e3037; }
[data-theme="racing"] .ez-chat-msg.is-mine { background: var(--ez-red); border-color: var(--ez-red); color: #fff; }
[data-theme="racing"] .ez-chat-msg.is-mine .ez-muted { color: #ffd2cf; }
[data-theme="racing"] .ez-avatar { background: var(--ez-red); color: #fff; }
[data-theme="racing"] .ez-member, [data-theme="racing"] .ez-invite { border-color: var(--ez-line); }
[data-theme="racing"] .ez-empty-stripes { background: var(--ez-chequer); }
[data-theme="racing"] .ez-card-title::before { background: var(--ez-chequer); }
