/* ACCELERATE — 1990s F1 pit-wall / Senna-Prost era */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@600;700;800&family=Orbitron:wght@500;700;900&family=Russo+One&family=Share+Tech+Mono&display=swap');

:root {
  --red: #e10600;
  --red-hot: #ff1a1a;
  --red-deep: #8b0000;
  --black: #0a0a0a;
  --carbon: #141414;
  --chrome: #c0c0c0;
  --chrome-bright: #e8e8e8;
  --white: #f5f5f5;
  --amber: #ffb000;
  --led-green: #39ff14;
  --led-amber: #ffbf00;
  --led-red: #ff0033;
  --lcd: #9eff9e;
  --lcd-bg: #0d1a0d;
  --metal: #2a2a2a;
  --scratch: rgba(255,255,255,0.06);
}

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

html {
  font-size: 15px;
  background: var(--black);
}

body {
  font-family: 'Share Tech Mono', ui-monospace, monospace;
  color: #111;
  background: #f4f4f4;
  min-height: 100vh;
  line-height: 1.35;
}

/* Chequered flag accent strip */
.chequer {
  height: 10px;
  background:
    repeating-linear-gradient(
      90deg,
      #000 0 12px,
      #fff 12px 24px
    );
  border-top: 2px solid var(--red);
  border-bottom: 2px solid var(--red);
}

/* —— FROZEN TOP BAR —— */
.top-freeze {
  position: sticky;
  top: 0;
  z-index: 300;
}

/* —— HEADER —— */
.header {
  position: relative;
  padding: 1.25rem 1.5rem 1rem;
  background:
    linear-gradient(135deg, #2a0000 0%, #0a0a0a 45%, #1a1a1a 100%);
  border-bottom: 3px solid var(--red);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 -1px 0 rgba(0,0,0,0.8),
    0 8px 24px rgba(225,6,0,0.25);
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, transparent 40%, rgba(192,192,192,0.08) 50%, transparent 60%);
  pointer-events: none;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.wordmark {
  font-family: 'Russo One', 'Orbitron', sans-serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-style: italic;
  letter-spacing: 0.04em;
  color: var(--white);
  text-shadow:
    2px 2px 0 #000,
    0 0 20px rgba(225,6,0,0.6),
    -1px -1px 0 rgba(255,255,255,0.2);
  line-height: 1;
}

.wordmark span {
  color: var(--red);
}

.subtitle {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--chrome);
  text-transform: uppercase;
}

.telemetry-panel {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: linear-gradient(180deg, #222 0%, #111 100%);
  border: 2px solid #444;
  border-radius: 4px;
  padding: 0.6rem 1rem;
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.8),
    0 0 0 1px #666;
}

.clock-wrap {
  text-align: center;
}

.clock-label {
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  color: var(--amber);
  margin-bottom: 0.2rem;
}

.analogue-clock {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #3a3a3a, #111 70%);
  border: 3px solid var(--chrome);
  box-shadow:
    inset 0 0 8px #000,
    0 0 0 1px #888;
  position: relative;
  margin: 0 auto;
}

.analogue-clock .face {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px dashed rgba(255,176,0,0.35);
}

.analogue-clock .hand {
  position: absolute;
  left: 50%;
  bottom: 50%;
  transform-origin: bottom center;
  background: var(--red);
  border-radius: 1px;
}

.analogue-clock .hand.hour {
  width: 2px;
  height: 14px;
  margin-left: -1px;
  background: var(--chrome-bright);
}

.analogue-clock .hand.minute {
  width: 1.5px;
  height: 18px;
  margin-left: -0.75px;
}

.analogue-clock .hand.second {
  width: 1px;
  height: 20px;
  margin-left: -0.5px;
  background: var(--amber);
}

.analogue-clock .pivot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 4px var(--red);
}

.refresh-lcd {
  background: var(--lcd-bg);
  border: 2px inset #1a3a1a;
  padding: 0.35rem 0.6rem;
  min-width: 140px;
}

.refresh-lcd .lbl {
  font-size: 0.5rem;
  color: #4a7a4a;
  letter-spacing: 0.15em;
}

.refresh-lcd .val {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  color: var(--lcd);
  text-shadow: 0 0 6px rgba(158,255,158,0.5);
}

/* —— MAIN —— */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1.25rem;
  padding: 0.6rem 0.9rem;
  background: #ffffff;
  border: 1px solid #ddd;
  border-left: 4px solid var(--red);
  font-size: 0.7rem;
  color: #333;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.legend strong { color: var(--red-deep); }
.legend .tag {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  margin-right: 0.25rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  border-radius: 2px;
}

.tag-drs { background: var(--led-green); color: #000; }
.tag-rocket { background: var(--red); color: #fff; }
.tag-cool { background: #e8e8e8; color: #444; }

.grids {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

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

/* —— GRID / CLASS —— */
.race-grid {
  background: #ffffff;
  border: 2px solid #ccc;
  border-radius: 3px;
  box-shadow:
    0 2px 8px rgba(0,0,0,0.08),
    0 8px 24px rgba(0,0,0,0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background:
    linear-gradient(90deg, var(--red-deep) 0%, #4a0000 40%, #1a1a1a 100%);
  border-bottom: 2px solid var(--red);
}

.grid-class {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-style: italic;
  font-size: 1.35rem;
  letter-spacing: 0.12em;
  color: #ffffff;
  text-shadow: 1px 1px 0 #000, 0 0 12px rgba(225,6,0,0.5);
}

.grid-meta {
  font-size: 0.55rem;
  letter-spacing: 0.18em;
  color: #ffffff;
  text-align: right;
}

.grid-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* —— DRIVER ROW —— */
.row {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 0;
  border-bottom: 1px solid #e0e0e0;
  text-decoration: none;
  color: #111;
  background: #fff;
  transition: background 0.15s, transform 0.1s;
  position: relative;
}

.row:hover {
  background: rgba(225,6,0,0.08);
  transform: translateX(2px);
}

.row:hover .go-x {
  color: var(--red);
}

.row.p1 {
  background: linear-gradient(90deg, rgba(225,6,0,0.12) 0%, #fff 70%);
  border-left: 3px solid var(--amber);
}

.row.cooling { opacity: 0.9; }

.pos {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(180deg, #f5f5f5, #e8e8e8);
  border-right: 1px solid #ccc;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-style: italic;
  font-size: 1.1rem;
  color: #111111;
  text-shadow: none;
  min-height: 88px;
}

.row.p1 .pos {
  background: linear-gradient(180deg, #ffe8a0, #ffd24d);
  color: #1a0500;
  font-size: 1.25rem;
}

.pos small {
  font-size: 0.45rem;
  letter-spacing: 0.15em;
  color: #555;
  font-style: normal;
  font-weight: 500;
}

.row-main {
  padding: 0.5rem 0.65rem 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.topic {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  font-style: normal;
  letter-spacing: -0.01em;
  color: #0a0a0a;
  line-height: 1.35;
  text-shadow: none;
  -webkit-font-smoothing: antialiased;
}

.row.p1 .topic {
  color: #000000;
  font-size: 1.12rem;
  font-weight: 800;
}

.status-pill {
  flex-shrink: 0;
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.15rem 0.35rem;
  border-radius: 2px;
  white-space: nowrap;
}

.status-ROCKET, .status-DRS-ON {
  background: var(--led-green);
  color: #000;
  box-shadow: 0 0 8px rgba(57,255,20,0.5);
  animation: pulse-drs 1.2s ease-in-out infinite;
}

.status-BUILDING {
  background: var(--led-amber);
  color: #000;
}

.status-STEADY, .status-SECTOR, .status-LOW {
  background: #e8e8e8;
  color: #333;
}

.status-COOLING, .status-PIT {
  background: #eef0f5;
  color: #445;
  border: 1px solid #ccd;
}

@keyframes pulse-drs {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ACCEL gauge row */
.telemetry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: end;
}

.accel-block {
  min-width: 0;
}

.accel-label {
  font-size: 0.5rem;
  letter-spacing: 0.2em;
  color: var(--red-deep);
  margin-bottom: 0.15rem;
}

.accel-gauge {
  position: relative;
  height: 18px;
  background: #050505;
  border: 1px solid #333;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px #000;
}

.accel-fill {
  height: 100%;
  background: linear-gradient(90deg,
    #1a5a00 0%,
    var(--led-green) 35%,
    var(--led-amber) 70%,
    var(--led-red) 100%);
  box-shadow: 0 0 10px rgba(57,255,20,0.35);
  transition: width 0.6s ease-out;
  position: relative;
}

.accel-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 3px,
    rgba(0,0,0,0.25) 3px 4px
  );
}

.accel-readout {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.accel-num {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.95rem;
  color: #0a5a0a;
  text-shadow: none;
}

.accel-unit {
  font-size: 0.5rem;
  color: #555;
  letter-spacing: 0.1em;
}

.stats {
  text-align: right;
  font-size: 0.65rem;
  color: #555;
  line-height: 1.4;
}

.stats .posts {
  color: #111;
  font-size: 0.8rem;
  font-weight: 700;
}

.stats .growth {
  color: var(--red-deep);
}

.trend-arrow {
  display: inline-block;
  font-size: 0.75rem;
  margin-left: 0.2rem;
}

.trend-up { color: #0a8a0a; }
.trend-down { color: #556; }
.trend-flat { color: #777; }

.go-x {
  font-size: 0.5rem;
  letter-spacing: 0.15em;
  color: #666;
  margin-top: 0.1rem;
}

.title-hint {
  font-size: 0.55rem;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* —— FOOTER —— */
.footer {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 1.25rem 2rem;
  text-align: center;
  font-size: 0.65rem;
  color: #444;
  letter-spacing: 0.06em;
  border-top: 1px solid #ddd;
  background: #f4f4f4;
}

.footer .chequer-mini {
  display: inline-block;
  width: 48px;
  height: 8px;
  margin: 0 0.5rem;
  vertical-align: middle;
  background: repeating-linear-gradient(90deg, #000 0 6px, #fff 6px 12px);
}

/* tyre warmer accent */
.tyre-strip {
  height: 4px;
  background: linear-gradient(90deg, var(--red-deep), var(--red-hot), var(--red-deep));
  box-shadow: 0 0 12px rgba(225,6,0,0.6);
}
