/* Emoji Prime Player (tools/emoji-prime). The player itself is fz-player.css. */
.ep, .ep-dlg { --ep-accent: var(--fz-accent, #d9661a); --ep-fill: var(--fz-accent-fill, #c3540a); --ep-line: var(--fz-line, rgba(127,127,127,0.3));
  --ep-muted: var(--fz-muted, #9a9a9a); --ep-surface: var(--fz-surface, #1a1a1a); }
.ep { margin-top: 20px; }
.ep [hidden], .ep-dlg[hidden], .ep-dlg [hidden] { display: none !important; }

/* source bar */
.ep-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ep-btn {
  height: 36px; padding: 0 16px; border-radius: 18px; border: 1px solid transparent; background: var(--ep-fill); color: #fff;
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.ep-btn:hover { filter: brightness(1.1); }
.ep-btn:disabled { opacity: 0.45; cursor: default; filter: none; }
.ep-btn-ghost { background: transparent; color: var(--text-color); border-color: var(--ep-line); }
.ep-btn-ghost:hover { border-color: var(--ep-accent); filter: none; }
.ep-folder { color: var(--ep-muted); font-size: 0.9rem; }
.ep-search {
  margin-left: auto; height: 36px; min-width: 0; width: 240px; max-width: 100%; padding: 0 14px; border-radius: 18px;
  border: 1px solid var(--ep-line); background: var(--ep-surface); color: var(--text-color); font: inherit;
}
.ep-bar-min .ep-search { display: none; }
.ep-msg { min-height: 1.2em; margin: 8px 0; color: var(--ep-muted); font-size: 0.9rem; }
.ep-msg.ep-bad { color: var(--fz-bad, #e2564a); }

/* library */
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px 16px; margin-top: 8px; }
.ep-card, .ep-sitem { display: block; color: var(--text-color); text-decoration: none; }
.ep-card:visited, .ep-sitem:visited { color: var(--text-color); }
.ep-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #222; }
.ep-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; max-width: none; }
.ep-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 34px; }
.ep-badge { position: absolute; right: 6px; bottom: 6px; padding: 1px 5px; border-radius: 4px; background: rgba(0,0,0,0.8); color: #fff; font-size: 12px; }
.ep-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,0.3); }
.ep-prog span { display: block; height: 100%; background: #f00; }
.ep-ct { display: block; }
.ep-ctitle { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 10px; font-weight: 600; line-height: 1.35; }
.ep-csub { display: block; margin-top: 3px; color: var(--ep-muted); font-size: 0.85rem; }
.ep-card:hover .ep-ctitle { color: var(--ep-accent); }
.ep-empty { color: var(--ep-muted); }

/* watching */
.ep-back { margin: 0 0 10px; padding: 0; border: 0; background: none; color: var(--ep-accent); font: inherit; cursor: pointer; }
.ep-under { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 12px; }
.ep-title { margin: 0 0 6px; font-size: 1.2rem; line-height: 1.4; text-align: left; word-break: break-word; }
.ep-meta { margin: 0 0 8px; color: var(--ep-muted); font-size: 0.9rem; }
.ep-chip { display: inline-block; padding: 2px 10px; border-radius: 12px; background: var(--ep-surface); border: 1px solid var(--ep-line); color: var(--text-color); }
.ep-track { margin: 6px 0; font-size: 0.9rem; color: var(--ep-muted); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.ep-track-on { color: var(--text-color); cursor: pointer; }
.ep-track-note { flex-basis: 100%; color: var(--text-color); }
.ep-keys { margin-top: 10px; font-size: 0.9rem; }
.ep-keys summary { cursor: pointer; color: var(--ep-muted); }
.ep-keylist { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 10px 0 0; }
.ep-keylist dt, .ep-keylist dd { margin: 0; }
.ep-keylist kbd { font-size: 0.8rem; white-space: nowrap; }
.ep-side-h { margin: 0 0 10px; font-size: 1rem; text-align: left; }
.ep-sitem { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; margin-bottom: 10px; border-radius: 8px; }
.ep-sitem .ep-ctitle { margin-top: 0; font-size: 0.92rem; }
.ep-sitem:hover .ep-ctitle { color: var(--ep-accent); }

.ep-stage .fzp { max-height: calc(100vh - 130px); }   /* like YouTube: the whole player fits the window */
/* theater: the player takes the window's width (standard layout), or the whole main column (wide) */
.ep-theater .ep-stage { width: 100vw; margin-left: calc(50% - 50vw); }
.ep-theater .ep-stage .fzp { border-radius: 0; aspect-ratio: auto; height: min(calc(100vh - 160px), 56.25vw); }
.layout-wide .ep-theater .ep-stage, .ep-theater.layout-wide .ep-stage { width: auto; margin-left: 0; }
@media (min-width: 1100px) {
  html:not(.layout-wide) body:not(.ep-theater) .ep-watch { width: min(1280px, calc(100vw - 48px)); margin-left: 50%; transform: translateX(-50%); }
  .ep-under { grid-template-columns: minmax(0, 1fr) 360px; }
}
.layout-wide .ep-under { grid-template-columns: minmax(0, 1fr) 380px; }

/* the add-a-video dialog */
.ep-dlg { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.ep-dlg-card { width: min(560px, 100%); background: var(--bg-color, #111); color: var(--text-color); border: 1px solid var(--ep-line); border-radius: 12px; padding: 8px 20px 20px; }
.ep-dlg-card.ep-over { outline: 2px dashed var(--ep-accent); outline-offset: -6px; }
.ep-dlg-head { display: flex; align-items: center; justify-content: space-between; }
.ep-dlg-head h2 { margin: 10px 0; font-size: 1.1rem; }
.ep-x { border: 0; background: none; color: inherit; font-size: 18px; cursor: pointer; }
.ep-dlg-hint { margin: 0 0 14px; color: var(--ep-muted); font-size: 0.9rem; }
.ep-row {
  display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-bottom: 8px; padding: 10px 12px;
  border: 1px solid var(--ep-line); border-radius: 10px; cursor: pointer;
}
.ep-row:hover { border-color: var(--ep-accent); }
.ep-k { font-weight: 600; }
.ep-k small { display: block; color: var(--ep-muted); font-weight: 400; }
.ep-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ep-muted); font-size: 0.9rem; }
.ep-name.ep-chosen { color: var(--ep-accent); }
.ep-pick { font-size: 0.85rem; font-weight: 600; }
.ep-dlg-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
@media (max-width: 560px) {
  .ep-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ep-name { grid-column: 1 / -1; grid-row: 2; }
  .ep-search { margin-left: 0; width: 100%; }
}

/* the pictures (same look as the YouTube extension) */
.ep-sticker {
  position: absolute; --o: 3px;
  filter: drop-shadow(var(--o) 0 0 #fff) drop-shadow(calc(-1 * var(--o)) 0 0 #fff)
    drop-shadow(0 var(--o) 0 #fff) drop-shadow(0 calc(-1 * var(--o)) 0 #fff) drop-shadow(2px 4px 4px rgba(0,0,0,0.45));
  animation: ep-pop 0.12s ease-out; white-space: nowrap; line-height: 1;
  font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", sans-serif; will-change: transform;
}
.ep-img { display: block; width: auto; height: auto; object-fit: contain; }
.ep-rebus .ep-chunk { display: inline-block; margin: 0 0.04em; }
.ep-rebus .ep-chunk.ep-hidden { visibility: hidden; }
@keyframes ep-pop { from { opacity: 0; } to { opacity: 1; } }
