/* ── Concurso de disfraces · Halloween + Día de Muertos ─────────
 * Se apoya en base.css / juego.css (topbar, card-lg, btn, pill).
 * Acento nuevo: cempasúchil (naranja). Lo memorable: el flequillo de
 * pétalos sobre cada foto y el podio que se revela lugar por lugar.
 * ------------------------------------------------------------------ */
:root {
  --naranja: #ff8a1f;
  --naranja-deep: #e0620a;
  --hueso: #f4ecdf;
  --morado: #9a6bff;
  --petalo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='10'%3E%3Cpath d='M0 0h18L9 10z' fill='%23ff8a1f'/%3E%3C/svg%3E");
}

body.tema-muertos {
  background:
    radial-gradient(900px 560px at 88% -8%, rgba(255, 138, 31, 0.26), transparent 62%),
    radial-gradient(900px 600px at 4% 108%, rgba(154, 107, 255, 0.20), transparent 60%),
    linear-gradient(160deg, #1f102e, #0f0716 70%);
  background-attachment: fixed;   /* sin costura cuando la página es más alta que la pantalla */
  background-repeat: no-repeat;
  background-color: #0f0716;
  height: auto;
}

.btn-naranja {
  background: linear-gradient(135deg, var(--naranja), var(--naranja-deep));
  color: #2a1000;
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 14px 30px -14px rgba(255, 138, 31, 0.7);
}

.c-wrap { width: min(1120px, 100%); margin: 0 auto; padding: clamp(1rem, 3vw, 2rem) clamp(1rem, 4vw, 2rem) 5rem; display: grid; gap: 1.4rem; }

/* ── encabezado + estado ───────────────────────────────────── */
.c-title { font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 6vw, 3.4rem); letter-spacing: -0.02em; line-height: 1.05; margin: 0; }
.c-title .emo { letter-spacing: 0.12em; margin-left: 0.3rem; }
.c-status {
  padding: 0.95rem 1.15rem; border-radius: var(--r-md);
  background: rgba(255, 138, 31, 0.10); border: 1px solid rgba(255, 138, 31, 0.38);
  border-left: 5px solid var(--naranja);
  font-size: 1.05rem; line-height: 1.45;
}
.c-status.is-ok { background: rgba(22, 192, 121, 0.12); border-color: rgba(22, 192, 121, 0.45); border-left-color: var(--jade); }
.c-status.is-closed { background: var(--card); border-color: var(--line); border-left-color: var(--morado); color: var(--muted); }

/* ── galería de participantes ──────────────────────────────── */
.c-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 1.1rem; }
.c-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: border-color 0.15s, opacity 0.2s;
}
.c-card.is-mine { border-color: var(--naranja); box-shadow: 0 0 0 2px var(--naranja) inset, var(--shadow); }
.c-card.is-dim { opacity: 0.55; }

.c-photo {
  position: relative; display: block; width: 100%; aspect-ratio: 4 / 5;
  padding: 0; border: 0; background: #2a1238; cursor: zoom-in; overflow: hidden;
}
.c-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.c-photo::before { /* flequillo de pétalos de cempasúchil */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 10px; z-index: 2;
  background: var(--petalo) repeat-x 0 0 / 18px 10px;
}
.c-ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 3.4rem; background: linear-gradient(160deg, #3b1a52, #1c0d29); }
.c-num {
  position: absolute; left: 0.6rem; bottom: 0.6rem; z-index: 3;
  background: var(--hueso); color: #2a1238; font-family: var(--display); font-weight: 800;
  padding: 0.12rem 0.6rem; border-radius: 8px; font-size: 0.95rem;
}
.c-info { padding: 0.85rem 1rem 0.5rem; display: grid; gap: 0.15rem; }
.c-info h3 { font-size: 1.1rem; line-height: 1.2; }
.c-costume { margin: 0; color: var(--naranja); font-weight: 600; font-size: 0.95rem; }
.c-dept { margin: 0; color: var(--muted); font-size: 0.82rem; }
.c-act { padding: 0.4rem 1rem 1rem; margin-top: auto; }
.c-act .btn { width: 100%; padding: 0.7rem 1rem; }
.c-act .btn.is-voted { background: rgba(22, 192, 121, 0.18); border: 1px solid var(--jade); color: var(--ink); opacity: 1; }
.c-empty { color: var(--muted); text-align: center; padding: 2rem 1rem; }

/* ── podio ─────────────────────────────────────────────────── */
.c-podio { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 1rem; align-items: end; }
.c-slot {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 0.7rem;
  text-align: center; padding: 1.2rem 1rem 1.3rem; border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255, 138, 31, 0.18), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 138, 31, 0.4);
}
.c-slot-1 { order: 2; min-height: 25rem; border-color: var(--naranja); box-shadow: 0 0 70px -12px rgba(255, 138, 31, 0.6); }
.c-slot-2 { order: 1; min-height: 20rem; }
.c-slot-3 { order: 3; min-height: 17rem; }
.c-slot.is-hidden { opacity: 0.55; border-style: dashed; background: var(--card); box-shadow: none; justify-content: center; }
.c-medal { font-size: 2.6rem; line-height: 1; }
.c-slot-1 .c-medal { font-size: 3.4rem; }
.c-winners { display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center; }
.c-winner { width: min(100%, 170px); display: grid; gap: 0.35rem; justify-items: center; margin: 0; }
.c-slot-1 .c-winner { width: min(100%, 210px); }
.c-winners.is-tie .c-winner, .c-slot-1 .c-winners.is-tie .c-winner { width: auto; flex: 0 1 calc(50% - 0.4rem); max-width: 150px; }
.c-winner .c-photo { border-radius: var(--r-md); cursor: zoom-in; }
.c-winner b { font-family: var(--display); font-size: 1.1rem; line-height: 1.2; }
.c-winner span { color: var(--naranja); font-size: 0.9rem; font-weight: 600; }
.c-slot-meta { color: var(--muted); font-size: 0.95rem; }
.c-slot-meta b { color: var(--ink); }
.c-q { font-family: var(--display); font-size: 3rem; color: var(--muted); }
.c-slot.pop { animation: pop 0.75s cubic-bezier(0.2, 0.9, 0.25, 1.15); }
.c-slot-1.pop { animation: pop 0.75s cubic-bezier(0.2, 0.9, 0.25, 1.15), glow 1.6s ease-out 0.4s 2; }
@keyframes pop { from { opacity: 0; transform: translateY(28px) scale(0.92); } to { opacity: 1; transform: none; } }
@keyframes glow { 50% { box-shadow: 0 0 110px 0 rgba(255, 138, 31, 0.85); } }

/* ── modales (confirmar voto / ver foto / formularios) ─────── */
.c-modal {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1rem;
  background: rgba(10, 4, 16, 0.8); backdrop-filter: blur(6px);
}
.c-dialog {
  width: min(460px, 100%); max-height: 92dvh; overflow: auto;
  background: #261235; border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 1.4rem; box-shadow: var(--shadow); display: grid; gap: 1rem;
}
.c-dialog.wide { width: min(560px, 100%); }
.c-dialog h2 { font-size: 1.4rem; }
.c-dialog p { margin: 0; color: var(--muted); line-height: 1.5; }
.c-dialog .row { display: flex; gap: 0.7rem; justify-content: flex-end; flex-wrap: wrap; }
.c-dialog .row .btn { padding: 0.7rem 1.2rem; }
.c-zoom { width: 100%; max-height: 68dvh; object-fit: contain; border-radius: var(--r-md); background: #150a1b; }
.c-caption { text-align: center; display: grid; gap: 0.15rem; }
.c-caption b { font-family: var(--display); font-size: 1.2rem; }

/* ── moderador ─────────────────────────────────────────────── */
.c-phase { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.85rem; border-radius: 999px; font-weight: 700; font-size: 0.9rem; border: 1px solid var(--line); background: var(--card); }
.c-phase i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: block; }
.c-phase.p-open { border-color: var(--jade); } .c-phase.p-open i { background: var(--jade); box-shadow: 0 0 0 4px rgba(22, 192, 121, 0.2); }
.c-phase.p-closed { border-color: var(--morado); } .c-phase.p-closed i { background: var(--morado); }
.c-phase.p-revealed { border-color: var(--naranja); } .c-phase.p-revealed i { background: var(--naranja); }

.c-panel { display: grid; gap: 1.1rem; }
.c-panel-head { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.c-panel-head h2 { font-size: 1.35rem; }
.c-grow { margin-left: auto; }
.c-hint { color: var(--muted); margin: 0; line-height: 1.5; }
.c-progress { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.c-progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--naranja), var(--oro)); border-radius: 999px; transition: width 0.4s; }
.c-turnout { font-family: var(--display); font-weight: 700; }
.c-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; }
.c-actions .btn { padding: 0.8rem 1.3rem; }
.c-warn { padding: 0.7rem 1rem; border-radius: var(--r-sm); background: rgba(255, 206, 58, 0.12); border: 1px solid rgba(255, 206, 58, 0.4); color: var(--oro); font-size: 0.92rem; }
.c-error { padding: 0.7rem 1rem; border-radius: var(--r-sm); background: rgba(255, 80, 98, 0.14); border: 1px solid var(--coral); color: #ffb3bb; font-size: 0.92rem; }
.btn-danger { color: #ffb3bb; border-color: rgba(255, 80, 98, 0.45); background: transparent; font-weight: 500; }
.btn-danger:hover { background: rgba(255, 80, 98, 0.12); color: #ffd3d8; }

.c-count { display: grid; gap: 0.5rem; }
.c-count-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 3.2rem; gap: 0.8rem; align-items: center; }
.c-thumb { width: 44px; height: 55px; border-radius: 9px; overflow: hidden; background: #2a1238; display: grid; place-items: center; font-size: 1.3rem; }
.c-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.c-count-name { display: flex; justify-content: space-between; gap: 0.6rem; font-weight: 600; font-size: 0.95rem; }
.c-count-name small { color: var(--muted); font-weight: 500; }
.c-bar { height: 8px; margin-top: 0.35rem; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.c-bar > span { display: block; height: 100%; background: var(--naranja); border-radius: 999px; transition: width 0.4s; }
.c-count-n { text-align: right; font-family: var(--display); font-weight: 800; font-size: 1.4rem; }

.c-plist { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 0.9rem; }
.c-pcard { border-radius: var(--r-md); border: 1px solid var(--line); background: var(--card); overflow: hidden; display: flex; flex-direction: column; }
.c-pcard .c-photo { aspect-ratio: 4 / 4.2; cursor: default; }
.c-pcard .c-info { padding: 0.7rem 0.8rem 0.4rem; }
.c-pcard .c-info h3 { font-size: 1rem; }
.c-pcard-act { display: flex; gap: 0.4rem; padding: 0.3rem 0.8rem 0.8rem; margin-top: auto; flex-wrap: wrap; }
.c-pcard-act .btn { padding: 0.45rem 0.8rem; font-size: 0.85rem; }
.c-badge { display: inline-block; font-size: 0.72rem; border-radius: 999px; padding: 0.05rem 0.55rem; border: 1px solid var(--line); color: var(--muted); }
.c-badge.ok { border-color: var(--jade); color: #8be3bb; }

/* formularios */
.c-form { display: grid; gap: 0.85rem; }
.c-field { display: grid; gap: 0.3rem; }
.c-field > label { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.c-field small { color: var(--muted); font-size: 0.78rem; line-height: 1.4; }
.c-field input[type="text"], .c-field select, .c-field textarea {
  color-scheme: dark; width: 100%; font: inherit; color: var(--ink);
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 0.65rem 0.8rem;
}
.c-field textarea { min-height: 9rem; resize: vertical; }
.c-field input[type="file"] { color-scheme: dark; font: inherit; color: var(--muted); }
.c-preview { width: 120px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); background: #2a1238; }
.c-check { display: flex; gap: 0.5rem; align-items: center; font-size: 0.9rem; color: var(--muted); }

.c-toast {
  position: fixed; left: 50%; bottom: 1.4rem; transform: translateX(-50%); z-index: 120;
  background: #1c2a22; border: 1px solid var(--jade); color: var(--ink);
  padding: 0.7rem 1.2rem; border-radius: 999px; font-weight: 600; box-shadow: var(--shadow);
}
.c-toast.is-err { background: #2d1219; border-color: var(--coral); }

/* ── responsive ────────────────────────────────────────────── */
@media (max-width: 700px) {
  .c-podio { grid-template-columns: 1fr; }
  .c-slot-1 { order: 1; min-height: 0; } .c-slot-2 { order: 2; min-height: 0; } .c-slot-3 { order: 3; min-height: 0; }
}
@media (max-width: 520px) {
  .c-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
  .c-info { padding: 0.65rem 0.7rem 0.3rem; } .c-info h3 { font-size: 0.98rem; }
  .c-act { padding: 0.3rem 0.7rem 0.8rem; }
  .c-plist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .c-slot.pop, .c-slot-1.pop { animation: none !important; } }
