:root {
  --bg: #111111;
  --card: #1d1d1d;
  --card-2: #262626;
  --text: #f2f2f2;
  --muted: #a3a3a3;
  --accent: #ff6b1a;
  --red: #e10600;
  --ok: #3ddc84;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

[hidden] { display: none !important; }

/* Cabecera */
.hero {
  position: relative;
  padding: 0 0 28px;
  background: linear-gradient(160deg, #1a1a1a 0%, #0b0b0b 70%);
  border-bottom: 4px solid var(--accent);
  overflow: hidden;
}
.checkered {
  height: 26px;
  margin-bottom: 22px;
  background:
    repeating-conic-gradient(#f2f2f2 0% 25%, #111 0% 50%) 0 0 / 26px 26px;
  transform: skewY(-2deg);
  transform-origin: top left;
  box-shadow: 0 6px 0 var(--red);
}
.hero-inner { padding: 0 16px; max-width: 720px; margin: 0 auto; }
.kicker {
  margin: 0 0 6px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 12px;
  font-weight: 700;
}
h1 {
  margin: 0 0 8px;
  font-size: clamp(30px, 8vw, 46px);
  font-style: italic;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -.01em;
  line-height: 1.05;
}
.sub { margin: 4px 0; color: var(--muted); }
.note { color: var(--text); }
.small { font-size: 14px; }

/* Layout */
.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 16px 8px;
  display: grid;
  gap: 14px;
}
.card {
  background: var(--card);
  border: 1px solid #2c2c2c;
  border-radius: var(--radius);
  padding: 18px;
}
h2 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.label {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
  font-weight: 700;
}

/* Cuenta atrás */
.countdown {
  margin: 6px 0 4px;
  font-size: clamp(28px, 7vw, 40px);
  font-weight: 900;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.countdown.closed { color: var(--red); }

/* Plazas */
.progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.progress-head strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.bar {
  height: 12px;
  background: var(--card-2);
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--red));
  transition: width .4s ease;
}

/* Mi plaza */
.mine {
  border-color: var(--ok);
  background: linear-gradient(135deg, #17301f, var(--card));
}
.mine-title { margin: 0 0 4px; font-size: 22px; font-weight: 900; color: var(--ok); }

/* Formulario */
.field { display: grid; gap: 6px; margin: 0 0 16px; border: 0; padding: 0; min-width: 0; }
.field > span, .field > legend { color: var(--muted); font-size: 14px; font-weight: 600; padding: 0; }
input[type="text"], textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--card-2);
  color: var(--text);
  border: 1px solid #3a3a3a;
  border-radius: 10px;
  font: inherit;
}
input[type="text"]:focus, textarea:focus, button:focus-visible, label.opt:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.options { display: grid; gap: 8px; }
.opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--card-2);
  border: 1px solid #3a3a3a;
  border-radius: 10px;
  cursor: pointer;
}
.opt input { width: 20px; height: 20px; accent-color: var(--accent); }

/* Botones */
.btn {
  display: inline-block;
  width: 100%;
  padding: 14px 18px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  cursor: pointer;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #111; }
.btn-danger { background: transparent; color: var(--red); border: 2px solid var(--red); margin-top: 12px; }
.btn-ghost { width: auto; padding: 10px 14px; background: var(--card-2); color: var(--text); border: 1px solid #3a3a3a; font-size: 13px; }

.error { color: #ff7a7a; font-weight: 600; min-height: 1em; }

/* Votos */
.vote { margin-bottom: 14px; }
.vote-head { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 6px; }
.vote-bar { height: 10px; background: var(--card-2); border-radius: 999px; overflow: hidden; }
.vote-fill { height: 100%; background: var(--accent); transition: width .4s ease; }

/* Listas */
.list { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 6px; }
.list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: var(--card-2);
  border-radius: 8px;
}
.list .dates { color: var(--muted); font-size: 13px; }
.list .empty { color: var(--muted); background: none; padding: 4px 0; }
.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  background: var(--card-2);
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
}

/* Admin */
.admin { border-color: var(--accent); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid #2c2c2c; vertical-align: top; }
th { color: var(--muted); font-weight: 700; }
.tag { padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.tag.confirmed { background: #173d28; color: var(--ok); }
.tag.waitlist { background: #3d2e17; color: var(--accent); }
.del {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 8px;
  padding: 4px 10px;
  font: inherit;
  cursor: pointer;
}

.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 16px 40px; }

@media (min-width: 720px) {
  .wrap { grid-template-columns: 1fr 1fr; }
  .wrap > .card.wide, .wrap > #formCard, .wrap > #admin, .wrap > #mine { grid-column: 1 / -1; }
}
