:root {
  --bg: #0d0b1a;
  --bg2: #17132b;
  --card: #1f1a3a;
  --line: #2f2856;
  --text: #f4f1ff;
  --muted: #a49cc9;
  --pink: #ff3d81;
  --purple: #8b5cf6;
  --yellow: #ffd23f;
  --green: #22c55e;
  --radius: 16px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; }
.hidden { display: none !important; }
.logo { font-weight: 800; letter-spacing: -0.02em; }
.logo b { background: linear-gradient(90deg, var(--pink), var(--purple)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.btn {
  background: linear-gradient(90deg, var(--pink), var(--purple));
  color: #fff; font-weight: 700; padding: 14px 22px; border-radius: 999px;
  box-shadow: 0 6px 24px rgba(255, 61, 129, .25);
}
.btn:disabled { opacity: .5; }
.btn.ghost { background: var(--card); box-shadow: none; border: 1px solid var(--line); }
.btn:focus-visible, .ghost:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; color: #111; }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #000c; border: 1px solid var(--line); padding: 12px 18px; border-radius: 12px;
  z-index: 50; max-width: 90vw; text-align: center;
}

/* ---------------- TV ---------------- */
.tv { display: grid; grid-template-columns: 1fr minmax(300px, 25vw); height: 100vh; overflow: hidden; }
.stage { position: relative; background: #000; overflow: hidden; }
#player, .stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 4vw; z-index: 5;
  background: radial-gradient(circle at 30% 20%, #3b1d6e 0, transparent 50%), radial-gradient(circle at 80% 80%, #6d1240 0, transparent 45%), var(--bg);
}
.overlay h1 { font-size: clamp(32px, 5vw, 84px); margin: 0 0 12px; line-height: 1.05; }
.overlay p { font-size: clamp(16px, 1.8vw, 30px); color: var(--muted); margin: 6px 0; }
.overlay .big-qr { background: #fff; padding: 18px; border-radius: 22px; margin: 26px 0 14px; }
.overlay .big-qr svg, .overlay .big-qr img { display: block; width: min(34vh, 380px); height: auto; }
.overlay .url { font-size: clamp(16px, 1.6vw, 28px); color: var(--yellow); font-weight: 700; }
.intro .singer { font-size: clamp(22px, 3vw, 52px); margin-top: 18px; }
.intro .count { font-size: clamp(40px, 7vw, 120px); font-weight: 800; color: var(--yellow); margin-top: 10px; }
.side { background: var(--bg2); border-left: 1px solid var(--line); display: flex; flex-direction: column; padding: 20px; gap: 16px; min-height: 0; }
.side .logo { font-size: 26px; }
.joinbox { display: flex; gap: 14px; align-items: center; background: var(--card); border-radius: var(--radius); padding: 14px; }
.joinbox .qr { background: #fff; padding: 8px; border-radius: 10px; flex: none; }
.joinbox .qr svg, .joinbox .qr img { display: block; width: 110px; height: 110px; }
.joinbox .code { font-size: 40px; font-weight: 800; letter-spacing: .08em; color: var(--yellow); }
.joinbox small { color: var(--muted); display: block; }
.now { background: var(--card); border-radius: var(--radius); padding: 14px; }
.label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; margin-bottom: 8px; }
.now .title { font-weight: 700; font-size: 18px; }
.list { list-style: none; padding: 0; margin: 0; overflow-y: auto; flex: 1; min-height: 0; }
.list li { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list .n { width: 28px; height: 28px; border-radius: 50%; background: var(--line); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.list .t { font-weight: 600; font-size: 15px; line-height: 1.25; }
.list .who { font-size: 13px; color: var(--muted); }
.empty { color: var(--muted); padding: 10px 0; }
.tvbar { display: flex; gap: 8px; flex-wrap: wrap; }
.tvbar .btn { padding: 10px 14px; font-size: 14px; }
.people { color: var(--muted); font-size: 14px; }
.react {
  position: absolute; bottom: 40px; z-index: 20; pointer-events: none; text-align: center;
  animation: floatup 3.2s ease-out forwards;
}
.react .e { font-size: clamp(42px, 5vw, 90px); display: block; }
.react .nm { font-size: 14px; font-weight: 700; padding: 2px 8px; border-radius: 999px; color: #111; }
@keyframes floatup {
  0% { transform: translateY(0) scale(.6); opacity: 0; }
  10% { opacity: 1; transform: translateY(-20px) scale(1.1); }
  100% { transform: translateY(-60vh) scale(1); opacity: 0; }
}
.start .btn { font-size: 24px; padding: 18px 34px; margin-top: 26px; }

@media (max-width: 800px) {
  .tv { grid-template-columns: 1fr; grid-template-rows: 56vw 1fr; }
}

/* ---------------- Celular ---------------- */
.phone { max-width: 560px; margin: 0 auto; min-height: 100vh; padding: 16px 16px 110px; }
.phone header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.phone header .logo { font-size: 22px; }
.phone header .room { color: var(--muted); font-size: 14px; }
.panel { background: var(--card); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; border: 1px solid var(--line); }
.panel h2 { margin: 0 0 6px; font-size: 22px; }
.panel p { color: var(--muted); margin: 0 0 14px; }
.field { width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); font-size: 17px; margin-bottom: 12px; }
.field:focus { outline: 2px solid var(--purple); }
.wide { width: 100%; }
.nowp { display: flex; gap: 12px; align-items: center; }
.nowp img { width: 96px; height: 54px; object-fit: cover; border-radius: 8px; flex: none; }
.nowp .title { font-weight: 700; line-height: 1.25; }
.ctrls { display: flex; gap: 8px; margin-top: 12px; }
.ctrls .btn { flex: 1; padding: 11px 10px; font-size: 15px; }
.tabs { display: flex; gap: 6px; background: var(--bg2); padding: 5px; border-radius: 999px; margin-bottom: 14px; }
.tabs button { flex: 1; padding: 10px; border-radius: 999px; background: transparent; font-weight: 700; color: var(--muted); }
.tabs button.on { background: var(--card); color: var(--text); }
.search { display: flex; gap: 8px; }
.search .field { margin: 0; }
.search .btn { padding: 0 18px; }
.results { list-style: none; margin: 14px 0 0; padding: 0; }
.results li { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.results img { width: 112px; height: 63px; object-fit: cover; border-radius: 8px; flex: none; background: var(--bg2); }
.results .meta { flex: 1; min-width: 0; }
.results .t { font-weight: 600; font-size: 15px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.results .c { color: var(--muted); font-size: 13px; margin-top: 3px; }
.add { background: var(--purple); color: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 14px; flex: none; }
.add.done { background: var(--green); }
.add.rm { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.reacts {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 0;
  padding: 10px 8px calc(10px + env(safe-area-inset-bottom)); background: #0d0b1aee; border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.reacts button { font-size: 26px; background: transparent; padding: 6px 5px; border-radius: 12px; transition: transform .1s; }
.reacts button:active { transform: scale(1.35); background: var(--card); }
.hint { color: var(--muted); font-size: 13px; text-align: center; margin-top: 10px; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--pink); border-radius: 50%; animation: spin 1s linear infinite; margin: 20px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
