:root {
  --bg: #0b0b0b;
  --panel: #161616;
  --panel-2: #1f1f1f;
  --line: #2c2c2c;
  --text: #f2f2f2;
  --muted: #a3a3a3;
  --red: #e10600;
  --red-dark: #b00500;
  --green: #22c55e;
  --amber: #f59e0b;
  --blue: #3b82f6;
  --radius: 10px;
  --head: "Oswald", "Arial Narrow", sans-serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 16px; line-height: 1.5; }
a { color: #fff; }
h1, h2, h3 { font-family: var(--head); text-transform: uppercase; letter-spacing: .02em; line-height: 1.15; margin: 0 0 .6em; }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
h1 .accent, h2 .accent { color: var(--red); }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* ---------- topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 12px clamp(16px, 4vw, 40px); background: rgba(11,11,11,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 6px; text-decoration: none; }
.brand-mark { font-family: var(--head); font-weight: 700; font-style: italic; font-size: 1.6rem; letter-spacing: .02em; }
.brand-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--red); margin-top: -10px; }
.brand-sub { font-family: var(--head); color: var(--muted); text-transform: uppercase; font-size: .85rem; margin-left: 8px; }
.nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { font-family: var(--head); text-transform: uppercase; text-decoration: none; padding: 8px 12px; border-radius: 6px; color: #ddd; }
.nav a:hover, .nav a.active { color: #fff; background: var(--panel-2); }
.nav a.active { box-shadow: inset 0 -2px 0 var(--red); }
.menu-btn { display: none; margin-left: auto; background: none; border: 0; padding: 8px; cursor: pointer; }
.menu-btn span { display: block; width: 22px; height: 2px; background: #fff; margin: 5px 0; }
@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .nav.open { display: flex; }
}

/* ---------- layout ---------- */
.container { max-width: 960px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 40px) 64px; min-height: 70vh; }
.panel { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--red); border-radius: var(--radius); padding: clamp(18px, 3vw, 28px); margin-bottom: 20px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.section-title { display: flex; align-items: center; gap: 12px; color: var(--red); font-family: var(--head); text-transform: uppercase; font-size: 1.05rem; margin: 24px 0 12px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }

/* ---------- form ---------- */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-family: var(--head); text-transform: uppercase; font-size: .78rem; letter-spacing: .04em; color: #ccc; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; background: #0e0e0e; color: var(--text); border: 1px solid #333; border-radius: 8px; padding: 12px 14px; font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--red); outline-offset: 0; border-color: transparent; }
textarea { min-height: 90px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; margin: 10px 0; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--red); flex: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--head); text-transform: uppercase; letter-spacing: .03em;
  border: 0; border-radius: 8px; padding: 12px 20px; font-size: 1rem; cursor: pointer; text-decoration: none; background: var(--red); color: #fff; }
.btn:hover { background: var(--red-dark); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; border: 1px solid #444; }
.btn.ghost:hover { border-color: #888; background: var(--panel-2); }
.btn.small { padding: 7px 12px; font-size: .85rem; }
.btn.block { width: 100%; }
.btn.green { background: #15803d; } .btn.green:hover { background: #166534; }

/* ---------- choice cards ---------- */
.choices { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.choice { position: relative; display: block; cursor: pointer; background: var(--panel-2); border: 2px solid transparent; border-radius: var(--radius); padding: 16px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:checked) { border-color: var(--red); background: #241010; }
.choice:has(input:disabled) { opacity: .4; cursor: not-allowed; }
.choice .title { font-family: var(--head); text-transform: uppercase; font-size: 1.15rem; }
.choice .price { font-family: var(--head); font-size: 1.6rem; color: var(--red); }
.choice .desc { color: var(--muted); font-size: .85rem; }
.choice:focus-within { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- number grid ---------- */
.numgrid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; max-width: 640px; }
.num { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-family: var(--head); font-size: 1.05rem;
  background: var(--panel-2); border: 1px solid #333; border-radius: 6px; color: #fff; cursor: pointer; padding: 0; }
.num:hover:not(:disabled) { border-color: #fff; }
.num.sel { background: var(--red); border-color: var(--red); }
.num:disabled { background: #111; color: #444; text-decoration: line-through; cursor: not-allowed; }
.num.blocked:disabled { color: #3a3a3a; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
@media (max-width: 420px) { .numgrid { gap: 4px; } .num { font-size: .9rem; } }

/* ---------- summary ---------- */
.summary { background: #0e0e0e; border: 1px dashed #3a3a3a; border-radius: var(--radius); padding: 16px; }
.summary .line { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.summary .total { border-top: 1px solid #333; margin-top: 8px; padding-top: 10px; font-family: var(--head); font-size: 1.4rem; }
.sticky-pay { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 20px 0 8px; }

/* ---------- badges / lists ---------- */
.badge { display: inline-block; font-family: var(--head); text-transform: uppercase; font-size: .72rem; letter-spacing: .04em; padding: 3px 8px; border-radius: 4px; background: #333; }
.badge.paid { background: #14532d; color: #bbf7d0; }
.badge.pending, .badge.awaiting_payment { background: #713f12; color: #fde68a; }
.badge.pending_approval { background: #1e3a8a; color: #bfdbfe; }
.badge.cancelled, .badge.expired, .badge.rejected { background: #2a2a2a; color: #999; }
.badge.attention { background: var(--red); color: #fff; }
.card-list { display: grid; gap: 12px; }
.item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.item .head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.item .race { font-family: var(--head); font-size: 2rem; color: var(--red); line-height: 1; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: .92rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.iban { font-family: ui-monospace, monospace; font-size: 1.05rem; background: #0e0e0e; border: 1px solid #333; padding: 10px 12px; border-radius: 8px; word-break: break-all; }
.notice { border-left: 3px solid var(--amber); background: #1d1608; padding: 12px 14px; border-radius: 6px; margin: 12px 0; }
.notice.error { border-color: var(--red); background: #200a0a; }
.notice.ok { border-color: var(--green); background: #0a1d10; }
.event-card { display: grid; gap: 8px; }
.event-date { font-family: var(--head); color: var(--red); text-transform: uppercase; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.photos img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; border: 1px solid #333; background: #111; }

/* ---------- table (admin) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
th { font-family: var(--head); text-transform: uppercase; font-size: .75rem; color: var(--muted); background: var(--panel-2); position: sticky; top: 0; }
tr:hover td { background: #141414; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs a { font-family: var(--head); text-transform: uppercase; text-decoration: none; padding: 8px 14px; border-radius: 6px; background: var(--panel-2); }
.tabs a.active { background: var(--red); }
.stat { background: var(--panel-2); border-radius: 8px; padding: 12px 14px; }
.stat b { display: block; font-family: var(--head); font-size: 1.6rem; }

/* ---------- toast / footer ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(150%); background: #222; border: 1px solid #444; color: #fff;
  padding: 12px 18px; border-radius: 8px; z-index: 50; transition: transform .25s, visibility .25s; max-width: calc(100vw - 32px); visibility: hidden; }
.toast.show { transform: translateX(-50%) translateY(0); visibility: visible; }
.toast.error { border-color: var(--red); }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 24px clamp(16px, 4vw, 40px); color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
