/* Pro Mod Racing — shared styles for the live site and the admin canvas. */

@property --glow {
  syntax: '<color>';
  inherits: true;
  initial-value: #39ff14;
}
@keyframes glowcycle {
  0%   { --glow: #39ff14; }
  25%  { --glow: #ffffff; }
  50%  { --glow: #2b7bff; }
  75%  { --glow: #ffe53b; }
  100% { --glow: #39ff14; }
}

:root {
  --bg: #0a0b0e;
  --fg: #f4f6fb;
  --muted: #9aa3b2;
  --panel: #12141a;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #f65a08;
  --glow: #39ff14;
  --racing: "Racing Sans One", "Segoe UI", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  min-height: 100vh;
  animation: glowcycle 9s linear infinite;
}

/* ---- Site background: the pit-crew photo, dimmed by an overlay so content stays
   readable (darkest behind the centered content column). On portrait screens it's
   re-framed toward the door branding. Fixed pseudo-element, not
   background-attachment:fixed (which iOS ignores). ---- */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(10, 11, 14, 0.50) 0%, rgba(10, 11, 14, 0.86) 30%, rgba(10, 11, 14, 0.86) 70%, rgba(10, 11, 14, 0.50) 100%),
    url("../bg/bg-photo.jpg") center / cover no-repeat;
}
@media (orientation: portrait) {
  body::before {
    background:
      linear-gradient(180deg, rgba(10, 11, 14, 0.84) 0%, rgba(10, 11, 14, 0.72) 45%, rgba(10, 11, 14, 0.80) 100%),
      url("../bg/bg-photo.jpg") 76% center / cover no-repeat;
  }
}
img { max-width: 100%; display: block; }
a { color: var(--glow); }

.glow { text-shadow: 0 0 10px var(--glow), 0 0 24px var(--glow); }

/* ---- Masthead ---- */
.masthead {
  text-align: center;
  padding: clamp(1.75rem, 6vh, 4rem) 1rem 0;
}
.site-title {
  font-family: var(--racing);
  font-weight: 400;
  letter-spacing: 0.04em;
  padding-left: 0.04em;
  font-size: clamp(1.6rem, 9vw, 6rem);
  text-transform: uppercase;
  line-height: 1.05;
  white-space: nowrap;
}
.site-logo {
  display: block;
  margin: 0 auto;
  /* sized by height: the badge logo is ~1.64:1, so width-based sizing made it huge */
  height: clamp(120px, 13vw, 175px);
  width: auto;
  max-width: 92vw;
  object-fit: contain;
}

/* ---- Tab bar: social icons | tabs | merch ---- */
.tabs {
  margin: clamp(0.35rem, 1.25vh, 0.6rem) auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  padding: 0 1rem 0.95rem;
  max-width: 920px;
  /* thicker underline: orange -> white -> orange fade all the way across */
  background-image: linear-gradient(90deg, var(--accent) 0%, #ffffff 50%, var(--accent) 100%);
  background-repeat: no-repeat;
  background-position: bottom center;
  background-size: 100% 3px;
}
.tab-group {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1.25rem;
}

/* Social buttons — left of the tabs, mirroring the merch button.
   Orange by default; flips to white (with an orange glyph) when highlighted. */
.social {
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
  display: flex;
  gap: 10px;
  width: min(100%, 122px);  /* ~34px icons */
  translate: -16px -7px;   /* mirror of the merch nudge */
}
.soc {
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: 1 / 1;
  display: block;
  line-height: 0;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.soc svg { width: 100%; height: 100%; display: block; }
.soc .shape { fill: var(--accent); transition: fill 0.15s ease; }
.soc .glyph { fill: #fff; transition: fill 0.15s ease; }
.soc .glyph-stroke { stroke: #fff; transition: stroke 0.15s ease; }
a.soc:hover .shape, a.soc:focus-visible .shape { fill: #fff; }
a.soc:hover .glyph, a.soc:focus-visible .glyph { fill: var(--accent); }
a.soc:hover .glyph-stroke, a.soc:focus-visible .glyph-stroke { stroke: var(--accent); }
a.soc:hover { transform: scale(1.08); filter: drop-shadow(0 0 8px rgba(246, 90, 8, 0.55)); }
a.soc:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 10px; }

/* Merch Shop button — right of the tabs, a little bigger than them */
.merch-link {
  grid-column: 3;
  grid-row: 1;
  justify-self: center;
  display: block;
  width: min(100%, 162px);
  line-height: 0;
  translate: 16px -7px;   /* nudge right + up a tad */
  margin-block: -12px;    /* overflow the row so it doesn't push the tabs/line down */
  transition: transform 0.15s ease, filter 0.15s ease;
}
.merch-link img { width: 100%; height: auto; display: block; }
a.merch-link:hover { transform: scale(1.06); filter: drop-shadow(0 0 10px rgba(246, 90, 8, 0.6)); }
@media (max-width: 860px) {
  /* below ~860px the side columns get too narrow for the icons/merch, so stack:
     tabs on top; social icons + merch side by side underneath */
  .tabs { grid-template-columns: 1fr 1fr; row-gap: 0.6rem; }
  .tab-group { grid-column: 1 / -1; grid-row: 1; }
  .social { grid-column: 1; grid-row: 2; width: min(100%, 116px); translate: none; margin: 0; }
  .merch-link { grid-column: 2; grid-row: 2; width: 136px; margin: 0; translate: none; }
  .tabs:not(:has(.social)) .merch-link,
  .tabs:not(:has(.merch-link)) .social { grid-column: 1 / -1; }
}
.tab {
  background: none;
  border: none;
  color: var(--fg);
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: clamp(0.8rem, 2.4vw, 1rem);
  padding: 0.6rem 0.4rem;
  margin-bottom: 0;
  cursor: pointer;
  transition: color 0.15s ease;
}
.tab:hover { color: var(--accent); }
.tab.is-active { color: var(--accent); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* Image tabs: white artwork by default, orange artwork when active. */
.tab.tab-img { padding: 0.35rem 0.25rem; border-bottom: none; line-height: 0; }
.tab.tab-img img { height: clamp(18px, 5vw, 30px); width: auto; display: block; }
.tab.tab-img .ti-on { display: none; }
.tab.tab-img.is-active .ti-off { display: none; }
.tab.tab-img.is-active .ti-on { display: block; }

/* ---- Content area ---- */
.stage {
  margin: 0 auto;
  padding: 2rem 0 4rem;
}
.panel { display: none; }
.panel.is-active { display: block; }
.panel.is-legacy { max-width: 920px; margin: 0 auto; padding: 0 1rem; }

/* ---- Free-form canvas pages (content v2) ----
   .cv-wrap is the size container; .cv-page turns design px into real px with
   --u = 100cqw / design width, so every item scales with the page width.
   Geometry comes from per-item custom properties set by renderer.js.        */
.cv-wrap {
  container-type: inline-size;
  width: min(100% - 2rem, var(--maxw, 1000px));
  margin-inline: auto;
}
/* phone layouts carry their own 16 px margins, so no extra gutter */
.cv-wrap.cv-mobile, .cv-wrap.cv-flow { width: min(100%, var(--maxw, 480px)); }
.cv-page {
  --u: calc(100cqw / var(--dw));
  position: relative;
  z-index: 0;
  isolation: isolate;             /* item z-indexes can't escape the page */
  height: calc(var(--ph) * var(--u));
  overflow-x: clip;
}
.cv-item {
  position: absolute;
  left: calc(var(--x) * var(--u));
  top: calc(var(--y) * var(--u));
  width: calc(var(--w) * var(--u));
  height: calc(var(--h) * var(--u));
  z-index: var(--z, 1);
  box-sizing: border-box;
  background: var(--bgc, transparent);
  border-radius: calc(var(--r, 0) * var(--u));
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}
a.cv-item { display: block; cursor: pointer; }
.cv-item.has-border { border: max(1px, calc(var(--bw) * var(--u))) solid var(--bc); }
.cv-item.has-shadow { box-shadow: 0 calc(8 * var(--u)) calc(26 * var(--u)) rgba(0, 0, 0, 0.5); }
.cv-item.has-blur { -webkit-backdrop-filter: blur(calc(10 * var(--u))); backdrop-filter: blur(calc(10 * var(--u))); }

.cv-text {
  height: auto;
  min-height: calc(var(--h) * var(--u));   /* grows with its text; never clips while fonts load */
  overflow: visible;
  display: flex;
  flex-direction: column;
  padding: calc(var(--pad, 8) * var(--u));
  font-size: calc(var(--fs, 24) * var(--u));
  color: var(--tc, #fff);
  line-height: var(--lh, 1.3);
  letter-spacing: calc(var(--ls, 0) * 1em);
  overflow-wrap: anywhere;
}
.cv-text.va-middle { justify-content: center; }
.cv-text.va-bottom { justify-content: flex-end; }
.cv-tx { margin: 0; font: inherit; }
.cv-tx p { margin: 0 0 0.5em; }
.cv-tx p:last-child { margin-bottom: 0; }
.cv-tx ul, .cv-tx ol { margin: 0 0 0.5em; padding-left: 1.3em; }
.cv-tx a { color: var(--accent); }

.cv-image img { display: block; width: 100%; height: 100%; border-radius: inherit; -webkit-user-drag: none; }
.cv-video iframe, .cv-video video { display: block; width: 100%; height: 100%; border: 0; background: #000; }
.cv-facade {
  position: relative; display: block; width: 100%; height: 100%;
  border: 0; padding: 0; margin: 0; cursor: pointer;
  background: #000 center / cover no-repeat;
}
.cv-facade.is-static { cursor: default; }
.cv-play {
  position: absolute; left: 50%; top: 50%;
  width: max(44px, calc(68 * var(--u))); transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
  transition: transform 0.15s ease;
}
.cv-play svg { display: block; width: 100%; height: auto; }
.cv-facade:not(.is-static):hover .cv-play { transform: translate(-50%, -50%) scale(1.08); }
.cv-ph, .cv-ph-label {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
  color: var(--muted); font-size: 13px; text-align: center;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0 10px, transparent 10px 20px);
  border: 1px dashed rgba(255, 255, 255, 0.25); box-sizing: border-box;
}
.cv-ph-label { position: absolute; inset: auto 0 8px 0; height: auto; background: none; border: 0; }

/* phones without a custom mobile layout: the desktop items stacked in a column */
.cv-page.cv-flow { height: auto; padding: calc(16 * var(--u)) calc(16 * var(--u)) calc(40 * var(--u)); display: flex; flex-direction: column; }
.cv-frow { display: flex; flex-direction: column; align-items: center; gap: calc(12 * var(--u)); margin-top: calc(var(--gap, 16) * var(--u)); }
.cv-frow:first-child { margin-top: 0; }
.cv-frow.is-row { flex-direction: row; justify-content: center; }
.cv-flow .cv-item, .cv-fbox .cv-item { position: relative; left: auto; top: auto; flex: none; }
.cv-flow .cv-fi { width: calc(var(--w) * var(--u)); }
.cv-flow .cv-box.cv-fi, .cv-flow .cv-image.cv-fi, .cv-flow .cv-video.cv-fi { height: auto; }
.cv-flow .cv-box.cv-fi:not(.cv-fbox) { height: calc(var(--h) * var(--u)); }
.cv-fbox { display: flex; flex-direction: column; align-items: center; gap: calc(12 * var(--u)); padding: calc(12 * var(--u)); }

/* canvas inside a pop-up tab */
.modal-box.has-canvas { padding: 0; overflow: hidden; }
.modal-box.has-canvas .cv-wrap { width: 100%; }

/* ---- Blocks ---- */
.block { margin: 0 0 1.5rem; }
.block:last-child { margin-bottom: 0; }

.blk-heading {
  font-family: var(--racing);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
  font-size: clamp(1.5rem, 6vw, 2.6rem);
}
.blk-text { color: #cdd3de; line-height: 1.6; font-size: 1.02rem; }
.blk-text p { margin: 0 0 0.9rem; }
.blk-text p:last-child { margin-bottom: 0; }
.blk-text a { color: var(--accent); }

.blk-image img { border-radius: 10px; margin: 0 auto; }
.blk-image .cap { text-align: center; color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem; }

.blk-button { text-align: center; }
.btn {
  display: inline-block;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: #0a0b0e;
  background: var(--accent);
  padding: 0.75rem 1.6rem;
  border-radius: 999px;
  box-shadow: 0 0 22px rgba(255, 122, 24, 0.4);
  transition: transform 0.12s ease;
}
.btn:hover { transform: translateY(-2px); }

.blk-divider { height: 1px; background: var(--line); border: 0; }
.blk-spacer { height: 2rem; }

/* ---- Hero ---- */
.hero { text-align: center; padding: clamp(1rem, 4vh, 2.5rem) 0; }
.hero-title {
  font-family: var(--racing);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: clamp(2rem, 8vw, 4rem);
}
.hero-blurb { color: #cdd3de; max-width: 620px; margin: 1rem auto 1.5rem; line-height: 1.6; }

/* ---- Standings table ---- */
.standings { width: 100%; border-collapse: collapse; }
.standings th, .standings td {
  padding: 0.7rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.standings th {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: var(--accent);
}
.standings td:first-child, .standings th:first-child { width: 3rem; text-align: center; color: var(--glow); font-weight: 700; }
.standings tr:hover td { background: rgba(255, 255, 255, 0.03); }

/* ---- Schedule ---- */
.schedule { list-style: none; display: grid; gap: 0.6rem; }
.sched-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 0.85rem 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.sched-date { font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.sched-track { font-weight: 600; }
.sched-time { color: var(--muted); white-space: nowrap; }
@media (max-width: 520px) {
  .sched-row { grid-template-columns: 1fr; gap: 0.2rem; }
  .sched-time { text-align: left; }
}

/* ---- News / articles ---- */
.news-list { display: grid; gap: 1rem; }
.news-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  width: 100%;
  border-left: 3px solid var(--accent);
}
.news-card .thumb { background: #000 center/cover no-repeat; min-height: 90px; }
.news-card .body { padding: 0.9rem 1rem 0.9rem 0; }
.news-card h3 { font-size: 1.1rem; margin-bottom: 0.3rem; }
.news-card p { color: var(--muted); font-size: 0.92rem; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 520px) { .news-card { grid-template-columns: 1fr; } .news-card .thumb { min-height: 140px; } .news-card .body { padding: 0 1rem 1rem; } }

.article-full img { border-radius: 10px; margin: 0 0 1.25rem; }
.article-full h2 { font-family: var(--racing); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 1rem; font-size: clamp(1.5rem, 6vw, 2.4rem); }
.article-full .body { color: #cdd3de; line-height: 1.7; white-space: pre-wrap; }
.back-link { background: none; border: none; color: var(--accent); font: inherit; cursor: pointer; margin-bottom: 1rem; padding: 0; }

/* ---- Rules modal ---- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(4, 5, 8, 0.82);
  display: flex; align-items: flex-start; justify-content: center;
  padding: clamp(1rem, 4vh, 3rem) 1rem; overflow-y: auto;
}
.modal[hidden] { display: none; }
.modal-box {
  position: relative; background: var(--panel);
  border: 1px solid rgba(255, 122, 24, 0.55);
  box-shadow: 0 0 34px rgba(255, 122, 24, 0.28), 0 18px 60px rgba(0, 0, 0, 0.6);
  border-radius: 14px; max-width: 720px; width: 100%;
  padding: clamp(1.5rem, 4vw, 2.5rem); text-align: left;
}
.modal-close {
  position: absolute; top: 0.5rem; right: 0.8rem; z-index: 2;
  background: none; border: none; color: var(--fg);
  font-size: 2rem; line-height: 1; padding: 0.2rem 0.5rem; cursor: pointer;
}
.modal-close:hover { color: var(--accent); }
.modal-title { font-family: var(--racing); font-weight: 400; text-align: center; text-transform: uppercase; letter-spacing: 0.04em; font-size: clamp(1.6rem, 6vw, 2.6rem); }
.modal-subtitle { text-align: center; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; margin-top: 0.4rem; font-size: clamp(0.9rem, 2.6vw, 1.1rem); }
.modal-intro { text-align: center; color: #cdd3de; line-height: 1.5; margin: 1rem 0 1.6rem; }
.rules-list { list-style: none; counter-reset: rule; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
.rules-list li { counter-increment: rule; position: relative; padding-left: 2.7rem; }
.rules-list li::before { content: counter(rule); position: absolute; left: 0; top: -0.1rem; font-family: var(--racing); color: var(--accent); font-size: 1.5rem; line-height: 1; }
.rule-title { display: block; text-transform: uppercase; font-weight: 800; letter-spacing: 0.05em; color: #fff; font-size: 0.98rem; margin-bottom: 0.25rem; }
.rule-desc { display: block; color: #aab2c0; line-height: 1.5; font-size: 0.92rem; }
.modal-footer { text-align: center; margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); text-transform: uppercase; font-weight: 700; letter-spacing: 0.06em; color: var(--accent); font-size: clamp(0.8rem, 2.4vw, 0.95rem); }

.empty { color: var(--muted); text-align: center; padding: 2rem 0; }

@media (prefers-reduced-motion: reduce) {
  body { animation: none; --glow: #17d4ff; }
}

/* ---- Roster: solid ProMod-orange car numbers (no colour-cycling glow) ---- */
.panel[data-tab="roster"] .standings td:first-child,
.panel[data-tab="roster"] .standings th:first-child { color: var(--accent); text-shadow: none; }

/* ---- Season schedule graphic: edges fade into black so it blends with the page ---- */
.blk-image:has(img[src*="schedule-season1"]) { filter: drop-shadow(0 0 16px rgba(0, 0, 0, 0.8)); }
.blk-image img[src*="schedule-season1"] {
  border-radius: 0;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 3%, #000 97%, transparent 100%),
                      linear-gradient(to bottom, transparent 0, #000 4%, #000 96%, transparent 100%);
  -webkit-mask-composite: source-in;
          mask-image: linear-gradient(to right, transparent 0, #000 3%, #000 97%, transparent 100%),
                      linear-gradient(to bottom, transparent 0, #000 4%, #000 96%, transparent 100%);
          mask-composite: intersect;
}

/* ---- Home button: above the social icons, same orange/white style; back to the landing view ---- */
.social { position: relative; }
.home-btn {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 30px; border-radius: 9px; background: var(--accent); color: #fff;
  font-family: inherit; font-weight: 800; font-size: 0.82rem; letter-spacing: 0.12em; line-height: 1;
  text-decoration: none;
  transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.home-btn svg { width: 16px; height: 16px; display: block; }
.home-btn .home-glyph { fill: #fff; transition: fill 0.15s ease; }
a.home-btn:hover, a.home-btn:focus-visible { background: #fff; color: var(--accent); transform: scale(1.05); filter: drop-shadow(0 0 8px rgba(246, 90, 8, 0.55)); }
a.home-btn:hover .home-glyph, a.home-btn:focus-visible .home-glyph { fill: var(--accent); }
a.home-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 860px) {
  .social { flex-wrap: wrap; row-gap: 8px; }
  .home-btn { position: static; flex: 0 0 100%; }
}

/* ---- Home badge: an image like the Merch Shop button, a little wider than the social row ---- */
.home-btn { background: none; height: auto; border-radius: 0; display: block; line-height: 0; left: -12px; right: -12px; }
.home-btn img { width: 100%; height: auto; display: block; }
a.home-btn:hover, a.home-btn:focus-visible { background: none; transform: scale(1.06); filter: drop-shadow(0 0 10px rgba(246, 90, 8, 0.6)); }

/* ---- Home lettering (v2): sized by height, centred over the social icons ---- */
.home-btn { left: 0; right: 0; display: flex; justify-content: center; }
.home-btn img { width: auto; height: 46px; max-width: 100%; }
@media (max-width: 860px) { .home-btn img { height: 40px; } }

/* ---- Our Drivers sign: left of the logo (the logo stays centred); drivers.js opens the pop-up ---- */
.masthead { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; }
.masthead > .site-logo, .masthead > .site-title { grid-column: 2; grid-row: 1; }
.drv-link {
  grid-column: 1; grid-row: 1; justify-self: end; display: block; line-height: 0;
  width: clamp(56px, 11vw, 150px); margin-right: clamp(0.25rem, 2.2vw, 2rem);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.drv-link img { width: 100%; height: auto; display: block; }
a.drv-link:hover, a.drv-link:focus-visible { transform: scale(1.06); filter: drop-shadow(0 0 10px rgba(246, 90, 8, 0.6)); }
a.drv-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
@media (max-width: 400px) {
  .masthead { padding-left: 0.5rem; padding-right: 0.5rem; }
  .site-logo { height: 104px; }
}
/* ---- Admin: top-left corner -> ProMod Studio (shown only once an admin password exists) ---- */
.masthead { position: relative; }
.admin-link {
  position: absolute; top: 12px; left: 16px; z-index: 2; display: block; line-height: 0;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.admin-link[hidden] { display: none; }
.admin-link img { height: 30px; width: auto; display: block; }
a.admin-link:hover, a.admin-link:focus-visible { transform: scale(1.06); filter: drop-shadow(0 0 10px rgba(246, 90, 8, 0.6)); }
a.admin-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
@media (max-width: 600px) { .admin-link { top: 8px; left: 10px; } .admin-link img { height: 24px; } }

/* ---- No glow on text anywhere (owner's call 2026-10-28): plain headings; links + standings numbers solid orange ---- */
.glow { text-shadow: none; }
a { color: var(--accent); }
.standings td:first-child, .standings th:first-child { color: var(--accent); }
body { animation: none; }   /* the colour cycle only fed the glow */

/* ---- Our Drivers tab: darker white text in an orange outline, so it stands out from the plain tabs ---- */
.tab.tab-drivers {
  color: #c9ced8; border: 2px solid var(--accent); border-radius: 8px; padding: 0.4rem 0.75rem; line-height: 1.2;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.tab.tab-drivers:hover, .tab.tab-drivers:focus-visible { color: #fff; background: rgba(246, 90, 8, 0.18); box-shadow: 0 0 12px rgba(246, 90, 8, 0.35); }

/* ---- Merch Shop "Coming soon" pop-up ---- */
.modal-box:has(.soon-box) { max-width: 420px; }
.soon-box { text-align: center; padding: 0.5rem 0 0.25rem; }
.soon-box .modal-subtitle { font-size: clamp(1.1rem, 4vw, 1.4rem); margin-top: 0.6rem; }
/* ---- Roster: drivers side by side, 3 per row, centred, in car-number order (rows are stored sorted by number) ---- */
.panel[data-tab="roster"] .standings thead { display: none; }
.panel[data-tab="roster"] .standings { display: block; }
.panel[data-tab="roster"] .standings tbody { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
.panel[data-tab="roster"] .standings tr {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem; text-align: center;
  padding: 0.8rem 0.5rem; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}
.panel[data-tab="roster"] .standings td { display: block; width: auto; padding: 0; border: 0; text-align: center; background: none; }
.panel[data-tab="roster"] .standings td:first-child { width: auto; font-size: 1.2rem; font-weight: 800; }
.panel[data-tab="roster"] .standings td + td { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.panel[data-tab="roster"] .standings tr:hover { border-color: rgba(246, 90, 8, 0.6); }
.panel[data-tab="roster"] .standings tr:hover td { background: none; }
@media (max-width: 520px) {
  .panel[data-tab="roster"] .standings tbody { gap: 0.4rem; }
  .panel[data-tab="roster"] .standings tr { padding: 0.6rem 0.3rem; }
  .panel[data-tab="roster"] .standings td + td { font-size: 0.85rem; }
}.panel[data-tab="roster"] .standings td:first-child { min-height: 1.5rem; }   /* same card height when a driver has no number yet */

/* ---- Tab bar with the extra Our Drivers tab: wider bar on big screens so the icons + Merch keep their size;
        below 1080px the icons and Merch move under the tabs (same as the phone layout) ---- */
.tabs { max-width: 1120px; }
@media (max-width: 1079px) {
  .tabs { grid-template-columns: 1fr 1fr; row-gap: 0.6rem; }
  .tab-group { grid-column: 1 / -1; grid-row: 1; }
  .social { grid-column: 1; grid-row: 2; width: min(100%, 116px); translate: none; margin: 0; flex-wrap: wrap; row-gap: 8px; }
  .merch-link { grid-column: 2; grid-row: 2; width: 136px; margin: 0; translate: none; }
  .tabs:not(:has(.social)) .merch-link,
  .tabs:not(:has(.merch-link)) .social { grid-column: 1 / -1; }
  .home-btn { position: static; flex: 0 0 100%; }
  .home-btn img { height: 40px; }
}
/* ---- Pop-up tabs (Rules, Our Drivers, and any pop-up tab added later): the same outlined look ---- */
.tab[aria-haspopup="dialog"] {
  color: #c9ced8; border: 2px solid var(--accent); border-radius: 8px; padding: 0.4rem 0.75rem; line-height: 1.2;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.tab[aria-haspopup="dialog"]:hover, .tab[aria-haspopup="dialog"]:focus-visible { color: #fff; background: rgba(246, 90, 8, 0.18); box-shadow: 0 0 12px rgba(246, 90, 8, 0.35); }
/* ---- Social icons: each keeps the size of one of three in the row (~34px), centred, however many links are set
        (2026-11-02: Facebook + TikTok; an icon with no link isn't shown) ---- */
.social { justify-content: center; }
.soc { flex: 0 1 calc((100% - 20px) / 3); }

/* ---- Schedule: finished races (event.winner set) are grayed out and show the winner ---- */
.sched-row.is-done { background: #0d0e12; border-color: rgba(255, 255, 255, 0.06); }
.sched-row.is-done .sched-date, .sched-row.is-done .sched-track { color: #5f6673; }
.sched-winner { color: #ffd34d; font-weight: 800; white-space: nowrap; }
@media (max-width: 520px) { .sched-winner { white-space: normal; } }
