:root {
  --bg: #0d0f14;
  --bg-elev: #161a23;
  --bg-elev-2: #1e232f;
  --text: #eef1f6;
  --text-dim: #9aa4b2;
  --accent: #ff2d55;
  --accent-2: #7c5cff;
  --border: #262c3a;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

/* Garante que o atributo hidden sempre vença regras de display (modal, hero etc.) */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap {
  width: min(1200px, 92vw);
  margin: 0 auto;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(13, 15, 20, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  white-space: nowrap;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 14px;
}
.search { flex: 1; }
.search input {
  width: 100%;
  padding: 11px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.search input:focus { border-color: var(--accent-2); }
.member-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
}
.member-badge .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #35d07f;
  box-shadow: 0 0 8px #35d07f;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid var(--border);
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: saturate(1.1);
  transform: scale(1.02);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--bg) 6%, rgba(13,15,20,0.35) 60%, rgba(13,15,20,0.75) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 40px 0 44px;
  max-width: 640px;
}
.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
}
.hero h1 {
  font-size: clamp(28px, 4vw, 46px);
  margin: 10px 0 12px;
  line-height: 1.05;
}
.hero-desc {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.55;
  margin: 0 0 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.hero-meta { color: var(--text-dim); font-size: 13px; }

/* ---------- Botões ---------- */
.btn {
  border: 0;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 10px;
  transition: transform .08s ease, opacity .2s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: #fff;
  color: #111;
}
.btn-primary:hover { opacity: .9; }

/* ---------- Filtros ---------- */
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 24px 0 4px;
}
.chip {
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-dim);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s ease;
}
.chip:hover { color: var(--text); border-color: var(--accent-2); }
.chip.active {
  background: var(--text);
  color: #111;
  border-color: var(--text);
  font-weight: 600;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb { padding: 22px 0 0; }
.link-btn {
  background: none;
  border: 0;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  padding: 6px 0;
}
.link-btn:hover { color: var(--text); }

/* ---------- Lista ---------- */
.list-desc {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.55;
  margin: -6px 0 8px;
  max-width: 720px;
}
.list-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 26px 0 16px;
}
.list-header h2 { margin: 0; font-size: 22px; }
.list-count { color: var(--text-dim); font-size: 14px; }
.status-msg {
  padding: 40px;
  text-align: center;
  color: var(--text-dim);
  background: var(--bg-elev);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

/* ---------- Grade ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  padding-bottom: 60px;
}
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-2);
}
.card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-elev-2) center / cover no-repeat;
}
.card-thumb .play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  background: rgba(0,0,0,0.35);
  transition: opacity .16s ease;
}
.card:hover .play-overlay { opacity: 1; }
.play-overlay span {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  color: #111;
  display: grid; place-items: center;
  font-size: 20px;
  padding-left: 3px;
}
.card-duration {
  position: absolute;
  bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.8);
  color: #fff;
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 6px;
}
.card-body { padding: 12px 14px 16px; }
.card-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  color: var(--text-dim);
  font-size: 12.5px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.card-cat {
  color: var(--accent-2);
  font-weight: 600;
}
.card-desc {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.45;
  margin: 6px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Badge de contagem em cima da capa da obra */
.card-count {
  position: absolute;
  top: 8px; left: 8px;
  background: rgba(124, 92, 255, 0.92);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
}

/* skeleton loading */
.skeleton { pointer-events: none; }
.skeleton .card-thumb,
.skeleton .card-title,
.skeleton .card-meta {
  background: linear-gradient(90deg, #1a1f2b 25%, #232a39 37%, #1a1f2b 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s infinite;
  color: transparent;
  border-radius: 6px;
}
.skeleton .card-title { height: 14px; margin-bottom: 10px; }
.skeleton .card-meta { height: 12px; width: 60%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------- Modal / player ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(4px);
}
.modal-dialog {
  position: relative;
  z-index: 2;
  width: min(960px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 3;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}
.player-wrap { background: #000; }
.player { width: 100%; display: block; aspect-ratio: 16 / 9; background: #000; border: 0; }
.player-info { padding: 20px 24px 26px; }
.player-info h3 { margin: 0 0 8px; font-size: 22px; }
.player-meta { color: var(--text-dim); font-size: 13px; margin-bottom: 14px; }
.player-desc { color: #cdd3dd; line-height: 1.6; font-size: 15px; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.tag {
  font-size: 12px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
}
.related { margin-top: 26px; border-top: 1px solid var(--border); padding-top: 18px; }
.related h4 { margin: 0 0 12px; font-size: 15px; }
.related-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.related-item { cursor: pointer; }
.related-item .rt {
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: var(--bg-elev-2) center / cover no-repeat;
  margin-bottom: 6px;
}
.related-item span {
  font-size: 12.5px;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.related-item:hover span { color: var(--text); }

/* ---------- User box (header) ---------- */
.user-box { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.user-email { color: var(--text-dim); font-size: 13px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Auth gate ---------- */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(1200px 600px at 50% -10%, #1a1030 0%, var(--bg) 60%);
}
.auth-card {
  width: min(400px, 100%);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 26px 30px;
}
.auth-brand { justify-content: center; font-size: 18px; margin-bottom: 22px; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.auth-tab {
  flex: 1;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
}
.auth-tab.active { background: var(--text); color: #111; border-color: var(--text); font-weight: 600; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form input {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.auth-form input:focus { border-color: var(--accent-2); }
.auth-submit { width: 100%; margin-top: 4px; }
.auth-hint { color: var(--text-dim); font-size: 12.5px; text-align: center; margin: 4px 0 0; }
.auth-msg {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  background: rgba(255,45,85,0.12);
  border: 1px solid rgba(255,45,85,0.4);
  color: #ffb3c1;
}
.pending-box { text-align: center; }
.pending-box h3 { margin: 0 0 10px; }
.pending-box p { color: var(--text-dim); line-height: 1.55; font-size: 14px; margin: 0 0 18px; }

/* ---------- Admin ---------- */
.admin-dialog { padding: 24px 26px 28px; }
.admin-dialog h3 { margin: 0 0 6px; }
.admin-sub { color: var(--text-dim); font-size: 13px; margin: 0 0 18px; }
.admin-actions { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.sync-msg { font-size: 12.5px; color: var(--text-dim); }
.allow-approve { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 5px; cursor: pointer; }
.inlist { font-size: 11px; padding: 1px 6px; border-radius: 999px; margin-left: 4px; }
.inlist.yes { background: #10391f; color: #6bffa0; }
.inlist.no { background: #3a1414; color: #ff8f8f; }

/* Report */
.report-dialog { padding: 24px 26px 28px; }
.report-dialog h3 { margin: 0 0 6px; }
.auth-form textarea {
  padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-elev-2); color: var(--text); font-size: 14px; resize: vertical;
  font-family: inherit; outline: none;
}
.auth-form textarea:focus { border-color: var(--accent-2); }
.rep-msg { font-size: 14px; margin: 4px 0; white-space: pre-wrap; }
.rep-when { color: var(--text-dim); font-size: 12px; font-weight: 400; }
.admin-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.admin-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elev-2);
}
.admin-row .who { flex: 1; min-width: 0; }
.admin-row .who .em { font-size: 14px; }
.admin-row .who .nt { font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-row .st {
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px;
}
.st.pending { background: #4a3b00; color: #ffd66b; }
.st.active { background: #10391f; color: #6bffa0; }
.st.blocked { background: #3a1414; color: #ff8f8f; }
.admin-row button { font-size: 12px; padding: 6px 10px; }

@media (max-width: 640px) {
  .user-email { display: none; }
  .hero { min-height: 340px; }
}
