/* D Racing Sims — dark racing theme. Colors and fonts come from site settings (see base.html). */

:root {
  --text-muted: color-mix(in srgb, var(--text) 62%, transparent);
  --text-faint: color-mix(in srgb, var(--text) 40%, transparent);
  --line: color-mix(in srgb, var(--text) 10%, transparent);
  --surface-2: color-mix(in srgb, var(--surface) 85%, var(--text) 4%);
  --live: #2ee66b;
  --offline: #8a8f99;
  --radius: 14px;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 120px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* Fonts that only come in one weight (Anton, Russo One, Bebas Neue) are already heavy;
     don't let the browser smear them thicker to fake bold. */
  font-synthesis-weight: none;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a { color: inherit; }

h1, h2, h3 { font-family: var(--font-heading); font-weight: 700; font-style: italic; line-height: 1.1; margin: 0; letter-spacing: 0.05em; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }

.muted { color: var(--text-faint); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner { display: flex; align-items: center; gap: 16px; height: 64px; }

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; margin-right: auto; }

.brand__logo { height: 40px; width: auto; display: block; }

.brand__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 22px;
  font-style: italic;
  clip-path: polygon(18% 0, 100% 0, 82% 100%, 0 100%);
}

.brand__name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 18px;
  text-transform: uppercase;
  font-style: italic;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 0.15em;   /* room for the italic slant so the last letter isn't clipped */
}

.site-nav { display: flex; gap: 4px; }

.site-nav > a {
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 10px 14px;
  border-radius: 8px;
  transition: color .15s, background .15s;
}

.site-nav > a:hover { color: var(--text); background: var(--line); }

.site-nav > a.is-active { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }

.nav-toggle { display: none; }

/* Steam account */

.account { display: flex; align-items: center; gap: 8px; margin-left: 10px; }

.account form { margin: 0; }

.account__user { display: flex; align-items: center; gap: 8px; min-width: 0; }

.account__avatar { width: 28px; height: 28px; border-radius: 6px; flex: none; }

.account__name { font-weight: 600; font-size: 14px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

a.account__user { color: inherit; text-decoration: none; border-radius: 8px; }

a.account__user:hover .account__reg { color: var(--accent); }

.account__names { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }

.account__reg { font-size: 12px; color: var(--text-faint); white-space: nowrap; }

/* ---------- Leaderboard name registration ---------- */

.register > * { max-width: 760px; }

.register .panel + .panel { margin-top: 16px; }

.privacy-note { border-left: 3px solid var(--accent); }

.privacy-note p { margin: 0 0 10px; color: var(--text-muted); }

.privacy-note p strong { color: var(--text); }

.name-preview {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0;
  padding: 14px 16px;
  background: var(--surface-2);
  border-radius: 10px;
}

.name-preview__label { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }

.name-preview__value { font-family: var(--font-heading); font-size: 22px; font-style: italic; letter-spacing: 0.04em; }

.register__actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.register__skip { color: var(--text-muted); font-size: 14px; }

.account__out {
  padding: 6px 10px;
  font: 600 13px var(--font-body);
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.account__out:hover { color: var(--text); border-color: var(--text-faint); }

.btn-steam {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  font: 600 13px var(--font-body);
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  background: linear-gradient(180deg, #2a475e, #1b2838);
  border: 1px solid #3d6a8a;
  border-radius: 8px;
  transition: filter .15s;
}

.btn-steam:hover { filter: brightness(1.2); }

.btn-steam svg { width: 18px; height: 18px; fill: #fff; flex: none; }

.flash {
  margin: 14px 0 0;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 10px;
}

@media (max-width: 1240px) {
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0 11px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
  }
  .nav-toggle__bar { display: block; height: 2px; background: var(--text); border-radius: 2px; }
  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px var(--gutter) 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .site-nav.is-open { display: flex; }
  .account { margin: 14px 0 0; justify-content: space-between; }
  .btn-steam { width: 100%; justify-content: center; min-height: 46px; font-size: 15px; }
  .site-nav > a { padding: 14px 4px; font-size: 15px; border-bottom: 1px solid var(--line); }
  .site-nav > a.is-active { box-shadow: inset 3px 0 0 var(--accent); padding-left: 14px; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, transparent 40%, var(--bg) 100%),
    linear-gradient(100deg, color-mix(in srgb, var(--bg) 92%, transparent) 30%, color-mix(in srgb, var(--bg) 40%, transparent)),
    var(--banner, none) center / cover no-repeat,
    radial-gradient(1200px 400px at 85% -10%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 60%),
    var(--bg);
}

.hero::after {
  /* speed stripes */
  content: "";
  position: absolute;
  right: -40px;
  top: 0;
  bottom: 0;
  width: 46%;
  background: repeating-linear-gradient(115deg, transparent 0 22px, color-mix(in srgb, var(--accent) 16%, transparent) 22px 26px);
  mask-image: linear-gradient(90deg, transparent, #000 70%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 70%);
  pointer-events: none;
}

.hero__inner { position: relative; z-index: 1; padding-top: 56px; padding-bottom: 40px; }

.hero--small .hero__inner { padding-top: 48px; padding-bottom: 48px; }

.eyebrow {
  margin: 0 0 10px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent);
}

.hero__title {
  font-size: clamp(34px, 7vw, 64px);
  font-weight: 700;
  font-style: italic;
  text-transform: uppercase;
  max-width: 14ch;
}

.hero__intro { margin: 14px 0 0; max-width: 52ch; color: var(--text-muted); font-size: 17px; }

.hero__stats { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

.stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
}

.stat__num { font-family: var(--font-heading); font-weight: 700; font-size: 24px; font-variant-numeric: tabular-nums; }

.stat__label { color: var(--text-muted); font-size: 14px; }

/* ---------- Categories & grid ---------- */

.category { padding-top: 40px; }

.category:last-child { padding-bottom: 56px; }

.category__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.category__title {
  font-size: 22px;
  font-weight: 700;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  position: relative;
  padding-left: 16px;
}

.category__title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 6px;
  background: var(--accent);
  transform: skewX(-14deg);
}

.category__count { color: var(--text-faint); font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }

@media (max-width: 420px) { .grid { grid-template-columns: 1fr; } }

/* ---------- Server card ---------- */

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}

.card--live.is-online:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 16px 40px -18px color-mix(in srgb, var(--accent) 60%, transparent);
}

.card__media { position: relative; aspect-ratio: 16 / 8; overflow: hidden; background: var(--surface-2); }

.card__img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform .4s;
}

.card:hover .card__img { transform: scale(1.04); }

.card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, color-mix(in srgb, var(--surface) 92%, transparent));
}

/* Fallback art per category when no image is set */
.card__img:not([style]) {
  background:
    repeating-linear-gradient(115deg, transparent 0 18px, color-mix(in srgb, var(--hue, var(--accent)) 14%, transparent) 18px 21px),
    radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--hue, var(--accent)) 45%, transparent), transparent 60%),
    var(--surface-2);
}

.cat-touge { --hue: #ff2a3d; }
.cat-time-attack { --hue: #ffb020; }
.cat-race { --hue: #3d8bff; }
.cat-traffic { --hue: #20d0b0; }

.pill {
  position: absolute;
  z-index: 1;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border-radius: 999px;
  background: color-mix(in srgb, #000 65%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid color-mix(in srgb, #fff 14%, transparent);
}

.pill--live { color: var(--offline); }
.is-online .pill--live { color: var(--live); }

.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.is-online .dot { box-shadow: 0 0 0 0 currentColor; animation: pulse 1.8s infinite; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 70%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.pill--soon { color: var(--text-muted); }

.card__body { display: flex; flex-direction: column; flex: 1; padding: 4px 18px 18px; }

.card__title { font-size: 21px; font-weight: 700; text-transform: uppercase; }

.card__desc { margin: 6px 0 0; color: var(--text-muted); font-size: 14px; }

.card__stats { display: flex; gap: 16px; margin: 16px 0 0; }

.card__stat { min-width: 0; }

.card__stat--track { flex: 1; }

.card__stat dt {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-faint);
}

.card__stat dd {
  margin: 2px 0 0;
  font-weight: 600;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card:not(.is-online) .card__stat--track dd { color: var(--text-faint); font-weight: 500; }

.meter { height: 4px; margin-top: 12px; background: var(--line); border-radius: 4px; overflow: hidden; }

.meter span { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .4s; }

.card__actions { margin-top: auto; padding-top: 18px; }

.card__timing { margin-top: 8px; min-height: 42px; font-size: 14px; }

.card__timing svg { width: 18px; height: 18px; fill: currentColor; }

/* Coming soon: greyed out */
.card--soon { opacity: 0.55; }
.card--soon .card__media { aspect-ratio: 16 / 4; }
.card--soon .card__img { filter: grayscale(1); }
.card--soon:hover .card__img { transform: none; }

/* ---------- Buttons ---------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter .15s, transform .1s;
}

.btn svg { width: 18px; height: 18px; fill: currentColor; }

.btn--primary { background: var(--accent); color: #fff; }

.btn--primary:hover { filter: brightness(1.12); }

.btn--primary:active { transform: scale(0.98); }

.btn--ghost { background: transparent; border-color: var(--line); color: var(--text-faint); cursor: default; }

.btn[aria-disabled="true"] { pointer-events: none; }

.btn--primary[aria-disabled="true"] { background: var(--surface-2); color: var(--text-faint); }

.btn--outline { background: transparent; border-color: var(--line); color: var(--text); }

.btn--outline:hover { border-color: var(--accent); }

.btn--small { width: auto; min-height: 38px; padding: 0 14px; font-size: 13px; background: var(--accent); color: #fff; }

/* ---------- Shared bits ---------- */

.section { padding-top: 28px; padding-bottom: 56px; }

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 14px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
}

.back:hover { color: var(--text); }

.back svg { width: 18px; height: 18px; fill: currentColor; }

.season-picker { display: flex; align-items: center; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

.season-picker label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-faint);
}

.select { position: relative; }

.select::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.select select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 44px;
  padding: 0 40px 0 14px;
  font: 600 15px var(--font-body);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

.select select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Leaderboards: track map + list ---------- */

.explorer {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  grid-template-areas: "list map";
  gap: 16px;
  margin-bottom: 24px;
}

.explorer__map { grid-area: map; position: relative; min-width: 0; }

.explorer__list {
  grid-area: list;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  height: 500px;
}

.track-map {
  height: 500px;
  background: #0e0f12;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  z-index: 0;
}

.track-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.track-search:focus-within { border-color: var(--accent); }

.track-search svg { width: 18px; height: 18px; fill: var(--text-faint); flex: none; }

.track-search input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  font: 500 15px var(--font-body);
  color: var(--text);
  background: none;
  border: 0;
  outline: none;
}

.track-list {
  list-style: none;
  margin: 0;
  padding: 4px;
  flex: 1;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  scrollbar-width: thin;
}

.track-list__empty { margin: 0; font-size: 14px; color: var(--text-faint); }

.track-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: inherit;
  text-decoration: none;
  border-radius: 10px;
}

.track-item:hover { background: var(--surface-2); }

.track-item.is-active { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); box-shadow: inset 3px 0 0 var(--accent); }

.track-item__pin {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface-2);
}

.track-item__pin svg { width: 18px; height: 18px; fill: var(--accent); }

.track-item__pin.is-fictional svg { fill: var(--text-muted); }

.track-item__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }

.track-item__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.track-item__meta { font-size: 13px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.track-item__count {
  flex: none;
  min-width: 28px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  color: var(--text-muted);
  background: var(--surface-2);
  border-radius: 999px;
}

/* Map pins, tooltip and the info card on top of the map */
.map-pin span {
  display: block;
  width: 24px;
  height: 24px;
  background: var(--accent);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent), 0 2px 8px rgba(0, 0, 0, 0.6);
  transition: transform 0.2s;
}

.map-pin:hover span { transform: scale(1.15); }

.map-pin.is-active span { animation: pin-pulse 1.6s ease-out infinite; transform: scale(1.2); }

@keyframes pin-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent), 0 2px 8px rgba(0, 0, 0, 0.6); }
  100% { box-shadow: 0 0 0 18px transparent, 0 2px 8px rgba(0, 0, 0, 0.6); }
}

@media (prefers-reduced-motion: reduce) { .map-pin.is-active span { animation: none; } }

.leaflet-tooltip.map-tip {
  padding: 4px 10px;
  font: 600 13px var(--font-body);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

.leaflet-tooltip.map-tip::before { display: none; }

.leaflet-container { font-family: var(--font-body); background: #0e0f12; }

.map-satellite { filter: brightness(0.62) saturate(0.8) contrast(1.05); }

.leaflet-bar a, .leaflet-bar a:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
}

.leaflet-bar { border: 1px solid var(--line) !important; box-shadow: none !important; }

.leaflet-control-attribution { background: rgba(10, 11, 14, 0.75) !important; color: var(--text-faint) !important; }

.leaflet-control-attribution a { color: var(--text-muted) !important; }

.map-card {
  position: absolute;
  left: 14px;
  bottom: 30px;
  z-index: 500;
  max-width: min(320px, calc(100% - 28px));
  padding: 12px 16px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.map-card > p { margin: 0; }

.map-card__eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }

.map-card__name { margin-top: 2px !important; font-family: var(--font-heading); font-style: italic; font-size: 20px; letter-spacing: 0.04em; text-transform: uppercase; }

.map-card__ref { margin-top: 4px !important; font-size: 14px; color: var(--text-muted); }

/* Fictional / no location: a bigger card in the middle of the world view */
.map-card.is-center {
  left: 50%;
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
  max-width: min(380px, calc(100% - 28px));
  padding: 18px 22px;
  text-align: center;
  border-left: 1px solid var(--line);
  border-top: 3px solid var(--accent);
}

.map-card.is-center .map-card__name { font-size: 26px; }

.map-card.is-center .map-card__ref { font-size: 15px; color: var(--text); }

/* Leaderboard panel under the map */
.track-board-wrap { transition: opacity 0.15s; }

.track-board-wrap.is-loading { opacity: 0.45; pointer-events: none; }

.track-board__head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }

.track-board__img {
  flex: none;
  width: 180px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.track-board__info { min-width: 0; }

.track-board__title { font-size: clamp(24px, 4vw, 34px); text-transform: uppercase; }

.track-board__layout { margin: 4px 0 0; font-weight: 600; color: var(--text-muted); }

.track-board__ref { margin: 6px 0 0; font-size: 14px; color: var(--text-muted); }

.track-board__ref span { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-right: 4px; }

.external-note { margin: 24px 0 0; font-size: 14px; color: var(--text-muted); }

.external-note a { color: var(--accent); }

/* ---------- Home page stream player ---------- */

.hero__inner--stream { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: center; }

.stream { width: 300px; justify-self: end; }

.stream__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }

.stream__title { font-family: var(--font-heading); font-style: italic; text-transform: uppercase; letter-spacing: 0.05em; }

.stream__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #fff;
  background: #e5132b;
  border-radius: 999px;
}

.stream__badge[hidden] { display: none; }

.stream__badge .dot { background: #fff; animation: pulse 1.8s infinite; }

.stream__frame {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.stream__frame #stream-player, .stream__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.stream__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 12px; }

.stream__nav { display: inline-flex; gap: 4px; }

.stream__nav[hidden] { display: none; }

@media (max-width: 860px) {
  .hero__inner--stream { grid-template-columns: 1fr; }
  .stream { justify-self: center; width: min(300px, 100%); }
}

/* ---------- Admin: battle courses ---------- */

.course-map { margin: 14px 0; padding: 10px; background: #0e0f12; border: 1px solid var(--line); border-radius: var(--radius); }

.course-map svg { display: block; width: 100%; height: min(60vh, 520px); cursor: crosshair; }

.course-pick { margin-bottom: 16px; }

.course-length { margin: 4px 0 0; font-size: 15px; }

.course-warn { margin-left: 10px; color: #ff9f1c; font-weight: 600; }

#finish-field[hidden] { display: none; }

/* ---------- Touge rankings ---------- */

.rank__subhead { margin: 32px 0 12px; font-size: 22px; text-transform: uppercase; }

.rank__subhead .muted { font-size: 14px; font-style: normal; text-transform: none; letter-spacing: 0; }

.pace {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  font-family: var(--font-heading);
  font-size: 16px;
  font-style: italic;
  border-radius: 6px;
  color: #111;
  cursor: help;
}

.pace--s { background: #f5c542; }
.pace--a { background: #4fd18b; }
.pace--b { background: #5aa9ff; }
.pace--c { background: #9aa3ad; }

.kamote {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  color: #111;
  background: #ff9f1c;
  border-radius: 4px;
  vertical-align: 2px;
  cursor: help;
}

.decay {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px dashed var(--line);
  border-radius: 4px;
  vertical-align: 2px;
  cursor: help;
}

.battle-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }

.battle-card { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

.battle-card__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 10px; font-size: 13px; }

.battle-card__mode { font-family: var(--font-heading); font-style: italic; text-transform: uppercase; color: var(--accent); }

.battle-card__track { font-weight: 600; font-size: 14px; }

.battle-card__drivers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

.battle-card__drivers li { display: flex; align-items: center; gap: 10px; font-size: 14px; }

.battle-card__place {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  font-family: var(--font-heading);
  font-size: 13px;
  border-radius: 5px;
  background: var(--surface-2);
}

.battle-card__drivers li.is-win .battle-card__place { background: #f5c542; color: #111; }

.battle-card__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.delta { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.delta--up { color: var(--live); }
.delta--down { color: #ff6b6b; }

.rank__rules { margin-top: 32px; }

.rank__rules ul { margin: 12px 0 0; padding-left: 18px; color: var(--text-muted); line-height: 1.6; }

.rank__rules li + li { margin-top: 6px; }

.rank__rules strong { color: var(--text); }

@media (max-width: 640px) {
  .rank__battles-col, .rank__wdl-col, .rank__last-col { display: none; }
}

/* ---------- Live timing ---------- */

.live-list { display: flex; flex-direction: column; gap: 36px; }

.live { scroll-margin-top: 110px; }

.live__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.live__title { font-size: clamp(24px, 4vw, 34px); text-transform: uppercase; }

.live__head .pill { position: static; background: var(--surface); border: 1px solid var(--line); }

.live__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.live__detail { width: auto; min-height: 36px; padding: 0 14px; font-size: 13px; }

.live__detail[hidden] { display: none; }

.live__detail svg { width: 15px; height: 15px; fill: currentColor; }

.live .pill--live { color: var(--live); }

.live .pill--live .dot { animation: pulse 1.8s infinite; }

@media (prefers-reduced-motion: reduce) { .live .pill--live .dot { animation: none; } }

.pill--off { color: var(--offline); }

.live__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 8px 0 16px; font-size: 14px; color: var(--text-muted); }

.live__meta:empty { display: none; }

.live__track { font-weight: 600; color: var(--text); }

a.live__track { text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 60%, transparent); }

a.live__track:hover { border-bottom-color: var(--accent); }

.live__clock { font-variant-numeric: tabular-nums; }

.live__sep { color: var(--text-faint); }

.livemap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  padding: 18px;
  background: radial-gradient(ellipse at center, var(--surface-2), var(--surface) 70%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.livemap[hidden] { display: none; }

.livemap__frame { position: relative; max-width: 100%; }

.livemap__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.9;
  user-select: none;
  pointer-events: none;
}

.livemap__dots { position: absolute; inset: 0; }

.livemap__dot {
  position: absolute;
  z-index: 1;
  display: flex;
  align-items: center;
  transform: translate(-11px, -50%);
  transition: left 1s linear, top 1s linear;
  will-change: left, top;
}

.livemap__dot b {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  font: 700 11px var(--font-body);
  color: #111;
  background: var(--medal, #fff);
  border: 2px solid #111;
  border-radius: 50%;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

.livemap__name {
  margin-left: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  color: #fff;
  background: rgba(10, 11, 14, 0.78);
  border-radius: 4px;
}

.livemap__dot.is-me { z-index: 2; }

.livemap__dot.is-me b { color: #fff; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent); }

.livemap__dot.is-pit { opacity: 0.5; }

@media (prefers-reduced-motion: reduce) { .livemap__dot { transition: none; } }

@media (max-width: 640px) {
  .livemap { padding: 10px; }
  .livemap__name { display: none; }
  .livemap__dot.is-me .livemap__name { display: inline; }
}

.pit {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #111;
  background: #f5c542;
  border-radius: 4px;
  vertical-align: 2px;
}

@media (max-width: 640px) {
  .lb--live .lb__laps-col, .lb--live .lb__last-col { display: none; }
  .lb--live .lb__gap-col { display: table-cell; }
}

@media (max-width: 420px) {
  .lb--live .lb__gap-col { display: none; }
}

@media (max-width: 860px) {
  .explorer { grid-template-columns: 1fr; grid-template-areas: "map" "list"; }
  .track-map { height: 320px; }
  .explorer__list { height: auto; }
  .track-list { display: flex; gap: 8px; padding: 0; overflow-x: auto; overflow-y: hidden; background: none; border: 0; }
  .track-list li { flex: none; width: 240px; }
  .track-list .track-item { background: var(--surface); border: 1px solid var(--line); }
  .track-list .track-item.is-active { border-color: var(--accent); }
}

@media (max-width: 520px) {
  .track-board__head { align-items: flex-start; flex-direction: column; gap: 12px; }
  .track-board__img { width: 100%; max-width: 360px; }
}

.board__cat {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
}

.board__note { margin: 0; color: var(--text-muted); font-size: 14px; }

.board__note--me { margin-bottom: 14px; font-size: 13px; }

.p1 { --medal: #f5c542; }
.p2 { --medal: #c9d1dc; }
.p3 { --medal: #d98c4a; }

/* ---------- Leaderboard detail ---------- */

.chips { display: flex; gap: 8px; margin-bottom: 18px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.chip.is-active { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }

.chip__count { font-size: 12px; color: var(--text-faint); }

.me-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 12px;
}

.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }

.lb { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }

.lb th {
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  border-bottom: 1px solid var(--line);
}

.lb td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }

.lb tbody tr:last-child td { border-bottom: 0; }

.lb tbody tr:hover { background: color-mix(in srgb, var(--text) 3%, transparent); }

.lb__pos { width: 56px; }

.lb__num { text-align: right; white-space: nowrap; }

.lb th.lb__num { text-align: right; }

.lb__time { font-family: var(--font-heading); font-weight: 700; font-size: 16px; }

.lb__driver { font-weight: 600; }

.lb__car-sub { display: none; }

.pos {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  font-family: var(--font-heading);
  font-weight: 700;
  border-radius: 6px;
  background: var(--surface-2);
}

.p1 .pos, .p2 .pos, .p3 .pos { background: var(--medal); color: #111; clip-path: polygon(15% 0, 100% 0, 85% 100%, 0 100%); border-radius: 0; }

.lb tr.is-me td { background: color-mix(in srgb, var(--accent) 16%, transparent); }

.lb tr.is-me td:first-child { box-shadow: inset 4px 0 0 var(--accent); }

.you {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  vertical-align: 2px;
}

@media (max-width: 640px) {
  .lb__car-col, .lb__date-col, .lb__gap-col { display: none; }
  .lb__car-sub { display: block; font-size: 13px; color: var(--text-faint); }
  .lb td, .lb th { padding: 10px; }
  .lb__pos { width: 46px; }
}

.pager-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; font-size: 14px; }

.pager { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

.pager__btn {
  display: grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.pager__btn:hover { color: var(--text); border-color: var(--text-faint); }

.pager__btn.is-active { color: #fff; background: var(--accent); border-color: var(--accent); }

.pager__btn.has-me:not(.is-active) { border-color: var(--accent); color: var(--text); }

.pager__btn.is-disabled { opacity: 0.35; pointer-events: none; }

.pager__gap { padding: 0 4px; color: var(--text-faint); }

/* ---------- All-time records ---------- */

.record-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

@media (max-width: 420px) { .record-grid { grid-template-columns: 1fr; } }

.record {
  position: relative;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.record::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 90px;
  height: 100%;
  background: repeating-linear-gradient(115deg, transparent 0 10px, color-mix(in srgb, var(--accent) 12%, transparent) 10px 12px);
  mask-image: linear-gradient(90deg, transparent, #000);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000);
}

.record__track { position: relative; margin: 0; font-weight: 600; color: var(--text-muted); }

.record__time {
  position: relative;
  margin: 4px 0 14px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-style: italic;
  font-size: 36px;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.record__meta { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 0; }

.record__meta dt { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-faint); }

.record__meta dd { margin: 2px 0 0; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Downloads ---------- */

.dl-group + .dl-group { margin-top: 36px; }

.dl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }

@media (max-width: 420px) { .dl-list { grid-template-columns: 1fr; } }

.dl {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, transform .15s;
}

.dl:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); transform: translateY(-2px); }

.dl__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-2));
}

.dl__icon svg { width: 22px; height: 22px; fill: var(--accent); }

.dl__main { flex: 1; min-width: 0; }

.dl__title { display: block; font-weight: 700; }

.dl__desc { display: block; font-size: 13px; color: var(--text-muted); }

.dl__size { flex: none; font-size: 13px; color: var(--text-faint); }

/* ---------- Admin ---------- */

.admin { padding-top: 28px; padding-bottom: 56px; max-width: 900px; }

.admin__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }

.admin__title { font-size: clamp(26px, 5vw, 36px); font-weight: 700; font-style: italic; text-transform: uppercase; }


.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.admin-tabs::-webkit-scrollbar { display: none; }

.admin-tabs a {
  flex: none;
  padding: 12px 14px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.admin-tabs a.is-active { color: var(--text); border-bottom-color: var(--accent); }

.panel-stack { display: flex; flex-direction: column; gap: 16px; }

.panel {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.panel + .panel { margin-top: 16px; }

.panel-stack .panel + .panel { margin-top: 0; }

.panel__title { margin: 0 0 6px; font-size: 18px; font-weight: 700; text-transform: uppercase; }

details.panel > summary { cursor: pointer; list-style: none; }

details.panel > summary::before { content: "▸ "; color: var(--accent); }

details.panel[open] > summary::before { content: "▾ "; }

details.panel[open] > summary { margin-bottom: 14px; }

.hint { display: block; margin: 0 0 14px; font-size: 13px; color: var(--text-muted); }

.field .hint { margin: 4px 0 0; }

.form-stack { display: flex; flex-direction: column; gap: 14px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.field__label { font-size: 13px; font-weight: 600; color: var(--text-muted); }

.admin input[type="text"], .admin input[type="url"], .admin input[type="number"], .admin textarea,
.admin .select select, .inline-form input[type="text"], .register input[type="text"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font: 15px var(--font-body);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.admin .select select { padding-right: 40px; }

.admin textarea { resize: vertical; line-height: 1.45; }

.admin input:focus-visible, .admin textarea:focus-visible, .register input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

.admin input[type="file"] { font: 14px var(--font-body); color: var(--text-muted); max-width: 100%; }

.admin input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 8px 14px;
  font: 600 13px var(--font-body);
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); cursor: pointer; }

.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.image-field { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }

.image-field__preview {
  display: grid;
  place-items: center;
  width: 220px;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  padding: 8px;
  overflow: hidden;
  text-align: center;
  font-size: 13px;
  background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--bg) 0 50%) 0 0 / 16px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.image-field__preview img { max-width: 100%; max-height: 100%; object-fit: contain; }

.image-field__preview--logo { aspect-ratio: 3 / 1; }

.image-field__controls { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 220px; }

.color-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }

.color-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

.color-field input[type="color"] {
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  cursor: pointer;
}

.color-field > span { display: flex; flex-direction: column; font-size: 14px; }

.color-field .muted { font-size: 12px; }

.theme-preview {
  margin-top: 14px;
  padding: 18px;
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--line);
}

.theme-preview > * { margin: 0; }

.theme-preview__eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); }

.theme-preview__title {
  margin: 8px 0 4px;
  padding: 12px 14px 0;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text);
  background: var(--surface);
  border-radius: 10px 10px 0 0;
}

.theme-preview__text { padding: 0 14px 14px; font-size: 14px; color: var(--text); opacity: .7; background: var(--surface); border-radius: 0 0 10px 10px; }

.theme-preview__btn {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 22px;
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--accent);
  border-radius: 10px;
}

.segmented { display: flex; padding: 3px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }

.segmented label { flex: 1; cursor: pointer; }

.segmented input { position: absolute; opacity: 0; pointer-events: none; }

.segmented span {
  display: grid;
  place-items: center;
  min-height: 38px;
  padding: 0 12px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-muted);
  border-radius: 8px;
}

.segmented input:checked + span { color: #fff; background: var(--accent); }

.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.save-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, var(--bg) 35%);
}

.btn--auto { width: auto; display: inline-flex; }

.btn--compact { width: auto; min-height: 36px; padding: 0 12px; font-size: 13px; }

.link-btn { padding: 0; font: 14px var(--font-body); color: var(--text-muted); background: none; border: 0; text-decoration: underline; cursor: pointer; }

.link-btn--danger { color: #ff6b6b; }

.reset-form, .danger-zone { margin-top: 8px; }

.danger-zone { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }

.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }

.admin-toolbar .hint { margin: 0; }

.item-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.item__thumb {
  flex: none;
  width: 64px;
  height: 40px;
  border-radius: 6px;
  background: var(--surface-2) center / cover no-repeat;
}

.item__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }

.item__name { font-weight: 700; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.item__name:hover { color: var(--accent); }

.item__meta { display: flex; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--text-faint); }

.item__url { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.item__actions { display: flex; align-items: center; gap: 6px; flex: none; }

.item__actions form { margin: 0; }

.item--cat { flex-wrap: wrap; }

.item--cat .inline-form { flex: 1; min-width: 200px; }

.badge {
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: var(--surface-2);
  border-radius: 999px;
}

.badge--live { color: var(--live); background: color-mix(in srgb, var(--live) 14%, transparent); }

.badge--warn { color: #ffb020; background: color-mix(in srgb, #ffb020 14%, transparent); }

.move { display: flex; gap: 2px; }

.move form { margin: 0; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.icon-btn:hover:not(:disabled) { color: var(--text); border-color: var(--text-faint); }

.icon-btn:disabled { opacity: .3; cursor: default; }

.icon-btn--danger:hover:not(:disabled) { color: #ff6b6b; border-color: #ff6b6b; }

.inline-form { display: flex; gap: 8px; align-items: center; margin: 0; }

.inline-form--add { margin-top: 12px; }

@media (max-width: 560px) {
  .item { flex-wrap: wrap; }
  .item__actions { width: 100%; justify-content: flex-end; }
  .admin__head { align-items: flex-start; flex-direction: column; gap: 8px; }
}

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--line); padding: 22px 0 calc(22px + env(safe-area-inset-bottom)); color: var(--text-faint); font-size: 13px; }

.site-footer__sep { margin: 0 6px; }

.site-footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; }

.site-footer__contact a { color: var(--text-muted); text-decoration: none; }

.site-footer__contact a:hover { color: var(--text); }

/* Social icons (header + footer) */
.socials { display: inline-flex; align-items: center; gap: 4px; }

.socials__link {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--text-muted);
  border-radius: 8px;
  transition: color .15s, background .15s;
}

.socials__link:hover { color: var(--text); background: var(--line); }

.socials__link svg { width: 18px; height: 18px; fill: currentColor; }

.socials--header { margin-left: 6px; }

@media (max-width: 1240px) {
  .socials--header { margin: 8px 0 0; }
}

/* ---------- drsims.net home + products ---------- */

.home-hero__inner { padding-top: 72px; padding-bottom: 64px; }

.home-hero__title { max-width: 16ch; font-size: clamp(40px, 8vw, 80px); }

.portals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 40px; }

.portal {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  min-height: 280px;
  padding: 28px 84px 28px 28px;
  overflow: hidden;
  isolation: isolate;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: radial-gradient(600px 300px at 100% 0%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%), var(--surface);
  transition: transform .2s, border-color .2s, box-shadow .2s;
}

.portal::before {
  /* picture, darkened at the bottom so the text stays readable */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 15%, transparent) 0%, color-mix(in srgb, var(--bg) 92%, transparent) 78%),
              var(--portal-img, none) center / cover no-repeat;
  transition: transform .4s;
}

.portal::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
}

.portal:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--accent) 60%, transparent); }

.portal:hover::before { transform: scale(1.04); }

.portal__kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border: 1px solid var(--line);
}

.portal__kicker .dot { color: var(--live); }

.portal--products .portal__kicker { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }

.portal__title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.05;
}

.portal__text { color: var(--text-muted); max-width: 40ch; }

.portal__go {
  position: absolute;
  right: 24px;
  bottom: 28px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  transition: transform .2s;
}

.portal__go svg { width: 22px; height: 22px; fill: currentColor; }

.portal:hover .portal__go { transform: translateX(4px); }

.home-section { padding: 64px 0; border-bottom: 1px solid var(--line); }

.home-section--alt { background: color-mix(in srgb, var(--surface) 55%, var(--bg)); }

.section-title {
  font-size: clamp(24px, 3.4vw, 34px);
  text-transform: uppercase;
  position: relative;
  padding-left: 18px;
}

.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.12em;
  bottom: 0.12em;
  width: 5px;
  background: var(--accent);
  transform: skewX(-14deg);
}

.section-intro { margin: 12px 0 0; color: var(--text-muted); max-width: 60ch; }

.home-about { margin-top: 18px; max-width: 70ch; color: var(--text-muted); font-size: 17px; }

.home-about p { margin: 0 0 12px; }

.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 32px; }

.pillar {
  position: relative;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
}

.pillar__num { font-family: var(--font-heading); font-weight: 700; font-style: italic; font-size: 14px; color: var(--accent); letter-spacing: 0.1em; }

.pillar__title { margin: 6px 0 10px; font-size: 24px; text-transform: uppercase; }

.pillar p { margin: 0 0 8px; color: var(--text-muted); }

.partners { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-top: 28px; }

.partner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .2s, transform .2s;
}

a.partner:hover { border-color: var(--accent); transform: translateY(-2px); }

.partner__logo {
  display: grid;
  place-items: center;
  height: 96px;
  margin-bottom: 6px;
  padding: 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--text) 5%, transparent);
}

.partner__logo img { max-width: 100%; max-height: 72px; object-fit: contain; }

.partner__wordmark { font-family: var(--font-heading); font-style: italic; font-size: 22px; text-transform: uppercase; text-align: center; color: var(--text-muted); }

.partner__name { font-size: 18px; text-transform: uppercase; }

.partner__text { margin: 0; color: var(--text-muted); font-size: 14px; }

.partner__link { margin-top: auto; padding-top: 6px; font-size: 13px; font-weight: 600; color: var(--accent); }

.home-connect { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }

.connect-card { padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

.connect-card__cta { margin-top: 20px; }

.socials--big { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

.socials--big .socials__link {
  width: auto;
  height: 44px;
  display: inline-flex;
  gap: 8px;
  padding: 0 16px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.socials--big .socials__link:hover { border-color: var(--accent); }

.contact-list { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.contact-list a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color .2s;
}

.contact-list a:hover { border-color: var(--accent); }

.contact-list svg { width: 22px; height: 22px; flex: none; fill: var(--accent); }

.contact-list span { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }

.contact-list small { color: var(--text-faint); font-size: 13px; }

.products-hero__inner { padding-top: 80px; padding-bottom: 80px; }

.products-status {
  display: inline-block;
  margin-top: 16px;
  padding: 6px 14px;
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #fff;
  background: var(--accent);
  border-radius: 4px;
  transform: skewX(-8deg);
}

.products-note { margin: 10px 0 0; color: var(--text-faint); }

.products-hero .back { margin-top: 24px; }

@media (max-width: 720px) {
  .portals { grid-template-columns: 1fr; }
  .portal { min-height: 220px; padding: 22px 76px 22px 22px; }
  .portal__go { right: 18px; bottom: 22px; }
  .home-section { padding: 44px 0; }
  .home-hero__inner { padding-top: 48px; padding-bottom: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
