/* General body setup */
body {
  font-family: Arial, sans-serif;
  background-color: #f8f8f8;
  text-align: center;
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow: hidden;
}

/* Logo (center + spin in/out) */
#logo {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0) rotate(0deg);
  width: 200px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
}

#logo.show {
  opacity: 1;
  animation: spinIn 0.4s forwards;
}

#logo.hide {
  animation: spinOut 0.4s forwards;
}

@keyframes spinIn {
  0% {
    transform: translate(-50%, -50%) scale(0) rotate(-360deg);
    opacity: 0;
  }

  100% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes spinOut {
  0% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -50%) scale(0) rotate(360deg);
    opacity: 0;
  }
}

/* Hide helper — must win */
.hidden {
  display: none !important;
}

/* OPTIONS (center the whole block, but allow internal scroll if tall) */
#options {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 40px 20px 20px 20px;
  z-index: 1;
  overflow-y: auto;
}

/* Stack puts banner above grid and moves everything slightly upwards */
.stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  width: min(1100px, 92vw);
}

/* Banner image */
.banner {
  width: min(820px, 80vw);
  height: auto;
  border-radius: 10px;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.12));
}

/* 3×2 grid centered */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  width: 100%;
  justify-items: center;
}

/* Boxes */
.box {
  background: #fff;
  color: #990403;
  border-radius: 12px;
  padding: 52px 28px;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  width: 100%;
  max-width: 320px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
  transition: transform 0.25s ease, box-shadow 0.25s ease;

  text-decoration: none;
  display: block;

  /* needed for watermark */
  position: relative;
  overflow: hidden;
}

/* base watermark layer (each box will set its own background-image) */
.box::before {
  content: "";
  position: absolute;
  inset: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 70%;
  /* adjust size of watermark */
  opacity: 0.06;
  /* how faint the watermark is */
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.box:hover::before {
  opacity: 0.11;
  transform: scale(1.03);
}

/* keep the text above the watermark */
.box span {
  position: relative;
  z-index: 1;
}

.box:hover {
  transform: translateY(-6px);
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

/* Per-card watermark images (update paths to your actual icons) */
.box-fundamental::before {
  background-image: url("../icons/fundamental.png");
}

.box-events::before {
  background-image: url("../icons/events.png");
}

.box-reps::before {
  background-image: url("../icons/reps.png");
}

.box-wisdom::before {
  background-image: url("../icons/wisdom.png");
}

.box-physical::before {
  background-image: url("../icons/physical.png");
}

.box-career::before {
  background-image: url("../icons/career.png");
}

/* Fade-in helper */
.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 980px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .banner {
    width: 90vw;
  }

  .box {
    padding: 40px 20px;
    font-size: 20px;
  }
}

@media (max-width: 600px) {
  body {
    overflow-y: auto;
    overflow-x: hidden;
  }

  #options {
    display: block;
    padding: 20px 10px;
  }

  .stack {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    gap: 20px;
    padding: 0 5px;
  }

  .banner {
    width: 80%;
    max-width: 300px;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 16px;
    width: 100%;
  }

  .box {
    max-width: 100%;
    padding: 36px 20px;
    font-size: 18px;
  }

  .box::before {
    background-size: 35%;
  }

  .partners-section {
    margin-top: 30px;
  }

  .partners-section h2 {
    font-size: 18px;
    margin-bottom: 12px;
  }

  .partner-logo {
    height: 30px !important;
  }

  /* Make specific logos even smaller on mobile */
  .partner-logo[alt="SC"] {
    height: 100px !important;
  }

  .partner-logo[alt="SZ FHS"] {
    height: 60px !important;
  }

  .partner-logo[alt="Sveučilište u Zagrebu"] {
    height: 50px !important;
  }

  .partner-logo[alt="Croatica"],
  .partner-logo[alt="DSN"] {
    height: 50px !important;
  }

  .partner-logo[alt="SZZG"],
  .partner-logo[alt="DBHZ"] {
    height: 40px !important;
  }
}

@media (max-width: 400px) {
  .stack {
    width: 100%;
    max-width: 100%;
    gap: 16px;
    padding: 0 3px;
  }

  .banner {
    width: 90%;
    border-radius: 6px;
  }

  .box {
    padding: 32px 16px;
    font-size: 17px;
  }

  .partners-section h2 {
    font-size: 16px;
  }

  .partner-logo {
    height: 25px !important;
  }

  .partner-logo[alt="SC"] {
    height: 80px !important;
  }

  .partner-logo[alt="SZ FHS"] {
    height: 50px !important;
  }
}

/* ========== Partners & Allies section on main page ========== */

.partners-section {
  margin-top: 40px;
  width: 100%;
}

.partners-section h2 {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #990403;
  /* same red */
}

/* The strip that holds the moving logos */
.partner-strip {
  overflow: hidden;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 14px 0;
}

.partner-track {
  display: inline-flex;
  align-items: center;
  gap: 40px;
  animation: partnersScroll 25s linear infinite;
}

/* Continuous scroll left; because logos are duplicated,
   when the first half leaves the screen, the second half follows seamlessly */
@keyframes partnersScroll {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

.partner-logo {
  height: 40px;
  width: auto;
  filter: grayscale(20%);
  opacity: 0.9;
  transition: transform 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
}

.partner-logo:hover {
  transform: scale(1.05);
  filter: grayscale(0%);
  opacity: 1;
}

/* ========== Sub-pages Shared Styles (Principles, Vitality, Wisdom, Conquest) ========== */

/* Top bar with logo in the top-left corner */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background-color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  z-index: 100;
}

/* clickable logo with spin on hover */
.logo-link {
  display: inline-block;
  cursor: pointer;
}

.logo-top-left {
  height: 40px;
  width: auto;
  transition: transform 0.6s ease;
}

.logo-link:hover .logo-top-left {
  transform: rotate(360deg);
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
  color: #990403;
  /* updated red */
}

.subpage-body {
  background-color: #f8f8f8;
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-y: auto;
  height: auto;
}

.content-wrapper {
  margin-top: 72px;
  padding: 60px 20px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 1;
}

.page-intro {
  text-align: center;
  margin-bottom: 60px;
  animation: fadeIn 0.8s ease forwards;
}

.page-intro h2 {
  color: #990403;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.page-intro p {
  font-size: 18px;
  line-height: 1.6;
  color: #555;
  max-width: 800px;
  margin: 0 auto;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  animation: fadeIn 1s ease forwards;
}

.info-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 40px 30px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-bottom: 4px solid transparent;
  box-sizing: border-box;
}

.info-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px rgba(153, 4, 3, 0.15);
  border-bottom: 4px solid #990403;
}

.info-card h3 {
  margin: 0 0 12px;
  font-size: 20px;
  color: #990403;
  font-weight: 700;
}

.info-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: #666;
}

/* Specific Background for Principles Page */
.principles-page::before {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background-image: url("../icons/fundamental.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

/* Center the grid items specifically for the Principles page */
.principles-page .content-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.principles-page .info-card {
  flex: 1 1 300px;
  max-width: 400px;
}

/* References Section */
.references-section {
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid #e0e0e0;
  text-align: left;
  font-size: 14px;
  color: #555;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeIn 1.2s ease forwards;
}

.references-section h3 {
  color: #990403;
  font-size: 18px;
  margin-bottom: 16px;
  font-weight: 700;
}

.references-section ol {
  padding-left: 20px;
  margin: 0;
}

.references-section li {
  margin-bottom: 12px;
  line-height: 1.5;
}

.references-section a {
  color: #990403;
  text-decoration: none;
  font-weight: 600;
}

.references-section a:hover {
  text-decoration: underline;
}

/* Responsive adjustments for Sub-pages (Vitality, Wisdom, Principles, Conquest) */
@media (max-width: 600px) {
  .content-wrapper {
    margin-top: 60px;
    padding: 30px 15px;
  }

  .page-intro {
    margin-bottom: 40px;
  }

  .page-intro h2 {
    font-size: 24px;
  }

  .page-intro p {
    font-size: 16px;
  }

  .content-grid {
    grid-template-columns: 1fr;
    /* Force single column on mobile */
    gap: 20px;
  }

  /* Fix for Principles page flex layout on mobile */
  .principles-page .info-card {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .info-card {
    padding: 30px 20px;
  }

  /* Adjust background watermark size for mobile */
  .principles-page::before {
    width: 300px;
    height: 300px;
  }
}

/* ========== Representatives page ========== */

.representatives-page {
  margin: 0;
  padding: 0;
  background-color: #f8f8f8;
  font-family: Arial, sans-serif;
  overflow-y: auto;
  height: auto;
  min-height: 100vh;
}

.representatives-wrapper {
  margin-top: 72px;
  padding: 40px 20px 60px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.representatives-intro {
  text-align: center;
  margin-bottom: 50px;
  padding: 0 20px;
}

.representatives-intro p {
  font-size: 18px;
  line-height: 1.6;
  color: #555;
  max-width: 700px;
  margin: 0 auto;
}

/* Representatives Grid */
.representatives-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 35px;
  padding: 0 10px;
}

/* Individual Representative Card */
.rep-card {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.rep-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px rgba(153, 4, 3, 0.15);
}

/* Photo Container - UPDATED FOR CIRCULAR PHOTOS */
.rep-photo-container {
  position: relative;
  width: 100%;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #990403 0%, #c41e1c 100%);
  padding: 40px;
  box-sizing: border-box;
}

.rep-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  display: block;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Custom border frame overlay */
.rep-photo-container::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background-image: url('../../photos/misc/border-frame.png');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 2;
  transition: transform 0.4s ease;
}

/* Optional: Add white overlay to make border appear thinner */
.rep-photo-container::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: linear-gradient(135deg, #990403 0%, #c41e1c 100%);
  pointer-events: none;
  z-index: 1.5;
  transition: transform 0.4s ease;
}

.rep-card:hover .rep-photo-container::before {
  transform: scale(1.08);
}

.rep-card:hover .rep-photo {
  transform: scale(1.08);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.rep-card:hover .rep-photo-container::after {
  transform: scale(1.08);
}

.rep-photo-overlay {
  display: none;
}

/* Content Section */
.rep-content {
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.rep-name {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #990403;
  line-height: 1.2;
}

.rep-position {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rep-details {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rep-education {
  margin: 0;
  font-size: 14px;
  color: #990403;
  font-weight: 600;
  font-style: italic;
}



.rep-bio {
  margin: 12px 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: #990403;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Tags */
.rep-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.tag {
  display: inline-block;
  padding: 6px 14px;
  background-color: #fff0f0;
  color: #990403;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid #ffe0e0;
  transition: all 0.2s ease;
}

.tag:hover {
  background-color: #990403;
  color: #ffffff;
  border-color: #990403;
}

/* Appearances / Contributions */
.rep-appearances {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed rgba(153, 4, 3, 0.2);
}

.appearance-title {
  font-size: 11px;
  font-weight: 800;
  color: #990403;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.appearance-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.appearance-link {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  text-decoration: none;
  color: #444;
  font-size: 11.5px;
  line-height: 1.4;
  transition: all 0.2s ease;
  text-align: left;
}

.appearance-link span {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.appearance-link:hover {
  color: #990403;
  transform: translateX(4px);
}

.appearance-icon {
  flex-shrink: 0;
  color: inherit;
}

/* Contact Links */
.rep-contact {
  display: flex;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background-color: #f8f8f8;
  color: #990403;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
  transition: all 0.2s ease;
  flex: 1;
  justify-content: center;
  cursor: pointer;
  font-family: Arial, sans-serif;
}

.contact-link:hover {
  background-color: #990403;
  color: #ffffff;
  border-color: #990403;
  transform: translateY(-2px);
}

.contact-link svg {
  flex-shrink: 0;
}

/* Responsive adjustments for Representatives page */
@media (max-width: 768px) {
  .representatives-wrapper {
    margin-top: 60px;
    padding: 20px 15px 40px;
  }

  .representatives-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .rep-photo-container {
    height: 280px;
    padding: 30px;
  }

  .rep-photo {
    width: 180px;
    height: 180px;
  }

  .rep-photo-container::after {
    width: 240px;
    height: 240px;
  }

  .rep-photo-container::before {
    width: 200px;
    height: 200px;
  }

  .rep-name {
    font-size: 20px;
  }

  .rep-position {
    font-size: 13px;
  }

  .rep-bio {
    font-size: 13px;
  }

  .representatives-intro p {
    font-size: 16px;
  }

  .rep-tags {
    gap: 6px;
  }

  .tag {
    font-size: 11px;
    padding: 5px 12px;
  }

  .topbar h1 {
    font-size: 18px;
  }

  .logo-top-left {
    height: 35px;
  }
}

@media (max-width: 480px) {
  .representatives-wrapper {
    margin-top: 60px;
    padding: 15px 10px 30px;
  }

  .rep-photo-container {
    height: 260px;
    padding: 25px;
  }

  .rep-photo {
    width: 160px;
    height: 160px;
  }

  .rep-photo-container::after {
    width: 220px;
    height: 220px;
  }

  .rep-photo-container::before {
    width: 180px;
    height: 180px;
  }

  .rep-content {
    padding: 20px 16px 16px;
  }

  .rep-name {
    font-size: 19px;
  }

  .rep-position {
    font-size: 12px;
  }

  .rep-education {
    font-size: 13px;
  }

  .rep-bio {
    font-size: 13px;
    line-height: 1.5;
  }

  .rep-contact {
    flex-direction: column;
    gap: 8px;
  }

  .contact-link {
    width: 100%;
    max-width: 100%;
    padding: 10px 16px;
    box-sizing: border-box;
  }

  .topbar {
    padding: 10px 15px;
  }

  .topbar h1 {
    font-size: 16px;
  }

  .logo-top-left {
    height: 32px;
  }

  .representatives-intro p {
    font-size: 15px;
  }
}

/* Language Switcher */
.language-switcher-container {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
}

.language-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 20px;
}

.language-switcher .lang-link {
  color: white;
  text-decoration: none;
  font-weight: bold;
  font-size: 0.9rem;
  transition: color 0.3s;
}

.language-switcher .lang-link.active,
.language-switcher .lang-link:hover {
  color: #c0c0c0;
  /* Light gray for active/hover */
}

.language-switcher span {
  color: white;
}

.topbar .language-switcher {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-right: 1rem;
  background-color: transparent;
}

.topbar .language-switcher .lang-link {
  color: #990403;
}

.topbar .language-switcher span {
  color: #990403;
}

/* ========== Vitality / Challenge Page — Enhanced ========== */

/* Background watermark for vitality page */
.vitality-page::before {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background-image: url("../icons/physical.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}

/* Challenge Section */
.challenge-section {
  margin-bottom: 70px;
  animation: fadeIn 0.8s ease forwards;
}

/* Challenge Header */
.challenge-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  margin-bottom: 50px;
  padding: 30px 40px;
  background: linear-gradient(135deg, #990403 0%, #c41e1c 50%, #990403 100%);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(153, 4, 3, 0.25);
  position: relative;
  overflow: hidden;
}

.challenge-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.challenge-title {
  color: #ffffff;
  font-size: 30px;
  font-weight: 800;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 1;
}

.challenge-logo {
  height: 72px;
  width: auto;
  filter: brightness(0) invert(1) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
  position: relative;
  z-index: 1;
  transition: transform 0.4s ease;
}

.challenge-logo:hover {
  transform: scale(1.1) rotate(3deg);
}

/* Medal Grid */
.medal-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

/* Medal Cards */
.medal-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #ffffff;
  border-radius: 16px;
  padding: 22px 26px;
  flex: 0 1 280px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  text-align: left;
  border-left: 4px solid transparent;
  position: relative;
  overflow: hidden;
}

.medal-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, transparent 0%, rgba(153, 4, 3, 0.02) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.medal-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 36px rgba(153, 4, 3, 0.15);
}

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

/* Colored left border on hover per medal tier */
.medal-card:nth-child(1) {
  border-left-color: #b9936c;
}

.medal-card:nth-child(2) {
  border-left-color: #8c8c8c;
}

.medal-card:nth-child(3) {
  border-left-color: #cd7f32;
}

.medal-card:nth-child(4) {
  border-left-color: #c0c0c0;
}

.medal-card:nth-child(5) {
  border-left-color: #ffd700;
}

.medal-card:nth-child(6) {
  border-left-color: #d4cfc9;
}

.medal-card:nth-child(7) {
  border-left-color: #82cedb;
}

/* Medal Icon */
.medal-icon {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  /* Outer ring border */
  border: 3px solid rgba(0, 0, 0, 0.08);
}

.medal-card:hover .medal-icon {
  transform: scale(1.15) rotate(8deg);
}

/* Inner ring to give a coin/medal feel */
.medal-icon::before {
  content: "\2605";
  /* star character */
  position: absolute;
  inset: 5px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  pointer-events: none;
  z-index: 1;
}

/* Glossy shine sweep */
.medal-icon::after {
  content: "";
  position: absolute;
  top: -30%;
  left: -30%;
  width: 160%;
  height: 160%;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.4) 45%,
      rgba(255, 255, 255, 0) 55%,
      rgba(255, 255, 255, 0) 100%);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.6s ease;
  transform: translateX(-60%);
  z-index: 2;
}

.medal-card:hover .medal-icon::after {
  opacity: 1;
  transform: translateX(60%);
}

/* Custom Medal Colors */
.medal-icon.wood {
  background: linear-gradient(145deg, #d4ad7c, #8a6e4b, #c9a37c);
  border-color: #7a5e3b;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.15), inset 0 -4px 8px rgba(0, 0, 0, 0.25), 0 4px 14px rgba(138, 110, 75, 0.4);
}

.medal-icon.wood::before {
  color: rgba(255, 255, 255, 0.25);
}

.medal-icon.iron {
  background: linear-gradient(145deg, #d5d5d5, #6e6e6e, #aaaaaa);
  border-color: #666;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2), inset 0 -4px 8px rgba(0, 0, 0, 0.25), 0 4px 14px rgba(100, 100, 100, 0.4);
}

.medal-icon.bronze {
  background: linear-gradient(145deg, #f0a84c, #8b5a1e, #cd7f32);
  border-color: #7a4b12;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2), inset 0 -4px 8px rgba(0, 0, 0, 0.25), 0 4px 14px rgba(205, 127, 50, 0.45);
}

.medal-icon.silver {
  background: linear-gradient(145deg, #f8f8f8, #8e8e8e, #d4d4d4);
  border-color: #999;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.35), inset 0 -4px 8px rgba(0, 0, 0, 0.15), 0 4px 14px rgba(180, 180, 180, 0.45);
}

.medal-icon.silver::before {
  color: rgba(255, 255, 255, 0.45);
  border-color: rgba(255, 255, 255, 0.35);
}

.medal-icon.gold {
  background: linear-gradient(145deg, #ffe66a, #9e7c00, #ffd700);
  border-color: #b89b00;
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.3), inset 0 -4px 8px rgba(0, 0, 0, 0.2), 0 4px 16px rgba(255, 215, 0, 0.5);
}

.medal-icon.gold::before {
  color: rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.35);
}

.medal-icon.platinum {
  background: linear-gradient(145deg, #f5f4f2, #9e9c9a, #e0dfdd);
  border-color: #b0aeac;
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.4), inset 0 -4px 8px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(200, 198, 196, 0.5);
}

.medal-icon.platinum::before {
  color: rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.4);
}

.medal-icon.diamond {
  background: linear-gradient(145deg, #e8faff, #48a8be, #b9ecf7);
  border-color: #5eb8cc;
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.45), inset 0 -4px 8px rgba(0, 0, 0, 0.12), 0 4px 18px rgba(130, 206, 219, 0.55);
}

.medal-icon.diamond::before {
  content: "\2666";
  color: rgba(255, 255, 255, 0.55);
  border-color: rgba(255, 255, 255, 0.4);
  font-size: 16px;
}

.medal-info {
  flex-grow: 1;
}

.medal-card h3 {
  margin: 0 0 4px;
  font-size: 17px;
  color: #990403;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.medal-card p {
  margin: 0;
  font-size: 15px;
  color: #777;
  font-weight: 600;
}

/* ========== Guidelines Section ========== */

.guidelines-section {
  margin-top: 70px;
  animation: fadeIn 1s ease forwards;
}

.guidelines-title {
  color: #990403;
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 36px;
  text-align: center;
  letter-spacing: 0.5px;
  position: relative;
  padding-bottom: 16px;
}

.guidelines-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, #990403, #c41e1c);
  border-radius: 2px;
}

.guideline-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 36px 36px 32px;
  margin-bottom: 28px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  text-align: left;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-top: 3px solid transparent;
  position: relative;
}

.guideline-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(153, 4, 3, 0.12);
  border-top-color: #990403;
}

.guideline-card h3 {
  margin: 0 0 16px;
  font-size: 21px;
  color: #990403;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.guideline-card h3::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 24px;
  background: linear-gradient(to bottom, #990403, #c41e1c);
  border-radius: 3px;
  flex-shrink: 0;
}

.guideline-card p,
.guideline-card ol {
  font-size: 16px;
  line-height: 1.8;
  color: #555;
}

.guideline-card ol {
  padding-left: 24px;
  counter-reset: guideline-counter;
}

.guideline-card ol li {
  margin-bottom: 14px;
  padding-left: 4px;
}

.guideline-card a {
  color: #990403;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 18px;
  background: #fff0f0;
  border-radius: 8px;
  border: 1px solid #ffe0e0;
  transition: all 0.2s ease;
  font-size: 14px;
}

.guideline-card a:hover {
  background: #990403;
  color: #ffffff;
  border-color: #990403;
  transform: translateY(-1px);
}

/* ========== Vitality Responsive ========== */

@media (max-width: 768px) {
  .challenge-header {
    flex-direction: column;
    gap: 16px;
    padding: 24px 20px;
    border-radius: 16px;
  }

  .challenge-title {
    font-size: 22px;
    letter-spacing: 1px;
  }

  .challenge-logo {
    height: 56px;
  }

  .medal-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .guidelines-title {
    font-size: 22px;
  }

  .guideline-card {
    padding: 26px 22px;
  }

  .vitality-page::before {
    width: 300px;
    height: 300px;
  }
}

@media (max-width: 480px) {
  .challenge-header {
    padding: 20px 16px;
  }

  .challenge-title {
    font-size: 18px;
  }

  .challenge-logo {
    height: 48px;
  }

  .challenge-logo.left {
    display: none;
  }

  .medal-card {
    padding: 16px 18px;
  }

  .medal-icon {
    width: 46px;
    height: 46px;
  }

  .guideline-card {
    padding: 22px 18px;
    border-radius: 14px;
  }

  .guideline-card h3 {
    font-size: 18px;
  }

  .guideline-card p,
  .guideline-card ol {
    font-size: 15px;
  }
}

/* ========== Gateway & Detailed Book Pages ========== */

.gateway-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.gateway-card {
  position: relative;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  min-height: 280px;
}

.gateway-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 36px rgba(153, 4, 3, 0.15);
}

.gateway-spine {
  height: 8px;
  width: 100%;
}

.intellectual-spine {
  background: linear-gradient(90deg, #660000 0%, #990403 100%);
}

.bridge-spine {
  background: linear-gradient(90deg, #444 0%, #888 100%);
}

.spiritual-spine {
  background: linear-gradient(90deg, #d4af37 0%, #ffd700 100%);
}

.gateway-content {
  padding: 30px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  position: relative;
  z-index: 1;
}

.gateway-title {
  font-size: 22px;
  color: #990403;
  margin: 0 0 10px 0;
  text-transform: uppercase;
}

.gateway-subtitle {
  font-size: 15px;
  color: #555;
  margin: 0 0 20px 0;
  line-height: 1.5;
}

.gateway-explore {
  margin-top: auto;
  font-size: 14px;
  font-weight: 700;
  color: #990403;
  text-align: right;
  transition: padding-right 0.3s ease;
}

.gateway-card:hover .gateway-explore {
  padding-right: 5px;
}

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: #666;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: #990403;
}

/* ========== Cinematic Poster Grid ========== */

.cinematic-mode {
  background-color: #1a0505;
  /* Deep cinematic red */
  color: #f0f0f0;
}

.cinematic-mode .topbar h1 {
  color: #990403;
}

.cinematic-mode .gateway-card {
  background: #110000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.cinematic-mode .gateway-title {
  color: #ffffff;
}

.cinematic-mode .gateway-subtitle {
  color: #aaaaaa;
}

.cinematic-mode .page-intro h2 {
  color: #ffffff;
}

.cinematic-mode .page-intro p {
  color: #cccccc;
}

.cinematic-mode .back-link {
  color: #aaaaaa;
}

.cinematic-mode .back-link:hover {
  color: #ffffff;
}

/* Representatives Cinematic Overrides */
.cinematic-mode.representatives-page {
  background-color: #1a0505;
}

.cinematic-mode .representatives-intro p {
  color: #cccccc;
}

.cinematic-mode .rep-card {
  background: rgba(20, 0, 0, 0.6);
  border: 1px solid rgba(153, 4, 3, 0.2);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cinematic-mode .rep-card:hover {
  background: rgba(40, 0, 0, 0.8);
  border-color: rgba(153, 4, 3, 0.6);
  box-shadow: 0 15px 40px rgba(153, 4, 3, 0.2);
  transform: translateY(-10px) scale(1.02);
}

.cinematic-mode .rep-photo-container {
  background: linear-gradient(135deg, #4a0000 0%, #110000 100%);
  border-bottom: 1px solid rgba(153, 4, 3, 0.2);
}

.cinematic-mode .rep-photo-container::before {
  background: linear-gradient(135deg, #990403 0%, #330000 100%);
}

.cinematic-mode .rep-name {
  color: #ffffff;
}

.cinematic-mode .rep-position {
  color: #ff6666;
}

.cinematic-mode .rep-education {
  color: #990403;
}

.rep-work-position {
  margin: 6px 0 2px;
  font-size: 13px;
  font-weight: 500;
  color: #990403;
  display: inline-block;
  padding: 2px 0;
  position: relative;
}



.cinematic-mode .rep-work-position {
  color: #ff9999;
}

.cinematic-mode .rep-bio {
  color: #ff6666;
}

.cinematic-mode .tag {
  background-color: #220000;
  color: #ff6666;
  border-color: #660000;
}

.cinematic-mode .tag:hover {
  background-color: #990403;
  color: #ffffff;
  border-color: #ff3333;
}

.cinematic-mode .rep-contact {
  border-top: 1px solid rgba(153, 4, 3, 0.2);
}

.cinematic-mode .rep-appearances {
  border-top-color: rgba(255, 102, 102, 0.2);
}

.cinematic-mode .appearance-title {
  color: #ff6666;
}

.cinematic-mode .appearance-link {
  color: #cccccc;
}

.cinematic-mode .appearance-link:hover {
  color: #ffffff;
}

.cinematic-mode .contact-link {
  background-color: #1a0505;
  color: #ff6666;
  border-color: rgba(153, 4, 3, 0.3);
}

.cinematic-mode .contact-link:hover {
  background-color: #990403;
  color: #ffffff;
  border-color: #ff3333;
  transform: translateY(-2px);
}

.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.poster-card {
  position: relative;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.poster-card:hover {
  transform: scale(1.05);
}

.poster-cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  margin-bottom: 12px;
}

.poster-info {
  display: flex;
  flex-direction: column;
}

.poster-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 4px 0;
  line-height: 1.2;
}

.poster-author {
  font-size: 13px;
  color: #aaaaaa;
  margin: 0;
}

/* ========== Cinematic Modal ========== */

.movie-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.movie-modal-content {
  background: #110000;
  /* Extremely dark red/black */
  border: 1px solid #4a0000;
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: row;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.movie-modal-overlay.active .movie-modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 28px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  z-index: 2;
}

.modal-close:hover {
  opacity: 1;
}

.modal-left {
  flex: 0 0 300px;
}

.modal-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 12px 0 0 12px;
}

.modal-right {
  padding: 40px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.modal-title {
  font-size: 32px;
  color: #ffffff;
  margin: 0 0 8px 0;
}

.modal-author {
  font-size: 16px;
  color: #990403;
  margin: 0 0 20px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.modal-desc {
  font-size: 16px;
  line-height: 1.6;
  color: #cccccc;
}

/* ========== Difficulty Meter ========== */

.modal-difficulty {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.difficulty-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #888888;
  white-space: nowrap;
}

.difficulty-track {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.difficulty-fill {
  height: 100%;
  border-radius: 4px;
  width: 0%;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Color grades for difficulty */
.difficulty-fill[data-level="1"],
.difficulty-fill[data-level="2"],
.difficulty-fill[data-level="3"] {
  background: linear-gradient(90deg, #2d8a4e, #4ade80);
}

.difficulty-fill[data-level="4"],
.difficulty-fill[data-level="5"] {
  background: linear-gradient(90deg, #b8860b, #fbbf24);
}

.difficulty-fill[data-level="6"],
.difficulty-fill[data-level="7"] {
  background: linear-gradient(90deg, #c45e00, #f97316);
}

.difficulty-fill[data-level="8"],
.difficulty-fill[data-level="9"],
.difficulty-fill[data-level="10"] {
  background: linear-gradient(90deg, #990403, #ef4444);
}

.difficulty-value {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  min-width: 32px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
  .movie-modal-content {
    flex-direction: column;
  }

  .modal-left {
    flex: none;
    width: 100%;
    max-height: 400px;
  }

  .modal-poster {
    border-radius: 12px 12px 0 0;
  }

  .poster-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .modal-difficulty {
    padding: 10px 14px;
  }
}