/* Web player do FICHER TV */
#player-app { min-height: 100vh; display: flex; flex-direction: column; }
#player-app[hidden] { display: none !important; }

.pbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px; background: rgba(7, 11, 16, .92); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.pbrand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); }
.pbrand .word { font-size: 20px; }
.ptabs { display: flex; gap: 4px; background: var(--surface); border-radius: 12px; padding: 4px; }
.ptabs button {
  border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600;
  padding: 8px 14px; border-radius: 9px; cursor: pointer; white-space: nowrap;
}
.ptabs button.on { background: var(--surface2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.psearch {
  flex: 1; min-width: 80px; max-width: 420px; margin: 0 0 0 auto; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--text); font: inherit; font-size: 14px;
}
.pboost, .pget {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px;
  padding: 9px 14px; font: inherit; font-size: 12px; font-weight: 900; letter-spacing: .5px; cursor: pointer; white-space: nowrap;
  text-decoration: none;
}
.pboost.on { background: linear-gradient(135deg, var(--a1), var(--a2)); color: #04120f; border-color: transparent; }
.pget { color: var(--a1); }

/* primeira visita */
.welcome { max-width: 980px; width: 100%; margin: 0 auto; padding: 26px 16px 40px; }
.hero { text-align: center; padding: 34px 22px; }
.hero img { width: 120px; height: 120px; }
.hero h1 { font-size: 30px; margin-top: 6px; }
.hero .sub { max-width: 560px; margin: 0 auto 18px; font-size: 15px; }
.hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hero-actions .btn { width: auto; margin: 0; padding: 14px 22px; }
.hero .aviso { max-width: 620px; margin: 22px auto 0; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 16px; }
.cols h2 { font-size: 18px; margin: 0 0 6px; }
.cols .btn { width: auto; display: inline-block; margin: 0 0 14px; text-decoration: none; }
.passos.small { font-size: 14px; color: #c3cdd5; }

/* biblioteca */
.pbody { flex: 1; display: grid; grid-template-columns: 250px 1fr; min-height: 0; }
.pbody[hidden] { display: none !important; }
.pside { border-right: 1px solid var(--line); padding: 14px 12px 30px; overflow-y: auto; max-height: calc(100vh - 62px); position: sticky; top: 62px; }
.pside-h { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin: 14px 6px 8px; }
.pside-h:first-child { margin-top: 2px; }
.srv {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 12px; background: var(--surface); margin-bottom: 6px;
}
.srv .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.srv .dot.on { background: var(--a1); }
.srv .dot.off { background: var(--danger); }
.srv .nm { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srv .st { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srv .txt { flex: 1; min-width: 0; }
.srv button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.srv button:hover { color: var(--danger); background: var(--surface2); }
.btn.small { padding: 10px 14px; font-size: 13px; border-radius: 11px; margin-top: 4px; }
.pcats button {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; text-align: left;
  border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; padding: 9px 10px; border-radius: 10px; cursor: pointer;
}
.pcats button span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcats button:hover { background: var(--surface); color: var(--text); }
.pcats button.on { background: var(--surface2); color: var(--text); font-weight: 700; box-shadow: inset 0 0 0 1px var(--line); }
.pcats small { color: var(--muted); font-size: 11px; flex: none; }

.pcontent { padding: 16px 18px 40px; min-width: 0; }
.notice { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: #2a1f12; color: #ffd08a; font-size: 13px; }
.pempty { color: var(--muted); font-size: 14px; padding: 30px 6px; }

/* modo compatível (espelho HTTP) */
.mirrortip { margin: 0; padding: 9px 18px; background: #2a1f12; color: #ffd08a; font-size: 13px; line-height: 1.45; }
.mirrortip a { color: #ffe3b5; font-weight: 700; white-space: nowrap; }
.impbar { margin: 14px 18px 0; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid rgba(63, 217, 168, .45); }
.impbar p { margin: 0 0 6px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.impbar .btn { width: auto; }
#p-http { margin: 0 0 4px; }

/* explicação do Boost */
.boostinfo { display: grid; gap: 14px; margin: 6px 0 18px; }
.boostinfo b { display: block; font-size: 14px; margin-bottom: 2px; color: var(--text); }
.boostinfo.on b { color: var(--a1); }
.boostinfo span { color: var(--muted); font-size: 14px; line-height: 1.5; }
#boost-info { z-index: 60; }
.stage-err .row { flex-wrap: wrap; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pgrid.posters { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
.pcard {
  position: relative; display: block; width: 100%; padding: 0; border: 2px solid transparent; border-radius: 14px; overflow: hidden;
  background: var(--surface); color: var(--text); cursor: pointer; aspect-ratio: 16 / 10; font: inherit; text-align: left;
  transition: transform .12s ease, border-color .12s ease;
}
.pgrid.posters .pcard { aspect-ratio: 2 / 3; }
.pcard:hover, .pcard:focus-visible { transform: scale(1.04); border-color: var(--text); outline: none; z-index: 2; }
.pcard img { position: absolute; inset: 12px 20px 30px; width: calc(100% - 40px); height: calc(100% - 42px); object-fit: contain; }
.pgrid.posters .pcard img { inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pcard .ini { position: absolute; inset: 0 0 24px; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 900; color: #2c3b48; letter-spacing: 1px; }
.pcard .nm {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 9px 7px; font-size: 12px; font-weight: 600; line-height: 1.25;
  background: linear-gradient(transparent, rgba(0, 0, 0, .92)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pgrid.posters .pcard .nm { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pcard .bdg { position: absolute; top: 6px; right: 6px; padding: 2px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; color: #04120f; background: linear-gradient(135deg, var(--a1), var(--a2)); }
.pcard .star { position: absolute; top: 6px; left: 8px; font-size: 12px; font-weight: 900; color: #ffc857; }
#more { width: auto; margin: 18px auto 0; display: block; }
#more[hidden] { display: none; }

/* modais */
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .7); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 14px; overflow-y: auto; }
.modal[hidden] { display: none !important; }
.modal-card { width: 100%; max-width: 460px; }
.modal-card.wide { max-width: 760px; }
.row { display: flex; gap: 10px; align-items: center; }
.row .btn { margin-top: 6px; }
.row.between { justify-content: space-between; }
.row.between h1 { margin: 0; }
.row.between .btn, .row.center .btn { width: auto; }
.row.center { justify-content: center; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 0; }
.chips:empty { display: none; }
.chip { border: 1px solid var(--line); background: var(--surface2); color: var(--muted); border-radius: 999px; padding: 7px 13px; font: inherit; font-size: 13px; cursor: pointer; }
.chip.on { color: var(--text); border-color: var(--a1); font-weight: 700; }
.eps { margin-top: 12px; display: grid; gap: 8px; max-height: 52vh; overflow-y: auto; }
.ep { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; border: 0; background: var(--bg); color: var(--text); border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.ep:hover { box-shadow: inset 0 0 0 1px var(--a1); }
.ep b { color: var(--a1); flex: none; }

/* player */
.stage { position: fixed; inset: 0; z-index: 60; background: #000; }
.stage[hidden] { display: none !important; }
.stage video { width: 100%; height: 100%; background: #000; }
.stage-top {
  position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px 30px; background: linear-gradient(rgba(0, 0, 0, .85), transparent); transition: opacity .25s ease;
}
.stage.idle .stage-top { opacity: 0; pointer-events: none; }
.stage.idle { cursor: none; }
.stage-info { flex: 1; min-width: 160px; }
.st-title { font-size: 19px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-src { font-size: 13px; color: var(--a1); }
.stage-top .chips { margin: 0; }
.stage-top .btn { width: auto; margin: 0; }
.stage-err { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, 90vw); text-align: center; background: rgba(15, 22, 29, .96); border: 1px solid var(--line); border-radius: 20px; padding: 24px; }
.stage-err[hidden] { display: none; }
.stage-err p { margin: 0 0 14px; font-size: 15px; line-height: 1.5; }

@media (max-width: 820px) {
  .pbar { flex-wrap: wrap; gap: 8px 10px; padding: 8px 12px; }
  .pbrand .word { font-size: 17px; }
  .psearch { order: 5; flex-basis: 100%; max-width: none; margin: 0; }
  .ptabs { order: 4; flex: 1; }
  .ptabs button { flex: 1; padding: 8px 6px; }
  .pboost { margin-left: auto; }
  .pbody { grid-template-columns: 1fr; }
  .pside { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
  .pcats { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
  .pcats button { width: auto; flex: none; background: var(--surface); border-radius: 999px; padding: 8px 13px; }
  .pcats small { display: none; }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
  .pgrid.posters { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .pcontent { padding: 12px 12px 34px; }
}
