/*
 * Global styles and variables for the Twist of Fate landing page.
 *
 * Colors, radii and shadows are defined as CSS custom properties on
 * the :root element for easy reuse. The layout adapts to smaller
 * devices via media queries. Motion preferences are respected.
 */

:root {
  --bg: #0b0f14;
  --panel: #121821;
  --gold: #c7a448;
  --gold-dark: #9b7b2e;
  --crimson: #9b2c2c;
  --teal: #1f7a74;
  --text: #e3e5e8;
  --text-light: #9fa3ab;
  --radius: 1rem;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  /* Background images are defined here for easy reference across sections */
  /* Assign richer backgrounds to each section using the new artwork provided. */
  --bg-about: url('../assets/img/background-tavern-fire.png');
  --bg-quests: url('../assets/img/background-inn-night.png');
  --bg-reports: url('../assets/img/background-tavern-crow.png');
  --bg-news: url('../assets/img/background-board2.png');
  --bg-contacts: url('../assets/img/background-raven-scroll.png');
  /* Header and footer now use the decorative frame with chain corners */
  --bg-header: url('../assets/img/background-frame2.png');
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--gold);
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

main {
  position: relative;
}

/* Header and navigation */
header {
  /* The header uses a decorative frame image combined with a translucent dark overlay */
  /* Blend the decorative frame with a slightly lighter dark overlay so the chain corners are visible */
  background-image: var(--bg-header), rgba(18, 24, 33, 0.75);
  background-size: cover;
  background-position: center;
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 1000;
  /* Enhanced header design */
  border-bottom: 2px solid rgba(199, 164, 72, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.navbar {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  /* Enhanced navbar spacing */
}

.logo img {
  height: 56px;
  transition: transform 0.3s, filter 0.3s;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.logo:hover img {
  transform: scale(1.05);
  filter: drop-shadow(0 4px 8px rgba(199, 164, 72, 0.4));
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-weight: 600;
  color: var(--text);
  transition: color 0.3s, text-shadow 0.3s;
  position: relative;
  padding: 0.5rem 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width 0.3s;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--gold);
  text-shadow: 0 0 8px rgba(199, 164, 72, 0.5);
}


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

.btn {
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background 0.3s, color 0.3s, transform 0.3s;
}

.btn-primary {
  background: linear-gradient(to right, var(--gold), var(--gold-dark));
  color: #0b0f14;
  box-shadow: 0 0 8px var(--gold-dark);
  transition: all 0.3s;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(199, 164, 72, 0.4);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  transition: all 0.3s;
}

.btn-secondary:hover {
  background: var(--gold);
  color: var(--bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(199, 164, 72, 0.3);
}

.user-icon svg {
  width: 36px;
  height: 36px;
  fill: var(--gold);
  background: rgba(199, 164, 72, 0.2);
  border-radius: 50%;
  padding: 4px;
  transition: all 0.3s;
  border: 2px solid rgba(199, 164, 72, 0.3);
}

.user-icon {
  cursor: pointer;
  transition: transform 0.3s;
}

.user-icon:hover {
  transform: scale(1.1);
}

.user-icon:hover svg {
  background: rgba(199, 164, 72, 0.3);
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(199, 164, 72, 0.5);
}

/* Hamburger menu styles */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0.5rem;
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--gold);
  border-radius: 1px;
}

/* Hero section */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 1rem;
  padding-bottom: 0;
  text-align: center;
  color: var(--text);
  overflow: hidden;
  min-height: 700px;
  /* Ensure the hero background moves independently of content for the parallax effect */
  perspective: 1px;
  margin-bottom: 0;
  /* Hero extends to cover chain area */
  padding-bottom: 100px;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('../assets/img/hero.webp');
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  opacity: 0.7;
  /* The hero background sits at the far back behind other decorations */
  z-index: -3;
  /* Extend hero background much further to cover chain area and connect with about section */
  height: calc(100% + 200px);
  bottom: -200px;
}

.hero-content {
  max-width: 900px;
  margin: 0 auto;
  padding-top: 4rem; /* push content down to reveal the logo beneath the sticky nav */
  position: relative;
  z-index: 1;
}

.hero-logo {
  width: 280px;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.6));
}

.hero h1 {
  font-family: 'Cormorant Garamond', 'Cinzel', serif;
  font-size: 3rem;
  margin: 0.5rem 0;
  line-height: 1.2;
  color: var(--gold);
}

.subtitle {
  margin-bottom: 1rem;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text-light);
}

.bullet-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.bullet-list li {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin: 0.3rem 0;
}

.bullet-icon {
  width: 0.5rem;
  height: 0.5rem;
  margin-top: 0.4rem;
  flex-shrink: 0;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 4px var(--gold-dark);
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

/* Generic sections */
.section {
  padding: 4rem 1rem;
  min-height: 500px;
  position: relative;
  /* Ensure sections flow seamlessly */
  margin: 0;
  /* Add padding for chain overlap */
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.about p {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.1rem;
  color: var(--text-light);
}

/* Mechanics cards */
.mechanics {
  position: relative;
  background: transparent;
  border-radius: 0;
  margin: 0;
  max-width: 100%;
  padding: 4rem 2rem;
  box-shadow: none;
  overflow: hidden;
}

.mechanics::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.mechanics video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.mechanics .container {
  position: relative;
  z-index: 1;
}

.mechanics .cards {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  margin-top: 2rem;
}

/* On larger screens, force the mechanics cards into exactly three columns for symmetry. */
@media (min-width: 900px) {
  .mechanics .cards {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

.card {
  background: linear-gradient(135deg, rgba(18, 24, 33, 0.95) 0%, rgba(11, 15, 20, 0.95) 100%);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6),
              0 0 0 1px rgba(199, 164, 72, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  border: 2px solid rgba(199, 164, 72, 0.15);
  /* Authentic medieval style */
  backdrop-filter: blur(4px);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(199, 164, 72, 0.05) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.card:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7),
              0 0 0 1px rgba(199, 164, 72, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.1),
              0 0 20px rgba(199, 164, 72, 0.2);
  border-color: rgba(199, 164, 72, 0.3);
  transform: translateY(-4px);
}

.card:hover::before {
  opacity: 1;
}

.card .icon-wrap {
  /* Increase the icon wrapper to better showcase the detailed emblem icons */
  width: 90px;
  height: 90px;
  margin: 0 auto 1rem;
  position: relative;
  /* Add decorative frame around icon */
  padding: 0.5rem;
  background: radial-gradient(circle, rgba(199, 164, 72, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  transition: all 0.3s;
}

.card:hover .icon-wrap {
  background: radial-gradient(circle, rgba(199, 164, 72, 0.2) 0%, transparent 70%);
  transform: scale(1.05);
  filter: drop-shadow(0 0 12px rgba(199, 164, 72, 0.4));
}

.card .icon-wrap svg {
  width: 100%;
  height: 100%;
  fill: var(--gold);
  /* Ensure any strokes inside icons inherit gold color */
  stroke: var(--gold);
}

/* When using image icons instead of inline SVGs, constrain them uniformly */
.card .icon-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  margin: 0 auto 0.5rem;
}

/* Propagate gold color to child shapes within card icons */
.card .icon-wrap svg * {
  fill: var(--gold);
  stroke: var(--gold);
}

.card h3 {
  font-family: 'Cormorant Garamond', 'Cinzel', serif;
  margin: 0.75rem 0 0.5rem;
  font-size: 1.3rem;
  color: var(--gold);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5),
               0 0 8px rgba(199, 164, 72, 0.3);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.card p {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-top: 0.5rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.pill-section {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.pill {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 0.9rem;
  /* Align icon and text nicely */
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Small icons inside pills */
.pill-icon {
  width: 1rem;
  height: 1rem;
  display: inline-block;
  vertical-align: middle;
  fill: currentColor;
}

/* Set fill and stroke on inner elements of pill icons */
.pill-icon * {
  fill: currentColor;
  stroke: currentColor;
}

/* Chain divider styles - using chain-repeat.png for seamless chains */
.chain-divider {
  position: relative;
  width: 100%;
  height: 200px;
  line-height: 0;
  overflow: visible;
  color: var(--gold);
  z-index: 10;
  /* Position chains to cover section transitions - overlap sections */
  margin-top: -100px;
  margin-bottom: -100px;
  padding: 0;
  /* Use chain-repeat.png for seamless repeating chains */
  background-image: url('../assets/img/chain-repeat.png');
  background-repeat: repeat-x;
  background-size: auto 100%;
  background-position: 0 center;
  /* Ensure chains sit on top of backgrounds */
  background-color: transparent;
  /* Animate chains to create movement effect */
  animation: chainMove 20s linear infinite;
}

/* Animation for chain movement - creates stretching/pulling effect */
@keyframes chainMove {
  0% {
    background-position: 0 center;
    transform: scaleX(1);
  }
  50% {
    background-position: 200px center;
    transform: scaleX(1.02);
  }
  100% {
    background-position: 400px center;
    transform: scaleX(1);
  }
}
.chain-divider svg {
  display: none;
}

/* Poster (wanted banner) styles */
.poster {
  position: relative;
  background-image: url('../assets/img/background-alt1.png');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  color: var(--text);
  border-radius: 0;
  box-shadow: none;
  padding: 4rem 2rem;
  margin: 0;
  max-width: 100%;
  overflow: hidden;
  min-height: 600px;
  display: flex;
  align-items: center;
  padding-top: 4rem;
}
.poster::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 0;
}
.poster .container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  width: 100%;
}
.poster-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
}
.poster-image {
  position: relative;
  z-index: 1;
  max-width: 400px;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  /* Remove black background from GIF - improved method */
  mix-blend-mode: screen;
  /* Enhanced filter to completely remove black background */
  filter: contrast(1.3) brightness(1.2) saturate(1.1);
  /* Ensure transparent background */
  background: transparent;
  /* Use CSS mask to remove black pixels */
  image-rendering: auto;
  /* Additional method: blend with background */
  isolation: isolate;
}

/* Alternative approach: if mix-blend-mode doesn't work well, use filter */
@supports (filter: contrast(1)) {
  .poster-image {
    /* Force black to transparent using filter */
    filter: contrast(1.3) brightness(1.2) saturate(1.1);
  }
}
.poster-logo {
  display: block;
  width: 120px;
  margin: 0 0 1rem 0;
  filter: drop-shadow(0 0 10px rgba(199, 164, 72, 0.5));
}
.poster h2 {
  font-family: 'Cinzel', serif;
  font-size: 2.2rem;
  margin: 0.5rem 0 0.75rem;
  color: var(--gold);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}
.poster p {
  font-size: 1.1rem;
  margin: 0 0 1.5rem;
  color: var(--text);
  max-width: 700px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}
.poster-cta {
  display: flex;
  justify-content: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
.poster-cta .btn-primary {
  background: linear-gradient(to right, var(--gold), var(--gold-dark));
  color: var(--bg);
}
.poster-cta .btn-secondary {
  border: 2px solid var(--gold);
  color: var(--gold);
  background: transparent;
}

/* Quests, Reports, Contacts */
.quests,
.reports,
.contacts {
  /* Sections with their own backgrounds have decorative panels underneath text.  Colors and shadows remain for legibility. */
  border-radius: 0;
  margin-top: 0;
  padding: 4rem 2rem;
  box-shadow: none;
}

/* Section background images - seamless transitions */
.about {
  position: relative;
  background-image: var(--bg-about);
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  color: var(--text);
  margin-top: -100px;
  padding-top: calc(4rem + 100px);
  padding-bottom: 4rem;
  /* Ensure seamless connection with hero - extend background to cover chain area */
  overflow: hidden;
}
.about::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: -1;
}

.quests {
  color: var(--text);
  position: relative;
  margin-top: 0;
  padding-top: 4rem;
  overflow: hidden;
}
.quests::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(0, 0, 0, 0.6);
  pointer-events: none;
}
.quests video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
.quests .container {
  position: relative;
  z-index: 1;
}

.reports {
  color: var(--text);
  position: relative;
  margin-top: 0;
  padding-top: 4rem;
  overflow: hidden;
}
.reports::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(0, 0, 0, 0.6);
  pointer-events: none;
}
.reports video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
.reports .container {
  position: relative;
  z-index: 1;
}

.news {
  color: var(--text);
  position: relative;
  background-image: var(--bg-news);
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  margin-top: 0;
  padding-top: 4rem;
}
.news::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: -1;
}

.contacts {
  position: relative;
  margin-top: 0;
  padding-top: 4rem;
  overflow: hidden;
}

.contacts::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.contacts video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.contacts .container {
  position: relative;
  z-index: 1;
}

.about h2,
.mechanics h2,
.quests h2,
.reports h2,
.contacts h2,
.news h2 {
  font-family: 'Cormorant Garamond', 'Cinzel', serif;
  color: var(--gold);
  margin-bottom: 1rem;
  font-size: 2rem;
  text-align: center;
  position: relative;
  z-index: 1;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.about .container,
.quests .container,
.reports .container,
.news .container,
.contacts .container {
  position: relative;
  z-index: 1;
}

.report-cards {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  margin-top: 1rem;
}

.report-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1rem;
  border: 1px solid var(--panel);
  transition: background 0.3s, transform 0.3s;
}

.report-card:hover {
  background: var(--panel);
  transform: translateY(-3px);
}

.report-date {
  font-size: 0.8rem;
  color: var(--gold);
}

.report-card h3 {
  font-size: 1.1rem;
  margin: 0.3rem 0;
  color: var(--text);
}

.report-card p {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* News section styles */
.news {
  position: relative;
  border-radius: 0;
  margin-top: 0;
  padding: 4rem 2rem;
  box-shadow: none;
  color: var(--text);
  overflow: hidden;
}

.news::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.news video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
.news .container {
  position: relative;
  z-index: 1;
}

.news h2 {
  font-family: 'Cormorant Garamond', 'Cinzel', serif;
  color: var(--gold);
  margin-bottom: 1rem;
  text-align: center;
  position: relative;
  z-index: 1;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}
.news-cards {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  margin-top: 1rem;
}
.news-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1rem;
  border: 1px solid var(--panel);
  transition: background 0.3s, transform 0.3s;
}
.news-card:hover {
  background: var(--panel);
  transform: translateY(-3px);
}
.news-date {
  font-size: 0.8rem;
  color: var(--gold);
}
.news-card h3 {
  font-size: 1.1rem;
  margin: 0.3rem 0;
  color: var(--text);
}
.news-card p {
  font-size: 0.9rem;
  color: var(--text-light);
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.contact-list li {
  margin: 0.5rem 0;
}

.contact-list a {
  color: var(--gold);
}

/* Footer */
.site-footer {
  /* Footer shares the decorative frame but uses a dark overlay slightly lighter than before */
  background-image: var(--bg-header), rgba(18, 24, 33, 0.85);
  background-size: cover;
  background-position: center;
  padding: 2.5rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-light);
  /* Enhanced footer design */
  border-top: 2px solid rgba(199, 164, 72, 0.3);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
  position: relative;
  backdrop-filter: blur(8px);
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  opacity: 0.5;
}

.footer-auth {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.site-footer .container {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.site-footer p {
  margin: 0.5rem 0;
  line-height: 1.6;
  color: var(--text);
}

/* Modals - Enhanced Medieval Style */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal[aria-hidden="false"] {
  display: flex;
}

.modal-content {
  background: linear-gradient(135deg, rgba(18, 24, 33, 0.98) 0%, rgba(11, 15, 20, 0.98) 100%);
  padding: 0;
  border-radius: 12px;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8),
              0 0 0 2px rgba(199, 164, 72, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  color: var(--text);
  border: 2px solid rgba(199, 164, 72, 0.2);
  overflow: hidden;
  animation: slideUp 0.4s ease;
}

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

.modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  opacity: 0.6;
}

.modal-header {
  padding: 2rem 2rem 1rem;
  text-align: center;
  border-bottom: 1px solid rgba(199, 164, 72, 0.2);
  position: relative;
}

.modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  background: radial-gradient(circle, rgba(199, 164, 72, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(199, 164, 72, 0.3);
}

.modal-icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--gold);
}

.modal-header h2 {
  font-family: 'Cormorant Garamond', 'Cinzel', serif;
  font-size: 1.8rem;
  color: var(--gold);
  margin: 0 0 0.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.modal-subtitle {
  font-size: 0.9rem;
  color: var(--text-light);
  margin: 0;
  font-style: italic;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(199, 164, 72, 0.1);
  border: 1px solid rgba(199, 164, 72, 0.3);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1.2rem;
  color: var(--gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  line-height: 1;
}

.modal-close:hover {
  background: rgba(199, 164, 72, 0.2);
  border-color: var(--gold);
  transform: rotate(90deg);
}

.modal form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 2rem;
}

.form-group {
  position: relative;
}

.modal label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--text);
  position: relative;
}

.label-icon {
  font-size: 1.2rem;
  margin-right: 0.5rem;
  display: inline-block;
}

.modal input {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 2px solid rgba(199, 164, 72, 0.2);
  background: rgba(11, 15, 20, 0.8);
  color: var(--text);
  font-size: 1rem;
  transition: all 0.3s;
  font-family: inherit;
}

.modal input:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(11, 15, 20, 0.95);
  box-shadow: 0 0 0 3px rgba(199, 164, 72, 0.1),
              0 0 12px rgba(199, 164, 72, 0.2);
}

.modal input::placeholder {
  color: var(--text-light);
  opacity: 0.6;
}

.password-hint {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.25rem;
  font-style: italic;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-light);
  flex-direction: row;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(199, 164, 72, 0.3);
  border-radius: 4px;
  background: rgba(11, 15, 20, 0.8);
  position: relative;
  transition: all 0.3s;
  flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
  background: var(--gold);
  border-color: var(--gold);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--bg);
  font-size: 14px;
  font-weight: bold;
}

.checkbox-label a {
  color: var(--gold);
  text-decoration: underline;
}

.forgot-password {
  color: var(--gold);
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.3s;
}

.forgot-password:hover {
  color: var(--gold-dark);
  text-decoration: underline;
}

.btn-modal {
  width: 100%;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

.btn-modal svg {
  width: 20px;
  height: 20px;
}

.modal-footer {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(199, 164, 72, 0.2);
  text-align: center;
}

.modal-footer p {
  margin: 0;
  color: var(--text-light);
  font-size: 0.9rem;
}

.modal-footer a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
}

.modal-footer a:hover {
  color: var(--gold-dark);
  text-decoration: underline;
}

/* Toast notification */
#toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: var(--panel);
  color: var(--gold);
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: none;
  z-index: 3000;
  font-weight: 600;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 3.2rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.55rem;
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(199, 164, 72, 0.24);
  border-radius: 0.5rem;
  background: rgba(8, 13, 20, 0.72);
  color: #e4ca78;
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus-visible {
  border-color: #c7a448;
  outline: none;
}

.field-error {
  display: block;
  min-height: 1.15rem;
  margin-top: 0.25rem;
  color: #ffaaa4;
  font-size: 0.78rem;
  line-height: 1.35;
}

.auth-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.btn[hidden],
[data-auth-action][hidden] {
  display: none !important;
}

/* Wave transitions */
.wave {
  width: 100%;
  overflow: hidden;
  line-height: 0;
}
.wave svg {
  display: block;
  width: 100%;
  height: 100px;
}
.wave-up svg {
  transform: rotate(180deg);
}

/* ------------------------------------------------------------------- */
/* Decorative enhancements using chain images and ring overlay          */
/* These rules position the vertical chains along the sides of the hero
   section and display a ring behind the hero content. They also hide
   the old SVG-based chain separator graphics and replace them with
   repeating chain background images. */

/* Vertical chain decorations in hero */
.vertical-chain {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100px;
  /* Allow the spiked links to scale nicely without distortion */
  object-fit: cover;
  pointer-events: none;
  opacity: 0.4;
  z-index: -2;
}

.vertical-chain.left {
  left: 0;
  /* Mirror the chain on the left side for symmetry */
  transform: scaleX(-1);
}

.vertical-chain.right {
  right: 0;
}

/* Ring overlay behind hero content */
.ring-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 75%;
  max-width: 900px;
  pointer-events: none;
  opacity: 0.3;
  z-index: -1;
  /* Rotate the chain ring slowly for a mesmerizing effect */
  animation: spin 80s linear infinite;
}


/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* Responsive adjustments */
@media (max-width: 800px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(18, 24, 33, 0.95);
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
    gap: 1rem;
  }
  .nav-links.open {
    display: flex;
  }
  .menu-toggle {
    display: flex;
  }
  .nav-actions {
    display: none;
  }
  .hero {
    padding: 4rem 1rem;
  }
  .hero h1 {
    font-size: 1.8rem;
  }
  .subtitle {
    font-size: 1rem;
  }
  .hero-cta {
    flex-direction: column;
  }
  .poster .container {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .poster-image {
    max-width: 300px;
    margin: 2rem auto 0;
    mix-blend-mode: screen;
    filter: contrast(1.2) brightness(1.1);
  }
  .poster-cta {
    justify-content: center;
  }
}

/* Reduce motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation-duration: 0s !important;
  }
}

/* Decorative floating runes overlay */
.rune-container {
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  /* Positioned above the ring and vertical chains but below the hero content */
  z-index: 0;
}

.rune {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  opacity: 0.4;
  animation: float var(--duration) linear infinite;
  animation-delay: var(--delay);
}

@keyframes float {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0.4;
  }
  100% {
    transform: translateY(-120vh) scale(0.5);
    opacity: 0;
  }
}

/* Slow rotation for the decorative ring in the hero section */
@keyframes spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}
