/* Painel de letra sincronizada + karaokê do player web.
   Mesma identidade da pílula do player (style.css, #evil-player): vidro
   escuro translúcido, borda branca fina, acento ciano #00e5ff, banda em
   branco/negrito e título em ciano. Sem brilho/gradiente decorativo. */

/* Botão do microfone na pílula do player */
.ep-karaoke-btn {
  position: relative;
}
.ep-karaoke-btn.has-karaoke::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00e5ff;
}
.ep-karaoke-btn.active {
  color: #00e5ff !important;
}

#evil-karaoke-panel {
  --ek-accent: #00e5ff;
  --ek-accent-soft: rgba(0, 229, 255, 0.14);
  --ek-line: rgba(255, 255, 255, 0.1);
  --ek-text: #f8fafc;
  --ek-muted: rgba(226, 232, 240, 0.62);
  --ek-font: 1;

  position: fixed;
  right: 24px;
  bottom: 120px;
  width: 420px;
  height: min(620px, calc(100vh - 160px));
  min-width: 320px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  z-index: 2147481000;
  border-radius: 22px;
  border: 1px solid var(--ek-line);
  background: rgba(10, 10, 12, 0.78);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  color: var(--ek-text);
  font-family: inherit;
  overflow: hidden;
}
#evil-karaoke-panel[hidden] {
  display: none;
}
#evil-karaoke-panel.ek-dragging,
#evil-karaoke-panel.ek-resizing {
  user-select: none;
  -webkit-user-select: none;
}

/* ── Topo: foto da banda + capa + música / banda / álbum ── */
.ek-hero {
  position: relative;
  flex: 0 0 auto;
  min-height: 132px;
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.ek-dragging .ek-hero {
  cursor: grabbing;
}
.ek-hero-photo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 30%;
  background-color: #0b0b0e;
}
.ek-hero-photo.empty {
  background-image: none;
}
.ek-hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 10, 12, 0.25) 0%, rgba(10, 10, 12, 0.55) 45%, rgba(10, 10, 12, 0.96) 100%);
}
.ek-hero-top,
.ek-hero-meta {
  position: relative;
  z-index: 1;
}
.ek-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ek-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--ek-line);
  color: var(--ek-accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ek-hero-actions {
  display: flex;
  gap: 4px;
}
.ek-hero-meta {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-top: 18px;
  min-width: 0;
}
.ek-hero-cover {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 10px;
  object-fit: cover;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}
.ek-hero-text {
  min-width: 0;
}
.ek-song {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ek-band {
  margin: 3px 0 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ek-accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ek-album {
  margin: 2px 0 0;
  font-size: 0.75rem;
  color: var(--ek-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Botões (mesma linguagem dos ícones da pílula) ── */
.ek-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(0, 0, 0, 0.35);
  color: rgba(255, 255, 255, 0.82);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.ek-icon-btn:hover:not(:disabled) {
  color: var(--ek-accent);
  border-color: rgba(0, 229, 255, 0.35);
}
.ek-icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.ek-icon-btn:focus-visible,
.ek-mic:focus-visible,
.ek-chip:focus-visible,
.ek-select:focus-visible,
.ek-edit-btn:focus-visible {
  outline: 2px solid var(--ek-accent);
  outline-offset: 2px;
}

/* ── Barra de controles ── */
.ek-toolbar {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--ek-line);
  border-bottom: 1px solid var(--ek-line);
}
.ek-toolbar[hidden] {
  display: none;
}
.ek-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ek-mic {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.ek-mic:hover:not(:disabled) {
  border-color: rgba(0, 229, 255, 0.5);
}
.ek-mic.on {
  background: var(--ek-accent);
  border-color: var(--ek-accent);
  color: #001418;
}
.ek-mic.locked {
  color: var(--ek-muted);
}
.ek-mic:disabled {
  opacity: 0.4;
  cursor: default;
}
.ek-chip {
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;
  color: var(--ek-muted);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.ek-chip.active {
  border-color: var(--ek-accent);
  color: var(--ek-accent);
  background: var(--ek-accent-soft);
}
.ek-select {
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #111114;
  color: #fff;
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.ek-font {
  display: flex;
  gap: 2px;
}

/* ── Letra ── */
.ek-body {
  /* relative: centerActive() mede offsetTop das linhas a partir daqui. */
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 12px 22px;
  user-select: none;
  -webkit-user-select: none;
  /* Sem barra visível (preferência do user, igual às colunas do globo): rola
     com a roda, com o dedo ou clicando e arrastando a letra. */
  scrollbar-width: none;
  overscroll-behavior: contain;
  cursor: grab;
}
.ek-body::-webkit-scrollbar {
  display: none;
}
.ek-body.ek-grabbing {
  cursor: grabbing;
}
.ek-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ek-line {
  position: relative;
  padding: 10px 40px 10px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.ek-line:hover {
  opacity: 0.85;
  background: rgba(255, 255, 255, 0.04);
}
.ek-line.active {
  opacity: 1;
  background: rgba(0, 229, 255, 0.07);
  border-color: rgba(0, 229, 255, 0.28);
}
.ek-jp {
  font-size: calc(15px * var(--ek-font));
  font-weight: 700;
  line-height: 1.45;
  color: #fff;
}
.ek-romaji {
  margin-top: 3px;
  font-size: calc(12px * var(--ek-font));
  line-height: 1.4;
  color: var(--ek-accent);
}
.ek-trans {
  margin-top: 3px;
  font-size: calc(12.5px * var(--ek-font));
  line-height: 1.45;
  color: rgba(226, 232, 240, 0.86);
}
.ek-edit-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.35);
  font-size: 11px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.ek-line:hover .ek-edit-btn,
.ek-line.active .ek-edit-btn,
.ek-edit-btn:focus-visible {
  opacity: 1;
}
.ek-edit-btn:hover {
  color: var(--ek-accent);
  background: rgba(255, 255, 255, 0.08);
}
@media (hover: none) {
  .ek-edit-btn {
    opacity: 1;
  }
}

/* ── Correção ── */
.ek-corr-box {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(0, 229, 255, 0.3);
  background: rgba(6, 6, 8, 0.96);
}
.ek-corr-box[hidden] {
  display: none;
}
.ek-corr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ek-corr-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ek-accent);
}
.ek-corr-original {
  margin: 0;
  font-size: 12px;
  color: var(--ek-muted);
  line-height: 1.4;
  max-height: 3.2em;
  overflow: hidden;
}
.ek-corr-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.ek-input {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #111114;
  color: #fff;
  font: inherit;
  font-size: 12.5px;
}
.ek-input:focus {
  outline: none;
  border-color: var(--ek-accent);
}
.ek-corr-submit {
  height: 32px;
  padding: 0 16px;
  border-radius: 999px;
  border: 0;
  background: var(--ek-accent);
  color: #001418;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.ek-corr-submit:disabled {
  opacity: 0.5;
  cursor: default;
}
.ek-corr-status {
  min-height: 1em;
  font-size: 11.5px;
  color: var(--ek-accent);
}

/* ── Estados ── */
.ek-upsell {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 18px 16px;
}
.ek-upsell h4 {
  margin: 0;
  font-size: 15px;
  color: #fff;
}
.ek-upsell p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ek-muted);
}
.ek-upsell-cta {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--ek-accent);
  color: #001418;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 700;
}
.ek-empty {
  text-align: center;
  padding: 28px 12px;
  font-size: 12.5px;
  color: var(--ek-muted);
}
.ek-preview-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 1px dashed rgba(0, 229, 255, 0.4);
  background: var(--ek-accent-soft);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.ek-preview-gate i {
  color: var(--ek-accent);
}
.ek-preview-gate:hover {
  border-style: solid;
}

/* ── Alças de redimensionar (8 bordas/cantos) ── */
.ek-rz {
  position: absolute;
  z-index: 3;
  touch-action: none;
}
.ek-rz-n,
.ek-rz-s {
  left: 14px;
  right: 14px;
  height: 8px;
  cursor: ns-resize;
}
.ek-rz-n {
  top: -3px;
}
.ek-rz-s {
  bottom: -3px;
}
.ek-rz-e,
.ek-rz-w {
  top: 14px;
  bottom: 14px;
  width: 8px;
  cursor: ew-resize;
}
.ek-rz-e {
  right: -3px;
}
.ek-rz-w {
  left: -3px;
}
.ek-rz-ne,
.ek-rz-nw,
.ek-rz-se,
.ek-rz-sw {
  width: 16px;
  height: 16px;
}
.ek-rz-ne {
  top: -3px;
  right: -3px;
  cursor: nesw-resize;
}
.ek-rz-sw {
  bottom: -3px;
  left: -3px;
  cursor: nesw-resize;
}
.ek-rz-nw {
  top: -3px;
  left: -3px;
  cursor: nwse-resize;
}
.ek-rz-se {
  bottom: -3px;
  right: -3px;
  cursor: nwse-resize;
}

/* ── Celular: folha fixa acima da pílula, sem arrastar/redimensionar ── */
@media (max-width: 640px) {
  #evil-karaoke-panel {
    left: 8px !important;
    right: 8px !important;
    top: auto !important;
    bottom: 112px !important;
    width: auto !important;
    height: min(70vh, calc(100vh - 140px)) !important;
    min-width: 0;
    border-radius: 20px;
  }
  .ek-hero {
    cursor: default;
  }
  .ek-rz,
  [data-ek-reset-geom] {
    display: none;
  }
  .ek-toolbar-right {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ek-line,
  .ek-icon-btn,
  .ek-mic,
  .ek-edit-btn {
    transition: none;
  }
}
