:root {
  /* Light Theme Colors */
  --bg-primary: #f0ede3;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #0c0b09;
  --text-secondary: #444444;
  --brand-primary: #057087;
  --brand-secondary: #54b0bf;
  --accent-warning: #f38833;
  --accent-danger: #bc2231;
  --accent-success: #54b0bf;
  --border-color: #e0e0e0;
}

[data-theme="dark"] {
  /* Dark Theme Colors */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --brand-primary: #14b8a6;
  --brand-secondary: #22d3ee;
  --accent-warning: #f97316;
  --accent-danger: #f43f5e;
  --accent-success: #84cc16;
  --border-color: #475569;
}

body {
  font-family: "Press Start 2P", cursive;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.pixel-border {
  border: 4px solid var(--brand-primary);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  border-radius: 0;
}

/* Background video */
.video-background {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}

.video-background-media {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  filter: saturate(0.9) contrast(1.05);
}

.video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.5) 0%,
    rgba(15, 23, 42, 0.25) 40%,
    rgba(15, 23, 42, 0.5) 100%
  );
  z-index: -1;
}

/* Hoverable logo (MISINFO) */
.logo-container {
  display: flex;
  align-items: center;
}

.concept-two {
  display: grid;
  grid: 100% / repeat(7, 1fr);
  gap: 0.5rem;
}

.concept-two .hover {
  position: relative;
  display: grid;
  place-items: center;
}

.concept-two h1 {
  color: transparent;
  -webkit-text-stroke: 2px #fff;
  text-shadow: none;
  transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  font-size: 1.2rem;
  margin: 0;
}

.concept-two .hover:hover h1 {
  transform: scale(1.5);
  color: #fff;
  -webkit-text-stroke: 2px transparent;
  text-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Navbar sparkle effect - exact from navbar.txt */
.nav-link {
  --color: var(--brand-secondary);
  --shadow: rgba(0, 0, 0, 0.35);
  --glare: rgba(255, 255, 255, 0.8);
  --font-size: 12px;
  --padding: 8px 16px;
  padding: var(--padding);
  border-radius: 4px;
  text-decoration: none;
  color: transparent;
  position: relative;
  transition: background 0.2s;
  display: inline-block;
  --hover: 0.4;
  --pos: 0;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  --hover: 1;
  --pos: 1;
}

.nav-link:active {
  --hover: 0;
}

.nav-link:active span:last-of-type {
  --hover: 0;
  --pos: 1;
}

.nav-link span {
  display: inline-block;
  font-size: calc(var(--font-size) * 1.5);
  font-weight: bold;
  transition: all 0.2s;
  text-decoration: none;
  text-shadow: calc(var(--hover) * (var(--font-size) * -0))
      calc(var(--hover) * (var(--font-size) * 0)) var(--shadow),
    calc(var(--hover) * (var(--font-size) * -0.02))
      calc(var(--hover) * (var(--font-size) * 0.02)) var(--shadow),
    calc(var(--hover) * (var(--font-size) * -0.04))
      calc(var(--hover) * (var(--font-size) * 0.04)) var(--shadow),
    calc(var(--hover) * (var(--font-size) * -0.06))
      calc(var(--hover) * (var(--font-size) * 0.06)) var(--shadow),
    calc(var(--hover) * (var(--font-size) * -0.08))
      calc(var(--hover) * (var(--font-size) * 0.08)) var(--shadow),
    calc(var(--hover) * (var(--font-size) * -0.1))
      calc(var(--hover) * (var(--font-size) * 0.1)) var(--shadow);
  transform: translate(
    calc(var(--hover) * (var(--font-size) * 0.1)),
    calc(var(--hover) * (var(--font-size) * -0.1))
  );
  color: white;
}

.nav-link span:last-of-type {
  position: absolute;
  inset: var(--padding);
  background: linear-gradient(
        108deg,
        transparent 0 55%,
        var(--glare) 55% 60%,
        transparent 60% 70%,
        var(--glare) 70% 85%,
        transparent 85%
      )
      calc(var(--pos) * -200%) 0% / 200% 100%,
    var(--color);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  z-index: 2;
  text-shadow: none;
  transform: translate(
    calc(var(--hover) * (var(--font-size) * 0.1)),
    calc(var(--hover) * (var(--font-size) * -0.1))
  );
  transition: transform 0.2s, background-position 0s;
}

.nav-link:hover span:last-of-type {
  transition: transform 0.2s,
    background-position calc(var(--hover) * 1.5s) calc(var(--hover) * 0.25s);
}

.nav-link svg {
  position: absolute;
  z-index: 3;
  width: calc(var(--font-size) * 0.5);
  aspect-ratio: 1;
  --delay-step: 0.15;
  top: calc(var(--y, 50) * 1%);
  left: calc(var(--x, 0) * 1%);
  transform: translate(-50%, -50%) scale(0);
}

.nav-link svg path {
  fill: var(--glare);
}

.nav-link:hover svg {
  animation: sparkle 0.75s calc((var(--delay-step) * var(--d)) * 1s) both;
}

@keyframes sparkle {
  50% {
    transform: translate(-50%, -50%) scale(var(--s, 1));
  }
}

.nav-link svg:nth-of-type(1) {
  --x: 0;
  --y: 20;
  --s: 1.1;
  --d: 1;
}
.nav-link svg:nth-of-type(2) {
  --x: 15;
  --y: 80;
  --s: 1.25;
  --d: 2;
}
.nav-link svg:nth-of-type(3) {
  --x: 45;
  --y: 40;
  --s: 1.1;
  --d: 3;
}
.nav-link svg:nth-of-type(4) {
  --x: 75;
  --y: 60;
  --s: 0.9;
  --d: 2;
}
.nav-link svg:nth-of-type(5) {
  --x: 100;
  --y: 30;
  --s: 0.8;
  --d: 4;
}

/* Login button (slide only, no bubbles) */
.button {
  position: relative;
  text-align: center;
  height: 40px;
  width: 140px;
}

.button input {
  display: none;
}

.button_inner {
  border-radius: 2px;
  position: absolute;
  width: 140px;
  height: 40px;
  left: 0;
  right: 0;
  top: 50%;
  margin: auto;
  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.04);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  border: 2px solid #fff;
  color: white;
  text-align: center;
  transition: all 0.3s, box-shadow 0.2s, transform 0.2s 0.2s;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.button_inner span.t {
  position: relative;
  top: 0;
  opacity: 1;
  left: 0;
  transition: transform 0.4s 0.1s;
  font-size: 12px;
}

.button_inner i.l {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #00c4ff;
  font-size: 18px;
  opacity: 0;
  transition: left 0.3s 0s, opacity 0.3s 0s;
}

.button_inner:hover {
  color: #2c3940;
  background: white;
  box-shadow: 0 17px 18px -14px rgba(0, 0, 0, 0.08);
}

.button_inner:hover span.t {
  transform: translateX(10px);
}

.button_inner:hover i.l {
  left: 10px;
  opacity: 1;
}

/* Ensure hero shows video */
.hero-section {
  background: transparent !important;
  color: white;
  padding: 60px 20px;
  text-align: center;
}

.game-placeholder {
  border: 4px dashed var(--accent-warning);
  background: linear-gradient(
    45deg,
    var(--brand-secondary) 25%,
    #f1ef35 25%,
    #f1ef35 50%,
    var(--brand-secondary) 50%,
    var(--brand-secondary) 75%,
    #f1ef35 75%
  );
  background-size: 20px 20px;
  color: var(--accent-danger);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.game-placeholder:hover {
  transform: scale(1.02);
  box-shadow: 0 0 20px rgba(243, 136, 51, 0.5);
}

.hover-button:hover {
  background-color: var(--accent-warning) !important;
  color: white !important;
  transform: translateY(-2px);
}

.mobile-nav a {
  color: white !important;
  transition: all 0.3s ease;
  text-decoration: none;
  font-weight: bold;
  border: 2px solid transparent;
}

.mobile-nav a:hover {
  background-color: var(--accent-warning) !important;
  color: white !important;
  transform: translateY(-2px);
  border-color: var(--accent-warning);
  box-shadow: 0 4px 8px rgba(243, 136, 51, 0.3);
}

.nav-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.nav-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

.fullscreen-game {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 1000 !important;
  background: var(--brand-primary) !important;
  margin: 0 !important;
  padding: 20px !important;
  border: none !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
}

.game-controls {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1001;
}

.exit-game-btn {
  background: var(--accent-danger) !important;
  color: white !important;
  padding: 12px 24px !important;
  font-size: 14px !important;
}

.exit-game-btn:hover {
  background: var(--accent-warning) !important;
  transform: scale(1.1) !important;
}

.hamburger-menu {
  display: none;
  font-size: 24px;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 10px;
  transition: all 0.3s ease;
}

/* Hexagon overlay styles */
.hexagon-bg {
  position: absolute;
  top: 64px; /* height of header (approx) */
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0; /* sits above video (z -2) but below content header and main */
  pointer-events: none; /* default non-interactive; we'll enable pointer when hovered */
}

#hexagon-bg.hover-active {
  pointer-events: auto; /* allow events when active */
}

#hexagon-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: transparent;
}

/* When user hovers near the hexagon area, reveal subtle hex lines */
.hexagon-visible {
  opacity: 1;
  transition: opacity 0.35s ease-in-out;
}

.hexagon-hidden {
  opacity: 0;
  transition: opacity 0.35s ease-in-out;
}

.hamburger-menu:hover {
  color: var(--accent-warning);
  transform: scale(1.1);
}

.mobile-nav {
  display: none;
  flex-direction: column;
  background: rgba(5, 112, 135, 0.95);
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 20px;
  border-top: 4px solid var(--brand-secondary);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

/* Desktop navigation - always visible on larger screens */
.desktop-nav {
  display: flex !important;
  align-items: center;
  gap: 1.5rem;
  z-index: 10;
  visibility: visible !important;
  opacity: 1 !important;
}

.desktop-nav .nav-link {
  white-space: nowrap;
  position: relative;
  visibility: visible !important;
  opacity: 1 !important;
  display: block !important;
}

/* Ensure header text is visible */
header {
  background-color: rgba(5, 112, 135, 0.9) !important;
  color: white !important;
  position: relative;
  z-index: 100;
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--brand-secondary);
}

header .text-lg,
header .text-xl {
  color: white !important;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Mobile navigation - hidden by default */
.mobile-nav {
  display: none;
}

/* Mobile hamburger menu - hidden by default */
.hamburger-menu {
  display: none;
}

@media (max-width: 768px) {
  /* Hide desktop nav on mobile */
  .desktop-nav {
    display: none !important;
  }

  /* Show hamburger menu on mobile */
  .hamburger-menu {
    display: block !important;
  }

  /* Show mobile nav when visible */
  .mobile-nav.nav-visible {
    display: flex !important;
  }

  .mobile-nav a {
    padding: 15px;
    border-bottom: 2px solid var(--brand-secondary);
    margin-bottom: 5px;
    border-radius: 4px;
  }

  .mobile-nav a:last-child {
    border-bottom: none;
    margin-bottom: 0;
  }
}

.content-section {
  flex: 1;
  padding: 20px;
}

.fact-check-section {
  background: var(--bg-primary);
  padding: 40px 20px;
}

/* Game description block that spans the width of the resource boxes */
.game-description {
  background: var(--bg-card);
  border: 4px solid var(--brand-primary);
  padding: 20px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

@media (max-width: 768px) {
  .game-description {
    grid-column: 1 / -1; /* ensure full width on small screens */
  }
}

.chat-input {
  border: 3px solid var(--brand-primary) !important;
  font-family: "Press Start 2P", cursive !important;
  font-size: 12px !important;
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

.chat-input:focus {
  border-color: var(--accent-warning) !important;
  box-shadow: 0 0 10px rgba(243, 136, 51, 0.5) !important;
}

.misinfo-stats {
  background: var(--brand-secondary);
  padding: 30px;
  margin: 40px auto;
  text-align: center;
  max-width: 1200px;
  width: 90%;
}

.stat-number {
  font-size: 2.5rem;
  color: var(--accent-danger);
  margin-bottom: 10px;
}

.stat-label {
  color: var(--brand-primary);
  font-size: 0.8rem;
}

.warning-banner {
  background: rgba(243, 136, 51, 0.8);
  color: white;
  padding: 15px;
  text-align: center;
  margin: 20px auto;
  max-width: 600px;
  width: 90%;
  backdrop-filter: blur(5px);
  border: 2px solid var(--accent-warning);
}

.hidden {
  display: none !important;
}

#chatbot-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Press Start 2P", cursive;
  font-size: 0.9rem;
  font-weight: bold;
  color: #e0f7fa;
  background-color: #0d1b2a;
  padding: 1rem 2rem;
  border: 4px solid #00bcd4;
  border-radius: 999px;
  clip-path: inset(0 round 20px);
  transition: all 0.2s ease-in-out;
  animation: floatWave 3s ease-in-out infinite;
}

#chatbot-button:hover {
  background-color: #00bcd4;
  color: #0d1b2a;
}

#chatbot-button i {
  font-size: 1.2rem;
  filter: drop-shadow(0 0 2px #00bcd4);
}

@keyframes floatWave {
  0% {
    transform: translateY(-6px);
  }
  50% {
    transform: translateY(6px);
  }
  100% {
    transform: translateY(-6px);
  }
}

#chat-window {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 300px;
  height: 400px;
  background: #1e1e2f;
  border-radius: 12px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.chat-header {
  background: #29294d;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
  font-size: 16px;
  color: white;
  padding: 10px;
  border-radius: 12px 12px 0 0;
}

.chat-body {
  flex: 1;
  padding: 10px;
  color: white;
  overflow-y: auto;
}

#chat-input {
  border: none;
  padding: 8px;
  border-top: 1px solid #444;
  outline: none;
  border-radius: 12px;
}

/* Ensure navigation is always visible on desktop */
@media (min-width: 769px) {
  .desktop-nav {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .desktop-nav .nav-link {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: white !important;
  }

  .hamburger-menu {
    display: none !important;
  }
}
