/* ÍDOLOS — fiesta y escenario: dorado sobre negro, muy legible en el celular. */
:root {
  --bg: #0b0a08;
  --bg2: #16130d;
  --card: #1a1610;
  --line: #3a3020;
  --gold: #e8c766;
  --gold2: #c9a227;
  --gold-soft: #f6e3a1;
  --text: #fbf6e9;
  --muted: #b9ad92;
  --error: #ff8a80;
  --ok: #9be59b;
  --radius: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.5 "Nunito Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  overflow-x: hidden;
}
.spotlights {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(60vmax 40vmax at 15% -10%, rgba(232, 199, 102, .16), transparent 60%),
    radial-gradient(60vmax 40vmax at 85% -10%, rgba(232, 199, 102, .12), transparent 60%),
    radial-gradient(80vmax 30vmax at 50% 110%, rgba(201, 162, 39, .10), transparent 70%);
}
a { color: var(--gold); }
img { max-width: 100%; }
[hidden] { display: none !important; }

.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(11, 10, 8, .88); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { font: 400 30px/1 "Bebas Neue", Impact, sans-serif; letter-spacing: 2px; color: var(--gold); text-decoration: none; }
.brand-star { margin-right: 6px; font-size: 22px; vertical-align: 3px; }
.tools { display: flex; gap: 8px; }
.pill { border: 1px solid var(--gold2); color: var(--gold-soft); border-radius: 999px; padding: 3px 12px; font-size: 14px; font-weight: 800; }
.pill-admin { background: var(--gold); color: #000; }

main { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; padding: 16px 16px 32px; }
.loading { text-align: center; color: var(--muted); padding: 40px 0; }
.screen { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.title { font: 400 38px/1.05 "Bebas Neue", Impact, sans-serif; letter-spacing: 1px; color: var(--gold); margin: 6px 0 16px; }
.kicker { color: var(--gold-soft); font-weight: 800; letter-spacing: .5px; text-transform: uppercase; font-size: 13px; margin: 8px 0 0; }
.lead { font-size: 19px; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.center { text-align: center; }
.stack { display: grid; gap: 12px; }
.big-icon { font-size: 56px; margin: 0; }

.card { background: linear-gradient(180deg, var(--card), var(--bg2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 16px; }
details.card summary { cursor: pointer; font-weight: 800; color: var(--gold-soft); }

/* Botones grandes, fáciles de tocar */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 20px; border-radius: 14px; border: 0; font: 800 18px/1.2 inherit; font-family: inherit; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-big { width: 100%; min-height: 60px; font-size: 21px; }
.btn-small { min-height: 42px; padding: 8px 14px; font-size: 16px; background: var(--bg2); color: var(--gold-soft); border: 1px solid var(--gold2); }
.btn-gold { background: linear-gradient(180deg, #f5dc8a, var(--gold) 45%, var(--gold2)); color: #1a1405; box-shadow: 0 6px 24px rgba(232, 199, 102, .25); }
.btn-outline { background: transparent; color: var(--gold-soft); border: 2px solid var(--gold2); }
.btn-mp { background: #009ee3; color: #fff; }
.btn-back, .btn-link { background: none; border: 0; color: var(--gold-soft); font: 700 17px inherit; font-family: inherit; padding: 8px 0; cursor: pointer; min-height: 44px; }
:focus-visible { outline: 3px solid var(--gold-soft); outline-offset: 2px; }

.hero { text-align: center; padding: 28px 0 12px; }
.hero-title {
  font: 400 clamp(84px, 26vw, 140px)/.9 "Bebas Neue", Impact, sans-serif; letter-spacing: 4px; margin: 6px 0 8px;
  background: linear-gradient(180deg, #fff3c4 0%, var(--gold) 45%, #9c7a17 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 40px rgba(232, 199, 102, .25);
}
.hero-sub { font-size: 21px; margin: 0 0 20px; }
.hero-note { color: var(--muted); font-size: 15px; }
.steps { list-style: none; padding: 0; margin: 8px 0 16px; display: grid; gap: 8px; }
.steps li { display: flex; gap: 12px; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.steps b { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--gold); color: #000; display: grid; place-items: center; }
.marquee { color: var(--gold-soft); text-align: center; font-size: 15px; opacity: .8; }

input[type="search"], input[type="text"], input[type="email"], input:not([type]), select, textarea {
  width: 100%; min-height: 50px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: #0f0d09; color: var(--text); font: 400 18px inherit; font-family: inherit;
}
.search-input { margin-bottom: 14px; }
.search-results { display: grid; gap: 6px; margin-top: 8px; }
.search-results button { text-align: left; }

.grid { display: grid; gap: 12px; }
.grid-cats { grid-template-columns: repeat(2, 1fr); }
.grid-idols { grid-template-columns: repeat(2, 1fr); }
.grid-poses { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 520px) { .grid-idols { grid-template-columns: repeat(3, 1fr); } }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px;
  min-height: 150px; padding: 14px 10px; border-radius: var(--radius); border: 1px solid var(--line); cursor: pointer;
  background: radial-gradient(120% 80% at 50% 0%, rgba(232, 199, 102, .14), transparent 60%), var(--card);
  color: var(--text); font: 800 17px/1.2 inherit; font-family: inherit; text-align: center;
}
.tile:hover, .tile:focus-visible { border-color: var(--gold); }
.tile img { width: 64px; height: 64px; flex: 1 0 auto; object-fit: contain; }
.tile .count { color: var(--muted); font-weight: 400; font-size: 14px; }
.tile-idol { min-height: 132px; }
.tile-idol img { width: 44px; height: 44px; opacity: .85; }
.tile-idol .region { color: var(--muted); font-weight: 400; font-size: 13px; }
.tile .emoji { font-size: 40px; flex: 1 0 auto; display: grid; place-items: center; }

.options { display: grid; gap: 10px; }
.option { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: 700 18px inherit; font-family: inherit; text-align: left; cursor: pointer; }
.option:hover, .option:focus-visible { border-color: var(--gold); }
.option .emoji { font-size: 24px; }
.option-special { border: 2px dashed var(--gold2); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-width: 56px; min-height: 52px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg2); color: var(--text); font: 800 20px inherit; font-family: inherit; cursor: pointer; }
.chip[aria-checked="true"] { border-color: var(--gold); background: var(--gold); color: #000; }

.camera-card { display: grid; gap: 12px; }
.camera { position: relative; border-radius: 14px; overflow: hidden; background: #000; }
.camera video { width: 100%; display: block; transform: scaleX(-1); max-height: 70vh; object-fit: cover; }
.camera-status { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--muted); }
.camera-controls { position: absolute; left: 0; right: 0; bottom: 10px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 14px; }
.shutter { width: 76px; height: 76px; border-radius: 50%; border: 5px solid #fff; background: var(--gold); cursor: pointer; }
.shutter:disabled { opacity: .4; }
#photoPreview { border-radius: 14px; width: 100%; }
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; }
.consent input { width: 26px; height: 26px; flex: none; accent-color: var(--gold); }

.msg { min-height: 0; margin: 0; font-weight: 700; }
.msg:empty { display: none; }
.msg.error { color: var(--error); }
.msg.ok { color: var(--ok); }

.generating { text-align: center; padding: 30px 0; }
.spinner { width: 84px; height: 84px; margin: 10px auto 20px; border-radius: 50%; border: 6px solid var(--line); border-top-color: var(--gold); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.result-frame { border-radius: var(--radius); overflow: hidden; border: 2px solid var(--gold2); box-shadow: 0 0 40px rgba(232, 199, 102, .2); margin-bottom: 14px; background: #000; }
.result-frame img { display: block; width: 100%; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 16px; }
.code-row { display: flex; gap: 8px; align-items: center; }
.code, .link { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; background: #0f0d09; border: 1px solid var(--line); font-family: ui-monospace, Consolas, monospace; overflow-wrap: anywhere; font-size: 15px; }
.code { font-size: 22px; letter-spacing: 2px; text-align: center; color: var(--gold-soft); }
.code-form { display: flex; gap: 8px; margin-top: 10px; }
.pack { font: 400 34px/1.1 "Bebas Neue", Impact, sans-serif; color: var(--gold); margin: 0; }

.date-row { display: grid; grid-template-columns: 1fr 1.4fr 1.2fr; gap: 8px; }
.date-row label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }

.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .75); display: grid; place-items: center; padding: 16px; }
.dialog { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--gold2); border-radius: var(--radius); padding: 20px; }
.turnstile-hidden { position: fixed; bottom: 8px; right: 8px; z-index: 30; }

.footer { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; padding: 20px 16px 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.footer p { flex-basis: 100%; margin: 4px 0 0; }

@media (prefers-reduced-motion: reduce) { .screen, .spinner { animation: none; } }
