:root {
  --bg: #1c130e;
  --ink: #f4ece4;
  --muted: #a3958a;
  --line: rgba(244, 236, 228, 0.09);
  --accent: #f6c28b;
  --accent-hover: #ffd3a3;
  --font-display: "Anton", Impact, "Arial Narrow", sans-serif;
  --font-body: "Poppins", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font: 400 15px/1.5 var(--font-body);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.demo-note {
  margin: 0;
  padding: 8px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 72px 24px 80px;
}

/* ---------- Encabezado ---------- */

.masthead { margin-bottom: 56px; }

.masthead h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 7vw, 64px);
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--accent);
}

.lede {
  margin: 12px 0 0;
  font-size: 17px;
  color: var(--ink);
}

.people-line {
  margin: 28px 0 0;
  font-size: 15px;
  color: var(--muted);
}

.people-line strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Lista ---------- */

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.row {
  display: grid;
  grid-template-columns: 40px 72px minmax(0, 1fr) 150px auto;
  grid-template-areas: "pos cover meta people actions";
  align-items: center;
  column-gap: 28px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.pos {
  grid-area: pos;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.row:first-child .pos { color: var(--accent); }

.cover {
  grid-area: cover;
  display: block;
  width: 72px; height: 72px;
  border-radius: 4px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.04);
}

.meta { grid-area: meta; min-width: 0; }

.name {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
}

.by {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people {
  grid-area: people;
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.35;
}

.people strong {
  display: block;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.actions {
  grid-area: actions;
  display: flex;
  gap: 10px;
}

/* ---------- Botones ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font: 500 14px/1 var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-vote { color: var(--bg); background: var(--accent); }
.btn-vote:hover { background: var(--accent-hover); }
.btn-vote:disabled { opacity: 0.6; cursor: progress; }

.btn-ghost { color: var(--ink); background: transparent; border-color: var(--line); }
.btn-ghost:hover { border-color: rgba(244, 236, 228, 0.3); }

.btn-ghost svg { width: 16px; height: 16px; flex: none; fill: #1ed760; }

/* ---------- Pie ---------- */

.foot {
  margin-top: 56px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Móvil ---------- */

@media (max-width: 760px) {
  .page { padding: 48px 20px 64px; }
  .masthead { margin-bottom: 40px; }

  .row {
    grid-template-columns: 22px 64px minmax(0, 1fr);
    grid-template-areas:
      "pos cover meta"
      "pos cover people"
      ".   .     actions";
    column-gap: 16px;
    row-gap: 6px;
    padding: 22px 0;
  }

  .cover { width: 64px; height: 64px; align-self: start; }
  .pos { align-self: start; padding-top: 2px; }
  .by { white-space: normal; }
  .people strong { display: inline; font-size: 13.5px; }
  .actions { margin-top: 10px; }
  .actions .btn { flex: 1; min-height: 40px; padding: 0 12px; }
}

@media (max-width: 380px) {
  .row { grid-template-columns: 18px 56px minmax(0, 1fr); column-gap: 12px; }
  .cover { width: 56px; height: 56px; }
}

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

.modal {
  width: min(400px, calc(100% - 40px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #241811;
}

.modal::backdrop { background: rgba(10, 6, 3, 0.7); }

.modal-body { padding: 28px 24px 24px; }

.modal h2 { margin: 0; font-size: 19px; font-weight: 600; }

.modal p { margin: 8px 0 20px; font-size: 14px; color: var(--muted); }

.modal input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid rgba(244, 236, 228, 0.18);
  background: transparent;
  color: var(--ink);
  font: 16px var(--font-body);
}

.modal input:focus { outline: none; border-color: var(--accent); }

.modal .modal-error { min-height: 20px; margin: 8px 0 12px; font-size: 13px; color: #f09a8f; }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Aviso ---------- */

.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 30;
  max-width: calc(100% - 40px);
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink);
  background: #33241a;
  border: 1px solid var(--line);
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(240, 154, 143, 0.5); }

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