@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --ink: #0b0f1a;
  --surface: #131a2b;
  --surface-raised: #1b2438;
  --gold: #f5b942;
  --gold-dim: #c99630;
  --magenta: #ff4d8d;
  --text: #edeff7;
  --text-muted: #8a93ac;
  --border: #2a3550;
  --success: #4ade80;
  --radius: 16px;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

html, body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100%;
}

body {
  background-image:
    radial-gradient(circle at 15% 0%, rgba(245, 185, 66, 0.08), transparent 45%),
    radial-gradient(circle at 90% 20%, rgba(255, 77, 141, 0.07), transparent 40%);
  background-attachment: fixed;
}

a { color: inherit; }

button, input {
  font-family: inherit;
  color: inherit;
}

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 32px 20px 96px;
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand__mark {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold), var(--magenta));
  flex: none;
}

.site-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

/* ---------- Section labels ---------- */

.section-label {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin: 40px 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.empty-state {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

/* ---------- Ticket card (signature element) ---------- */

.ticket-grid {
  display: grid;
  gap: 16px;
}

.ticket {
  position: relative;
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.ticket:hover { border-color: var(--gold-dim); }

.ticket__main {
  flex: 1;
  min-width: 0;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ticket__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  margin: 0;
  overflow-wrap: anywhere;
}

.ticket__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.ticket__meta strong { color: var(--text); font-weight: 500; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 999px;
  width: fit-content;
}

.pill--live { background: rgba(74, 222, 128, 0.12); color: var(--success); }
.pill--ended { background: rgba(138, 147, 172, 0.15); color: var(--text-muted); }

.countdown {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--gold);
}

.winners-list {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-muted);
}

.winners-list strong { color: var(--magenta); font-weight: 600; }

.ticket__stub {
  width: 128px;
  flex: none;
  border-left: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  position: relative;
  background: var(--surface-raised);
}

.ticket__stub::before,
.ticket__stub::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  background: var(--ink);
  border-radius: 50%;
  left: -12px;
}
.ticket__stub::before { top: -11px; }
.ticket__stub::after { bottom: -11px; }

.ticket__cta {
  border: none;
  background: var(--gold);
  color: #21160a;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  width: 100%;
  transition: transform 0.15s ease, background 0.15s ease;
}
.ticket__cta:hover { background: #ffca6a; transform: translateY(-1px); }
.ticket__cta:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; transform: none; }

.ticket__stamp {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.05em;
}

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 14, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 420px;
  width: 100%;
}

.modal h3 {
  font-family: var(--font-display);
  margin: 0 0 4px;
  font-size: 20px;
}

.modal p.sub {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.field input {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 14px;
}

.field input:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.field input.wallet { font-family: var(--font-mono); }

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.btn--primary { background: var(--gold); color: #21160a; flex: 1; }
.btn--primary:hover { background: #ffca6a; }
.btn--primary:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn--ghost:hover { color: var(--text); border-color: var(--gold-dim); }

.msg {
  font-size: 13px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
}
.msg--error { background: rgba(255, 77, 141, 0.12); color: #ff8ab0; }
.msg--success { background: rgba(74, 222, 128, 0.12); color: var(--success); }

footer.hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 56px;
}

footer.hint a { color: var(--gold-dim); text-decoration: none; }
footer.hint a:hover { text-decoration: underline; }
