/* DobleCorchea Aula — paleta tomada del logo: grafito + degradado magenta → naranja → amarillo */
:root {
  --bg: #1e1e20;
  --bg-2: #252527;
  --panel: #2b2b2e;
  --panel-2: #333337;
  --panel-3: #3c3c41;
  --line: #414147;
  --text: #f5f5f6;
  --muted: #a9a9b1;
  --magenta: #e6197e;
  --orange: #f7941d;
  --yellow: #fcc21b;
  --grad: linear-gradient(90deg, var(--magenta), var(--orange) 62%, var(--yellow));
  --grad-soft: linear-gradient(90deg, rgba(230, 25, 126, .22), rgba(247, 148, 29, .18));
  --ok: #3ecf8e;
  --danger: #ff4d5e;
  --radius: 14px;
  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.ic { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }
.ic.dim { opacity: .4; }
.ic.glyph { width: auto; height: auto; font-size: 20px; line-height: 1; font-family: "Segoe UI Symbol", "Noto Music", serif; }
[data-icon] { display: inline-flex; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mono { font-variant-numeric: tabular-nums; }
.hint { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }
.hint.error { color: var(--danger); }
code { background: var(--panel-3); padding: 1px 5px; border-radius: 5px; font-size: .92em; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel-2);
  font-weight: 600; white-space: nowrap;
  transition: background .15s, border-color .15s, filter .15s;
}
.btn:hover:not(:disabled) { background: var(--panel-3); border-color: #57575e; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--grad); border: 0; color: #19191b; }
.btn-primary:hover:not(:disabled) { background: var(--grad); filter: brightness(1.08); }
.btn-lg { height: 46px; padding: 0 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn.warn { border-color: var(--orange); color: var(--yellow); background: rgba(247, 148, 29, .12); }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--text);
}
.icon-btn:hover:not(:disabled) { background: var(--panel-3); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.icon-btn.active, .seg-btn.active {
  background: var(--grad-soft); border-color: var(--magenta); color: #fff;
}
.icon-btn.btn-primary { background: var(--grad); color: #19191b; }
.seg-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 11px;
  border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); font-weight: 600; font-size: 13px;
}
.seg-btn:hover { background: var(--panel-3); }
.seg-btn .ic { width: 16px; height: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); font-size: 12.5px; font-weight: 600;
}
button.chip:hover { background: var(--panel-3); }
.chip .ic { width: 16px; height: 16px; }
.tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; background: var(--grad); color: #19191b;
}

select, input[type="number"], input:not([type]), input[type="text"] {
  height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg-2); padding: 0 10px;
}
select { padding-right: 6px; }
input[type="range"] { accent-color: var(--orange); width: 100%; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--magenta); }

/* ---------- campos ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 16px; border: 0; padding: 0; }
.field > span, .field > legend { font-weight: 600; font-size: 13px; color: var(--muted); padding: 0; margin-bottom: 6px; }
.field input { height: 44px; font-size: 15px; background: var(--bg-2); }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; }
.segmented span { display: block; text-align: center; padding: 9px; border-radius: 9px; font-weight: 600; cursor: pointer; color: var(--muted); }
.segmented input:checked + span { background: var(--grad); color: #19191b; }
.segmented input:focus-visible + span { outline: 2px solid var(--orange); }

/* ================================================================ LOBBY */
body.lobby {
  min-height: 100dvh; display: flex; flex-direction: column;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(230, 25, 126, .16), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(247, 148, 29, .12), transparent 60%),
    var(--bg);
}
.lobby-main {
  flex: 1; width: min(1120px, 100%); margin: 0 auto; padding: 48px 20px 24px;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center;
}
.lobby-logo { border-radius: 22px; box-shadow: 0 12px 40px rgba(0, 0, 0, .45); }
.lobby-hero h1 { font-size: clamp(32px, 4.4vw, 52px); line-height: 1.05; margin: 24px 0 14px; font-weight: 800; letter-spacing: -.02em; }
.lead { color: var(--muted); font-size: 16px; max-width: 46ch; margin: 0 0 26px; }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.feature-list li { display: flex; gap: 14px; align-items: flex-start; }
.feature-list li > span {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px;
  background: var(--grad-soft); border: 1px solid rgba(230, 25, 126, .35); color: var(--yellow);
}
.feature-list b { display: block; font-size: 14.5px; }
.feature-list small { color: var(--muted); font-size: 13px; }
.lobby-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35); position: relative; overflow: hidden;
}
.lobby-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--grad); }
.lobby-card h2 { margin: 0 0 20px; font-size: 22px; }
.lobby-actions { display: grid; gap: 10px; margin-top: 6px; }
.lobby-foot { text-align: center; color: var(--muted); font-size: 12px; padding: 18px; }

/* ================================================================ SALA */
body.room {
  height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; overflow: hidden;
}

/* ---------- barra superior ---------- */
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 10px 16px; min-height: 58px;
  border-bottom: 1px solid var(--line); background: var(--bg-2);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand img { border-radius: 9px; }
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.room-info { display: flex; align-items: center; gap: 8px; }
.room-code {
  font-weight: 800; letter-spacing: .06em; padding: 4px 10px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.top-beat { width: 12px; height: 12px; border-radius: 50%; background: var(--panel-3); border: 1px solid var(--line); }
.top-beat.running { border-color: var(--orange); }
.top-beat.beat { animation: pulse .18s ease-out; background: var(--orange); }
.top-beat.beat.accent { background: var(--magenta); }
@keyframes pulse { from { transform: scale(1.7); box-shadow: 0 0 0 6px rgba(247, 148, 29, .35); } to { transform: scale(1); box-shadow: none; } }
.stage-tabs { display: flex; gap: 4px; margin-left: auto; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.stage-tabs button {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px;
  border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600;
}
.stage-tabs button:hover { color: var(--text); }
.stage-tabs button.active { background: var(--grad); color: #19191b; }
.stage-tabs .ic { width: 18px; height: 18px; }
.conn { font-size: 12px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.conn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); }
.conn[data-state="online"]::before { background: var(--ok); }
.conn[data-state="offline"]::before { background: var(--danger); }

/* ---------- distribución ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 12px; padding: 12px; min-height: 0; }
.stage {
  min-width: 0; min-height: 0; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.view { display: none; flex: 1; min-height: 0; flex-direction: column; }
.view.active { display: flex; }
.sidebar { min-height: 0; display: flex; flex-direction: column; gap: 10px; }

/* ---------- barra de herramientas ---------- */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px;
  border-bottom: 1px solid var(--line); background: var(--bg-2);
}
.tool-group { display: flex; align-items: center; gap: 2px; padding-right: 8px; margin-right: 2px; border-right: 1px solid var(--line); }
.tool-group:last-child, .tool-group.push { border-right: 0; }
.tool-group.push { margin-left: auto; }
.tool-label { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 0 6px; min-width: 92px; text-align: center; }
.note-kinds { display: none; }
.note-kinds.show { display: flex; }
.swatches { gap: 6px; padding: 0 10px 0 4px; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--panel-3); background: var(--c); padding: 0; }
.swatch.active { box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 4px var(--orange); }
.size-btn i { display: block; width: var(--s); height: var(--s); border-radius: 50%; background: currentColor; }
#staffSelect { max-width: 210px; }
.lead-only #meterSelect, .lead-only #barsSelect { margin-left: 4px; }
#meterSelect { max-width: 170px; }
#barsSelect { max-width: 150px; }
.meter-label { min-width: 0; text-align: left; }
.meter-label:empty { display: none; }
body:not(.is-lead) .lead-only { display: none !important; }
body.is-lead .student-only { display: none !important; }

/* ---------- pizarra ---------- */
.board-wrap { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; background: #19191b; }
.board-holder { position: relative; border-radius: 8px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.board-holder canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
#boardInk { cursor: crosshair; }
.board-holder[data-tool="note"] #boardInk { cursor: copy; }
.board-holder[data-tool="eraser"] #boardInk { cursor: cell; }
.board-holder.locked #boardInk { cursor: not-allowed; }
.board-banner {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: rgba(30, 30, 32, .92); border: 1px solid var(--orange); font-weight: 600; font-size: 13px;
}

/* ---------- cifrados ---------- */
.chords-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr; }
.chords-body.editing { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.chords-editor { display: flex; flex-direction: column; padding: 14px; border-right: 1px solid var(--line); min-height: 0; }
.chords-editor textarea {
  flex: 1; min-height: 200px; resize: none; padding: 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-2); font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 14px; line-height: 1.6;
}
.chords-scroll { overflow: auto; padding: 22px clamp(16px, 4vw, 48px) 80px; min-height: 0; }
.chord-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 18px; }
.chips-label { color: var(--muted); font-size: 12.5px; font-weight: 600; margin-right: 4px; }
.chord-chip { padding: 3px 10px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); font-weight: 700; color: var(--yellow); }
.chords-view { font-size: 18px; max-width: 900px; }
.song-title { font-size: 1.6em; margin: 0 0 2px; font-weight: 800; }
.song-sub { color: var(--muted); margin: 0 0 18px; font-size: .85em; }
.song-section {
  display: inline-block; margin: 18px 0 8px; padding: 3px 10px; border-radius: 6px;
  background: var(--grad-soft); color: var(--yellow); font-weight: 700; font-size: .72em; letter-spacing: .06em; text-transform: uppercase;
}
.song-gap { height: .9em; }
.song-line { display: flex; flex-wrap: wrap; align-items: flex-end; padding: 4px 10px; margin: 0 -10px; border-radius: 9px; border-left: 3px solid transparent; }
.can-mark .song-line { cursor: pointer; }
.can-mark .song-line:hover { background: rgba(255, 255, 255, .04); }
.song-line.current { background: var(--grad-soft); border-left-color: var(--magenta); }
.seg { display: inline-flex; flex-direction: column; }
.seg.bare { margin-right: 1.2em; }
.seg .ch { color: var(--orange); font-weight: 700; font-size: .86em; min-height: 1.3em; padding-right: .35em; }
.seg .ly { white-space: pre; }
.lyric-only .ly { white-space: pre-wrap; }

/* ---------- vídeo ---------- */
.cam-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: 38%; overflow: auto; flex: none; }
.cam-strip:empty { display: none; }
body.cams-on-stage .cam-strip { display: none; }
.cam-stage {
  flex: 1; min-height: 0; padding: 12px; display: grid; gap: 10px; align-content: center;
  grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); overflow: auto;
}
.tile {
  position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden;
  background: #131315; border: 2px solid transparent; transition: border-color .15s;
}
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; background: #131315; }
.cam-stage .tile video { object-fit: contain; }
.tile.mirror video { transform: scaleX(-1); }
.tile.speaking { border-color: var(--orange); }
.tile.teacher { box-shadow: inset 0 0 0 1px rgba(230, 25, 126, .5); }
.tile .avatar { position: absolute; inset: 0; display: none; place-items: center; background: radial-gradient(circle at 50% 40%, #2f2f33, #18181a); }
.tile.no-video .avatar { display: grid; }
.tile.no-video video { visibility: hidden; }
.avatar span {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad); color: #19191b; font-weight: 800; font-size: 18px;
}
.cam-stage .avatar span { width: 84px; height: 84px; font-size: 28px; }
.tile-meta {
  position: absolute; left: 6px; bottom: 6px; right: 6px; display: flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; pointer-events: none;
}
.tile-meta > * { background: rgba(15, 15, 17, .72); border-radius: 6px; padding: 2px 6px; }
.tile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tile-mic { display: none; color: var(--danger); padding: 2px 3px; }
.tile-mic .ic { width: 14px; height: 14px; }
.tile.muted .tile-mic { display: inline-flex; }
.tile-role { display: none; background: var(--grad) !important; color: #19191b; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.tile.teacher .tile-role { display: inline-block; }
.tile-hand { position: absolute; top: 6px; right: 6px; font-size: 20px; display: none; animation: wave 1s ease-in-out infinite alternate; }
.tile.hand .tile-hand { display: block; }
.tile.hand { border-color: var(--yellow); }
.tile.reconnecting::after { content: "Conectando…"; position: absolute; top: 6px; left: 6px; font-size: 11px; background: rgba(15, 15, 17, .8); padding: 2px 6px; border-radius: 6px; }
@keyframes wave { from { transform: rotate(-12deg); } to { transform: rotate(12deg); } }

/* ---------- pestañas laterales ---------- */
.side-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; flex: none; }
.side-tabs button {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px;
  border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 11.5px; font-weight: 600;
}
.side-tabs button:hover { color: var(--text); }
.side-tabs button.active { background: var(--panel-3); color: var(--text); }
.side-tabs button.active .ic { color: var(--orange); }
.badge-count {
  position: absolute; top: 3px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--magenta); color: #fff; font-size: 10.5px; display: grid; place-items: center;
}
.badge-count.soft { background: var(--panel-3); color: var(--text); }
.side-panel {
  display: none; flex: 1; min-height: 0; overflow: auto; padding: 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.side-panel.active { display: block; }

/* ---------- metrónomo ---------- */
.metro { display: grid; gap: 14px; }
.metro-dots { display: flex; justify-content: center; gap: 10px; min-height: 22px; flex-wrap: wrap; }
.metro-dots .dot { width: 18px; height: 18px; border-radius: 50%; background: var(--panel-3); border: 1px solid var(--line); transition: background .06s, transform .06s; }
.metro-dots .dot.accent { border-color: var(--magenta); }
.metro-dots .dot.on { background: var(--orange); transform: scale(1.25); }
.metro-dots .dot.accent.on { background: var(--magenta); }
.metro-bpm { display: flex; align-items: center; justify-content: space-between; }
.bpm-readout { text-align: center; }
.bpm-readout output { display: block; font-size: 54px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.bpm-readout small { color: var(--muted); font-weight: 600; }
.metro-row { display: flex; gap: 10px; align-items: flex-end; }
.mini-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
.mini-field > span { display: inline-flex; align-items: center; gap: 5px; }
.mini-field .ic { width: 15px; height: 15px; }
.mini-field.grow { flex: 1; }
.mini-field select, .mini-field input[type="number"] { color: var(--text); }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; height: 36px; }
#metroToggle.running { background: var(--panel-3); color: var(--text); border: 1px solid var(--magenta); }
.metro-row .btn { flex: none; }
.metro-row .mini-field:first-child { flex: 1; }

/* ---------- afinador ---------- */
.tuner { display: grid; gap: 12px; }
.gauge { width: 100%; max-width: 280px; margin: 0 auto; display: block; }
.gauge-arc { fill: none; stroke: var(--panel-3); stroke-width: 10; stroke-linecap: round; }
.gauge-ok { fill: none; stroke: var(--ok); stroke-width: 10; opacity: .35; }
.tick { stroke: var(--muted); stroke-width: 1.5; }
.tick.zero { stroke: var(--text); stroke-width: 2.5; }
#needle { stroke: var(--muted); stroke-width: 3; stroke-linecap: round; transition: transform .08s linear; }
.gauge-hub { fill: var(--text); }
.tuner.on #needle { stroke: var(--orange); }
.tuner.in-tune #needle { stroke: var(--ok); }
.tuner.in-tune .gauge-ok { opacity: 1; }
.tuner-note { text-align: center; font-size: 56px; font-weight: 800; line-height: 1; margin-top: -8px; }
.tuner-note sub { font-size: 20px; color: var(--muted); margin-left: 2px; }
.tuner.in-tune .tuner-note { color: var(--ok); }
.tuner.sharp .tuner-note, .tuner.flat .tuner-note { color: var(--yellow); }
.tuner.idle .tuner-note, .tuner.idle .tuner-meta { opacity: .45; }
.tuner-meta { display: flex; justify-content: center; gap: 16px; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.strings { display: flex; flex-wrap: wrap; gap: 6px; }
.string-btn { flex: 1; min-width: 46px; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); font-weight: 700; }
.string-btn:hover { background: var(--panel-3); }
.string-btn.active { border-color: var(--orange); background: var(--grad-soft); }
.tuner .metro-row .mini-field { flex: 1; }
.tuner .metro-row input[type="number"] { width: 100%; }

/* ---------- chat ---------- */
.chat-panel.active { display: flex; flex-direction: column; padding: 0; }
.chat-list { list-style: none; margin: 0; padding: 14px; flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.chat-list li { background: var(--panel-2); border-radius: 10px; padding: 8px 11px; }
.chat-list li.teacher { border-left: 3px solid var(--magenta); }
.chat-list li.sys { background: none; padding: 0; text-align: center; color: var(--muted); font-size: 12px; }
.chat-head { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.chat-head time { margin-left: auto; color: var(--muted); font-size: 11px; }
.chat-list p { margin: 3px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; min-width: 0; }

/* ---------- participantes ---------- */
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); }
.person.hand { box-shadow: inset 0 0 0 1px var(--yellow); }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #19191b; font-weight: 800; font-size: 12px; flex: none; }
.pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pname em { color: var(--muted); font-style: normal; font-weight: 500; }
.pstat { display: inline-flex; gap: 4px; }
.pstat .ic { width: 16px; height: 16px; }
.hand-btn { border: 0; background: transparent; font-size: 18px; padding: 0 2px; }
.hand-btn:disabled { cursor: default; }

/* ---------- controles inferiores ---------- */
.controls {
  display: flex; justify-content: center; gap: 8px; padding: 10px 12px 12px; flex-wrap: wrap;
  border-top: 1px solid var(--line); background: var(--bg-2);
}
.ctl {
  display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 76px; padding: 7px 10px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); font-size: 11.5px; font-weight: 600;
}
.ctl:hover { background: var(--panel-3); }
.ctl .ic { width: 22px; height: 22px; }
.ctl.off { background: rgba(255, 77, 94, .14); border-color: rgba(255, 77, 94, .6); color: #ffb3bb; }
.ctl.active { background: var(--grad-soft); border-color: var(--magenta); }
.ctl.leave { background: var(--danger); border-color: var(--danger); color: #fff; margin-left: 12px; }
.ctl.leave:hover { filter: brightness(1.1); background: var(--danger); }

/* ---------- diálogo y avisos ---------- */
.dialog {
  border: 1px solid var(--line); border-radius: 20px; background: var(--panel); color: var(--text);
  padding: 28px; width: min(420px, calc(100vw - 32px));
}
.dialog::backdrop { background: rgba(10, 10, 12, .7); backdrop-filter: blur(4px); }
.dialog img { border-radius: 16px; display: block; margin: 0 auto 10px; }
.dialog h2 { text-align: center; margin: 0 0 20px; font-size: 20px; }
#toasts { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; width: min(460px, calc(100vw - 32px)); }
.toast {
  padding: 11px 16px; border-radius: 12px; background: #3a3a3f; border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4); font-weight: 500; animation: toastIn .2s ease-out; transition: opacity .4s, transform .4s;
}
.toast.warn { border-color: var(--orange); }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .hide-sm { display: none; }
  .stage-tabs button span:last-child { display: none; }
}
@media (max-width: 860px) {
  .lobby-main { grid-template-columns: 1fr; gap: 28px; padding-top: 28px; }
  body.room { height: auto; min-height: 100dvh; overflow-x: hidden; overflow-y: auto; grid-template-columns: minmax(0, 1fr); }
  .tool-group { flex-wrap: wrap; }
  .swatches { padding-right: 4px; }
  #staffSelect { max-width: 100%; }
  .stage-tabs button { min-width: 0; padding: 0 6px; }
  .room-info { min-width: 0; }
  .topbar { flex-wrap: wrap; gap: 8px 10px; padding: 8px 12px; }
  .brand-name { display: none; }
  .stage-tabs { margin-left: 0; order: 5; width: 100%; justify-content: stretch; }
  .stage-tabs button { flex: 1; justify-content: center; }
  .stage-tabs button span:last-child { display: inline; }
  .conn { margin-left: auto; }
  .layout { grid-template-columns: minmax(0, 1fr); padding: 8px; }
  .stage { height: 62vh; min-height: 380px; }
  .sidebar { min-height: 520px; }
  .cam-strip { max-height: none; }
  .chords-body.editing { grid-template-columns: 1fr; grid-template-rows: 40% 1fr; }
  .chords-editor { border-right: 0; border-bottom: 1px solid var(--line); }
  .controls { position: sticky; bottom: 0; z-index: 5; gap: 6px; }
  .ctl { min-width: 0; flex: 1; padding: 7px 4px; font-size: 10.5px; }
  .ctl.leave { margin-left: 0; }
  #toasts { bottom: 110px; }
}
.dialog .block-msg { text-align: center; color: var(--muted); margin: -8px 0 20px; max-width: 34ch; margin-inline: auto; }
.dialog a.btn { text-decoration: none; color: #19191b; }

/* ---------- menú de exportar ---------- */
.menu-anchor { position: relative; }
.pop-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 230px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: 0 12px 32px rgba(0,0,0,.4); display: grid; }
.pop-menu[hidden] { display: none; }
.pop-menu button { text-align: left; background: transparent; border: 0; color: var(--text); font: inherit; font-size: 13px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.pop-menu button:hover { background: var(--panel-3); }

/* ---------- panel Lección ---------- */
.lesson-panel { overflow-y: auto; }
.lesson-progress small { color: var(--muted); font-size: 11.5px; }
.lesson-progress .bar { height: 6px; border-radius: 99px; background: var(--panel-3); overflow: hidden; margin: 4px 0; }
.lesson-progress .bar i { display: block; height: 100%; background: var(--grad); }
.lesson-nav { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 4px; font-size: 12px; color: var(--muted); }
.lesson-nav .icon-btn span { font-size: 20px; line-height: 1; }
.lesson-unit { margin: 6px 0 0; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.lesson-title { margin: 2px 0 4px; font-size: 16px; }
.lesson-state { margin: 0 0 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
.lesson-state.done { color: var(--ok); }
.lesson-panel h4 { margin: 12px 0 4px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.lesson-text { margin: 0; font-size: 13px; line-height: 1.45; }
.lesson-panel details summary { cursor: pointer; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.lesson-files { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 13px; }
.lesson-files small { color: var(--muted); }
.linkish { background: none; border: 0; padding: 0; color: var(--yellow); font: inherit; cursor: pointer; text-align: left; }
.lesson-actions { display: grid; gap: 8px; margin-top: 14px; }
.lesson-panel .btn-block { margin-top: 10px; }
