:root {
  --asphalt: #0b0b0d;
  --kerb: #16161c;
  --panel: #1c1c24;
  --ink: #f4f0e8;
  --muted: #b7b1a4;
  --red: #e10600;
  --amber: #f2b400;
  --green: #2ecc71;
  --blue: #3d7ea6;
  --gold: #d4af37;
  --silver: #c0c0c8;
  --bronze: #cd7f32;
  --yes: #1f7a4c;
  --maybe: #9a6b12;
  --no: #8a1c1c;
  --radius: 16px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  font-family: "Segoe UI", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--asphalt); color: var(--ink); }
body {
  background-image:
    radial-gradient(circle at 20% -10%, rgba(225, 6, 0, 0.18), transparent 42%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.015) 0 2px, transparent 2px 7px);
}
a { color: inherit; }

.chequer-top {
  height: 10px;
  background: repeating-conic-gradient(#f4f0e8 0% 25%, #111 0% 50%) 50% / 16px 16px;
}

.mast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #2a2a33;
  position: sticky;
  top: 0;
  background: rgba(11, 11, 13, 0.92);
  backdrop-filter: blur(10px);
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-flag {
  width: 28px; height: 28px; border-radius: 6px;
  background: repeating-conic-gradient(#fff 0% 25%, #111 0% 50%) 50% / 10px 10px;
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.05; }
.brand-copy strong { letter-spacing: 0.08em; text-transform: uppercase; }
.brand-copy small { color: var(--muted); }
.mast-nav { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.mast-nav button, .ghost {
  background: transparent; color: var(--ink); border: 1px solid #3a3a46;
  border-radius: 999px; padding: 8px 12px; min-height: 44px; cursor: pointer;
}

.lights { display: flex; gap: 6px; }
.lights span {
  width: 14px; height: 14px; border-radius: 50%;
  background: #2a1010; box-shadow: inset 0 0 0 2px #3a1515;
}
.lights.armed span { background: var(--red); box-shadow: 0 0 10px var(--red); }
.lights.out span { background: #1a1a1a; box-shadow: none; }
.lights span.on { background: var(--red); box-shadow: 0 0 12px var(--red); }

.app { max-width: 980px; margin: 0 auto; padding: 20px 16px 80px; }
.boot, .muted { color: var(--muted); }
.hero h1 { font-size: clamp(2rem, 6vw, 3.4rem); margin: 0 0 8px; letter-spacing: -0.03em; }
.hero p { color: var(--muted); margin-top: 0; max-width: 40rem; }

.grid-2 { display: grid; gap: 16px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.card {
  background: linear-gradient(180deg, #1f1f28, var(--panel));
  border: 1px solid #2f2f3a;
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 12px; font-size: 1.1rem; letter-spacing: 0.04em; text-transform: uppercase; }

label { display: block; font-size: 0.85rem; color: var(--muted); margin: 10px 0 6px; }
input, select, textarea {
  width: 100%; min-height: 44px; border-radius: 12px; border: 1px solid #3a3a46;
  background: #111116; color: var(--ink); padding: 10px 12px; font: inherit;
}
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn, button.btn {
  min-height: 48px; border: 0; border-radius: 999px; padding: 0 18px; font: inherit;
  font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer;
  background: var(--red); color: white;
}
.btn.secondary { background: #2c2c36; color: var(--ink); }
.btn.gold { background: var(--gold); color: #111; }
.error { color: #ff8a80; min-height: 1.2em; }
.ok { color: var(--green); }

.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 16px; }
.tabs button {
  min-height: 44px; border-radius: 999px; border: 1px solid #3a3a46;
  background: transparent; color: var(--ink); padding: 0 14px; cursor: pointer; white-space: nowrap;
}
.tabs button.active { background: var(--ink); color: #111; }

.venue {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start;
  padding: 14px 0; border-bottom: 1px solid #2a2a33;
}
.venue:last-child { border-bottom: 0; }
.rank-chip {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: #111; border: 1px solid #444; font-weight: 800;
}
.rank-chip.p1 { background: var(--gold); color: #111; }
.rank-chip.p2 { background: var(--silver); color: #111; }
.rank-chip.p3 { background: var(--bronze); color: #111; }
.venue h3 { margin: 0; font-size: 1.05rem; }
.meta { color: var(--muted); font-size: 0.9rem; }
.badge {
  display: inline-block; margin-top: 6px; padding: 4px 8px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em;
}
.badge.fits { background: #143d28; color: #8ee0b1; }
.badge.split { background: #3d2e0d; color: #ffd36a; }
.badge.unknown { background: #2a2a33; color: var(--muted); }
.moves { display: flex; flex-direction: column; gap: 6px; }
.moves button { min-height: 44px; min-width: 44px; border-radius: 10px; border: 1px solid #444; background: #15151c; color: var(--ink); }

.cal-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 12px; }
.cal .dow { text-align: center; color: var(--muted); font-size: 0.75rem; }
.day {
  min-height: 48px; border-radius: 10px; border: 1px solid #2f2f3a; background: #121218;
  color: var(--ink); cursor: pointer; padding: 6px 4px; font-size: 0.85rem;
}
.day[disabled] { opacity: 0.28; cursor: default; }
.day.yes { background: var(--yes); }
.day.maybe { background: var(--maybe); }
.day.no { background: var(--no); }
.legend { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 0.85rem; margin-top: 8px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; }
.swatch.yes { background: var(--yes); }
.swatch.maybe { background: var(--maybe); }
.swatch.no { background: var(--no); }

.heat { overflow: auto; }
.heat table { border-collapse: collapse; min-width: 100%; font-size: 0.82rem; }
.heat th, .heat td { padding: 6px; border: 1px solid #2a2a33; text-align: center; }
.heat th { position: sticky; top: 0; background: #16161c; }
.cell-yes { background: var(--yes); }
.cell-maybe { background: var(--maybe); }
.cell-no { background: var(--no); }

.podium { display: grid; grid-template-columns: 1fr; gap: 10px; align-items: end; }
@media (min-width: 640px) {
  .podium { grid-template-columns: 1fr 1.15fr 1fr; }
  .podium .p2 { order: 1; }
  .podium .p1 { order: 2; }
  .podium .p3 { order: 3; }
}
.step { border-radius: 16px; padding: 16px; text-align: center; }
.step.p1 { background: linear-gradient(180deg, #5a4a18, #2a210c); min-height: 180px; }
.step.p2 { background: linear-gradient(180deg, #3a3a44, #1c1c22); min-height: 150px; }
.step.p3 { background: linear-gradient(180deg, #4a2e16, #1c120a); min-height: 130px; }
.step .place { font-size: 0.8rem; letter-spacing: 0.2em; }

.reveal-stage { text-align: center; padding: 24px 0; }
.reveal-stage .lights { justify-content: center; transform: scale(1.6); margin: 24px 0; }

.member-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: #121218; border: 1px solid #333; border-radius: 999px; padding: 6px 10px; font-size: 0.85rem; }

.invite-url { word-break: break-all; background: #111; padding: 10px; border-radius: 10px; }

.expand { color: var(--muted); font-size: 0.85rem; margin-top: 6px; }
details.expand summary { cursor: pointer; }

.pit { text-align: center; color: #6d6a63; font-size: 0.8rem; padding: 24px 12px 40px; }
