/* Statistik der EuroCityLogistik – Gestaltung nach Autobahnbeschilderung:
   Gelb = Gesamt (wie ein Hinweisschild), Blau = Europa (ETS2), Gruen = USA (ATS). */

@font-face { font-family: "Overpass"; src: url("/static/fonts/Overpass-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Overpass"; src: url("/static/fonts/Overpass-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Overpass"; src: url("/static/fonts/Overpass-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --concrete: #e6e7e3;
  --kerb: #cfd2cc;
  --ink: #1e2226;
  --ink-soft: #5b6168;
  --sign-yellow: #f2b705;
  --sign-blue: #1f4e9c;
  --sign-green: #1c6b3e;
  --white: #ffffff;
  --radius: 14px;
  --gap: clamp(14px, 2.4vw, 24px);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--concrete);
  color: var(--ink);
  font: 400 1rem/1.5 "Overpass", "Segoe UI", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}

h2 { font-size: 1.375rem; font-weight: 800; line-height: 1.2; margin: 0; }
p { margin: 0; }

:focus-visible { outline: 3px solid var(--sign-blue); outline-offset: 3px; border-radius: 4px; }

/* ---------------- Kopfzeile ---------------- */
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1180px; margin: 0 auto; padding: 18px 16px 8px;
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-mark {
  background: var(--sign-yellow); color: var(--ink); font-weight: 800; letter-spacing: .02em;
  padding: 4px 8px 2px; border-radius: 6px; box-shadow: inset 0 0 0 2px var(--sign-yellow), inset 0 0 0 4px var(--ink);
}
.brand-name { font-weight: 600; }

.month { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.month button {
  width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent;
  font: 800 1.4rem/1 "Overpass", sans-serif; color: var(--ink); cursor: pointer;
}
.month button:hover:not(:disabled) { background: var(--kerb); }
.month button:disabled { color: var(--kerb); cursor: default; }
#month-label { min-width: 9.5em; text-align: center; }

main { max-width: 1180px; margin: 0 auto; padding: 8px 16px 0; }

/* ---------------- Schilder ---------------- */
.road {
  display: grid; gap: var(--gap);
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
}
.games { display: grid; gap: var(--gap); }

.sign {
  border-radius: var(--radius);
  padding: clamp(18px, 3vw, 30px) clamp(20px, 3.2vw, 34px);
  color: var(--white);
  /* Doppelter Rand wie bei echten Schildern */
  box-shadow: inset 0 0 0 4px var(--bg), inset 0 0 0 7px var(--rim);
  background: var(--bg);
}
.sign-yellow { --bg: var(--sign-yellow); --rim: var(--ink); color: var(--ink); display: flex; flex-direction: column; justify-content: center; }
.sign-blue { --bg: var(--sign-blue); --rim: var(--white); }
.sign-green { --bg: var(--sign-green); --rim: var(--white); }

.sign-head { font-weight: 600; font-size: 1.0625rem; }
.sign-km {
  font-weight: 800; line-height: .95; letter-spacing: -.02em;
  font-size: clamp(3.4rem, 10.5vw, 8.25rem);
  margin: 10px 0 12px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 .18em;
}
.sign-num {
  font-weight: 800; line-height: 1; letter-spacing: -.01em;
  font-size: clamp(2.1rem, 5vw, 3.1rem); margin: 8px 0 6px;
  display: flex; align-items: baseline; gap: 0 .2em;
}
.unit { font-size: .38em; font-weight: 600; letter-spacing: 0; }
.sign-sub { font-size: 1.0625rem; }
.sign-blue .sign-sub, .sign-green .sign-sub { opacity: .88; }

/* ---------------- Rangliste und Lieferungen ---------------- */
.columns {
  display: grid; gap: clamp(28px, 4vw, 56px);
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  margin-top: clamp(32px, 5vw, 56px);
}

.board-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tabs { display: inline-flex; background: var(--kerb); border-radius: 999px; padding: 3px; }
.tabs button {
  border: 0; background: transparent; color: var(--ink-soft); cursor: pointer;
  font: 600 .9375rem/1 "Overpass", sans-serif; padding: 9px 14px 7px; border-radius: 999px;
}
.tabs button[aria-selected="true"] { background: var(--white); color: var(--ink); }
.hint { color: var(--ink-soft); font-size: .9375rem; margin: 8px 0 6px; }

.ranking { list-style: none; margin: 0; padding: 0; }
.ranking li {
  display: grid; grid-template-columns: 2.2em minmax(0, 1fr) 7.5em 8.5em; gap: 4px 16px;
  align-items: baseline; padding: 11px 0 9px; border-bottom: 1px solid var(--kerb);
}
.ranking .pos { font-weight: 800; color: var(--ink-soft); }
.ranking li:first-child .pos { color: var(--ink); }
.ranking .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking .km { font-weight: 800; text-align: right; }
.ranking .jobs { color: var(--ink-soft); text-align: right; }

.deliveries { list-style: none; margin: 14px 0 0; padding: 0; }
.deliveries li {
  display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 2px 12px;
  padding: 11px 0 10px; border-bottom: 1px solid var(--kerb);
}
.deliveries .game {
  grid-row: span 2; width: 12px; height: 12px; margin-top: 5px; border-radius: 3px;
  background: var(--sign-blue); box-shadow: inset 0 0 0 2px var(--sign-blue), inset 0 0 0 3px rgba(255,255,255,.7);
}
.deliveries .game.ats { background: var(--sign-green); box-shadow: inset 0 0 0 2px var(--sign-green), inset 0 0 0 3px rgba(255,255,255,.7); }
.deliveries .route { font-weight: 600; overflow-wrap: anywhere; }
.deliveries .meta { color: var(--ink-soft); font-size: .9375rem; }

.empty { color: var(--ink-soft); padding: 14px 0; border-bottom: 1px solid var(--kerb); }

/* ---------------- Fusszeile ---------------- */
.foot {
  max-width: 1180px; margin: clamp(36px, 6vw, 72px) auto 0; padding: 18px 16px 32px;
  color: var(--ink-soft); font-size: .9375rem; display: grid; gap: 4px;
}
#all-time { color: var(--ink); font-weight: 600; }
.status:empty { display: none; }
.status { color: #8a2d1d; font-weight: 600; }

/* ---------------- Handy ---------------- */
@media (max-width: 860px) {
  .road, .columns { grid-template-columns: minmax(0, 1fr); }
  .games { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .games { grid-template-columns: minmax(0, 1fr); }
  .brand-name { display: none; }
  #month-label { min-width: 8em; }
  .ranking li { grid-template-columns: 1.8em minmax(0, 1fr) auto; }
  .ranking .jobs { grid-column: 2 / -1; text-align: left; font-size: .875rem; }
}

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

/* ---------------- Navigation ---------------- */
.links { display: flex; gap: 4px; flex-wrap: wrap; }
.links a {
  color: var(--ink-soft); text-decoration: none; font-weight: 600;
  padding: 8px 12px 6px; border-radius: 999px;
}
.links a:hover { color: var(--ink); background: var(--kerb); }
.links a[aria-current="page"] { color: var(--ink); background: var(--white); }

/* ---------------- Fahrerbereich ---------------- */
.login { max-width: 640px; margin: clamp(24px, 6vw, 64px) auto 0; }
.login-sign { gap: 10px; }
.login-title { font-weight: 800; font-size: clamp(2rem, 6vw, 2.75rem); line-height: 1.05; }
.login-error { color: #8a2d1d; font-weight: 600; }
.login-error:empty { display: none; }
.btn-discord {
  align-self: flex-start; margin-top: 8px; background: var(--ink); color: var(--white);
  text-decoration: none; font-weight: 600; padding: 12px 20px 10px; border-radius: 10px;
}
.btn-discord:hover { background: #33393f; }

.area-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 8px 0 18px;
}
.area-head h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); font-weight: 800; margin: 0; line-height: 1.1; }
.area-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.area-tools form { margin: 0; }
.btn-quiet {
  border: 1px solid var(--kerb); background: transparent; color: var(--ink);
  font: 600 .9375rem/1 "Overpass", sans-serif; padding: 9px 14px 7px; border-radius: 999px; cursor: pointer;
}
.btn-quiet:hover { background: var(--kerb); }

.mytours { margin-top: clamp(32px, 5vw, 56px); max-width: 860px; }
.tourlist { list-style: none; margin: 14px 0 0; padding: 0; }
.tourlist li {
  display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 2px 14px; align-items: start;
  padding: 12px 0 10px; border-bottom: 1px solid var(--kerb);
}
.tourlist li.muted .route, .tourlist li.muted .tour-km { color: var(--ink-soft); }
.tourlist .game, .deliveries .game {
  width: 12px; height: 12px; margin-top: 5px; border-radius: 3px;
  background: var(--sign-blue); box-shadow: inset 0 0 0 2px var(--sign-blue), inset 0 0 0 3px rgba(255,255,255,.7);
}
.tourlist .game.ats { background: var(--sign-green); box-shadow: inset 0 0 0 2px var(--sign-green), inset 0 0 0 3px rgba(255,255,255,.7); }
.tour-main { display: grid; gap: 1px; min-width: 0; }
.tourlist .route { font-weight: 600; overflow-wrap: anywhere; }
.tourlist .meta { color: var(--ink-soft); font-size: .9375rem; }
.tourlist .notes { color: #8a5a00; font-size: .875rem; }
.tour-km { font-weight: 800; white-space: nowrap; }

@media (max-width: 560px) {
  .links a { padding: 8px 9px 6px; font-size: .9375rem; }
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------- Challenges ---------------- */
.page-title { font-size: clamp(1.6rem, 4vw, 2.1rem); font-weight: 800; margin: 8px 0 20px; line-height: 1.1; }
.challenge-list { display: grid; gap: clamp(36px, 6vw, 64px); }
.challenge { display: grid; gap: clamp(18px, 3vw, 28px); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.sign-plain { --bg: var(--white); --rim: var(--kerb); color: var(--ink); }
.challenge-title { font-size: clamp(1.8rem, 4.6vw, 2.6rem); font-weight: 800; line-height: 1.05; margin: 6px 0 10px; }
.challenge-total { margin-top: 14px; font-size: 1.0625rem; }
.challenge-total strong { font-size: 1.6rem; font-weight: 800; }
.prizes { margin: 14px 0 0; padding-left: 0; list-style: none; display: grid; gap: 2px; font-weight: 600; }
.goals { margin-top: 12px; font-weight: 600; }
.challenge-upcoming .sign { opacity: .85; }
.challenge-ranking li.prize .name { font-weight: 800; }
.challenge-ranking li.prize .jobs { color: var(--ink); font-weight: 600; }

@media (max-width: 860px) {
  .challenge { grid-template-columns: minmax(0, 1fr); }
}

.dotm { margin-top: clamp(32px, 5vw, 56px); max-width: 640px; }
