/* Rei Cabeça de Abóbora — CSS escrito à mão, mobile-first.
   Replica os estilos do site Next.js/Tailwind (src/lib/ui.ts e componentes). */
:root {
  --background: #fff8e8;
  --background-soft: #ffe8bf;
  --foreground: #2f1d12;
  --card: #fff2d5;
  --card-border: #e2c596;
  --accent: #d46f1f;
  --accent-deep: #9c3f12;
  --highlight: #f4c34e;
  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-200: #fde68a;
  --max: 72rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { background-color: var(--background-soft); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--foreground);
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 196, 82, .5), transparent 40%),
    radial-gradient(circle at 85% 5%, rgba(212, 111, 31, .25), transparent 35%),
    linear-gradient(160deg, var(--background), var(--background-soft));
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  overflow-x: hidden;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul { padding: 0; list-style: none; }
h1, h2, h3 { letter-spacing: -0.02em; font-size: inherit; overflow-wrap: anywhere; }
p { overflow-wrap: anywhere; }
a { color: inherit; }
img, iframe { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

.mono { font-family: "Space Mono", ui-monospace, monospace; font-size: .75rem; line-height: 1rem; }
.mudo { color: var(--accent-deep); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.texto-usuario { white-space: pre-wrap; overflow-wrap: anywhere; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sub { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 2px; }

/* ---------- Tipografia ---------- */
h1 { font-size: 1.875rem; line-height: 2.25rem; font-weight: 700; color: var(--foreground); }
h1 + .subtitulo { margin-top: .5rem; }
.subtitulo { color: var(--accent-deep); }
.titulo-secao { font-size: 1.25rem; line-height: 1.75rem; font-weight: 700; color: var(--foreground); }
.titulo-coment { font-size: 1rem; font-weight: 700; color: var(--accent-deep); }
.titulo-card { font-size: 1rem; font-weight: 600; color: var(--foreground); margin-top: .5rem; }
.titulo-card-lg { font-size: 1.125rem; line-height: 1.75rem; }
.desc { font-size: .875rem; line-height: 1.25rem; color: var(--accent-deep); margin-top: .25rem; }
.mini { font-size: .75rem; line-height: 1rem; color: var(--accent-deep); margin-top: .75rem; }
.trilha { font-size: .875rem; line-height: 1.25rem; color: var(--accent-deep); }
.trilha a { text-decoration: underline; }
.rotulo-detalhe { font-family: "Space Mono", ui-monospace, monospace; font-size: .75rem; line-height: 1rem; text-transform: uppercase; letter-spacing: .18em; color: var(--accent-deep); }
.texto { font-size: 15px; line-height: 1.75rem; }

/* ---------- Layout ---------- */
.container {
  width: 100%; max-width: var(--max); margin: 0 auto; flex: 1;
  display: flex; flex-direction: column; gap: 2rem;
  padding: 2rem 1.25rem;
}
.coluna-estreita, .coluna-media, .coluna-form {
  width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 2rem;
}
.coluna-estreita { max-width: 48rem; }
.coluna-media { max-width: 56rem; }
.coluna-form { max-width: 36rem; gap: 1.5rem; padding: 1.25rem 0; }
.centro { max-width: 36rem; margin: 0 auto; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1.5rem; padding: 1.25rem 0; }
.emoji-grande { font-size: 3.75rem; line-height: 1; }

.secao { display: flex; flex-direction: column; gap: 1rem; }
.secao-cab { display: flex; justify-content: space-between; align-items: flex-end; gap: .75rem; }
.secao-cab a { font-size: .875rem; font-weight: 600; color: var(--accent-deep); text-decoration: underline; }

.grade { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); }
.pilha { display: flex; flex-direction: column; gap: .75rem; }
.duas-colunas { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); }
.col-3 { display: flex; flex-direction: column; gap: .75rem; }
.col-4 { display: flex; flex-direction: column; gap: 1rem; }

/* ---------- Cabeçalho ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--foreground); color: var(--amber-50);
  border-bottom: 1px solid rgba(0, 0, 0, .3);
  box-shadow: 0 4px 16px -8px rgba(0, 0, 0, .6);
}
.header-inner { position: relative; max-width: var(--max); margin: 0 auto; padding: .75rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.logo { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; font-weight: 700; color: var(--highlight); text-decoration: none; }
.nav-desktop, .header-actions { display: none; }
.nav-desktop a { white-space: nowrap; border-radius: 999px; padding: .375rem .75rem; font-size: .875rem; line-height: 1.25rem; font-weight: 500; color: var(--amber-100); text-decoration: none; transition: background-color .15s, color .15s; }
.nav-desktop a:hover { background: rgba(255, 255, 255, .15); color: #fff; }
.ola { max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .875rem; color: var(--amber-200); }

.menu-toggle { display: flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; flex: none; border-radius: 999px; border: 1px solid rgba(253, 230, 138, .6); background: none; color: var(--amber-100); font-size: 1.25rem; line-height: 1; cursor: pointer; transition: background-color .15s; }
.menu-toggle:hover { background: rgba(255, 255, 255, .15); }
.menu-mobile { position: absolute; top: 100%; left: 0; right: 0; background: var(--foreground); border-bottom: 1px solid rgba(0, 0, 0, .3); box-shadow: 0 12px 24px -12px rgba(0, 0, 0, .7); padding: .5rem 1.25rem 1.25rem; }
.menu-mobile[hidden] { display: none; }
.menu-mobile nav { display: flex; flex-direction: column; }
.menu-mobile nav a { border-radius: .75rem; padding: .75rem; font-weight: 500; color: var(--amber-100); text-decoration: none; transition: background-color .15s; }
.menu-mobile nav a:hover { background: rgba(255, 255, 255, .15); }
.menu-mobile-conta { display: flex; flex-direction: column; gap: .5rem; margin-top: .75rem; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, .15); }
.menu-mobile-conta .ola { max-width: none; padding: 0 .25rem; }
.menu-mobile-conta form, .header-actions form { margin: 0; }

/* ---------- Rodapé ---------- */
.site-footer { margin-top: .5rem; border-top: 1px solid var(--card-border); background: rgba(255, 242, 213, .6); }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 1.5rem 1.25rem; display: flex; flex-direction: column; gap: .75rem; font-size: .875rem; line-height: 1.25rem; color: var(--accent-deep); }
.footer-links { display: flex; gap: 1rem; }
.footer-links a { text-decoration: underline; }

/* ---------- Componentes ---------- */
.card { display: block; border: 1px solid var(--card-border); background: var(--card); border-radius: 1.5rem; padding: 1.25rem; min-width: 0; }
.card-link { color: inherit; text-decoration: none; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.card-link:hover { transform: translateY(-2px); box-shadow: 0 18px 30px -22px rgba(89, 43, 18, .8); }
.card.card-sem-padding { padding: 0; }
.card.card-compacto { padding: 1rem; }
.card.card-p5 { padding: 1.25rem; }
.card-corpo { padding: 1.25rem; }
.card.card-flex, .card.col-3, .card.col-4 { display: flex; flex-direction: column; }
.card.card-flex, .card.col-3 { gap: .75rem; }
.card.col-4 { gap: 1rem; }
.card.form { display: flex; }

.btn { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 999px; padding: .5rem 1.25rem; font-size: .875rem; line-height: 1.25rem; font-weight: 600; text-decoration: none; cursor: pointer; transition: background-color .15s, color .15s; }
.btn-bloco { width: 100%; }
.btn-primario { background: var(--accent); color: var(--amber-50); }
.btn-primario:hover { background: var(--accent-deep); }
.btn-contorno { border-color: var(--accent-deep); color: var(--accent-deep); background: transparent; }
.btn-contorno:hover { background: var(--accent-deep); color: var(--amber-50); }
.btn-claro { border-color: rgba(253, 230, 138, .7); color: var(--amber-100); background: transparent; }
.btn-claro:hover { background: var(--amber-100); color: var(--foreground); }
.btn-claro:focus-visible { outline-color: var(--amber-200); }

.campo { display: block; width: 100%; border: 1px solid var(--card-border); background: var(--amber-50); border-radius: .75rem; padding: .625rem; font-size: .875rem; line-height: 1.25rem; color: var(--foreground); outline: none; }
.campo:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(212, 111, 31, .3); }
textarea.campo { resize: vertical; }
.form { display: flex; flex-direction: column; gap: .75rem; }
.form label { font-size: .875rem; line-height: 1.25rem; font-weight: 500; color: var(--accent-deep); margin-bottom: -.5rem; }
.form .btn { align-self: flex-start; }
.form .btn-bloco { align-self: stretch; }
.form p { font-size: .875rem; color: var(--accent-deep); }
.form p a, .card p a { font-weight: 600; text-decoration: underline; }

.selo { display: inline-block; width: fit-content; border-radius: 999px; background: rgba(244, 195, 78, .6); padding: .125rem .75rem; font-size: .75rem; line-height: 1rem; font-weight: 600; color: var(--accent-deep); }

.msg { border-radius: .75rem; padding: .5rem .75rem; font-size: .875rem; line-height: 1.25rem; }
.msg-erro { background: #fee2e2; color: #991b1b; }
.msg-ok { background: #dcfce7; color: #166534; }
.vazio { border: 1px dashed var(--card-border); background: var(--amber-50); color: var(--accent-deep); border-radius: 1rem; padding: 1.25rem; font-size: .875rem; line-height: 1.25rem; }
.vazio a { font-weight: 600; text-decoration: underline; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 1.5rem; box-shadow: 0 20px 40px -30px rgba(89, 43, 18, .7); }
.hero-corpo { position: relative; }
.hero h1 { margin-top: .5rem; }
.hero-texto { margin-top: .75rem; max-width: 42rem; font-size: 15px; color: var(--accent-deep); }
.brilho { position: absolute; border-radius: 50%; filter: blur(40px); pointer-events: none; }
.brilho-amarelo { width: 10rem; height: 10rem; right: -2.5rem; top: -2.5rem; background: rgba(244, 195, 78, .55); }
.brilho-laranja { width: 8rem; height: 8rem; left: -3rem; bottom: 0; background: rgba(212, 111, 31, .35); }
.acoes { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.acoes form { margin: 0; }

/* Vídeos e capas */
.thumb { position: relative; aspect-ratio: 16 / 9; background: var(--background-soft); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-vazia { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2.25rem; }
.thumb-tag { position: absolute; right: .5rem; bottom: .5rem; border-radius: 999px; background: rgba(0, 0, 0, .7); color: #fff; font-size: .75rem; line-height: 1rem; padding: .125rem .5rem; }
.thumb-grande { border: 1px solid var(--card-border); border-radius: 1.5rem; }
.video-card-corpo { padding: 1rem; }
.video-card-corpo .titulo-card { margin-top: 0; }
.video-card:hover .titulo-card { color: var(--accent-deep); }
.video-card-corpo .serie { margin-top: .25rem; font-size: .75rem; line-height: 1rem; color: var(--accent-deep); }
.player { aspect-ratio: 16 / 9; overflow: hidden; border-radius: 1.5rem; border: 1px solid var(--card-border); background: #000; }
.player iframe { width: 100%; height: 100%; border: 0; }
.data-pub { font-size: .875rem; line-height: 1.25rem; color: var(--accent-deep); }
.historia-resumo { margin-top: .5rem; font-size: 15px; line-height: 1.75rem; }
.ler { margin-top: .75rem; font-size: .875rem; font-weight: 600; color: var(--accent-deep); }
.historia-texto { font-size: 1rem; line-height: 2rem; }

/* Comentários */
.comentarios { display: flex; flex-direction: column; gap: .75rem; }
.lista-comentarios { display: flex; flex-direction: column; gap: .5rem; }
.lista-comentarios > li { border-radius: .75rem; background: rgba(255, 255, 255, .7); padding: .75rem; }
.comentario-cab { font-size: .75rem; line-height: 1rem; font-weight: 600; color: var(--accent-deep); }
.comentario-cab .quando { font-weight: 400; opacity: .7; }
.lista-comentarios .texto-usuario { margin-top: .25rem; font-size: .875rem; line-height: 1.25rem; }
.form-comentario { display: flex; flex-direction: column; gap: .5rem; }
.form-comentario .btn { align-self: flex-start; }

/* Novidades */
.novidade-cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.novidade-autor { font-size: .875rem; line-height: 1.25rem; font-weight: 600; color: var(--accent-deep); }

/* Admin */
.admin-cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.contadores { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.contador { text-align: center; }
.contador-n { display: block; font-size: 1.5rem; line-height: 2rem; font-weight: 700; }
.contador .mono { font-family: inherit; font-size: .75rem; color: var(--accent-deep); }
.pendente { border-radius: 1rem; background: var(--amber-50); padding: 1rem; }
.pendente p { font-size: .75rem; line-height: 1rem; color: var(--accent-deep); }
.pendente .texto-usuario { margin-top: .5rem; font-size: .875rem; line-height: 1.25rem; color: var(--foreground); }
.pendente .acoes { margin-top: .75rem; gap: .5rem; }
.email-local { border: 1px solid var(--card-border); background: var(--card); border-radius: 1rem; padding: 1rem; font-size: .875rem; }

/* Utilitários */
.texto-sm { font-size: .875rem; line-height: 1.25rem; margin-top: .25rem; }
.texto-largo { max-width: 48rem; }
.forte { font-weight: 600; }
.mini-r { display: block; font-size: .75rem; line-height: 1rem; color: var(--accent-deep); }
.sem-largura { display: flex; flex-direction: column; gap: 2rem; }
.btn-fit { align-self: flex-start; width: fit-content; }
.desc-vazio { font-size: .875rem; line-height: 1.25rem; color: rgba(156, 63, 18, .8); }
.card-flex.mudo { font-size: .875rem; line-height: 1.25rem; }

/* Abas do painel do dono */
.abas { display: flex; flex-direction: column; gap: 1rem; }
.abas-lista { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: thin; }
.aba { flex: none; border: 1px solid var(--card-border); background: var(--amber-50); color: var(--accent-deep); border-radius: 999px; padding: .5rem 1.25rem; font-size: .875rem; line-height: 1.25rem; font-weight: 600; cursor: pointer; transition: background-color .15s, color .15s; }
.aba:hover { background: var(--card); }
.aba[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--amber-50); }
.painel[hidden] { display: none; }

/* ---------- Barra de rolagem customizada ---------- */
/* Chrome, Edge, Safari: trilho cor do fundo, "polegar" laranja arredondado. */
::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track { background: var(--background-soft); }
::-webkit-scrollbar-thumb {
  background-color: var(--accent);
  border: 3px solid var(--background-soft);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--accent-deep); }
::-webkit-scrollbar-thumb:active { background-color: var(--foreground); }
::-webkit-scrollbar-corner { background: var(--background-soft); }
/* Firefox (e navegadores sem ::-webkit-scrollbar): propriedades padrão. */
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: var(--accent) var(--background-soft); }
}
/* Rolagens internas (abas, textarea) ficam mais finas. */
.abas-lista::-webkit-scrollbar, textarea::-webkit-scrollbar { width: 10px; height: 10px; }
.abas-lista::-webkit-scrollbar-track, textarea::-webkit-scrollbar-track { background: transparent; }
.abas-lista::-webkit-scrollbar-thumb, textarea::-webkit-scrollbar-thumb { border-width: 2px; border-color: transparent; background-clip: padding-box; }

/* ---------- Telas maiores ---------- */
@media (min-width: 640px) {
  h1 { font-size: 2.25rem; line-height: 2.5rem; }
  .container { padding-left: 2rem; padding-right: 2rem; }
  .header-inner { padding-left: 2rem; padding-right: 2rem; }
  .footer-inner { padding-left: 2rem; padding-right: 2rem; flex-direction: row; align-items: center; justify-content: space-between; }
  .logo { font-size: 1.125rem; line-height: 1.75rem; }
  .card { padding: 1.5rem; }
  .hero { padding: 2.5rem; }
  .hero-texto { font-size: 1rem; }
  .g-sm2-lg3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contadores { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .coluna-form { padding: 2.5rem 0; }
}
@media (min-width: 768px) {
  .g-md2-lg3, .g-md2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-md3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .container { padding-top: 3rem; padding-bottom: 3rem; }
  .g-sm2-lg3, .g-md2-lg3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .duas-colunas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-desktop { display: flex; gap: .25rem; }
  .header-actions { display: flex; align-items: center; gap: .5rem; }
  .menu-toggle, .menu-mobile { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .card-link:hover { transform: none; }
}
