/* ============================================================
   PAPO POP! Cinema — tema moderno, leve e responsivo
   ============================================================ */

/* ----- Tokens de tema (escuro = padrão) ----- */
:root,
[data-theme="dark"] {
  --bg:           #0e0f13;
  --bg-grad:      radial-gradient(1200px 600px at 50% -10%, #1b1f2b 0%, #0e0f13 60%);
  --surface:      #181a20;
  --surface-2:    #20232c;
  --text:         #eceef2;
  --muted:        #9aa1ad;
  --border:       #2a2e38;
  --accent:       #f5b301;
  --accent-2:     #ffcf45;
  --accent-ink:   #1a1400;
  --shadow:       0 10px 30px rgba(0, 0, 0, .45);
  --shadow-sm:    0 2px 10px rgba(0, 0, 0, .35);
}

[data-theme="light"] {
  --bg:           #f5f6f8;
  --bg-grad:      radial-gradient(1200px 600px at 50% -10%, #ffffff 0%, #eef1f5 60%);
  --surface:      #ffffff;
  --surface-2:    #f0f2f6;
  --text:         #1a1d24;
  --muted:        #5b6470;
  --border:       #e3e6ec;
  --accent:       #e0a200;
  --accent-2:     #f5b301;
  --accent-ink:   #1a1400;
  --shadow:       0 10px 30px rgba(20, 30, 60, .12);
  --shadow-sm:    0 2px 10px rgba(20, 30, 60, .08);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg-grad), var(--bg);
  background-attachment: fixed;
  transition: background-color .25s ease, color .25s ease;
}

/* ----- Cabeçalho ----- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--border);
}
.topbar__inner {
  max-width: 720px;
  margin: 0 auto;
  padding: .7rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-weight: 800;
  letter-spacing: .5px;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--accent); }
.brand__pack { color: var(--accent); }
.topbar__right { display: inline-flex; align-items: center; gap: .5rem; }
.lang-switch {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
}
.lang-switch button {
  border: 0; background: transparent; color: var(--muted);
  font: inherit; font-weight: 700; font-size: .72rem; letter-spacing: .03em;
  padding: 4px 8px; border-radius: 999px; cursor: pointer;
  transition: color .2s, background .2s;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button.is-active { color: var(--accent-ink); background: var(--accent); }

/* ----- Conteúdo principal (empurra o rodapé pra baixo) ----- */
.main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 3rem) 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen {
  width: 100%;
  text-align: center;
  animation: fade-up .4s ease both;
}
.screen.is-hidden { display: none; }

.eyebrow {
  margin: 0 0 .5rem;
  color: var(--accent);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.title {
  margin: 0 0 .5rem;
  font-size: clamp(1.8rem, 7vw, 2.8rem);
  font-weight: 800;
  line-height: 1.1;
}
.subtitle {
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: clamp(.95rem, 3.5vw, 1.1rem);
}

/* ----- Grade de modos ----- */
.modes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .9rem;
  max-width: 440px;
  margin: 0 auto 1.5rem;
}

/* ----- Botões (clean) ----- */
.btn {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 16px;
  padding: 1rem 1.2rem;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn--mode {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  min-height: 96px;
  justify-content: center;
}
.btn__big { font-size: 1.9rem; font-weight: 800; line-height: 1; }
.btn__small { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: 1px; }
.btn--mode:hover { border-color: var(--accent); }
.btn--mode:hover .btn__big { color: var(--accent); }

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  border-color: transparent;
  font-weight: 800;
  font-size: 1.05rem;
  padding: .95rem 2rem;
}
.btn--next { min-width: 200px; }
.btn:disabled { opacity: .55; cursor: default; transform: none; box-shadow: var(--shadow-sm); }

.btn--ghost {
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  padding: .95rem 2rem;
}
.btn--ghost:hover { color: var(--text); border-color: var(--accent); }

/* ----- Cartão do tema ----- */
.round {
  margin: 0 0 1rem;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: .85rem;
}
.theme-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: clamp(2rem, 8vw, 3.5rem) 1.5rem;
  margin: 0 auto 1.75rem;
  max-width: 560px;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-text {
  margin: 0;
  font-size: clamp(1.3rem, 5.5vw, 2rem);
  font-weight: 700;
  line-height: 1.3;
}
/* Transições direcionais do cartão de tema */
.theme-card.anim-new  { animation: card-pop  .45s ease both; }
.theme-card.anim-next { animation: card-next .40s cubic-bezier(.22,.61,.36,1) both; }
.theme-card.anim-prev { animation: card-prev .40s cubic-bezier(.22,.61,.36,1) both; }

.end-emoji { font-size: 3.5rem; margin-bottom: .5rem; }

/* ----- Botões de texto / link ----- */
.link-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: .5rem;
}
.link-btn:hover { color: var(--accent); }

/* ----- Botões de ícone ----- */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform .12s ease, background-color .18s ease, border-color .18s ease, color .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.icon-btn:active { transform: translateY(0); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* alterna ícone sol/lua conforme o tema */
.icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: block; }

/* ----- Barra de controles ----- */
.controls {
  display: flex;
  gap: .6rem;
  justify-content: center;
  padding: 0 1rem 1.25rem;
}
.controls.is-hidden { display: none; }

/* ----- Rodapé ----- */
.footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .85rem;
}
.footer a {
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.footer a:hover { color: var(--accent); }
.footer img { vertical-align: middle; opacity: .85; }
.footer__sep { opacity: .5; }

/* ----- Modal ----- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal.is-hidden { display: none; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(2px);
  animation: fade-up .2s ease both;
}
.modal__box {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: pop-in .25s ease both;
}
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.modal__head h2 { margin: 0; font-size: 1.15rem; }
.modal__body { padding: 1.25rem; color: var(--text); }
.modal__body p { margin: 0 0 .85rem; line-height: 1.5; }
.modal__note { color: var(--muted); font-size: .9rem; }
.modal__note a { color: var(--accent); }
.modal__foot {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  gap: .75rem;
}
.modal__foot--split { justify-content: flex-end; }
.modal__foot--split .btn { flex: 1; max-width: 160px; }
.modal__box--lg { max-width: 560px; }

/* ----- Botão pequeno ----- */
.btn--sm { padding: .55rem 1.1rem; font-size: .9rem; border-radius: 12px; }

/* ----- Links e crédito do rodapé ----- */
.footer__credit, .footer__links { display: inline-flex; align-items: center; gap: .5rem; }
.footer__link {
  background: none; border: none; cursor: pointer; font: inherit;
  color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 0;
}
.footer__link:hover { color: var(--accent); }

/* ----- Animações ----- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pop-in {
  0%   { opacity: 0; transform: scale(.96); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes card-pop {
  0%   { opacity: 0; transform: scale(.9); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes card-next {
  0%   { opacity: 0; transform: translateX(52px); }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes card-prev {
  0%   { opacity: 0; transform: translateX(-52px); }
  100% { opacity: 1; transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  *, .screen, .theme-text.is-anim, .modal__box, .modal__backdrop { animation: none !important; transition: none !important; }
}

/* ----- Responsivo ----- */
@media (max-width: 380px) {
  .modes { gap: .6rem; }
  .btn--mode { min-height: 84px; padding: .8rem; }
  .btn__big { font-size: 1.6rem; }
}

/* ============================================================
   Seleção de tema (packs) e logotipos
   ============================================================ */
.lang-switch.is-hidden { display: none; }

.hero-logo {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
  margin: 0 auto 1rem;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, .35));
}
.hero-logo--big { max-width: 380px; margin-bottom: 1.25rem; }

.play-logo {
  display: block;
  height: 54px;
  width: auto;
  max-width: 78%;
  margin: 0 auto 1rem;
  opacity: .95;
}

/* ----- Grade de temas ----- */
.packs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .9rem;
  max-width: 640px;
  margin: 0 auto;
}
.pack {
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  padding: 1rem .75rem .9rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .18s ease, border-color .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.pack:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent); }
.pack:active { transform: translateY(0); }
.pack:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.pack__logo {
  width: 100%;
  max-width: 210px;
  height: 82px;
  object-fit: contain;
  margin-bottom: .2rem;
}
.pack__name { font-weight: 800; font-size: 1rem; line-height: 1.2; }
.pack__sub {
  color: var(--muted);
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* O "Geral" ocupa a linha inteira, como destaque */
.pack--geral { grid-column: 1 / -1; }
.pack--geral .pack__logo { height: 110px; max-width: 280px; }

/* ----- Tela de modos ----- */
.start-links { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.modes.is-loading .btn { opacity: .45; pointer-events: none; }
.load-error { grid-column: 1 / -1; color: var(--muted); line-height: 1.5; }

@media (min-width: 620px) {
  .packs { grid-template-columns: repeat(3, 1fr); }
}
