:root {
  --deep-purple: #3b184b;
  --mystic-purple: #603a7a;
  --bright-purple:#921df1;
  --sparkle-green: #4a9d3c;
  --moonlight: #ebd5ff;
  --crystal-white: #f5f0ff;
  --roxo-principal: #6b46c1;
  --roxo-escuro: #471d86;
  --roxo-claro: #a78bfa;
  --dourado: #d4af37;
  --dourado-claro: #f7e98e;
  --preto: #121212;
  --preto-card: #1a1a1f;
  --prata: #c0c0c0;
  --prata-escuro: #a0a0a0;
  --turquesa: #2dd4bf;
  --turquesa-escuro: #0d9488;
  --branco: #f8fafc;
  --cinza: #94a3b8;
  --radius: 12px;
  --gap: 1rem;
  --narrow: 880px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--crystal-white);
  color: var(--preto);
  font-family: 'Montserrat Alternates', sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.secure-slot::after {
  content: '';
  color: inherit;
  font: inherit;
  white-space: pre-wrap;
}

img {
  pointer-events: none;
  -webkit-user-drag: none;
}

header {
  font-family: 'Cinzel Decorative', serif;
  background: linear-gradient(135deg, var(--roxo-escuro), var(--roxo-principal), var(--roxo-escuro));
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.container {
  max-width: var(--narrow);
  margin: 0 auto;
  position: relative;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo h1 {
  font-size: 2.5rem;
  color: var(--dourado);
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
}

.logo img{
  width: 70px;
  display: flex;
}

.logo-icon {
  font-size: 1.8rem;
}

.nav-menu ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
}

.nav-menu a {
  display: block;
  padding: 0.5rem 1rem;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.726);
  border-radius: 15px;
  color: var(--prata);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.nav-menu a:hover, .nav-menu a.active {
  background-color: var(--dourado);
  color: var(--preto);
  border-color: var(--dourado);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 20px;
  height: 15px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1001;
}

.nav-toggle .hamburger {
  width: 100%;
  height: 3px;
  background-color: var(--dourado);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

header.shrink {
  padding: 0.5rem 1rem;
}

header.shrink .logo h1 {
  font-size: 1.5rem;
}

header.shrink .logo img {
  width: 40px;
}

.nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}

.nav-overlay.active {
  display: block;
}

main {
  padding: 2rem 1rem;
  position: relative;
  z-index: 1;
}

section {
  display: none;
  margin-bottom: 3rem;
}

section.active {
  display: block;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

h2 {
  font-family: 'Cinzel Decorative', serif;
  color: var(--dourado);
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  border-bottom: 2px solid var(--roxo-principal);
  padding-bottom: 0.5rem;
}

h3 {
  color: var(--turquesa);
  margin: 1.5rem 0 1rem;
  font-size: 1.3rem;
}

h4 {
  color: var(--dourado-claro);
  text-shadow: 1px 1px 2px #121212;
  margin: 1rem 0 0.5rem;
  font-size: 1.1rem;
}

.intro {
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
  line-height: 1.7;
}

.note {
  margin-top: 2rem;
  padding: 1rem;
  background-color: rgba(107, 70, 193, 0.1);
  border-left: 4px solid var(--turquesa);
  border-radius: 4px;
  font-size: 0.95rem;
  text-align: justify ;
  color: var(--roxo-escuro);
}

.card {
  background-color: var(--roxo-claro);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(107, 70, 193, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(107, 70, 193, 0.3);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.card-icon {
  font-size: 1.5rem;
  color: var(--dourado);
}

.card-title {
  font-size: 1.4rem;
  color: var(--dourado-claro);
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.card-content {
  padding: 0.5rem 0;
}

.card-content .metadata {
  margin-bottom: 1rem;
}

.linha-meta {
  margin: 0 0 1rem;
  color: var(--roxo-escuro);
  font-size: 0.95rem;
}

.metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.pill {
  background-color: rgba(107, 70, 193, 0.2);
  border: 1px solid var(--roxo-principal);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
  color: var(--roxo-escuro);
}

dl {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0.5rem 1rem;
}

dt {
  color: var(--roxo-escuro);
  font-weight: 800;
}

dd {
  margin: 0;
  font-weight: 600;
}

.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.cards-container .card {
  margin-bottom: 0;
}

.cards-container .card-header {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.cards-container .card-title {
  font-size: 1.2rem;
}

.cards-container .card-content {
  padding: 0.5rem 0;
}

.accordion {
  margin: 1.5rem 0;
}

.accordion-item {
  background-color: var(--roxo-claro);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  overflow: hidden;
  border: 1px solid rgba(107, 70, 193, 0.3);
}

.accordion-header {
  padding: 1rem 1.5rem;
  background-color: rgba(107, 70, 193, 0.1);
  color: var(--dourado-claro);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

.accordion-header:hover {
  background-color: rgba(107, 70, 193, 0.2);
}

.accordion-content {
  padding: 0 1.5rem;
  text-align: justify;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.accordion-item.active .accordion-content {
  padding: 1rem 1.5rem;
  max-height: 1000px;
}

.accordion-icon {
  transition: transform 0.3s ease;
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
}

.aspecto-menor {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(107, 70, 193, 0.2);
}

.aspecto-menor:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.index-nav {
  background: linear-gradient(135deg, rgba(132, 79, 255, 0.2), rgba(117, 45, 212, 0.1), rgba(132, 79, 255, 0.2));
  border-radius: var(--radius);
  padding: 1rem;
  margin: 1.5rem 0;
  border: 1px solid rgba(107, 70, 193, 0.1);
}

.index-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
}

.index-list a {
  display: block;
  padding: 0.5rem 1rem;
  background-color: rgba(124, 68, 255, 0.5);
  border: 1px solid var(--crystal-white);
  border-radius: 20px;
  color: var(--preto);
  font-weight: 500;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.index-list a:hover {
  background-color: var(--turquesa);
  color: var(--preto);
  border-color: var(--turquesa);
}

.btn-group {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
}

.btn {
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: var(--roxo-principal);
  color: white;
}

.btn-primary:hover {
  background-color: var(--roxo-escuro);
}

.btn-secondary {
  background-color: var(--turquesa);
  color: var(--preto);
}

.btn-secondary:hover {
  background-color: var(--turquesa-escuro);
}

footer {
  background-color: var(--roxo-escuro);
  color: var(--prata);
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 3rem;
  font-size: small;
}

footer img{
  width: 8rem;
}

.back-to-top {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  width: 52px;
  height: 52px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--dourado-claro);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bright-purple), var(--roxo-escuro));
  color: var(--crystal-white);
  cursor: pointer;
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.22), 0 10px 22px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
  z-index: 2000;
}

.back-to-top__icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
  display: block;
  filter: drop-shadow(0 0 8px rgba(247, 233, 142, 0.55));
}

.back-to-top:hover {
  background: linear-gradient(135deg, var(--dourado), var(--dourado-claro));
  color: var(--preto);
  box-shadow: 0 0 0 5px rgba(212, 175, 55, 0.28), 0 12px 24px rgba(0, 0, 0, 0.4);
}

.back-to-top:focus-visible {
  outline: 2px solid var(--turquesa);
  outline-offset: 2px;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.floating {
  animation: float 3s ease-in-out infinite;
}

@keyframes tremularFogo { 
  0%,100% { transform: translateY(0) rotate(-1deg); } 
  50% { transform: translateY(-1px) rotate(1deg); } 
}

@keyframes pulsarTerra { 
  0%,100% { transform: scale(1); } 
  50% { transform: scale(1.03); } 
}

@keyframes soproAr { 
  0%,100% { transform: translateX(0); } 
  50% { transform: translateX(1.5px); } 
}

@keyframes ondaAgua { 
  0%,100% { transform: translateY(0); } 
  50% { transform: translateY(1.5px); } 
}

.icon-fogo { 
  animation: tremularFogo 2.6s ease-in-out infinite; 
}

.icon-terra { 
  animation: pulsarTerra 3.2s ease-in-out infinite; 
}

.icon-ar { 
  animation: soproAr 3s ease-in-out infinite; 
}

.icon-agua { 
  animation: ondaAgua 2.8s ease-in-out infinite; 
}

@media (max-width: 768px) {
  header {
    padding: 0.5rem 1rem;
  }

  .logo {
    margin-bottom: 0;
  }

  .logo h1 {
    font-size: 1.5rem;
  }

  .logo img {
    width: 40px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: linear-gradient(135deg, var(--roxo-escuro), var(--roxo-principal));
    padding: 5rem 1.5rem 2rem;
    transition: right 0.3s ease;
    z-index: 999;
    overflow-y: auto;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
  }

  .nav-menu.active {
    right: 0;
  }

  .nav-menu ul {
    flex-direction: column;
    gap: 0;
  }

  .nav-menu a {
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 0;
    font-size: 1rem;
    text-align: center;
  }

  .nav-toggle.active .hamburger:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px);
  }

  .nav-toggle.active .hamburger:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active .hamburger:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }

  main {
    padding: 1rem;
    padding-top: 1rem;
  }

  .container {
    padding: 0 1rem;
  }

  h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  h3 {
    font-size: 1.2rem;
  }

  .card {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .card-title {
    font-size: 1.2rem;
  }

  .cards-container {
    grid-template-columns: 1fr;
  }

  .btn, .nav-link, .index-list a {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .accordion-header {
    padding: 1rem;
    min-height: 60px;
  }

  dl {
    grid-template-columns: 1fr;
  }
  
  .index-list {
    flex-direction: column;
  }
  
  .index-list a {
    text-align: center;
  }
  
  .btn-group {
    flex-direction: column;
  }
  
  .metadata {
    flex-direction: column;
    align-items: flex-start;
  }

  .back-to-top {
    right: max(0.75rem, env(safe-area-inset-right));
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    width: 46px;
    height: 46px;
  }

  .back-to-top__icon {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  .nav-menu {
    width: 100%;
  }
  
  .logo h1 {
    font-size: 1.2rem;
  }

  .logo img {
    width: 35px;
  }

  .nav-toggle {
    right: 0.5rem;
  }

  .cards-container {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) {
  .nav-menu {
    display: block !important;
  }
  
  .nav-overlay {
    display: none !important;
  }
}