/* Tema escuro de propósito: os jurados estão numa sala de teatro às escuras,
   um ecrã branco encandeia e distrai o público. */
:root {
  /* Cores e letras do site do festival (dancingworld.opaloproductions.com):
     roxo-noite do topo, ameixa #8A3E7A dos botões, magenta #C42BA2 do logótipo, Peralta + Roboto */
  --bg: #12071b;
  --bg-2: #1a0b27;
  --surface: #221030;
  --surface-2: #2e1640;
  --line: #40215a;
  --text: #fbf2f8;
  --muted: #c3a9c8;
  --faint: #86698f;
  --gold: #e0359f;
  --gold-2: #ff6cc0;
  --gold-ink: #ffffff;
  --plum: #8a3e7a;
  --ok: #7fd3a6;
  --warn: #f2a65e;
  --bad: #ff7a86;
  --radius: 16px;
  --font: "Roboto", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --display: "Peralta", Georgia, "Times New Roman", serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(900px 520px at 85% -160px, rgba(196, 43, 162, .28) 0%, transparent 70%),
    radial-gradient(1100px 640px at 10% -240px, #3a1170 0%, transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gold-2); }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px 120px; }
.wrap.wide { max-width: 1180px; }

/* topo */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(18, 7, 27, .84);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.top-in { max-width: 720px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.wide .top-in, .top.wide .top-in { max-width: 1180px; }
.brand { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.brand small { color: var(--gold); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; }
.brand b { font: 400 17px/1.25 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pill {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  font-size: 12.5px; padding: 6px 11px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted);
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.pill.ok::before { background: var(--ok); }
.pill.busy::before { background: var(--gold); animation: pulse 1s infinite; }
.pill.off::before { background: var(--warn); }
@keyframes pulse { 50% { opacity: .3; } }

/* blocos */
h1, h2, h3 { font-family: var(--display); letter-spacing: -.01em; margin: 0; }
h2 { font-family: var(--font); font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: #ff7cc6; font-weight: 700; margin: 30px 0 10px; }
h3 { font: 600 12.5px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 22px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.pad { padding: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 11px;
  padding: 10px 15px; font-weight: 600; font-size: 14.5px; text-decoration: none; color: var(--text);
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: #4a3c52; }
.btn:active { transform: translateY(1px); }
.btn.gold { background: linear-gradient(160deg, #ec3fa8, #b5288f); border-color: #e0359f; color: #fff; box-shadow: 0 8px 22px -10px rgba(224, 53, 159, .8); }
.btn.gold:hover { background: linear-gradient(160deg, #ff57b8, #c42ba2); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 9px; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn.block { width: 100%; padding: 15px; font-size: 16px; }

input[type=text], input[type=number], select, textarea {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%;
  outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
textarea { resize: vertical; min-height: 70px; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 99px; padding: 7px 13px; font-size: 13.5px; font-weight: 600;
}
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }

.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 14px;
  transition: .25s; pointer-events: none; z-index: 50; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); color: #1a0709; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty b { display: block; color: var(--text); font: 400 21px var(--display); margin-bottom: 6px; }

/* ---------- jurado: lista ---------- */
.progress { height: 4px; background: var(--surface-2); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: var(--gold); border-radius: 4px; transition: width .4s; }

.next {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  margin-top: 18px; padding: 16px 18px; border-radius: var(--radius);
  background: linear-gradient(135deg, #5a2154 0%, #3a1450 100%); border: 1px solid #8a3e7a; color: var(--text);
}
.next .n { font: 700 12.5px var(--font); color: #ffb3e0; letter-spacing: .12em; text-transform: uppercase; }
.next b { display: block; font: 600 19px/1.25 var(--display); margin-top: 2px; }
.next .arrow { margin-left: auto; width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(160deg, #ff4fb0, #c42ba2); color: #fff; display: grid; place-items: center; font-size: 20px; flex: none; }

.list { display: flex; flex-direction: column; gap: 6px; }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text);
}
.row .num { width: 30px; height: 30px; flex: none; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.row .who { flex: 1; min-width: 0; }
.row .who b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .who span { font-size: 12.5px; color: var(--muted); }
.row .st { font-size: 13px; color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.row.done .num { background: rgba(124, 196, 154, .14); color: var(--ok); }
.row.done .st { color: var(--text); font-weight: 600; }
.row.pend .st { color: var(--warn); }

/* ---------- jurado: ficha ---------- */
.sheet-head { padding: 18px 0 6px; }
.sheet-head .meta { color: var(--gold); font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.sheet-head h1 { font-size: 30px; line-height: 1.15; margin-top: 6px; font-weight: 400; }
.crit { margin-top: 14px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.crit-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.crit-h b { font-weight: 600; }
.crit-h span { font: 400 21px var(--display); color: var(--gold-2); font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }
.crit.missing { border-color: rgba(233, 162, 95, .55); }
.scale { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; }
.scale button {
  aspect-ratio: 1 / 1.08; border-radius: 9px; border: 1px solid var(--line); background: var(--bg-2);
  font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--muted); padding: 0;
  transition: background .12s, color .12s, transform .08s;
}
.scale button:active { transform: scale(.92); }
.scale button.on { background: linear-gradient(160deg, #ff4fb0, #c42ba2); border-color: #ff4fb0; color: #fff; box-shadow: 0 6px 18px -6px rgba(224, 53, 159, .7); }
.scale button.lit { background: #3d1a45; border-color: #6a2e66; color: #ffb3e0; }
@media (max-width: 400px) { .scale { grid-template-columns: repeat(5, 1fr); } .scale button { aspect-ratio: 1.5 / 1; } }

.totalbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: rgba(18, 7, 27, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.totalbar-in { max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.totalbar .tot { line-height: 1.1; }
.totalbar .tot small { color: var(--muted); font-size: 12px; display: block; }
.totalbar .tot b { font: 400 27px var(--display); font-variant-numeric: tabular-nums; }
.totalbar .tot b em { font-style: normal; color: var(--faint); font-size: 16px; font-weight: 600; }
.totalbar .btn { margin-left: auto; padding: 14px 20px; font-size: 15.5px; }

.lockmsg { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: rgba(233, 162, 95, .1); border: 1px solid rgba(233, 162, 95, .4); color: var(--warn); font-size: 14px; }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; font-size: 18px; flex: none; color: var(--text); }

/* marca: "Dancing" manuscrito magenta + "WORLD" serifado, como no logótipo do festival */
.wm { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: .82; flex: none; text-decoration: none; }
.wm i { font: 400 22px "Kaushan Script", cursive; color: #ff3ea5; font-style: normal; letter-spacing: -.01em; }
.wm b { font: 500 17px "Playfair Display", Georgia, serif; color: #d78fc8; letter-spacing: .04em; margin-top: -1px; padding-left: 1px; }
.wm.big i { font-size: clamp(44px, 7vw, 120px); }
.wm.big b { font-size: clamp(34px, 5.4vw, 94px); margin-top: -.06em; }
.wm.center { align-items: center; }
.top .wm { padding-right: 12px; margin-right: 2px; border-right: 1px solid var(--line); }
@media (max-width: 480px) {
  .top .brand b { display: none; }
  .top .brand small { font-size: 10.5px; }
  .top .wm i { font-size: 19px; }
  .top .wm b { font-size: 14.5px; }
  .pill { font-size: 11.5px; padding: 5px 9px; }
}

/* logótipo oficial do festival (fundo branco, por isso vai num emblema redondo) */
.wm-logo { width: 44px; height: 44px; border-radius: 50%; background: #fff; flex: none; display: block; box-shadow: 0 0 0 2px rgba(255,255,255,.08); }
.top .wm-logo { margin-right: 4px; }
.wm-logo.pod { width: clamp(90px, 12vh, 150px); height: auto; aspect-ratio: 1; margin: 0 auto 4vh; }
.wm-full { display: block; margin: 0 auto; width: min(340px, 62vw); height: auto; border-radius: 22px; background: #fff; padding: 14px; }
.hero .wm-logo { width: 72px; height: 72px; }
@media (max-width: 480px) { .top .wm-logo { width: 38px; height: 38px; } }
