/* RoadTrip 26: European Loop. Mörk tour-manager-look, mobil först. */

:root {
  --bg: #0f1013;
  --surface: #17191e;
  --surface-2: #20232a;
  --line: #30343d;
  --text: #f2efe7;
  --muted: #9aa0aa;

  --red: #b3262d;
  --red-d: #8f1d23;
  --red-soft: #5b1b20;
  --amber: #d49a2a;
  --steel: #7f8b99;
  --green: #4f9b63;

  --shadow: 0 1px 2px rgba(0,0,0,.4);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; }
h2, h3 { letter-spacing: .01em; }
a { color: var(--amber); }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* Etikett/rubrik i tour-stil: versaler, spärrad, stram. */
.label, .section-title, .hero .kicker, .tabbar a span:last-child,
.pill, .chip, .badge, .log-meta {
  text-transform: uppercase; letter-spacing: .06em;
}

/* ---- Inloggning ---- */
.login {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(120% 80% at 50% -10%, #1c1e24 0%, var(--bg) 60%);
}
.login-card {
  background: var(--surface); border: 1px solid var(--line);
  border-top: 3px solid var(--red);
  border-radius: 14px; padding: 30px 24px;
  width: 100%; max-width: 340px; text-align: center; box-shadow: var(--shadow);
}
.login-logo { border-radius: 12px; margin-bottom: 10px; filter: saturate(.9); }
.login h1 { font-size: 1.5rem; text-transform: uppercase; letter-spacing: .08em; }
.login-sub { color: var(--muted); margin: 0 0 22px; text-transform: uppercase;
  letter-spacing: .12em; font-size: .78rem; }
#loginForm { display: grid; gap: 12px; text-align: left; }
#loginForm label { font-size: .72rem; color: var(--muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; }
#code {
  font-size: 1.5rem; letter-spacing: .35em; text-align: center;
  padding: 14px; border: 1px solid var(--line); border-radius: 10px;
  width: 100%; outline: none; background: var(--surface-2); color: var(--text);
}
#code:focus { border-color: var(--red); }
#loginForm button {
  background: var(--red); color: #fff; border: 0; border-radius: 10px;
  padding: 15px; font-size: .95rem; font-weight: 700; margin-top: 4px;
  text-transform: uppercase; letter-spacing: .06em;
}
#loginForm button:active { background: var(--red-d); }
.login-error { color: #e5807f; font-size: .9rem; min-height: 1.2em; margin: 0; text-align: center; }

/* ---- App-skal ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface); color: var(--text);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 2px 0 var(--red);
  padding: calc(10px + var(--safe-t)) 16px 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar-title { font-weight: 800; font-size: 1rem; text-transform: uppercase; letter-spacing: .1em; }
.topbar-user { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.view {
  padding: 16px 16px calc(88px + var(--safe-b));
  max-width: 720px; margin: 0 auto;
}

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
.tabbar a {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 0 8px; text-decoration: none; color: var(--muted);
  font-size: .62rem; font-weight: 700;
}
.tabbar a .ti { width: 22px; height: 22px; display: grid; place-items: center; }
.tabbar a .ti svg { width: 22px; height: 22px; stroke: currentColor; fill: none;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.active { color: var(--text); }
.tabbar a.active::before {
  content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 2px;
  background: var(--red); border-radius: 0 0 2px 2px;
}
.tabbar a.active .ti svg { stroke: var(--red); }
/* Kids ser inte Kassa: göm fliken och balansera om raden till fyra kolumner. */
body.role-kid .tabbar { grid-template-columns: repeat(4, 1fr); }
body.role-kid .tabbar a[data-tab="pengar"] { display: none; }
/* Olästa crew-feed-händelser: röd prick uppe till höger på Crew-fliken. */
.tab-badge {
  position: absolute; top: 5px; left: calc(50% + 4px);
  min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px;
  background: var(--red); color: #fff; font-size: .56rem; font-weight: 800;
  display: grid; place-items: center; line-height: 1;
  border: 1px solid var(--surface); text-transform: none; letter-spacing: 0;
}
.tab-badge[hidden] { display: none; }

/* ---- Kort och byggblock ---- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px; box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.card h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; }
.card h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.pill, .badge {
  display: inline-block; padding: 3px 9px; border-radius: 5px;
  font-size: .68rem; font-weight: 700; background: var(--surface-2);
  color: var(--muted); border: 1px solid var(--line);
}
.pill.pool { background: rgba(79,155,99,.15); color: #7cc493; border-color: rgba(79,155,99,.4); }
.pill.warn { background: rgba(212,154,42,.15); color: var(--amber); border-color: rgba(212,154,42,.4); }
.pill.paid { background: rgba(79,155,99,.15); color: #7cc493; border-color: rgba(79,155,99,.4); }
.pill.hot  { background: rgba(179,38,45,.18); color: #e07a7e; border-color: rgba(179,38,45,.45); }
.pill.ghost { background: transparent; color: var(--muted); }
.pill.theme-bunker { color: var(--steel); }
.pill.theme-mix { color: #b8a1cf; }
.pill.theme-ny { color: #7cc493; }
.section-title { font-size: .72rem; color: var(--muted); font-weight: 800;
  margin: 20px 2px 8px; }

.btn {
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  border-radius: 9px; padding: 11px 14px; font-weight: 700; font-size: .88rem;
}
.btn.primary { background: var(--red); color: #fff; border-color: var(--red);
  text-transform: uppercase; letter-spacing: .05em; }
.btn.primary:active { background: var(--red-d); }
.btn.block { display: block; width: 100%; text-align: center; }
.btn.sm { padding: 6px 10px; font-size: .8rem; }
.btn.ghost { background: transparent; }
input, select, textarea {
  font: inherit; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 9px; width: 100%; background: var(--surface-2); color: var(--text); outline: none;
}
input::placeholder, textarea::placeholder { color: #6b7280; }
input:focus, select:focus, textarea:focus { border-color: var(--red); }
textarea { resize: vertical; min-height: 70px; }
.field { margin-bottom: 12px; }

/* ---- Briefing / dagskort ---- */
.hero {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  color: var(--text); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.hero .kicker { font-size: .72rem; color: var(--amber); font-weight: 800; }
.hero .route { font-size: 1.45rem; font-weight: 800; margin: 6px 0 3px;
  text-transform: uppercase; letter-spacing: .01em; }
.hero .meta { font-size: .85rem; color: var(--muted); }
.hero-count { font-size: 2.6rem; font-weight: 800; margin: 4px 0; color: var(--amber); }

.daylist { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.dayrow {
  display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line);
  border-radius: 10px; padding: 11px 14px;
}
.dayrow.today { border-left-color: var(--red); background: #191b21; }
.dayrow.past { opacity: .5; }
.dayrow .dnum {
  flex: 0 0 44px; height: 42px; border-radius: 8px; background: var(--surface-2);
  color: var(--text); display: grid; place-items: center; font-weight: 800;
  line-height: 1; text-align: center; font-size: .62rem; text-transform: uppercase;
  letter-spacing: .04em; border: 1px solid var(--line);
}
.dayrow .dnum b { font-size: 1.15rem; display: block; }
.dayrow.today .dnum { color: var(--amber); }
.dayrow .dinfo { flex: 1; min-width: 0; }
.dayrow .dinfo .dto { font-weight: 700; text-transform: uppercase; letter-spacing: .02em; font-size: .95rem; }
.dayrow .dinfo .dsub { font-size: .76rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dayrow .dchev { color: var(--muted); }

/* ---- Karta ---- */
#map { height: 62vh; min-height: 340px; border-radius: 12px; border: 1px solid var(--line);
  box-shadow: var(--shadow); overflow: hidden; position: relative; z-index: 0; }
.leaflet-container { font: inherit; background: var(--surface-2); }

.roadpin { background: none; border: 0; }
.pin-inner { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%);
  text-align: center; cursor: pointer; }
.pin-body { display: inline-flex; align-items: baseline; gap: 5px;
  background: var(--red); color: #fff; border: 2px solid #0f1013; border-radius: 7px;
  padding: 2px 8px; font-size: .8rem; font-weight: 800; line-height: 1.25;
  white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.pin-date { font-size: .68rem; font-weight: 700; opacity: .9; }
.pin-tail { width: 0; height: 0; margin: -1px auto 0;
  border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-top: 7px solid var(--red); }
.roadpin.today .pin-body { background: var(--amber); color: #1a1204; }
.roadpin.today .pin-tail { border-top-color: var(--amber); }
.roadpin.past .pin-body { background: var(--steel); }
.roadpin.past .pin-tail { border-top-color: var(--steel); }

/* ---- Rating / stjärnor ---- */
.stars { display: inline-flex; gap: 4px; font-size: 1.7rem; line-height: 1; }
.stars button { background: none; border: 0; padding: 0; color: #3a3f49; }
.stars button.on { color: var(--amber); }
.rate-avg { font-size: 2rem; font-weight: 800; color: var(--amber); }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rank-row .rk { font-weight: 800; color: var(--muted); width: 26px; }
.rank-row .rc { flex: 1; font-weight: 600; }
.rank-row .rv { color: var(--amber); font-weight: 800; }

/* ---- Logg ---- */
.log-item { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.avatar { flex: 0 0 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: .85rem; }
.log-body { flex: 1; min-width: 0; }
.log-meta { font-size: .68rem; color: var(--muted); margin-bottom: 3px; }
.log-text { white-space: pre-wrap; word-wrap: break-word; }

/* ---- Foton ---- */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; display: block;
  border: 1px solid var(--line); }

/* ---- Kassa ---- */
.budget-bar { height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden;
  margin: 8px 0; border: 1px solid var(--line); }
.budget-bar span { display: block; height: 100%; background: var(--green); }
.budget-bar span.over { background: var(--red); }
.exp-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.exp-cat { flex: 0 0 auto; color: var(--steel); }
.exp-main { flex: 1; min-width: 0; }
.exp-amt { font-weight: 800; white-space: nowrap; }

/* ---- Route status (crew-admin) ---- */
.pay-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.pay-row:last-child { border-bottom: 0; }
.pay-check { flex: 0 0 24px; width: 24px; height: 24px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center;
  color: transparent; font-weight: 900; }
.pay-row.done .pay-check { background: var(--green); border-color: var(--green); color: #0f1013; }
.pay-row.done .pay-main { opacity: .5; text-decoration: line-through; }
.pay-main { flex: 1; min-width: 0; }
.pay-when { font-size: .7rem; color: var(--amber); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.pay-amt { font-weight: 800; white-space: nowrap; }
.ov-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.ov-item:last-child { border-bottom: 0; }
.ov-head { display: flex; align-items: baseline; gap: 8px; }
.ov-day { font-size: .7rem; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.ov-name { font-weight: 700; }

/* ---- Quiz / bingo ---- */
.quiz-opt { display: block; width: 100%; text-align: left; margin-bottom: 8px; }
.quiz-opt.correct { background: rgba(79,155,99,.18); border-color: var(--green); }
.quiz-opt.wrong { background: rgba(179,38,45,.18); border-color: var(--red); }
.bingo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bingo button {
  aspect-ratio: 1; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  padding: 6px; font-size: .72rem; font-weight: 600; color: var(--text);
  display: grid; place-items: center; text-align: center; line-height: 1.15;
}
.bingo button.hit { background: var(--red); color: #fff; border-color: var(--red); }

/* ---- Stop candidates / crew vote ---- */
.sugg { padding: 12px 0; border-bottom: 1px solid var(--line); }
.sugg:last-child { border-bottom: 0; }
.sugg-head { display: flex; align-items: flex-start; gap: 10px; }
/* Navigeringsknapp: öppnar platsen i kartappen. */
.navbtn { flex: none; display: grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2);
  color: var(--steel); text-decoration: none; }
.navbtn svg { width: 17px; height: 17px; stroke: currentColor; fill: none;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.navbtn:active { color: var(--amber); border-color: var(--amber); }

.sugg-title { flex: 1; font-weight: 700; line-height: 1.25; }
.sugg-title a { text-decoration: none; color: var(--text); }
.sugg-net { font-weight: 800; font-size: 1.15rem; color: var(--muted); min-width: 32px; text-align: right; }
.sugg-net.pos { color: var(--green); }
.sugg-net.neg { color: #e07a7e; }
.sugg-sum { margin-top: 3px; }
.sugg-note { margin-top: 6px; font-size: .8rem; line-height: 1.35;
  background: rgba(212,154,42,.1); color: var(--amber); border: 1px solid rgba(212,154,42,.3);
  border-radius: 7px; padding: 6px 10px; }
.vote-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.vbtn {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 7px;
  padding: 6px 12px; font-weight: 800; font-size: .76rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .03em;
}
.vbtn.must.on   { background: var(--red);   color: #fff;     border-color: var(--red); }
.vbtn.iftime.on { background: var(--amber); color: #1a1204;  border-color: var(--amber); }
.vbtn.no.on     { background: var(--steel); color: #0f1013;  border-color: var(--steel); }
.voters { display: inline-flex; gap: 3px; }
.vdot { width: 18px; height: 18px; border-radius: 5px; color: #fff; font-weight: 800;
  font-size: .7rem; display: grid; place-items: center; line-height: 1; }
.risk-item { padding: 4px 0; display: flex; align-items: baseline; gap: 8px; }
.wx { color: var(--amber); font-weight: 700; }
.spotify-embed { display: block; width: 100%; border: 0; border-radius: 10px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tagbtn {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: 6px; padding: 4px 9px; font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em;
}
.tagbtn.on { background: var(--surface-2); color: var(--text); border-color: var(--steel); }
.sugg-add { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }

/* Filterchips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 7px; padding: 8px 14px; font-weight: 700; font-size: .74rem; white-space: nowrap; }
.chip.on { background: var(--red); color: #fff; border-color: var(--red); }
.sugg-wrap[data-f="bunker"] .sugg:not([data-th="bunker"]),
.sugg-wrap[data-f="mix"]    .sugg:not([data-th="mix"]),
.sugg-wrap[data-f="ny"]     .sugg:not([data-th="ny"]),
.sugg-wrap[data-f="egna"]   .sugg:not([data-th="egna"]) { display: none; }
.sugg-wrap[data-f="bunker"] .sugg-day-block:not(:has(.sugg[data-th="bunker"])),
.sugg-wrap[data-f="mix"]    .sugg-day-block:not(:has(.sugg[data-th="mix"])),
.sugg-wrap[data-f="ny"]     .sugg-day-block:not(:has(.sugg[data-th="ny"])),
.sugg-wrap[data-f="egna"]   .sugg-day-block:not(:has(.sugg[data-th="egna"])) { display: none; }
.sugg-wrap:not([data-f="alla"]) .sugg-add { display: none; }

/* ---- Gul bil ---- */
.gulbil-hero { padding: 20px 16px; }
.gulbil-count { font-size: 4rem; font-weight: 800; color: var(--amber); line-height: 1; margin: 6px 0 14px; }
.btn.gb-big { font-size: 1.1rem; padding: 18px; background: var(--amber); border-color: var(--amber); color: #1a1204; }
.btn.gb-big:active { background: #b9821f; }

/* ---- Route Rush ---- */
.rush-stage {
  position: relative; overflow: hidden;
  background:
    linear-gradient(135deg, rgba(179,38,45,.16), transparent 32%),
    radial-gradient(110% 70% at 50% 0%, #252832 0%, var(--surface) 58%);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.rush-stage::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,.035) 0 1px, transparent 1px 5px);
  opacity: .28; mix-blend-mode: screen;
}
.rush-hud {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-bottom: 10px;
  color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em;
}
.rush-hud span {
  background: rgba(15,16,19,.78); border: 1px solid rgba(212,154,42,.24); border-radius: 8px;
  padding: 8px 6px; text-align: center;
}
.rush-hud b { color: var(--amber); font-size: 1rem; }
.rush-hud b.hot { color: #fff1c7; text-shadow: 0 0 10px rgba(212,154,42,.9); }
.rush-road {
  position: relative; height: min(58vh, 460px); min-height: 320px; overflow: hidden;
  display: grid; grid-template-columns: repeat(3, 1fr);
  touch-action: pan-y; cursor: pointer;
  background:
    radial-gradient(90% 40% at 50% -8%, rgba(212,154,42,.16), transparent 60%),
    linear-gradient(90deg, rgba(0,0,0,.55), transparent 18%, transparent 82%, rgba(0,0,0,.55)),
    linear-gradient(180deg, #0b0c0e 0%, #17191e 58%, #22252c 100%);
  border: 1px solid rgba(212,154,42,.18); border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03), inset 0 -30px 70px rgba(0,0,0,.45);
}
.rush-road.playing { touch-action: none; }
.rush-help { margin: 9px 0 0; }
.rush-road::before {
  content: ""; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(180deg, transparent 0 26px, rgba(212,154,42,.7) 26px 44px, transparent 44px 70px) 33.333% 0 / 2px 100% no-repeat,
    repeating-linear-gradient(180deg, transparent 0 26px, rgba(212,154,42,.7) 26px 44px, transparent 44px 70px) 66.666% 0 / 2px 100% no-repeat,
    repeating-linear-gradient(180deg, rgba(255,255,255,.035) 0 1px, transparent 1px 13px);
  opacity: .8;
}
.rush-road::after {
  content: "ROUTE RUSH\A DRIVER " attr(data-driver); position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  color: rgba(255,255,255,.035); font-weight: 900; font-size: 3.2rem;
  letter-spacing: .18em; white-space: pre; text-align: center; line-height: .95; pointer-events: none;
}
.rush-road.hit-good {
  box-shadow: inset 0 0 0 1px rgba(124,196,147,.35), inset 0 -30px 70px rgba(0,0,0,.45), 0 0 24px rgba(79,155,99,.28);
}
.rush-road.hit-bad {
  animation: rush-shake .18s linear;
  box-shadow: inset 0 0 0 1px rgba(224,122,126,.4), inset 0 -30px 70px rgba(0,0,0,.45), 0 0 26px rgba(179,38,45,.34);
}
@keyframes rush-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
.rush-lane { border-left: 1px solid rgba(255,255,255,.045); }
.rush-lane:first-child { border-left: 0; }
.rush-car, .rush-item {
  position: absolute; transform: translate(-50%, -50%); display: grid; place-items: center;
  border-radius: 8px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em;
  user-select: none; pointer-events: none;
}
.rush-car {
  bottom: 14px; width: 62px; height: 46px;
  background: linear-gradient(180deg, #d94a50 0%, var(--red) 58%, #6e171d 100%);
  color: #fff; border: 2px solid #0f1013; border-radius: 14px 14px 8px 8px;
  box-shadow: 0 0 0 2px rgba(212,154,42,.18), 0 10px 22px rgba(0,0,0,.65), 0 0 26px rgba(179,38,45,.32);
  transition: left .12s ease-out;
}
.rush-car::before {
  content: ""; position: absolute; left: 13px; right: 13px; top: 7px; height: 13px;
  background: linear-gradient(180deg, #f2efe7, #7f8b99); border-radius: 8px 8px 3px 3px;
  opacity: .85;
}
.rush-car::after {
  content: ""; position: absolute; left: 7px; right: 7px; bottom: -4px; height: 8px;
  background: radial-gradient(circle at 8px 4px, #0f1013 0 5px, transparent 6px),
              radial-gradient(circle at calc(100% - 8px) 4px, #0f1013 0 5px, transparent 6px);
}
.rush-car span {
  position: relative; z-index: 1; margin-top: 15px; font-size: .78rem; color: #f2efe7;
}
.rush-item {
  width: 76px; min-height: 42px; padding: 6px 7px; font-size: .62rem;
  grid-template-columns: 18px 1fr; gap: 6px;
  border: 1px solid rgba(255,255,255,.16); box-shadow: 0 5px 16px rgba(0,0,0,.55);
}
.rush-item .rush-icon {
  width: 18px; height: 18px; border-radius: 5px; display: block; position: relative;
  background: currentColor; opacity: .95;
}
.rush-item .rush-icon::after {
  content: ""; position: absolute; inset: 5px; background: rgba(15,16,19,.75); border-radius: 2px;
}
.rush-item.good {
  background: linear-gradient(135deg, rgba(79,155,99,.98), rgba(36,78,49,.96));
  color: #d9ffe2; border-color: rgba(124,196,147,.55);
}
.rush-item.bad {
  background: linear-gradient(135deg, rgba(179,38,45,.98), rgba(83,18,23,.96));
  color: #ffe7e8; border-color: rgba(224,122,126,.58);
}
.rush-item.ferry, .rush-item.photo { color: #d9ecff; background: linear-gradient(135deg, rgba(47,105,137,.98), rgba(26,45,62,.96)); }
.rush-item.fuel { color: #fff1c7; background: linear-gradient(135deg, rgba(212,154,42,.98), rgba(111,76,18,.96)); }
.rush-item.boost {
  color: #fff1c7;
  background: linear-gradient(135deg, rgba(212,154,42,.98), rgba(179,38,45,.96));
  border-color: rgba(242,239,231,.42);
  box-shadow: 0 5px 18px rgba(0,0,0,.55), 0 0 22px rgba(212,154,42,.35);
}
.rush-item.stop { color: #ddffe7; }
.rush-item.works .rush-icon { clip-path: polygon(50% 0, 100% 100%, 0 100%); border-radius: 0; }
.rush-item.queue .rush-icon { border-radius: 50%; }
.rush-item.toll .rush-icon { transform: rotate(45deg); }
.rush-item.ferry .rush-icon::after { inset: 7px 3px 4px; border-radius: 5px 5px 2px 2px; }
.rush-item.photo .rush-icon::before {
  content: ""; position: absolute; left: 5px; top: 5px; width: 8px; height: 8px;
  background: rgba(15,16,19,.72); border-radius: 50%;
}
.rush-item.photo .rush-icon::after { display: none; }
.rush-item.fuel .rush-icon::before {
  content: ""; position: absolute; right: -4px; top: 3px; width: 5px; height: 8px;
  border: 2px solid currentColor; border-left: 0; border-radius: 0 4px 4px 0;
}
.rush-item.boost .rush-icon { clip-path: polygon(55% 0, 100% 0, 67% 42%, 100% 42%, 37% 100%, 52% 56%, 16% 56%); border-radius: 0; }
.rush-item.boost .rush-icon::after { display: none; }
.rush-pop {
  position: absolute; transform: translate(-50%, -50%); z-index: 4; pointer-events: none;
  padding: 4px 8px; border-radius: 6px; font-size: .72rem; font-weight: 900;
  text-transform: uppercase; letter-spacing: .06em; animation: rush-pop .65s ease-out forwards;
}
.rush-pop.good { background: rgba(79,155,99,.96); color: #071008; }
.rush-pop.bad { background: rgba(179,38,45,.96); color: #fff; }
@keyframes rush-pop {
  0% { opacity: 0; transform: translate(-50%, -35%) scale(.75); }
  18% { opacity: 1; transform: translate(-50%, -55%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -115%) scale(.9); }
}
.rush-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); gap: 8px; margin: 0 0 10px; }
.rush-actions .btn { min-height: 46px; text-align: center; }

/* ---- Crew / backstage-hub ---- */
.hub { display: grid; gap: 8px; }
.hub a, .hub button {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; font-weight: 600; width: 100%; text-align: left;
}
.hub .hi { color: var(--steel); width: 24px; display: grid; place-items: center; }
.hub .hi svg { width: 20px; height: 20px; stroke: currentColor; fill: none;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Toast ---- */
.toast {
  position: fixed; left: 50%; bottom: calc(94px + var(--safe-b)); transform: translateX(-50%);
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line);
  padding: 11px 18px; border-radius: 8px;
  font-size: .86rem; z-index: 60; box-shadow: 0 6px 20px rgba(0,0,0,.5); max-width: 90vw;
}
.offline-note { background: rgba(212,154,42,.1); color: var(--amber); border: 1px solid rgba(212,154,42,.3);
  border-radius: 8px; padding: 8px 12px; font-size: .82rem; margin-bottom: 12px; }

.backlink { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px;
  font-weight: 700; text-decoration: none; color: var(--muted); text-transform: uppercase;
  letter-spacing: .05em; font-size: .78rem; }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; }
.loading { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---- Nyhets-modal ---- */
.modal-back {
  position: fixed; inset: 0; z-index: 80; padding: 20px;
  background: rgba(0,0,0,.72); display: grid; place-items: center;
}
.modal {
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--red);
  border-radius: 14px; padding: 22px; width: 100%; max-width: 360px;
  box-shadow: 0 12px 44px rgba(0,0,0,.6); max-height: 88vh; overflow-y: auto;
}
.modal h2 { font-size: 1.1rem; text-transform: uppercase; letter-spacing: .03em; }
.modal ul, .modal ol { margin: 12px 0; padding-left: 18px; }
.modal li { margin: 7px 0; }
.modal .kicker { color: var(--amber); font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; font-size: .72rem; }

/* ---- Block Route (blockpussel) ---- */
.br-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 4px; margin-bottom: 12px;
}
.br-tabs button {
  border: 0; background: transparent; color: var(--muted);
  padding: 9px 0; border-radius: 7px;
  text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; font-weight: 600;
}
.br-tabs button.active { background: var(--surface-2); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line); }

.br-stage {
  position: relative;
  background:
    radial-gradient(140% 90% at 50% -20%, #1d2027 0%, var(--surface) 55%);
  border: 1px solid var(--line); border-top: 3px solid var(--red);
  border-radius: 14px; padding: 12px 12px 14px; box-shadow: var(--shadow);
}
.br-hud {
  display: flex; align-items: center; justify-content: space-between;
  margin: 2px 2px 12px; gap: 8px;
}
.br-hud .br-score b, .br-hud .br-best b {
  display: block; font-size: 1.5rem; font-weight: 700; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.br-hud .br-best b { text-align: right; }
.br-hud i {
  font-style: normal; color: var(--muted); font-size: .68rem;
  text-transform: uppercase; letter-spacing: .08em;
}
.br-combo {
  background: var(--red-soft); color: var(--text);
  border: 1px solid var(--red); border-radius: 999px;
  padding: 4px 12px; font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  animation: br-combo-in .18s ease-out;
}
@keyframes br-combo-in { from { transform: scale(.7); opacity: 0; } }

.br-board {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px;
  width: 100%; max-width: 420px; margin: 0 auto;
  aspect-ratio: 1; touch-action: none;
  background: rgba(0,0,0,.25); border: 1px solid var(--line);
  border-radius: 10px; padding: 5px;
}
.br-cell {
  border-radius: 4px; background: var(--surface-2);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
  transition: background .08s;
}
.br-cell.fill {
  background: linear-gradient(180deg, color-mix(in srgb, var(--bc) 82%, #fff 18%) 0%, var(--bc) 55%,
    color-mix(in srgb, var(--bc) 82%, #000 18%) 100%);
  background-color: var(--bc);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 -2px 0 rgba(0,0,0,.28);
}
.br-cell.cargo {
  background: repeating-linear-gradient(45deg, var(--amber) 0 6px, #a87a20 6px 12px);
  box-shadow: inset 0 0 0 2px #f0c264, inset 0 -2px 0 rgba(0,0,0,.3);
  animation: br-cargo 1.6s ease-in-out infinite;
}
@keyframes br-cargo { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.22); } }
.br-cell.ghost {
  background: color-mix(in srgb, var(--bc) 38%, var(--surface-2));
  box-shadow: inset 0 0 0 2px var(--bc);
}
.br-cell.will-clear { box-shadow: inset 0 0 0 2px var(--amber); filter: brightness(1.15); }
.br-cell.placed { animation: br-pop .16s ease-out; }
@keyframes br-pop { from { transform: scale(.6); } }
.br-cell.clearing { animation: br-clear .24s ease-in forwards; }
@keyframes br-clear { to { transform: scale(.1); opacity: 0; } }

.br-tray {
  --brm: clamp(11px, 4.6vw, 19px);
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  min-height: calc(var(--brm) * 5 + 18px);
  margin: 14px auto 0; max-width: 420px; touch-action: none;
}
.br-slot { display: grid; place-items: center; }
.br-piece { display: grid; gap: 2px; touch-action: none; cursor: grab; }
.br-piece i {
  border-radius: 3px; background: linear-gradient(180deg,
    color-mix(in srgb, var(--bc) 82%, #fff 18%), var(--bc));
  background-color: var(--bc);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 -1px 0 rgba(0,0,0,.28);
}
.br-piece.dragging { opacity: .25; }
.br-piece.stuck { opacity: .32; filter: saturate(.4); }
.br-drag {
  position: fixed; left: 0; top: 0; z-index: 60; display: grid;
  pointer-events: none; filter: drop-shadow(0 8px 14px rgba(0,0,0,.45));
}
.br-drag i {
  border-radius: 4px; background: linear-gradient(180deg,
    color-mix(in srgb, var(--bc) 82%, #fff 18%), var(--bc));
  background-color: var(--bc);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 -2px 0 rgba(0,0,0,.28);
}
.br-actions {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; gap: 8px;
}
.br-help { margin: 10px 0 16px; }
.br-pop {
  position: absolute; left: 50%; top: 34%; transform: translateX(-50%);
  z-index: 5; pointer-events: none;
  font-weight: 800; font-size: 1.25rem; letter-spacing: .03em;
  color: var(--amber); text-shadow: 0 2px 6px rgba(0,0,0,.6);
  animation: br-pop-float .85s ease-out forwards;
}
@keyframes br-pop-float { to { transform: translateX(-50%) translateY(-34px); opacity: 0; } }

.br-overlay {
  position: absolute; inset: 0; z-index: 10;
  background: rgba(10, 11, 13, .78); border-radius: 13px;
  display: grid; place-items: center; padding: 18px;
  animation: br-fade .18s ease-out;
}
@keyframes br-fade { from { opacity: 0; } }
.br-overlay-card {
  background: var(--surface); border: 1px solid var(--line);
  border-top: 3px solid var(--red); border-radius: 12px;
  padding: 20px 18px; width: 100%; max-width: 300px; text-align: center;
  box-shadow: var(--shadow);
}
.br-final { font-size: 2.4rem; font-weight: 800; margin: 4px 0 2px;
  font-variant-numeric: tabular-nums; }

.br-levels {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px;
}
.br-level {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); padding: 10px 6px 8px; display: grid; gap: 2px; justify-items: center;
}
.br-level b { font-size: 1.15rem; }
.br-level span { font-size: .62rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em; text-align: center; }
.br-level.locked { opacity: .45; }
.br-lock { color: var(--steel); }
.br-stars i { font-style: normal; color: #3a3e47; font-size: .8rem; }
.br-stars i.on { color: var(--amber); }
.br-stars.big { margin: 6px 0 2px; }
.br-stars.big i { font-size: 1.7rem; margin: 0 2px; }

/* Social feed: bilder, likes, kommentarer (SOCIAL-FEED-PLAN.md) */
.feed-photo { display: inline-block; margin-top: 8px; }
.feed-photo img { max-width: 180px; max-height: 180px; border-radius: 8px;
  border: 1px solid var(--line); object-fit: cover; display: block; }
.feed-social { margin-top: 8px; }
.feed-like { display: inline-flex; align-items: center; gap: 5px; background: none;
  border: none; color: var(--muted); cursor: pointer; padding: 2px 0; font: inherit; }
.feed-like svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.feed-like.on { color: var(--red); }
.feed-like.on svg { fill: currentColor; }
.feed-actions { display: flex; gap: 14px; align-items: center; }
.feed-share { display: inline-flex; align-items: center; gap: 5px; background: none; border: none;
  color: var(--muted); cursor: pointer; padding: 2px 0; font: inherit; font-size: .8rem; }
.feed-share svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.fc-list { margin: 6px 0 4px; display: flex; flex-direction: column; gap: 3px; }
.fc { font-size: .85rem; color: var(--text); }
.fc-del { color: var(--muted); font-size: .75rem; margin-left: 4px; cursor: pointer;
  text-decoration: underline; }
.fc-form { margin-top: 4px; }
.fc-input { width: 100%; box-sizing: border-box; padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; font-size: .85rem; }
