:root {
  --bg: #140f24;
  --bg2: #1e1637;
  --card: #251c44;
  --line: #3a2d66;
  --text: #ece8ff;
  --muted: #9d94c4;
  --accent: #5ef2e6;
  --accent-ink: #0e0a1c;
  --danger: #ff5c7a;
  --radius: 14px;
}
body.igasu {
  --bg: #0b0707;
  --bg2: #150c0c;
  --card: #1c1010;
  --line: #3b1a1a;
  --text: #f3e6e6;
  --muted: #a88484;
  --accent: #e0282f;
  --accent-ink: #fff;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh;
  transition: background .4s, color .4s;
}
body.igasu { background: radial-gradient(ellipse at top, #2a0909 0%, var(--bg) 60%) fixed; }

.hidden { display: none !important; }
h1, h2 { margin: 0 0 12px; }
h2 { font-size: 15px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }

input, select, textarea, .btn {
  font: inherit;
  color: var(--text);
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  width: 100%;
  min-height: 46px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.btn { cursor: pointer; font-weight: 600; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn.small { min-height: 36px; padding: 6px 10px; width: auto; font-size: 13px; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; min-width: 0; }

.screen { min-height: 100dvh; }
#login { display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; display: grid; gap: 12px; text-align: center; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  display: grid;
  gap: 10px;
}

/* Barra superior */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.bot-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--bg2); image-rendering: pixelated; object-fit: cover; }
body.igasu .bot-avatar { box-shadow: 0 0 0 2px var(--accent), 0 0 18px #e0282f88; image-rendering: auto; }
.bot-info { flex: 1; display: grid; min-width: 0; }
.bot-info strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mode-label { font-size: 12px; color: var(--muted); }
body.igasu .mode-label { color: var(--accent); font-weight: 700; letter-spacing: .1em; }

.switch { position: relative; width: 58px; height: 32px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: var(--line); border-radius: 32px; transition: .3s; cursor: pointer; }
.slider::before { content: "🎵"; position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 14px; transition: .3s; }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { content: "👁️"; transform: translateX(26px); }
.switch input:disabled + .slider { opacity: .5; }

.guild-select { margin: 12px 16px 0; width: calc(100% - 32px); }

main { padding: 16px 16px calc(90px + env(safe-area-inset-bottom)); max-width: 720px; margin: 0 auto; }

/* Pestañas inferiores */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex;
  background: var(--bg2);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs button {
  flex: 1; background: none; border: 0; color: var(--muted);
  padding: 8px 0 10px; font: inherit; font-size: 11px; display: grid; gap: 2px; cursor: pointer;
}
.tabs button span { font-size: 20px; }
.tabs button.active { color: var(--accent); }
.tabs button.disabled { opacity: .35; }

.locked { text-align: center; }
.locked .eye { font-size: 40px; }

/* Canales de voz */
.vc-head { display: flex; align-items: center; gap: 8px; }
.vc-head h3 { margin: 0; font-size: 16px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-head .count { font-size: 12px; color: var(--muted); }
.vc.empty { opacity: .55; padding: 12px 16px; }
.vc.empty .members { display: none; }
.members { display: grid; gap: 6px; }
.member {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 10px; background: var(--bg2);
  border: 1px solid transparent; cursor: pointer; text-align: left; color: inherit; font: inherit; width: 100%;
}
.member:active { border-color: var(--accent); }
.member img { width: 36px; height: 36px; border-radius: 50%; flex: none; }
.member .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badges { display: flex; gap: 4px; font-size: 14px; }
.badge-server { filter: drop-shadow(0 0 3px var(--danger)); }

.list { display: grid; gap: 8px; }
.list-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--bg2); border-radius: 10px; }
.list-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted { color: var(--muted); font-size: 13px; }

/* Hoja inferior */
.backdrop { position: fixed; inset: 0; background: #0009; z-index: 10; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 11;
  background: var(--card); border-top: 1px solid var(--line);
  border-radius: 20px 20px 0 0;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom));
  max-height: 85dvh; overflow-y: auto;
  display: grid; gap: 10px;
  max-width: 720px; margin: 0 auto;
  animation: up .2s ease-out;
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet .grip { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 6px; }
.sheet-head { display: flex; align-items: center; gap: 12px; }
.sheet-head img { width: 48px; height: 48px; border-radius: 50%; }
.sheet-head h3 { margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 20;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px;
  font-weight: 600; max-width: calc(100% - 32px); box-shadow: 0 6px 24px #0008;
}
.toast.error { background: var(--danger); color: #fff; }

.np-title { font-weight: 700; }
.np-queue { margin: 0; padding-left: 20px; color: var(--muted); font-size: 13px; }
.kana { font-size: 18px; min-height: 26px; word-break: break-word; color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.check input { width: 20px; min-height: 20px; accent-color: var(--accent); }
input[type=range] { padding: 0; min-height: 30px; accent-color: var(--accent); }
