:root {
  --njit-red: #cc0000;
  --njit-red-dark: #a80000;
  --njit-blue: #1c1475;
  --njit-blue-dark: #141054;
  --njit-gray: #808080;

  --primary-light: #f0f4f8;
  --secondary-light: #e2e8f0;
  --text-light: #2d3748;
  --accent-light: var(--njit-red);
  ;
  /* Green selection feedback */
  --accent-light-hover: var(--njit-red-dark);
  --shadow-light: #d1d9e6;

  --primary-dark: #1a202c;
  --secondary-dark: #2d3748;
  --text-dark: #e2e8f0;
  --accent-dark: var(--njit-red);
  ;
  --accent-dark-hover: var(--njit-red-dark);
  --shadow-dark: #0f1420;

  --bg-primary: var(--primary-light);
  --bg-secondary: var(--secondary-light);
  --text-primary: var(--text-light);
  --text-secondary: #718096;
  --accent: var(--accent-light);
  --accent-hover: var(--accent-light-hover);
  --shadow-a: 8px 8px 16px var(--shadow-light), -8px -8px 16px #ffffff;
  --shadow-inset: inset 2px 2px 4px var(--shadow-light), inset -2px -2px 4px #ffffff;
  --border-radius: 20px;
  --glow: 0 0 20px rgba(34, 197, 94, 0.25);
  --submit-bg: #2563eb;
  --submit-bg-hover: #1d4ed8;
  --submit-glow: 0 0 20px rgba(37, 99, 235, 0.25);
}

body.dark-mode {
  --bg-primary: var(--primary-dark);
  --bg-secondary: var(--secondary-dark);
  --text-primary: var(--text-dark);
  --text-secondary: #cbd5e0;
  --accent: var(--accent-dark);
  --accent-hover: var(--accent-dark-hover);
  --shadow-a: 8px 8px 16px var(--shadow-dark), -8px -8px 16px #2a3141;
  --shadow-inset: inset 2px 2px 4px var(--shadow-dark), inset -2px -2px 4px #2a3141;
  --glow: 0 0 20px rgba(34, 197, 94, 0.25);
  --submit-bg: #f97316;
  --submit-bg-hover: #ea580c;
  --submit-glow: 0 0 20px rgba(249, 115, 22, 0.25);
}

body.dark-mode .theme-toggle,
body.dark-mode .back-btn,
body.dark-mode .option {
  border-color: var(--text-secondary);
}

body.dark-mode .progress-container {
  background: rgba(255, 255, 255, 0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: white;
  padding: 12px 24px;
  border-radius: 0 0 16px 16px;
  z-index: 9999;
  font-weight: 800;
  text-decoration: none;
  transition: top 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.skip-link:focus {
  top: 0;
  outline: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2000;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1.5px solid var(--text-secondary);
  padding: 12px 14px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.08), -4px -4px 8px rgba(255, 255, 255, 0.4);
  font-size: 1.05rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.start-logo {
  width: min(80vw, 320px);
  height: auto;
  display: block;
  margin: 0 auto 1rem;
}


.container {
  width: 100%;
  max-width: 420px;
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-a);
  overflow: hidden;
  position: relative;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* Header */
.header {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 26px 22px 34px;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-inset);
}

.header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.header p {
  opacity: 0.9;
  font-size: 1.4rem;
}

#appSubtitle:empty {
  display: none;
}

.header-logo {
  margin-bottom: 12px;
}

.njit-logo-small {
  height: 48px;
  width: auto;
}

.progress-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

body.dark-mode .progress-container {
  background: rgba(255, 255, 255, 0.08);
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* Question containers (dynamic) */
.question-container {
  padding: 48px 22px 70px;
  min-height: 420px;
  display: none;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  position: relative;
  opacity: 0;
}

.question-container.active {
  display: flex;
  opacity: 1;
  animation: fadeIn 0.25s ease;
}

.question-container.leaving {
  animation: fadeOut 0.2s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

.question-number {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: white;
  padding: 8px 16px;
  border-radius: 25px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 18px;
  align-self: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.question-text {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 22px;
  color: var(--text-primary);
}

.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.option {
  padding: 16px 18px;
  background: var(--bg-primary);
  border: 1.5px solid var(--text-secondary);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 56px;
  box-shadow: var(--shadow-inset);
  text-align: left;
}

.option:hover {
  transform: translateY(-2px);
}

.option.selected {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: white;
  transform: translateY(-2px) scale(1.01);
  box-shadow: var(--glow), 0 10px 30px rgba(0, 0, 0, 0.1);
}

.option i {
  font-size: 1rem;
  opacity: 0.85;
}

/* Submit row and button */
.submit-row {
  position: sticky;
  bottom: 0;
  margin-top: 22px;
  padding-top: 16px;
}

.submit-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--submit-bg);
  color: white;
  border: 1.5px solid var(--submit-bg-hover);
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: var(--submit-glow);
}

.submit-btn:hover {
  background: var(--submit-bg-hover);
  transform: translateY(-2px);
}

.submit-btn:active {
  transform: translateY(0);
}

.submit-btn i {
  font-size: 1rem;
}

/* Completion */
.completion-screen {
  text-align: center;
  padding: 60px 22px;
}

.completion-icon {
  width: 90px;
  height: 90px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: var(--glow);
  animation: celebrate 1.6s ease-in-out;
  font-size: 2.2rem;
  color: #fff;
}

@keyframes celebrate {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }
}

.completion-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.completion-text {
  opacity: 0.9;
  font-size: 1rem;
  margin-bottom: 22px;
  line-height: 1.5;
}

/* Stack resource + restart buttons nicely */
.completion-screen .help-nav-btn,
.completion-screen .restart-btn {
  display: block;
  width: 100%;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.completion-screen .help-nav-btn {
  margin-bottom: 12px;
}

.restart-btn {
  background: var(--accent);
  color: white;
  border: 1.5px solid var(--accent-hover);
  padding: 14px 26px;
  border-radius: 24px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--glow);
}

.restart-btn:hover {
  transform: translateY(-2px);
}

.k10-badge {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 800;
  color: white;
  background: var(--accent);
  margin-bottom: 10px;
}

/* Back button */
.back-btn {
  position: absolute;
  left: 16px;
  bottom: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1.5px solid var(--text-secondary);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
  box-shadow: var(--shadow-inset);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  z-index: 5;
}

.back-btn:hover {
  transform: translateY(-2px);
}

.back-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Footer note in completion */
.footer-note {
  margin-top: 18px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Cookie banner */
.cookie-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 18px;
}

.cookie-overlay.show {
  display: flex;
}

.cookie-banner {
  width: min(480px, 100%);
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: 18px;
  padding: 18px 18px 14px;
  box-shadow: var(--shadow-a);
  text-align: left;
}

.cookie-banner h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.cookie-banner p {
  font-size: 0.95rem;
  line-height: 1.45;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.cookie-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.cookie-btn {
  border: 1.5px solid transparent;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.cookie-btn.primary {
  background: var(--accent);
  color: white;
  box-shadow: var(--glow);
  padding: 10px 24px;
  border-color: var(--accent-hover);
}

.cookie-btn.secondary {
  background: var(--bg-primary);
  color: var(--text-primary);
  box-shadow: var(--shadow-inset);
  border-color: var(--text-secondary);
}

.cookie-btn:hover {
  transform: translateY(-1px);
}

.begin-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--accent-hover);
  border-radius: 12px;
  padding: 40px 44px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
  background: var(--accent);
  color: white;
  box-shadow: var(--glow);
  font-size: 2rem;
}

.begin-btn:hover {
  transform: translateY(-1px);
}


/* Start overlay (welcome) */
.start-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3100;
  padding: 18px;
}

.start-overlay.show {
  display: flex;
}

.start-card {
  width: min(480px, 100%);
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow-a);
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.start-media {
  position: relative;
  width: 100%;
  border-radius: 14px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  /* background gradients underneath everything */
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(34, 197, 94, 0.25) 0%, rgba(0, 0, 0, 0) 50%),
    radial-gradient(120% 120% at 100% 100%, rgba(37, 99, 235, 0.20) 0%, rgba(0, 0, 0, 0) 50%);
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow-inset);
}

/* Layer 1: diagonal yellow stripes */
.start-media::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg,
      rgba(255, 215, 0, 0.3) 0,
      rgba(255, 215, 0, 0.3) 10px,
      transparent 10px,
      transparent 20px);
  pointer-events: none;
}

/* Layer 2: logo image on top */
.start-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* keeps logo fully visible */
  z-index: 1;
  /* above stripes and background */
  pointer-events: none;
}

.start-content {
  text-align: center;
}

.start-content h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.start-anon {
  margin-bottom: 20px;
}

.start-lead {
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
}

.start-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Mode Selection Overlay (New) */
.mode-card {
  width: min(520px, 100%);
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow-a);
  text-align: center;
}

.mode-card h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 14px;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.mode-option {
  background: var(--bg-primary);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow-inset);
  border: 2px solid var(--accent);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-align: center;
}

.mode-option:hover {
  transform: translateY(-3px);
  box-shadow: var(--glow), var(--shadow-a);
}

.mode-option:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.mode-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow);
  color: #fff;
}

.mode-icon svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.mode-title {
  font-weight: 800;
  font-size: 1.05rem;
}

@media (min-width: 560px) {
  .start-card {
    grid-template-columns: 1fr;
    /* force vertical stack */
    align-items: center;
  }

  .start-media {
    margin: 0 auto;
    max-width: 480px;
  }
}


/* Help page */
.help-container {
  padding: 32px 22px 40px;
  display: none;
  flex-direction: column;
  gap: 18px;
  text-align: center;
  min-height: 420px;
}

.help-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.help-subtitle {
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.help-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.help-card {
  background: var(--bg-primary);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow-inset);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}

.help-card,
.help-card * {
  min-width: 0;
}

.help-card h4 {
  font-size: 1.05rem;
  font-weight: 800;
}

.help-meta {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.help-meta,
.chip {
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.help-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
}

.help-description {
  margin-top: 6px;
  font-size: 0.95rem;
  line-height: 1.45;
  opacity: 0.9;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  box-shadow: var(--shadow-inset);
  transition: transform 0.12s ease;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.25;
}

.chip:hover {
  transform: translateY(-1px);
}

/* Why Section Styles */
.why-section {
  text-align: left;
  margin-bottom: 20px;
  padding: 0 10px;
}

.why-link {
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 700;
}

.why-content {
  margin-top: 12px;
  padding: 14px;
  background: var(--bg-primary);
  border-radius: 12px;
  box-shadow: var(--shadow-inset);
  font-size: 0.95rem;
  line-height: 1.5;
}

.why-lead {
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.why-group {
  margin-bottom: 10px;
}

.why-group:last-child {
  margin-bottom: 0;
}

.why-group strong {
  display: block;
  margin-bottom: 4px;
}

.why-group ul {
  margin-left: 18px;
  color: var(--text-secondary);
}

/* Footer Branding */
.footer-branding {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: center;
}

body.dark-mode .footer-branding {
  border-top-color: rgba(255, 255, 255, 0.05);
}

.njit-logo-footer {
  height: 40px;
  width: auto;
  opacity: 0.8;
}

.help-back-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 6px;
}

.help-nav-btn {
  border: 1.5px solid var(--accent-hover);
  border-radius: 14px;
  width: 100%;
  padding: 12px 16px;
  font-weight: 800;
  cursor: pointer;
  background: var(--accent);
  color: white;
  box-shadow: var(--glow);
  transition: transform 0.12s ease;
}

.help-nav-btn.light-red,
.restart-btn.light-red {
  background: #FACCCD;
  /* Pale Red for secondary action */
  color: #D22630;
  /* Official NJIT Red for text */
  box-shadow: 0 4px 8px rgba(210, 38, 48, 0.1);
  border: 1.5px solid #D22630;
}

.help-nav-btn.light-red:hover,
.restart-btn.light-red:hover {
  background: #f8b8b9;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(210, 38, 48, 0.15);
}

.help-nav-btn.secondary,
.restart-btn.secondary {
  background: var(--bg-primary);
  color: var(--text-primary);
  box-shadow: var(--shadow-inset);
  border-color: var(--text-secondary);
}

.help-nav-btn:hover {
  transform: translateY(-1px);
}

@media (max-width: 480px) {
  .container {
    margin: 10px;
    border-radius: 16px;
  }

  .question-text {
    font-size: 1.15rem;
  }

  .header h1 {
    font-size: 1.4rem;
  }

  .completion-title {
    font-size: 1.6rem;
  }
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-5px);
  }

  20%,
  40%,
  60%,
  80% {
    transform: translateX(5px);
  }
}