/**
 * Envolvório Virtues: header + fundo do body; o viewer (conteudos-viewer.css) espelha conteudos.php.
 */
.livros-body-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Header Virtues (DM Sans) — independente do Trebuchet do viewer */
.site-header.livros-site-header {
  font-family: "DM Sans", system-ui, sans-serif;
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, #f4f0ff 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(26, 22, 37, 0.08);
}

[data-theme="dark"] .site-header.livros-site-header {
  background: color-mix(in srgb, #0d1118 94%, transparent);
  border-bottom-color: rgba(130, 170, 255, 0.12);
}

/* Hamburger Menu Button */
.hamburger-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(26, 22, 37, 0.12);
  background: #fff;
  color: #1a1625;
  cursor: pointer;
  padding: 0;
}

[data-theme="dark"] .hamburger-menu {
  background: #161c26;
  border-color: rgba(120, 160, 255, 0.18);
  color: #dce4f5;
}

.hamburger-menu:hover {
  background: rgba(107, 77, 255, 0.1);
}

[data-theme="dark"] .hamburger-menu:hover {
  background: rgba(120, 160, 255, 0.15);
}

/* Menu Overlay */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.menu-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Menu Sidebar */
.menu-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 85vw);
  background: #fff;
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .menu-sidebar {
  background: #0d1118;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
}

.menu-sidebar.active {
  transform: translateX(0);
}

.menu-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  border-bottom: 1px solid rgba(26, 22, 37, 0.08);
}

[data-theme="dark"] .menu-sidebar-header {
  border-bottom-color: rgba(130, 170, 255, 0.12);
}

.menu-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.menu-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #5c5669;
  cursor: pointer;
  padding: 0;
}

.menu-close:hover {
  background: rgba(107, 77, 255, 0.1);
  color: #6b4dff;
}

[data-theme="dark"] .menu-close {
  color: #9d96b0;
}

[data-theme="dark"] .menu-close:hover {
  background: rgba(120, 160, 255, 0.15);
  color: #a8b3ff;
}

.menu-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
}

.menu-section {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(26, 22, 37, 0.06);
}

[data-theme="dark"] .menu-section {
  border-bottom-color: rgba(130, 170, 255, 0.08);
}

.menu-section:last-child {
  border-bottom: none;
}

.menu-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9d96b0;
  margin: 0 0 0.75rem;
}

[data-theme="dark"] .menu-section-title {
  color: #6b7a94;
}

.menu-link {
  display: block;
  padding: 0.6rem 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: #5c5669;
  text-decoration: none;
  border: none;
  background: transparent;
  text-align: left;
  width: 100%;
  cursor: pointer;
  transition: color 0.2s;
}

.menu-link:hover {
  color: #6b4dff;
}

[data-theme="dark"] .menu-link {
  color: #9d96b0;
}

[data-theme="dark"] .menu-link:hover {
  color: #a8b3ff;
}

.menu-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.menu-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(107, 77, 255, 0.08);
  color: #6b4dff;
  transition: background 0.2s, transform 0.15s;
}

.menu-social-link:hover {
  background: rgba(107, 77, 255, 0.15);
  transform: translateY(-2px);
}

[data-theme="dark"] .menu-social-link {
  background: rgba(120, 160, 255, 0.12);
  color: #a8b3ff;
}

[data-theme="dark"] .menu-social-link:hover {
  background: rgba(120, 160, 255, 0.2);
}

.menu-social-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.menu-footer {
  padding: 1.25rem;
  border-top: 1px solid rgba(26, 22, 37, 0.08);
  text-align: center;
}

[data-theme="dark"] .menu-footer {
  border-top-color: rgba(130, 170, 255, 0.12);
}

.menu-footer p {
  margin: 0.25rem 0;
  font-size: 0.75rem;
  color: #9d96b0;
}

[data-theme="dark"] .menu-footer p {
  color: #6b7a94;
}

.header-inner {
  max-width: min(1200px, 100%);
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  height: 52px;
  width: 52px;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}

.brand-title {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  display: none;
}

/* Logótipo Books7 (PNG a cores): sem inverter no escuro */
[data-theme="dark"] .brand-logo--b7 {
  filter: none;
  opacity: 0.98;
}
[data-theme="dark"] .brand-logo:not(.brand-logo--b7) {
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

.nav-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(26, 22, 37, 0.12);
  background: #fff;
  color: #1a1625;
  cursor: pointer;
}

[data-theme="dark"] .theme-toggle {
  background: #161c26;
  border-color: rgba(120, 160, 255, 0.18);
  color: #dce4f5;
}

.theme-toggle .theme-ico-moon {
  display: none;
}
[data-theme="dark"] .theme-toggle .theme-ico-sun {
  display: none;
}
[data-theme="dark"] .theme-toggle .theme-ico-moon {
  display: block;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: #5c5669;
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
}

.nav-link:hover {
  color: #6b4dff;
  background: rgba(107, 77, 255, 0.1);
}

[data-theme="dark"] .nav-link {
  color: #9d96b0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: #6b4dff;
  color: #fff;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Área do viewer: fundo branco como conteudos.php */
.livros-viewer-root {
  flex: 1;
  background: #fff;
}

#livros-viewer-loading {
  padding: 3rem 1rem;
  text-align: center;
  font-family: "DM Sans", system-ui, sans-serif;
  color: #5c5669;
}
#livros-viewer-loading[hidden] {
  display: none !important;
}

#livros-viewer-error {
  padding: 2rem 1.25rem;
  max-width: 560px;
  margin: 0 auto;
  font-family: "DM Sans", system-ui, sans-serif;
  color: #b71c1c;
  text-align: center;
}

[data-theme="dark"] #livros-viewer-error {
  color: #ff8a80;
}

[data-theme="dark"] .livros-viewer-root {
  background: #0b0f14;
}

[data-theme="dark"] .brand {
  color: #e8ecf7;
}

[data-theme="dark"] #livros-viewer-loading {
  color: #8b96ae;
  background: #0b0f14;
}

/* Página inicial — grupos de 5 desenhos */
.livros-landing {
  flex: 1;
  width: 100%;
  padding: 1.5rem 1.25rem 2.5rem;
  font-family: "DM Sans", system-ui, sans-serif;
  background: linear-gradient(180deg, #fffefb 0%, #f5ecdf 100%);
}
[data-theme="dark"] .livros-landing {
  background: linear-gradient(180deg, #0f131a 0%, #151b26 100%);
}
.landing-inner {
  max-width: min(960px, 100%);
  margin: 0 auto;
}
.landing-hero {
  margin-bottom: 1.75rem;
}
.landing-title {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  margin: 0 0 0.65rem;
  color: #1f1712;
}
[data-theme="dark"] .landing-title {
  color: #eef2fb;
}
.landing-welcome {
  margin: 0;
  color: #5c4a3a;
  font-size: 0.98rem;
  line-height: 1.6;
  max-width: 38rem;
}
[data-theme="dark"] .landing-welcome {
  color: #9aa6bd;
}
.landing-grid-wrap {
  position: relative;
}
.landing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}
.landing-fade-out {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 120px;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(
    to top,
    #f5ecdf 0%,
    rgba(245, 236, 223, 0.65) 35%,
    transparent 100%
  );
}
[data-theme="dark"] .landing-fade-out {
  background: linear-gradient(
    to top,
    #151b26 0%,
    rgba(21, 27, 38, 0.7) 40%,
    transparent 100%
  );
}
.landing-more-wrap {
  display: flex;
  justify-content: center;
  padding: 0.75rem 0 0;
}
.landing-more-btn {
  min-width: 10rem;
}
.landing-card {
  border: 1px solid rgba(77, 58, 43, 0.15);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  overflow: hidden;
  font: inherit;
  color: inherit;
}
.landing-card--wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  padding: 0;
  transition: box-shadow 0.2s, transform 0.15s;
}
[data-theme="dark"] .landing-card {
  background: rgba(22, 28, 38, 0.96);
  border-color: rgba(120, 160, 255, 0.12);
}
.landing-card--wrap:hover {
  box-shadow: 0 12px 28px rgba(80, 55, 30, 0.12);
  transform: translateY(-2px);
}
.landing-card-open {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}
.landing-card-open:focus-visible {
  outline: 2px solid #dc7c32;
  outline-offset: -2px;
}
.landing-card-toggle {
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.75rem;
  border: 0;
  border-top: 1px solid rgba(77, 58, 43, 0.12);
  background: rgba(245, 240, 232, 0.85);
  color: #5c4a3a;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.35;
}
.landing-card-toggle:hover {
  background: rgba(220, 124, 50, 0.12);
  color: #a05512;
}
.landing-card-toggle[aria-pressed="true"] {
  background: rgba(46, 125, 50, 0.1);
  color: #2e7d32;
}
.landing-card-toggle:focus-visible {
  outline: 2px solid #dc7c32;
  outline-offset: -2px;
  z-index: 1;
}
[data-theme="dark"] .landing-card-toggle {
  border-top-color: rgba(120, 160, 255, 0.12);
  background: rgba(14, 18, 26, 0.75);
  color: #9aa6bd;
}
[data-theme="dark"] .landing-card-toggle:hover {
  background: rgba(124, 156, 255, 0.12);
  color: #c8d4f0;
}
[data-theme="dark"] .landing-card-toggle[aria-pressed="true"] {
  background: rgba(45, 212, 191, 0.1);
  color: #6ee7b7;
}
.landing-card-thumb {
  aspect-ratio: 1;
  background: #f0ebe3;
  display: flex;
  align-items: center;
  justify-content: center;
}
[data-theme="dark"] .landing-card-thumb {
  background: #1a202c;
}
.landing-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.landing-card-body {
  padding: 0.75rem 0.85rem 1rem;
}
.landing-card-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0 0 0.35rem;
  color: #1f1712;
}
[data-theme="dark"] .landing-card-title {
  color: #e8ecf7;
}
.landing-card-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: #2e7d32;
}
.landing-card-hint {
  font-size: 0.75rem;
  font-weight: 600;
  color: #736252;
}
.landing-card--done .landing-card-hint {
  color: #5c4a3a;
}
[data-theme="dark"] .landing-card-hint {
  color: #8b96ae;
}
[data-theme="dark"] .landing-card--done .landing-card-hint {
  color: #9aa6bd;
}
[data-theme="dark"] .landing-card-badge {
  color: #6ee7b7;
}

.landing-card--locked {
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.92;
}
.landing-card--locked:hover {
  box-shadow: none;
  transform: none;
}
.landing-card--locked .landing-card-thumb {
  position: relative;
}
.landing-card--locked .landing-card-thumb img {
  filter: brightness(0.42) contrast(0.95) saturate(0.85);
}
[data-theme="dark"] .landing-card--locked .landing-card-thumb img {
  filter: brightness(0.35) contrast(0.95) saturate(0.8);
}
.landing-card-lock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 18, 28, 0.45);
  border-radius: 0;
}
.landing-lock-icon {
  color: rgba(255, 248, 240, 0.95);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}
.landing-card-badge--locked {
  color: #8d7a68 !important;
}
[data-theme="dark"] .landing-card-badge--locked {
  color: #6b7a94 !important;
}

/* ===== NAV TABS ===== */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 14px;
  background: rgba(245, 236, 223, 0.8);
  border: 1px solid rgba(77, 58, 43, 0.08);
}
[data-theme="dark"] .nav-tabs {
  background: rgba(16, 22, 32, 0.85);
  border-color: rgba(120, 160, 255, 0.12);
}
.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #736252;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.nav-tab:hover {
  background: rgba(220, 124, 50, 0.1);
  color: #a05512;
}
.nav-tab.active {
  background: #fff;
  color: #1f1712;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
[data-theme="dark"] .nav-tab {
  color: #8b96ae;
}
[data-theme="dark"] .nav-tab:hover {
  background: rgba(124, 156, 255, 0.1);
  color: #c8d4f0;
}
[data-theme="dark"] .nav-tab.active {
  background: #1c2534;
  color: #e8ecf7;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.nav-tab svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
@media (max-width: 520px) {
  .nav-tab span { display: none; }
  .nav-tab { padding: 0.4rem 0.55rem; }
}


/* ===== PAGE SECTIONS ===== */
.page-section { flex: 1; width: 100%; }
.page-section[hidden] { display: none !important; }

/* ===== LOADING SCREEN ===== */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: #fff;
  transition: opacity 0.5s ease;
}
.loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}
.loading-screen-logo {
  width: min(220px, 55vw);
  height: auto;
}
.loading-bar-wrap {
  width: min(260px, 60vw);
  height: 6px;
  border-radius: 999px;
  background: #f0ebe3;
  overflow: hidden;
}
.loading-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #dc7c32, #f0a050);
  width: 0%;
  transition: width 0.3s ease;
}

/* ===== HOME PAGE ===== */
.page-home {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "DM Sans", system-ui, sans-serif;
}
.home-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.home-bg-svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
[data-theme="dark"] .home-bg { opacity: 0.35; }
.home-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 3rem;
  max-width: min(1100px, 95%);
  margin: 0 auto;
  padding: 2rem 1.25rem;
}
.home-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
}
.home-right {
  flex: 1 1 360px;
  max-width: min(720px, 100%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.home-logo-wrap {
  perspective: 600px;
}
.home-logo-anim {
  width: min(280px, 60vw);
  height: auto;
  animation: logoFloat 4s ease-in-out infinite;
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-14px) rotate(2deg); }
}
.home-title {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
  font-weight: 700;
  color: #1f1712;
  line-height: 1.2;
}
[data-theme="dark"] .home-title { color: #eef2fb; }
.home-subtitle {
  color: #5c4a3a;
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 30rem;
}
[data-theme="dark"] .home-subtitle { color: #9aa6bd; }

/* clouds */
.home-cloud--1 { animation: cloudDrift1 25s linear infinite; }
.home-cloud--2 { animation: cloudDrift2 35s linear infinite; }
.home-cloud--3 { animation: cloudDrift3 30s linear infinite; }
@keyframes cloudDrift1 { 0%{transform:translateX(0)} 100%{transform:translateX(120px)} }
@keyframes cloudDrift2 { 0%{transform:translateX(0)} 100%{transform:translateX(-100px)} }
@keyframes cloudDrift3 { 0%{transform:translateX(0)} 100%{transform:translateX(80px)} }

/* sparkles */
.home-sparkle--1 { animation: sparklePulse 3s ease-in-out infinite; }
.home-sparkle--2 { animation: sparklePulse 3.5s ease-in-out infinite 0.5s; }
.home-sparkle--3 { animation: sparklePulse 2.8s ease-in-out infinite 1s; }
.home-sparkle--4 { animation: sparklePulse 3.2s ease-in-out infinite 1.5s; }
.home-sparkle--5 { animation: sparklePulse 2.5s ease-in-out infinite 0.8s; }
@keyframes sparklePulse {
  0%,100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.6); opacity: 1; }
}

/* recommend card */
.home-recommend {
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(77, 58, 43, 0.12);
  border-radius: 22px;
  padding: 1.5rem;
  box-shadow: 0 16px 40px rgba(80, 55, 30, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.home-recommend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}
.home-recommend-grid--single {
  grid-template-columns: 1fr;
}
#home-continue-col[hidden] {
  display: none !important;
}
.home-recommend-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}
.home-continue-title {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #1f1712;
  margin: 0;
}
[data-theme="dark"] .home-continue-title { color: #eef2fb; }
[data-theme="dark"] .home-recommend {
  background: rgba(22, 28, 38, 0.96);
  border-color: rgba(120, 160, 255, 0.14);
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}
.home-recommend-title {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #1f1712;
}
[data-theme="dark"] .home-recommend-title { color: #eef2fb; }
.home-recommend-desc {
  color: #736252;
  font-size: 0.9rem;
}
[data-theme="dark"] .home-recommend-desc { color: #8b96ae; }
.home-recommend-card {
  border-radius: 16px;
  overflow: hidden;
  background: #f0ebe3;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
[data-theme="dark"] .home-recommend-card { background: #1a202c; }
.home-recommend-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.home-start-btn {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #dc7c32, #e8973e);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}
.home-start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(220, 124, 50, 0.35);
}
[data-theme="dark"] .home-start-btn {
  background: linear-gradient(135deg, #5eead4, #2dd4bf);
  color: #0b0f14;
}
.home-explore-btn {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  border: 1px solid rgba(220, 124, 50, 0.35);
  border-radius: 14px;
  background: transparent;
  color: #a05512;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.home-explore-btn:hover {
  background: rgba(220, 124, 50, 0.08);
}
[data-theme="dark"] .home-explore-btn {
  border-color: rgba(94, 234, 212, 0.3);
  color: #5eead4;
}
[data-theme="dark"] .home-explore-btn:hover {
  background: rgba(94, 234, 212, 0.06);
}

.home-continue-btn {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #ca8a04, #eab308);
  color: #ffffff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}
.home-continue-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(202, 138, 4, 0.35);
}
[data-theme="dark"] .home-continue-btn {
  background: linear-gradient(135deg, #eab308, #facc15);
  color: #1a1408;
}

@media (max-width: 768px) {
  .home-content { flex-direction: column; gap: 2rem; text-align: center; }
  .home-left { align-items: center; }
  .home-right { flex: none; width: 100%; max-width: 420px; }
  .home-recommend-grid { grid-template-columns: 1fr; }
}

/* ===== FASES - show past phases button ===== */
.show-past-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.55rem 1rem;
  border: 1px solid rgba(77, 58, 43, 0.2);
  border-radius: 12px;
  background: rgba(255,255,255,0.7);
  color: #5c4a3a;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.show-past-btn:hover { background: rgba(220, 124, 50, 0.1); color: #a05512; }
.show-past-btn.active { background: rgba(46, 125, 50, 0.1); color: #2e7d32; border-color: rgba(46, 125, 50, 0.3); }
[data-theme="dark"] .show-past-btn { background: rgba(22, 28, 38, 0.8); color: #9aa6bd; border-color: rgba(120, 160, 255, 0.15); }
[data-theme="dark"] .show-past-btn:hover { background: rgba(124, 156, 255, 0.1); color: #c8d4f0; }
[data-theme="dark"] .show-past-btn.active { background: rgba(94, 234, 212, 0.08); color: #6ee7b7; border-color: rgba(94, 234, 212, 0.25); }

/* Fases fade-in animation for cards */
.landing-card.phase-fade-in {
  animation: phaseFadeIn 0.5s ease-out both;
}
@keyframes phaseFadeIn {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== GALLERY ===== */
.page-galeria {
  font-family: "DM Sans", system-ui, sans-serif;
  background: linear-gradient(180deg, #fffefb 0%, #f5ecdf 100%);
  padding: 1.5rem 1.25rem 2.5rem;
}
[data-theme="dark"] .page-galeria {
  background: linear-gradient(180deg, #0f131a 0%, #151b26 100%);
}
.galeria-inner {
  max-width: min(960px, 100%);
  margin: 0 auto;
}
.galeria-hero { margin-bottom: 1.75rem; }
.galeria-title {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  margin: 0 0 0.65rem;
  color: #1f1712;
}
[data-theme="dark"] .galeria-title { color: #eef2fb; }
.galeria-desc {
  margin: 0;
  color: #5c4a3a;
  font-size: 0.98rem;
  line-height: 1.6;
  max-width: 38rem;
}
[data-theme="dark"] .galeria-desc { color: #9aa6bd; }
.galeria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}
.galeria-card {
  border: 1px solid rgba(77, 58, 43, 0.15);
  border-radius: 18px;
  background: rgba(255,255,255,0.92);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
}
.galeria-card:hover {
  box-shadow: 0 12px 28px rgba(80, 55, 30, 0.12);
  transform: translateY(-2px);
}
[data-theme="dark"] .galeria-card {
  background: rgba(22, 28, 38, 0.96);
  border-color: rgba(120, 160, 255, 0.12);
}
.galeria-card-thumb {
  aspect-ratio: 1;
  background: #f0ebe3;
  display: flex;
  align-items: center;
  justify-content: center;
}
[data-theme="dark"] .galeria-card-thumb { background: #1a202c; }
.galeria-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.galeria-card-body {
  padding: 0.75rem 0.85rem;
}
.galeria-card-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1f1712;
  margin: 0 0 0.2rem;
}
[data-theme="dark"] .galeria-card-title { color: #e8ecf7; }
.galeria-card-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: #2e7d32;
}
[data-theme="dark"] .galeria-card-badge { color: #6ee7b7; }
.galeria-card-badge--progress {
  display: inline-block;
  margin-top: 0.1rem;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  background: rgba(234, 179, 8, 0.22);
  color: #92400e;
}
[data-theme="dark"] .galeria-card-badge--progress {
  background: rgba(250, 204, 21, 0.18);
  color: #facc15;
}
.galeria-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 3rem 1rem;
  text-align: center;
  color: #736252;
  font-size: 1rem;
}
.galeria-empty[hidden] {
  display: none !important;
}
[data-theme="dark"] .galeria-empty { color: #8b96ae; }
.galeria-empty p { max-width: 28rem; line-height: 1.6; }

.preview-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.preview-toolbar-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
}
.preview-toolbar-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.drawing-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.back-to-landing {
  font-weight: 600;
}
.mark-complete-btn {
  border-radius: 12px;
  padding: 0.45rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid rgba(220, 124, 50, 0.45);
  background: rgba(220, 124, 50, 0.12);
  color: #a05512;
  cursor: pointer;
  font-family: inherit;
}
[data-theme="dark"] .mark-complete-btn {
  color: #7dd3c0;
  border-color: rgba(125, 211, 192, 0.4);
  background: rgba(45, 212, 191, 0.08);
}
.mark-complete-btn:hover {
  background: rgba(220, 124, 50, 0.22);
}
.mark-complete-btn--done {
  border-color: rgba(46, 125, 50, 0.45);
  background: rgba(46, 125, 50, 0.12);
  color: #2e7d32;
}
.mark-complete-btn--done:hover {
  background: rgba(200, 80, 80, 0.12);
  border-color: rgba(200, 80, 80, 0.4);
  color: #c62828;
}
[data-theme="dark"] .mark-complete-btn--done {
  border-color: rgba(110, 231, 183, 0.35);
  background: rgba(45, 212, 191, 0.08);
  color: #6ee7b7;
}
[data-theme="dark"] .mark-complete-btn--done:hover {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
}
