:root {
  --fundo: #170A26;
  --superficie: #251238;
  --superficie-2: #321A4A;
  --roxo: #9B3CE8;
  --roxo-escuro: #6E22B0;
  --texto: #F6F0FD;
  --lilas: #BFA9DD;
  --pipoca: #FFC94A;
  --erro: #FF8A8A;
  --raio: 14px;
  --display: "Bebas Neue", "Arial Narrow", sans-serif;
  --corpo: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fundo);
  background-image: radial-gradient(ellipse 120% 60% at 50% -10%, #3B1660 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--texto);
  font: 400 16px/1.5 var(--corpo);
  min-height: 100vh;
}
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--pipoca); outline-offset: 2px; border-radius: 6px; }

/* ---------------------------------------------------------------- tipografia */
.titulo-cartaz {
  font: 400 clamp(2.6rem, 9vw, 3.6rem)/0.95 var(--display);
  letter-spacing: 0.01em;
  margin: 0 0 12px;
}
.titulo-secao { font: 400 2rem/1 var(--display); letter-spacing: 0.01em; margin: 0 0 16px; }
.lead { color: var(--lilas); margin: 0 0 28px; max-width: 34ch; }

/* ---------------------------------------------------------------- entrar */
.tela-entrar {
  max-width: 420px;
  margin: 0 auto;
  padding: max(48px, env(safe-area-inset-top)) 20px 48px;
}
/* O png e o icone do app (moldura cinza); mostra so o disco roxo. */
.logo-grande, .topo img { clip-path: circle(36% at 50% 50%); transform: scale(1.3); }
.logo-grande { margin: 8px 0 24px 10px; filter: drop-shadow(0 12px 30px rgba(155, 60, 232, .45)); }
.topo img { margin: 0 4px; }
.form { display: grid; gap: 16px; }
.campo { display: grid; gap: 6px; }
.campo span { font-weight: 600; font-size: .95rem; }
.campo input {
  height: 52px;
  padding: 0 16px;
  background: var(--superficie);
  border: 1.5px solid var(--superficie-2);
  border-radius: 12px;
  font-size: 1.05rem;
}
.campo input:focus { border-color: var(--roxo); outline: none; }
.dica { color: var(--lilas); font-size: .9rem; margin: -4px 0 0; }
.msg-erro { color: var(--erro); font-weight: 600; margin: 0; }

.btn {
  height: 54px;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  padding: 0 28px;
}
.btn-principal { background: var(--roxo); color: #fff; }
.btn-principal:hover { background: #A955F0; }
.btn-principal:disabled { background: var(--superficie-2); color: var(--lilas); cursor: default; }

/* ---------------------------------------------------------------- topo */
.topo {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  background: rgba(23, 10, 38, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--superficie-2);
}
.topo-nome { font: 400 1.6rem/1 var(--display); margin-right: auto; padding-top: 3px; }
.topo-btn {
  position: relative;
  display: grid; place-items: center;
  min-width: 44px; height: 44px;
  background: none; border: 0; border-radius: 12px; cursor: pointer;
  color: var(--texto);
}
.topo-btn.texto { color: var(--lilas); font-weight: 600; padding: 0 6px; }
.bolinha {
  position: absolute; top: 6px; right: 4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--pipoca); color: #2A1500;
  border-radius: 999px; font-size: .72rem; font-weight: 700; line-height: 18px;
}

/* ---------------------------------------------------------------- busca */
.conteudo { max-width: 980px; margin: 0 auto; padding: 28px 16px 64px; }
.abas { display: inline-flex; background: var(--superficie); border-radius: 999px; padding: 4px; margin: 6px 0 14px; }
.aba {
  border: 0; background: none; cursor: pointer;
  padding: 9px 22px; border-radius: 999px; font-weight: 600; color: var(--lilas);
}
.aba[aria-selected="true"] { background: var(--roxo); color: #fff; }
.busca-campo {
  display: flex; align-items: center; gap: 10px;
  height: 56px; padding: 0 18px;
  background: var(--superficie);
  border: 1.5px solid var(--superficie-2);
  border-radius: 16px;
  color: var(--lilas);
}
.busca-campo:focus-within { border-color: var(--roxo); }
.busca-campo input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none; font-size: 1.1rem; color: var(--texto); }
.busca-campo input::-webkit-search-cancel-button { filter: invert(1); }
.cota { color: var(--lilas); font-size: .92rem; margin: 10px 2px 0; }
.vazio { color: var(--lilas); margin: 8px 2px 0; }

/* grade de posteres */
.grade {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 18px 12px;
  margin: 22px 0 8px;
}
@media (min-width: 640px) { .grade { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
.cartaz { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.cartaz-img {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: var(--superficie);
}
.cartaz-img img { width: 100%; height: 100%; object-fit: cover; }
.cartaz-img .sem-capa { display: grid; place-items: center; height: 100%; padding: 8px; text-align: center; color: var(--lilas); font-size: .85rem; }
.cartaz-nome { margin: 7px 0 2px; font-weight: 600; font-size: .9rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cartaz-ano { color: var(--lilas); font-size: .8rem; }
.selo {
  position: absolute; left: 6px; bottom: 6px; right: 6px;
  padding: 4px 8px; border-radius: 8px;
  font-size: .72rem; font-weight: 700; line-height: 1.25;
  background: rgba(23, 10, 38, .86); color: var(--texto);
  backdrop-filter: blur(4px);
}
.selo.pronto { background: var(--pipoca); color: #2A1500; }
.selo.disponivel { background: var(--roxo); color: #fff; }

/* ---------------------------------------------------------------- ingressos (meus pedidos) */
.meus { margin-top: 44px; }
.ingressos { display: grid; gap: 14px; }
@media (min-width: 760px) { .ingressos { grid-template-columns: 1fr 1fr; } }
.ingresso {
  --picote: 14px;
  position: relative;
  display: grid;
  grid-template-columns: 74px 1fr auto;
  align-items: stretch;
  background: var(--superficie);
  border-radius: var(--raio);
  overflow: hidden;
  /* recortes do picote nas bordas, como canhoto de cinema */
  -webkit-mask: radial-gradient(circle var(--picote) at calc(100% - 92px) 0, transparent 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle var(--picote) at calc(100% - 92px) 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
          mask: radial-gradient(circle var(--picote) at calc(100% - 92px) 0, transparent 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle var(--picote) at calc(100% - 92px) 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
}
.ingresso-capa { width: 74px; height: 100%; min-height: 110px; object-fit: cover; background: var(--superficie-2); }
.ingresso-meio { padding: 14px 14px 14px 14px; min-width: 0; }
.ingresso-nome { margin: 0; font-weight: 700; line-height: 1.25; }
.ingresso-meta { margin: 2px 0 8px; color: var(--lilas); font-size: .85rem; }
.ingresso-status { margin: 0; font-size: .92rem; font-weight: 600; }
.ingresso-canhoto {
  width: 92px;
  display: grid; place-items: center;
  border-left: 2px dashed var(--fundo);
  padding: 10px 6px;
}
.carimbo {
  transform: rotate(-8deg);
  border: 2px solid currentColor;
  border-radius: 8px;
  padding: 4px 6px;
  font: 400 1.05rem/1 var(--display);
  letter-spacing: .02em;
  text-align: center;
  color: var(--lilas);
}
.ingresso.pronto .carimbo { color: var(--pipoca); }
.ingresso.pronto { box-shadow: inset 0 0 0 1.5px rgba(255, 201, 74, .55); }
.ingresso.disponivel .carimbo, .ingresso.baixando .carimbo { color: #D3A4FF; }
.ingresso.recusado { opacity: .6; }

/* ---------------------------------------------------------------- folha (detalhe / avisos) */
.folha { position: fixed; inset: 0; z-index: 20; display: grid; align-items: end; }
@media (min-width: 640px) { .folha { place-items: center; } }
.folha-fundo { position: absolute; inset: 0; background: rgba(8, 3, 14, .72); }
.folha-corpo {
  position: relative;
  width: 100%; max-width: 560px; max-height: 92vh; overflow: auto;
  background: var(--superficie);
  border-radius: 22px 22px 0 0;
  padding: 0 20px max(24px, env(safe-area-inset-bottom));
  animation: sobe .22s ease-out;
}
@media (min-width: 640px) { .folha-corpo { border-radius: 22px; } }
@keyframes sobe { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .folha-corpo { animation: none; } }
.folha-x {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 40px; height: 40px; border: 0; border-radius: 999px;
  background: rgba(23, 10, 38, .7); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer;
}
#painel-avisos .folha-corpo { padding-top: 22px; }
.d-capa { margin: 0 -20px; aspect-ratio: 16 / 8; background: var(--superficie-2); overflow: hidden; }
.d-capa img { width: 100%; height: 100%; object-fit: cover; }
.d-info { display: flex; gap: 14px; align-items: flex-end; margin-top: -48px; position: relative; }
.d-poster { width: 92px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 10px; box-shadow: 0 10px 24px rgba(0, 0, 0, .5); background: var(--superficie-2); }
#d-nome { font: 400 2rem/1 var(--display); margin: 0; }
.d-meta { color: var(--lilas); margin: 4px 0 0; font-size: .92rem; }
.d-sinopse { color: #E2D6F2; margin: 16px 0; max-width: 60ch; }
.d-status { font-weight: 600; margin: 0 0 14px; }
.d-status.pronto { color: var(--pipoca); }
#d-pedir { width: 100%; }

.avisos { display: grid; gap: 10px; }
.aviso { display: grid; grid-template-columns: 46px 1fr; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; background: var(--superficie-2); }
.aviso img { width: 46px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; }
.aviso p { margin: 0; }
.aviso small { color: var(--lilas); }
.aviso.novo { box-shadow: inset 3px 0 0 var(--pipoca); }

.toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 30;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  background: var(--pipoca); color: #2A1500;
  padding: 12px 18px; border-radius: 12px; font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}
