:root {
  --brand: #c2410c;
  --brand-dark: #7c2d12;
  --brand-tint: #fdeee3;
  --ink: #1c1917;
  --muted: #6b625c;
  --line: #e7e0da;
  --bg: #faf7f4;
  --card: #ffffff;
  --danger: #b42318;
  --danger-tint: #fdecea;
  --warn-tint: #fff6e0;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 33, 31, .06), 0 4px 16px rgba(20, 33, 31, .05);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.55; font-size: 16px; }
a { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.wrap { width: min(1120px, 100% - 2rem); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }

/* header / footer */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.nav { display: flex; align-items: center; gap: 1.25rem; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; color: var(--ink); text-decoration: none; font-size: 1.1rem; }
.brand img { width: 44px; height: 44px; }
.nav-links { display: flex; gap: 1rem; flex: 1; flex-wrap: wrap; }
.nav-links a { color: var(--muted); text-decoration: none; font-weight: 500; padding: .25rem 0; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--brand-dark); }
.nav-actions { display: flex; gap: .5rem; align-items: center; }
.nav-actions form { margin: 0; }
main.wrap { padding: 2rem 0 3rem; min-height: 60vh; }
.site-footer { border-top: 1px solid var(--line); padding: 1.5rem 0; color: var(--muted); font-size: .9rem; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid transparent; border-radius: 10px; padding: .6rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: var(--card); color: var(--brand-dark); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--brand); }
.btn-danger { background: var(--card); color: var(--danger); border-color: #f0c4c0; }
.btn-danger:hover { background: var(--danger-tint); }
.btn-dark { background: #111; color: #fff; }
.btn-sm { padding: .35rem .7rem; font-size: .875rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

/* cards, grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.grid { display: grid; gap: 1rem; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; }
.stat { font-size: 2rem; font-weight: 700; color: var(--brand-dark); line-height: 1; }

/* flash */
.flash { border-radius: 10px; padding: .75rem 1rem; margin-bottom: 1rem; border: 1px solid var(--line); background: var(--card); }
.flash-success { background: var(--brand-tint); border-color: #f4c9ad; }
.flash-error { background: var(--danger-tint); border-color: #f0c4c0; color: var(--danger); }
.flash-info { background: #eef4ff; border-color: #cfdcf7; }
.notice { background: var(--warn-tint); border: 1px solid #f2dc9b; border-radius: 10px; padding: .75rem 1rem; margin-bottom: 1rem; }
.notice ul, .flash ul { margin: .25rem 0 0 1.2rem; padding: 0; }

/* forms */
label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .95rem; }
.hint { font-weight: 400; color: var(--muted); font-size: .85rem; display: block; margin-top: .2rem; }
input[type=text], input[type=email], input[type=password], select, textarea, input[type=file] {
  width: 100%; padding: .55rem .7rem; border: 1px solid #d3c9c1; border-radius: 8px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
input[type=color] { width: 56px; height: 40px; padding: 2px; border: 1px solid #d3c9c1; border-radius: 8px; background: #fff; }
.field { margin-bottom: 1rem; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.row > * { flex: 1 1 200px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 0 0 1.25rem; background: var(--card); }
legend { font-weight: 700; padding: 0 .4rem; }
.auth-card { max-width: 440px; margin: 2rem auto; }
.checkbox { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
.checkbox input { width: auto; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fbfdfc; }
td.num, th.num { text-align: right; }

/* hero (home) */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2rem; align-items: center; padding: 1.5rem 0 2.5rem; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
.hero .lead { font-size: 1.15rem; color: var(--muted); max-width: 34rem; }
@media (max-width: 800px) { .hero { grid-template-columns: 1fr; } }

.error-page { text-align: center; padding: 3rem 0; }
.error-page .code { font-size: 4rem; font-weight: 800; color: var(--brand); line-height: 1; }

[hidden] { display: none !important; }

/* ---- Gaslands additions ---- */
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: .25rem 0; }
.card-link { display: block; text-decoration: none; color: inherit; }
.card-link:hover { border-color: var(--brand); }
.tag { display: inline-block; background: var(--brand-tint); color: var(--brand-dark); border-radius: 999px; padding: .05rem .55rem; font-size: .75rem; font-weight: 600; }
.tag-warn { background: var(--warn-tint); color: #7a5b00; }
.text-danger { color: var(--danger); }
.text-ok { color: #1a7f37; }
.narrow { width: 5rem; }
.join-code { font-size: 1.25rem; letter-spacing: .12em; }
.budget { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.budget-over { border-color: #f0c4c0; background: var(--danger-tint); }
.vehicle-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.vehicle h3 { margin: 0; }
.statline { display: flex; gap: 1rem; flex-wrap: wrap; margin: .25rem 0 .5rem; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.5rem; align-items: start; }
.editor-preview { position: sticky; top: 80px; }
@media (max-width: 900px) { .editor { grid-template-columns: 1fr; } .editor-preview { position: static; order: -1; } }
.rows { display: grid; gap: .5rem; margin-bottom: .75rem; }
.row-line { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr) minmax(0, 1fr); gap: .5rem; }
.row-line select:only-child { grid-column: 1 / -1; }
.perk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .5rem .75rem; }
.perk { align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .5rem .6rem; }
.perk input { margin-top: .3rem; }
.radio-card { align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: .6rem .75rem; margin-bottom: .5rem; background: #fff; }
.radio-card input { margin-top: .3rem; }
.lines { width: 100%; }
.lines td { padding: .25rem .4rem; }
details summary { cursor: pointer; }
table.lines td.num { width: 3rem; }

/* printable team sheet */
.print-page { background: #fff; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 3px solid #000; margin-bottom: 1rem; }
.sheet-box { border: 2px solid #000; border-radius: 6px; padding: .6rem .8rem; margin-bottom: .8rem; break-inside: avoid; }
.dash { width: 100%; border-collapse: collapse; margin: .4rem 0; }
.dash th, .dash td { border: 1px solid #000; text-align: center; padding: .3rem; }
.dash td { font-size: 1.3rem; font-weight: 700; height: 2.2rem; }
.box { display: inline-block; width: 1.1rem; height: 1.1rem; border: 1.5px solid #000; margin: 0 .15rem .15rem 0; }
@media print {
  .no-print, .site-header, .site-footer { display: none !important; }
  body { background: #fff; }
  .wrap { width: 100%; }
}

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* homepage photo banner and gallery */
.hero-photo { position: relative; border-radius: var(--radius); overflow: hidden; margin: 0 0 1.5rem; color: #fff;
  background: linear-gradient(90deg, rgba(20, 10, 5, .82) 0%, rgba(20, 10, 5, .55) 55%, rgba(20, 10, 5, .25) 100%), url(/assets/photos/table-helicopter.jpg) center 60% / cover no-repeat #2b1a10; }
.hero-photo-inner { padding: 3.5rem 2rem 3rem; max-width: 40rem; }
.hero-photo h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: .6rem; text-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.hero-photo .lead { font-size: 1.1rem; color: #f3e6dc; text-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.btn-light { background: #fff; color: var(--brand-dark); border-color: #fff; }
.btn-light:hover { background: var(--brand-tint); }
.tick-list { margin: 0; padding-left: 1.2rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.gallery a { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #ddd; aspect-ratio: 4 / 3; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.gallery a:hover img { transform: scale(1.04); }
@media (max-width: 600px) { .hero-photo-inner { padding: 2rem 1.25rem; } }

.site-footer p { margin: 0 0 .4rem; } .site-footer .small { max-width: 60rem; }

/* rulebook / cars / Patreon block: text and buttons on the left, artwork on the right */
.buy-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 1.5rem; align-items: start; }
.buy-art { width: 220px; height: auto; border-radius: 12px; border: 1px solid var(--line); }
@media (max-width: 700px) { .buy-layout { grid-template-columns: 1fr; } .buy-art { width: 200px; margin: 0 auto; } }

/* rounds */
.round-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.round-head h3 { margin: 0; }
.round-current { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-tint), var(--shadow); }
.champion { background: var(--brand-tint); margin-bottom: 1rem; font-size: 1.1rem; }
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .75rem; margin-top: .75rem; }
.table-card { border: 1px solid var(--line); border-radius: 10px; padding: .75rem; background: #fff; }
table.matrix th, table.matrix td { text-align: center; padding: .3rem .5rem; }
table.matrix tbody th { text-align: left; }
table.matrix td.self { background: #f0ebe6; color: var(--muted); }
table.matrix td.met { background: var(--brand-tint); font-weight: 700; }

/* My teams: cards, with teams from finished leagues greyed out (still clickable) */
.team-card-link { display: block; color: inherit; text-decoration: none; margin-bottom: .5rem; }
.team-card:hover { border-color: var(--brand); }
.team-card.is-finished { background: #efeeec; border-color: #d9d6d2; color: #77726c; }
.team-card.is-finished h3, .team-card.is-finished .stat { color: #77726c; }
.team-card.is-finished .tag { background: #e2dfdb; color: #5f5a54; }
.team-card.is-finished:hover { background: #f6f4f1; }
