/* ============================================================
   PHISHING AWARENESS SERIOUS GAME - MAIN STYLESHEET
   Educational game for university students (18-25)
   ============================================================ */

/* ----------------------------------------
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ---------------------------------------- */
:root {
  /* Primary palette -Lancaster University */
  --color-bg-dark: #1e1f1f;
  --color-bg-mid: #2a2b2b;
  --color-bg-deep: #b5121b;
  --color-accent-coral: #b5121b;
  --color-accent-teal: #b5121b;
  --color-accent-teal-dark: #8b0d24;
  --color-lu-red: #b5121b;
  --color-lu-red-dark: #8b0d24;
  --color-lu-red-light: #d4434f;
  --color-lu-grey: #555656;
  --color-lu-pale: #bec0c2;

  /* Neutrals */
  --color-white: #ffffff;
  --color-gray-50: #f8f9fa;
  --color-gray-100: #f2f2f2;
  --color-gray-200: #e9ecef;
  --color-gray-300: #dee2e6;
  --color-gray-400: #bec0c2;
  --color-gray-500: #868e96;
  --color-gray-600: #555656;
  --color-gray-700: #495057;
  --color-gray-800: #343a40;
  --color-gray-900: #1e1f1f;

  /* Semantic */
  --color-success: #28a745;
  --color-success-bg: #d4edda;
  --color-success-border: #28a745;
  --color-warning: #f1c40f;
  --color-warning-bg: #fff3cd;
  --color-danger: #b5121b;
  --color-danger-bg: #f8d7da;
  --color-danger-border: #b5121b;
  --color-info: #205479;
  --color-info-bg: #d1ecf1;

  /* Typography */
  --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono",
    "Courier New", monospace;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-md: 1.125rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;
  --font-size-3xl: 2.5rem;
  --font-size-4xl: 3rem;
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Borders & Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  --border-width: 1px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15), 0 5px 10px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.18);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms ease;

  /* Z-index layers */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 500;
  --z-modal: 1000;
  --z-toast: 1500;

  /* Layout */
  --container-max: 960px;
  --container-wide: 1100px;
  --container-narrow: 640px;
  --header-height: 60px;
}

/* ----------------------------------------
   RESET & BASE
   ---------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-gray-900);
  background-color: var(--color-gray-50);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--color-accent-teal);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-teal-dark);
  text-decoration: underline;
}

ul,
ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  line-height: var(--line-height-tight);
  font-weight: 700;
  color: var(--color-bg-dark);
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: var(--font-size-md); }
h6 { font-size: var(--font-size-base); }

p {
  margin-bottom: var(--space-md);
  line-height: var(--line-height-relaxed);
}

/* ----------------------------------------
   SCREEN / VIEW MANAGEMENT
   ---------------------------------------- */
.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: screenFadeIn 0.35s ease-out;
}

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

/* ----------------------------------------
   APP HEADER
   ---------------------------------------- */
.app-header {
  background: var(--color-lu-grey);
  color: var(--color-white);
  height: var(--header-height);
  border-bottom: 3px solid var(--color-lu-red);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  box-shadow: var(--shadow-md);
}

.app-header .logo {
  font-size: var(--font-size-lg);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.app-header .logo .highlight {
  color: var(--color-accent-coral);
}

.app-header .participant-info {
  font-size: var(--font-size-sm);
  color: var(--color-gray-400);
}

/* ----------------------------------------
   LAYOUT CONTAINERS
   ---------------------------------------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-xl);
}

.container--wide {
  max-width: var(--container-wide);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.section-dark {
  background: linear-gradient(135deg, #1e1f1f 0%, #2a2b2b 100%);
  color: var(--color-white);
}

.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4,
.section-dark p,
.section-dark label {
  color: var(--color-white);
}

.section-dark p {
  color: var(--color-gray-300);
}

/* ----------------------------------------
   BUTTONS
   ---------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.7rem 1.5rem;
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  font-weight: 600;
  line-height: 1;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
}

a.btn, a.btn:hover, a.btn:focus, a.btn:visited {
  text-decoration: none;
}

.btn:focus-visible {
  outline: 3px solid var(--color-accent-teal);
  outline-offset: 2px;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary button (teal) */
.btn-primary {
  background: linear-gradient(135deg, var(--color-accent-teal) 0%, var(--color-accent-teal-dark) 100%);
  color: var(--color-white);
  border-color: var(--color-accent-teal-dark);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-accent-teal-dark) 0%, #6b0a18 100%);
  box-shadow: 0 4px 12px rgba(181, 18, 27, 0.35);
  transform: translateY(-1px);
}

/* Danger button (Lancaster red) */
.btn-danger {
  background: linear-gradient(135deg, #c0392b 0%, #962d22 100%);
  color: var(--color-white);
  border-color: #962d22;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #962d22 0%, #7a241b 100%);
  box-shadow: 0 4px 12px rgba(181, 18, 27, 0.35);
  transform: translateY(-1px);
}

/* Secondary button (gray / outline) */
.btn-secondary {
  background: var(--color-white);
  color: var(--color-gray-700);
  border-color: var(--color-gray-400);
}

.btn-secondary:hover {
  background: var(--color-gray-100);
  border-color: var(--color-gray-600);
  color: var(--color-gray-900);
}

/* Outline variant */
.btn-outline {
  background: transparent;
  color: var(--color-white);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-white);
  border-color: rgba(255, 255, 255, 0.7);
}

/* Success button (green) */
.btn-success {
  background: linear-gradient(135deg, var(--color-success) 0%, #27ae60 100%);
  color: var(--color-white);
  border-color: #27ae60;
}

.btn-success:hover {
  background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
  box-shadow: 0 4px 12px rgba(46, 204, 113, 0.35);
  transform: translateY(-1px);
}

/* Size variants */
.btn-sm {
  padding: 0.45rem 1rem;
  font-size: var(--font-size-sm);
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.9rem 2.2rem;
  font-size: var(--font-size-lg);
  border-radius: var(--radius-lg);
}

.btn-block {
  display: flex;
  width: 100%;
}

/* Button group */
.btn-group {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.btn-group--center {
  justify-content: center;
}

.btn-group--right {
  justify-content: flex-end;
}

/* ----------------------------------------
   FORMS
   ---------------------------------------- */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-gray-800);
  margin-bottom: var(--space-xs);
  letter-spacing: 0.3px;
}

.form-label .required {
  color: var(--color-accent-coral);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  display: block;
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  color: var(--color-gray-900);
  background-color: var(--color-white);
  border: var(--border-width) solid var(--color-gray-300);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-accent-teal);
  box-shadow: 0 0 0 3px rgba(181, 18, 27, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-gray-500);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.12);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23495057' d='M6 8.825L0.375 3.2l.85-.85L6 7.125 10.775 2.35l.85.85z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.4rem;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: var(--line-height-relaxed);
}

.form-hint {
  font-size: var(--font-size-xs);
  color: var(--color-gray-600);
  margin-top: var(--space-xs);
}

.form-error-message {
  font-size: var(--font-size-xs);
  color: var(--color-danger);
  margin-top: var(--space-xs);
  display: none;
}

.form-group.has-error .form-error-message {
  display: block;
}

.form-group.has-error .form-input,
.form-group.has-error .form-select,
.form-group.has-error .form-textarea {
  border-color: var(--color-danger);
}

/* Checkboxes and radios */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.form-check:hover {
  background-color: var(--color-gray-100);
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--color-accent-teal);
  cursor: pointer;
}

.form-check-label {
  font-size: var(--font-size-sm);
  color: var(--color-gray-800);
  line-height: var(--line-height-normal);
  cursor: pointer;
  user-select: none;
}

/* Inline form row */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ----------------------------------------
   CARDS
   ---------------------------------------- */
.card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-xl);
  transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
}

.card--clickable {
  cursor: pointer;
}

.card--clickable:hover {
  transform: translateY(-3px);
}

.card-header {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-gray-200);
}

.card-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-bg-dark);
}

.card-body {
  color: var(--color-gray-700);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
}

.card-footer {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-gray-200);
}

/* ----------------------------------------
   1. WELCOME SCREEN
   ---------------------------------------- */
#welcome-screen {
  background: linear-gradient(160deg, #1e1f1f 0%, #2a2b2b 50%, #333434 100%);
  color: var(--color-white);
  min-height: 100vh;
  margin-top: calc(-1 * var(--header-height));
  padding-top: var(--header-height);
  display: none;
}

#welcome-screen.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-content {
  max-width: 700px;
  text-align: center;
  padding: var(--space-2xl);
}

.welcome-content h1 {
  color: var(--color-white);
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-md);
}

.welcome-content h1 .highlight {
  color: var(--color-accent-coral);
}

.welcome-content .subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-gray-300);
  margin-bottom: var(--space-xl);
}

.welcome-content .study-info {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-2xl);
  text-align: left;
}

.welcome-content .study-info h3 {
  color: var(--color-accent-teal);
  margin-bottom: var(--space-md);
  font-size: var(--font-size-md);
}

.welcome-content .study-info p {
  color: var(--color-gray-300);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
}

.welcome-content .study-info ul {
  list-style: disc;
  padding-left: var(--space-xl);
  margin-bottom: var(--space-md);
}

.welcome-content .study-info ul li {
  color: var(--color-gray-300);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-xs);
}

.welcome-icon {
  font-size: 4rem;
  margin-bottom: var(--space-lg);
  display: block;
}

/* ----------------------------------------
   2. CONSENT SCREEN
   ---------------------------------------- */
#consent-screen .consent-document {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  max-height: 50vh;
  overflow-y: auto;
  margin-bottom: var(--space-xl);
  border: 1px solid var(--color-gray-200);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  color: var(--color-gray-700);
}

#consent-screen .consent-document h3 {
  font-size: var(--font-size-md);
  color: var(--color-bg-dark);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

#consent-screen .consent-document h3:first-child {
  margin-top: 0;
}

#consent-screen .consent-checkboxes {
  background: var(--color-gray-50);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}

#consent-screen .consent-checkboxes .form-check {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-gray-200);
}

#consent-screen .consent-checkboxes .form-check:last-child {
  border-bottom: none;
}

/* ----------------------------------------
   3. REGISTRATION SCREEN
   ---------------------------------------- */
#registration-screen .registration-form {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-md);
}

#registration-screen .form-section-title {
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--color-bg-deep);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-accent-teal);
  display: inline-block;
}

/* ----------------------------------------
   4. LOGIN SCREEN
   ---------------------------------------- */
#login-screen {
  background: linear-gradient(160deg, #1e1f1f 0%, #2a2b2b 100%);
  color: var(--color-white);
  min-height: 100vh;
  margin-top: calc(-1 * var(--header-height));
  padding-top: var(--header-height);
  display: none;
}

#login-screen.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl) var(--space-2xl);
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-xl);
}

.login-box h2 {
  text-align: center;
  margin-bottom: var(--space-xl);
  color: var(--color-bg-dark);
}

.login-box .form-label,
.login-box p {
  color: var(--color-gray-700);
}

/* ----------------------------------------
   5. DASHBOARD SCREEN
   ---------------------------------------- */
#dashboard-screen .dashboard-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

#dashboard-screen .dashboard-header h2 {
  margin-bottom: var(--space-sm);
}

#dashboard-screen .dashboard-header p {
  color: var(--color-gray-600);
  font-size: var(--font-size-md);
}

.phase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-xl);
}

.phase-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-xl);
  cursor: pointer;
  transition: all var(--transition-normal);
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.phase-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--color-accent-teal);
  transition: height var(--transition-normal);
}

.phase-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--color-accent-teal);
}

.phase-card:hover::before {
  height: 6px;
}

.phase-card.completed {
  border-color: var(--color-success);
  opacity: 0.85;
}

.phase-card.completed::before {
  background: var(--color-success);
}

.phase-card.locked {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.phase-card.locked::before {
  background: var(--color-gray-400);
}

.phase-card .phase-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  display: block;
}

.phase-card .phase-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-bg-dark);
  margin-bottom: var(--space-sm);
}

.phase-card .phase-description {
  color: var(--color-gray-600);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-md);
}

.phase-card .phase-status {
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
  display: inline-block;
}

.phase-status.status-available {
  background: rgba(181, 18, 27, 0.08);
  color: var(--color-accent-teal);
}

.phase-status.status-completed {
  background: var(--color-success-bg);
  color: var(--color-success-border);
}

.phase-status.status-locked {
  background: var(--color-gray-200);
  color: var(--color-gray-600);
}

.phase-status.status-in-progress {
  background: var(--color-warning-bg);
  color: #856404;
}

/* ----------------------------------------
   6. TEST INTRO SCREEN
   ---------------------------------------- */
#test-intro-screen .intro-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-md);
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

#test-intro-screen .intro-card h2 {
  margin-bottom: var(--space-lg);
}

#test-intro-screen .intro-card .instructions {
  text-align: left;
  background: var(--color-gray-50);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}

#test-intro-screen .intro-card .instructions li {
  list-style: decimal;
  margin-left: var(--space-xl);
  margin-bottom: var(--space-sm);
  color: var(--color-gray-700);
  font-size: var(--font-size-sm);
}

/* ----------------------------------------
   7. PHISHING DETECTION TEST
   ---------------------------------------- */
#phishing-test-screen .test-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.test-progress-info {
  font-size: var(--font-size-sm);
  color: var(--color-gray-600);
  font-weight: 600;
}

.test-email-display {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-bottom: var(--space-xl);
}

.test-email-display .email-header-bar {
  background: var(--color-gray-100);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-gray-200);
}

.test-email-display .email-subject-line {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-gray-900);
}

.test-email-display .email-meta {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-gray-200);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-xs) var(--space-md);
  font-size: var(--font-size-sm);
}

.test-email-display .email-meta-label {
  color: var(--color-gray-500);
  font-weight: 600;
}

.test-email-display .email-meta-value {
  color: var(--color-gray-800);
}

.test-email-display .email-body {
  padding: var(--space-lg);
  color: var(--color-gray-800);
  line-height: var(--line-height-relaxed);
  min-height: 150px;
}

.test-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
}

.test-actions .btn {
  min-width: 180px;
  padding: 0.9rem 2rem;
  font-size: var(--font-size-md);
}

/* ----------------------------------------
   8. SeBIS QUESTIONNAIRE
   ---------------------------------------- */
#sebis-screen .questionnaire-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.likert-question {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--color-accent-teal);
  transition: border-color var(--transition-fast);
}

.likert-question:hover {
  border-left-color: var(--color-bg-deep);
}

.likert-question.answered {
  border-left-color: var(--color-success);
  background: #fafffe;
}

.likert-question .question-text {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-gray-900);
  margin-bottom: var(--space-md);
}

.likert-question .question-number {
  color: var(--color-accent-teal);
  margin-right: var(--space-sm);
}

.likert-scale {
  display: flex;
  justify-content: space-between;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.likert-option {
  flex: 1;
  min-width: 60px;
  text-align: center;
}

.likert-option input[type="radio"] {
  display: none;
}

.likert-option label {
  display: block;
  padding: var(--space-sm) var(--space-xs);
  border: 2px solid var(--color-gray-300);
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  color: var(--color-gray-600);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.likert-option label:hover {
  border-color: var(--color-accent-teal);
  color: var(--color-accent-teal);
  background: rgba(181, 18, 27, 0.04);
}

.likert-option input[type="radio"]:checked + label {
  border-color: var(--color-accent-teal);
  background: var(--color-accent-teal);
  color: var(--color-white);
  font-weight: 600;
}

.likert-labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-xs);
  font-size: var(--font-size-xs);
  color: var(--color-gray-500);
}

/* ----------------------------------------
   PROGRESS BAR (tests & questionnaires)
   ---------------------------------------- */
.progress-bar-wrapper {
  margin-bottom: var(--space-xl);
}

.progress-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-sm);
  color: var(--color-gray-600);
  margin-bottom: var(--space-xs);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--color-gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-lu-red) 0%, var(--color-lu-red-dark) 100%);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* ----------------------------------------
   9. GAME INTRO SCREEN
   ---------------------------------------- */
#game-intro-screen .narrative-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-md);
  max-width: 700px;
  margin: 0 auto;
}

.narrative-card .narrative-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #f2f2f2 0%, #e9ecef 100%);
  margin: 0 auto var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--color-white);
}

.narrative-card .narrative-text {
  font-size: var(--font-size-md);
  color: var(--color-gray-700);
  line-height: var(--line-height-relaxed);
  text-align: center;
  margin-bottom: var(--space-xl);
}

.narrative-card .narrative-text strong {
  color: var(--color-bg-dark);
}

.narrative-card .narrative-highlight {
  background: var(--color-info-bg);
  border-left: 4px solid var(--color-info);
  padding: var(--space-md) var(--space-lg);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: var(--space-lg);
  font-size: var(--font-size-sm);
  color: var(--color-gray-800);
}

/* ----------------------------------------
   10. GAME LEVEL (#game-screen)
   ---------------------------------------- */

/* Timer bar */
.timer-bar-container {
  position: sticky;
  top: var(--header-height);
  z-index: var(--z-sticky);
  background: var(--color-white);
  padding: var(--space-sm) var(--space-xl);
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--color-gray-200);
}

.timer-bar-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xs);
  font-size: var(--font-size-sm);
}

.timer-bar-info .timer-label {
  font-weight: 600;
  color: var(--color-gray-700);
}

.timer-bar-info .timer-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.timer-bar {
  width: 100%;
  height: 10px;
  background: var(--color-gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.timer-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s linear, background-color 0.5s ease;
  background: var(--color-success);
}

.timer-bar-fill.timer-green {
  background: linear-gradient(90deg, #2ecc71 0%, #27ae60 100%);
}

.timer-bar-fill.timer-yellow {
  background: linear-gradient(90deg, #f1c40f 0%, #f39c12 100%);
}

.timer-bar-fill.timer-red {
  background: linear-gradient(90deg, var(--color-accent-coral) 0%, #c0392b 100%);
  animation: timerPulse 1s ease-in-out infinite;
}

@keyframes timerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

/* Game status bar (score, level info) */
.game-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-xl);
  background: linear-gradient(135deg, #1e1f1f 0%, #2a2b2b 100%);
  color: var(--color-white);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.game-stat {
  text-align: center;
}

.game-stat .stat-label {
  font-size: var(--font-size-xs);
  color: var(--color-gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 2px;
}

.game-stat .stat-value {
  font-size: var(--font-size-xl);
  font-weight: 800;
  color: var(--color-white);
  font-variant-numeric: tabular-nums;
}

.game-stat .stat-value.score-highlight {
  color: var(--color-accent-teal);
}

/* Level badge */
.level-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.level-badge--easy {
  background: rgba(46, 204, 113, 0.15);
  color: #1e8449;
  border: 1px solid rgba(46, 204, 113, 0.3);
}

.level-badge--medium {
  background: rgba(241, 196, 15, 0.15);
  color: #7d6608;
  border: 1px solid rgba(241, 196, 15, 0.3);
}

.level-badge--hard {
  background: rgba(233, 69, 96, 0.15);
  color: #c0392b;
  border: 1px solid rgba(233, 69, 96, 0.3);
}

/* Email Inbox Simulation */
.inbox-container {
  max-width: var(--container-wide);
  margin: var(--space-lg) auto;
  padding: 0 var(--space-xl);
}

.inbox-wrapper {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  border: 1px solid var(--color-gray-200);
}

.inbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-lg);
  background: var(--color-gray-50);
  border-bottom: 1px solid var(--color-gray-200);
}

.inbox-toolbar .inbox-title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--color-gray-800);
}

.inbox-toolbar .inbox-count {
  font-size: var(--font-size-xs);
  color: var(--color-gray-500);
  background: var(--color-gray-200);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.inbox-list {
  list-style: none;
}

.inbox-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-md);
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-gray-100);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.inbox-item:last-child {
  border-bottom: none;
}

.inbox-item:hover {
  background-color: var(--color-gray-50);
}

.inbox-item.unread {
  background-color: rgba(181, 18, 27, 0.03);
  font-weight: 600;
}

.inbox-item.unread .inbox-item-sender {
  font-weight: 700;
}

.inbox-item.classified {
  opacity: 0.55;
}

.inbox-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-lu-red) 0%, var(--color-lu-red-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  font-weight: 700;
  font-size: var(--font-size-sm);
  flex-shrink: 0;
}

.inbox-item-content {
  min-width: 0;
}

.inbox-item-sender {
  font-size: var(--font-size-sm);
  color: var(--color-gray-900);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inbox-item-subject {
  font-size: var(--font-size-sm);
  color: var(--color-gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.inbox-item-preview {
  font-size: var(--font-size-xs);
  color: var(--color-gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inbox-item-meta {
  text-align: right;
  flex-shrink: 0;
}

.inbox-item-date {
  font-size: var(--font-size-xs);
  color: var(--color-gray-500);
  white-space: nowrap;
}

.inbox-item-indicator {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-accent-teal);
  margin-top: var(--space-xs);
  margin-left: auto;
}

.inbox-item.classified .inbox-item-indicator {
  display: none;
}

/* ----------------------------------------
   11. EMAIL DETAIL SCREEN
   ---------------------------------------- */
#email-detail-screen .email-detail-container {
  max-width: 800px;
  margin: 0 auto;
}

.email-detail-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.email-detail-header {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--color-gray-200);
}

.email-detail-subject {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-gray-900);
  margin-bottom: var(--space-md);
}

.email-detail-meta {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.email-detail-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-lu-red) 0%, var(--color-lu-red-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  font-weight: 700;
  font-size: var(--font-size-md);
  flex-shrink: 0;
}

.email-detail-meta-info {
  flex: 1;
  min-width: 0;
}

.email-detail-from {
  font-weight: 700;
  color: var(--color-gray-900);
  font-size: var(--font-size-base);
}

.email-detail-from-address {
  font-weight: 400;
  color: var(--color-gray-500);
  font-size: var(--font-size-sm);
  margin-left: var(--space-xs);
}

.email-detail-to {
  font-size: var(--font-size-sm);
  color: var(--color-gray-500);
  margin-top: 2px;
}

.email-detail-date {
  font-size: var(--font-size-sm);
  color: var(--color-gray-500);
  flex-shrink: 0;
}

.email-detail-body {
  padding: var(--space-xl);
  color: var(--color-gray-800);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  min-height: 200px;
}

.email-detail-body p {
  margin-bottom: var(--space-md);
}

.email-detail-body a {
  color: var(--color-info);
  text-decoration: underline;
  word-break: break-all;
}

.email-detail-body .signature {
  margin-top: var(--space-xl);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-gray-200);
  color: var(--color-gray-600);
  font-size: var(--font-size-sm);
}

.email-detail-attachments {
  padding: var(--space-md) var(--space-xl);
  background: var(--color-gray-50);
  border-top: 1px solid var(--color-gray-200);
}

.email-detail-attachments .attachment-label {
  font-size: var(--font-size-xs);
  color: var(--color-gray-500);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-sm);
}

.attachment-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-white);
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  color: var(--color-gray-700);
  margin-right: var(--space-sm);
  margin-bottom: var(--space-xs);
}

/* Classify buttons */
.classify-actions {
  padding: var(--space-xl);
  background: var(--color-gray-50);
  border-top: 1px solid var(--color-gray-200);
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
}

.classify-actions .btn {
  min-width: 200px;
  padding: 0.9rem 2rem;
  font-size: var(--font-size-md);
}

.btn-phishing {
  background: linear-gradient(135deg, var(--color-accent-coral) 0%, #c0392b 100%);
  color: var(--color-white);
  border: 2px solid #c0392b;
}

.btn-phishing:hover {
  background: linear-gradient(135deg, #c0392b 0%, #a33225 100%);
  box-shadow: 0 4px 12px rgba(233, 69, 96, 0.35);
  transform: translateY(-1px);
}

.btn-legitimate {
  background: linear-gradient(135deg, var(--color-success) 0%, #27ae60 100%);
  color: var(--color-white);
  border: 2px solid #27ae60;
}

.btn-legitimate:hover {
  background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
  box-shadow: 0 4px 12px rgba(46, 204, 113, 0.35);
  transform: translateY(-1px);
}

.back-to-inbox {
  margin-bottom: var(--space-lg);
}

/* ----------------------------------------
   12. FEEDBACK MODAL
   ---------------------------------------- */
.feedback-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
  padding: var(--space-xl);
}

.feedback-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.feedback-modal {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  max-width: 540px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition-normal);
}

.feedback-modal-overlay.active .feedback-modal {
  transform: scale(1) translateY(0);
}

.feedback-modal-header {
  padding: var(--space-xl) var(--space-xl) var(--space-md);
  text-align: center;
}

.feedback-modal-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-md);
  font-size: 2rem;
}

.feedback-modal.correct .feedback-modal-icon {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 3px solid var(--color-success);
}

.feedback-modal.incorrect .feedback-modal-icon {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 3px solid var(--color-danger);
}

.feedback-modal.correct .feedback-modal-title {
  color: var(--color-success-border);
}

.feedback-modal.incorrect .feedback-modal-title {
  color: var(--color-danger-border);
}

.feedback-modal-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.feedback-modal-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-gray-600);
}

.feedback-modal-body {
  padding: var(--space-md) var(--space-xl);
}

.feedback-explanation {
  background: var(--color-gray-50);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}

.feedback-explanation h4 {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--color-gray-800);
  margin-bottom: var(--space-sm);
}

.feedback-explanation p {
  font-size: var(--font-size-sm);
  color: var(--color-gray-700);
  line-height: var(--line-height-relaxed);
  margin-bottom: 0;
}

.feedback-indicators {
  margin-top: var(--space-md);
}

.feedback-indicators h4 {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--color-gray-800);
  margin-bottom: var(--space-sm);
}

.feedback-indicator-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  font-size: var(--font-size-sm);
  color: var(--color-gray-700);
}

.feedback-indicator-item .indicator-icon {
  color: var(--color-accent-coral);
  font-weight: 700;
  flex-shrink: 0;
}

.feedback-points {
  text-align: center;
  padding: var(--space-md) 0;
  font-size: var(--font-size-lg);
  font-weight: 700;
}

.feedback-points.points-positive {
  color: var(--color-success);
}

.feedback-points.points-negative {
  color: var(--color-danger);
}

.feedback-modal-footer {
  padding: var(--space-md) var(--space-xl) var(--space-xl);
  text-align: center;
}

/* ----------------------------------------
   13. LEVEL COMPLETE SCREEN
   ---------------------------------------- */
#level-complete-screen .level-complete-card {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  background: var(--color-white);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-lg);
}

.level-complete-card .completion-icon {
  font-size: 4rem;
  margin-bottom: var(--space-lg);
}

.level-complete-card h2 {
  margin-bottom: var(--space-lg);
}

.score-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.score-item {
  text-align: center;
}

.score-item .score-number {
  font-size: var(--font-size-4xl);
  font-weight: 800;
  line-height: 1;
  display: block;
  margin-bottom: var(--space-xs);
  font-variant-numeric: tabular-nums;
}

.score-item .score-number.score-positive {
  color: var(--color-success);
}

.score-item .score-number.score-neutral {
  color: var(--color-bg-deep);
}

.score-item .score-number.score-negative {
  color: var(--color-danger);
}

.score-item .score-label {
  font-size: var(--font-size-xs);
  color: var(--color-gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.score-divider {
  border: none;
  border-top: 1px solid var(--color-gray-200);
  margin: var(--space-lg) 0;
}

/* ----------------------------------------
   14. GAME COMPLETE SCREEN
   ---------------------------------------- */
#game-complete-screen .game-complete-card {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
  background: var(--color-white);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-lg);
}

.final-score-display {
  background: linear-gradient(135deg, #1e1f1f 0%, #2a2b2b 100%);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  margin-bottom: var(--space-2xl);
  color: var(--color-white);
}

.final-score-display .final-score-number {
  font-size: 5rem;
  font-weight: 900;
  line-height: 1;
  color: var(--color-accent-teal);
  display: block;
  margin-bottom: var(--space-xs);
}

.final-score-display .final-score-label {
  font-size: var(--font-size-md);
  color: var(--color-gray-400);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.results-breakdown {
  margin-bottom: var(--space-2xl);
}

.results-breakdown h3 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-lg);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.results-table th {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-gray-500);
  border-bottom: 2px solid var(--color-gray-200);
}

.results-table td {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-sm);
  color: var(--color-gray-700);
  border-bottom: 1px solid var(--color-gray-100);
}

.results-table tbody tr:hover {
  background-color: var(--color-gray-50);
}

.results-table .result-correct {
  color: var(--color-success-border);
  font-weight: 600;
}

.results-table .result-incorrect {
  color: var(--color-danger-border);
  font-weight: 600;
}

/* ----------------------------------------
   15. QUALITATIVE FEEDBACK SCREEN
   ---------------------------------------- */
#feedback-screen .feedback-form {
  max-width: 700px;
  margin: 0 auto;
}

.feedback-question {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.feedback-question .question-label {
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--color-gray-900);
  margin-bottom: var(--space-md);
}

.feedback-question .form-textarea {
  min-height: 120px;
}

.feedback-question .char-count {
  text-align: right;
  font-size: var(--font-size-xs);
  color: var(--color-gray-500);
  margin-top: var(--space-xs);
}

/* ----------------------------------------
   16. PHASE COMPLETE / THANK YOU SCREEN
   ---------------------------------------- */
#phase-complete-screen .thank-you-card {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  background: var(--color-white);
  border-radius: var(--radius-xl);
  padding: var(--space-3xl);
  box-shadow: var(--shadow-lg);
}

.thank-you-card .thank-you-icon {
  font-size: 4rem;
  margin-bottom: var(--space-lg);
  display: block;
}

.thank-you-card h2 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-md);
  color: var(--color-accent-teal-dark);
}

.thank-you-card p {
  color: var(--color-gray-600);
  font-size: var(--font-size-md);
  line-height: var(--line-height-relaxed);
}

.thank-you-card .participant-id-display {
  display: inline-block;
  background: var(--color-gray-100);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--color-bg-deep);
  margin: var(--space-lg) 0;
  border: 1px dashed var(--color-gray-400);
  user-select: all;
}

/* ----------------------------------------
   ALERT / NOTIFICATION BOXES
   ---------------------------------------- */
.alert {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  margin-bottom: var(--space-lg);
  border-left: 4px solid transparent;
}

.alert-info {
  background: var(--color-info-bg);
  color: #0c5460;
  border-left-color: var(--color-info);
  text-align: left;
}
[dir="rtl"] .alert-info {
  text-align: right;
}

.alert-success {
  background: var(--color-success-bg);
  color: #155724;
  border-left-color: var(--color-success-border);
}

.alert-warning {
  background: var(--color-warning-bg);
  color: #856404;
  border-left-color: var(--color-warning);
}

.alert-danger {
  background: var(--color-danger-bg);
  color: #721c24;
  border-left-color: var(--color-danger-border);
}

/* ----------------------------------------
   TOOLTIP
   ---------------------------------------- */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--color-gray-900);
  color: var(--color-white);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
  z-index: var(--z-toast);
  pointer-events: none;
}

[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
}

/* ----------------------------------------
   BADGE / TAG
   ---------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.3px;
}

.badge-success {
  background: var(--color-success-bg);
  color: var(--color-success-border);
}

.badge-warning {
  background: var(--color-warning-bg);
  color: #856404;
}

.badge-danger {
  background: var(--color-danger-bg);
  color: var(--color-danger-border);
}

.badge-info {
  background: var(--color-info-bg);
  color: #0c5460;
}

.badge-neutral {
  background: var(--color-gray-200);
  color: var(--color-gray-700);
}

/* ----------------------------------------
   LOADING / SPINNER
   ---------------------------------------- */
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--color-gray-300);
  border-top-color: var(--color-accent-teal);
  border-radius: var(--radius-full);
  animation: spin 0.7s linear infinite;
}

.spinner--lg {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: var(--z-overlay);
  gap: var(--space-md);
}

.loading-overlay .loading-text {
  font-size: var(--font-size-sm);
  color: var(--color-gray-600);
  font-weight: 600;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ----------------------------------------
   PHISHING INDICATOR HIGHLIGHTS
   ---------------------------------------- */
.phishing-highlight {
  background: rgba(233, 69, 96, 0.12);
  border-bottom: 2px dashed var(--color-accent-coral);
  padding: 0 2px;
  cursor: help;
  transition: background-color var(--transition-fast);
}

.phishing-highlight:hover {
  background: rgba(233, 69, 96, 0.25);
}

.suspicious-link {
  color: var(--color-accent-coral);
  font-style: italic;
}

/* ----------------------------------------
   TOAST NOTIFICATIONS
   ---------------------------------------- */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + var(--space-md));
  right: var(--space-xl);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-md) var(--space-lg);
  font-size: var(--font-size-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-width: 280px;
  max-width: 400px;
  animation: toastSlideIn 0.3s ease;
  border-left: 4px solid var(--color-info);
}

.toast.toast-success {
  border-left-color: var(--color-success);
}

.toast.toast-error {
  border-left-color: var(--color-danger);
}

.toast.toast-leaving {
  animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* ----------------------------------------
   SCREEN-SPECIFIC SECTION HEADINGS
   ---------------------------------------- */
.screen-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-gray-900);
  margin-bottom: var(--space-sm);
}

.screen-subtitle {
  font-size: var(--font-size-md);
  color: var(--color-gray-600);
  margin-bottom: var(--space-2xl);
}

/* ----------------------------------------
   SCROLLBAR STYLING
   ---------------------------------------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-gray-100);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
  background: var(--color-gray-400);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-500);
}

/* ----------------------------------------
   CONFETTI / CELEBRATION ANIMATION
   ---------------------------------------- */
@keyframes celebratePop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.celebrate-pop {
  animation: celebratePop 0.5s ease-out;
}

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

.score-animate {
  animation: scoreCountUp 0.6s ease-out;
}

/* ----------------------------------------
   DIFFICULTY STAR RATING
   ---------------------------------------- */
.difficulty-stars {
  display: inline-flex;
  gap: 2px;
}

.difficulty-stars .star {
  width: 14px;
  height: 14px;
}

.difficulty-stars .star.filled {
  color: var(--color-warning);
}

.difficulty-stars .star.empty {
  color: var(--color-gray-300);
}

/* ----------------------------------------
   RESPONSIVE DESIGN
   ---------------------------------------- */

/* Tablets and smaller laptops */
@media (max-width: 1024px) {
  .container {
    padding: var(--space-xl) var(--space-lg);
  }

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

  .score-summary {
    gap: var(--space-md);
  }
}

/* Small tablets */
@media (max-width: 768px) {
  :root {
    --header-height: 50px;
  }

  h1 { font-size: var(--font-size-2xl); }
  h2 { font-size: var(--font-size-xl); }
  h3 { font-size: var(--font-size-lg); }

  .app-header {
    padding: 0 var(--space-md);
  }

  .container {
    padding: var(--space-lg) var(--space-md);
  }

  .welcome-content {
    padding: var(--space-lg);
  }

  .welcome-content h1 {
    font-size: var(--font-size-2xl);
  }

  .phase-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .test-actions,
  .classify-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .test-actions .btn,
  .classify-actions .btn {
    min-width: unset;
  }

  .likert-scale {
    flex-direction: column;
  }

  .likert-option {
    min-width: unset;
  }

  .score-summary {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .score-item .score-number {
    font-size: var(--font-size-3xl);
  }

  .final-score-display .final-score-number {
    font-size: 3.5rem;
  }

  .game-status-bar {
    padding: var(--space-sm) var(--space-md);
  }

  .game-stat .stat-value {
    font-size: var(--font-size-lg);
  }

  .inbox-item {
    padding: var(--space-sm) var(--space-md);
  }

  .email-detail-meta {
    flex-direction: column;
  }

  .email-detail-date {
    margin-top: var(--space-xs);
  }

  .btn-group {
    flex-direction: column;
  }

  .btn-group .btn {
    width: 100%;
  }

  .results-table {
    font-size: var(--font-size-xs);
  }

  .results-table th,
  .results-table td {
    padding: var(--space-xs) var(--space-sm);
  }

  .feedback-modal {
    max-width: 95%;
  }
}

/* Mobile (though primarily for laptops, graceful degradation) */
@media (max-width: 480px) {
  .container {
    padding: var(--space-md) var(--space-sm);
  }

  .card {
    padding: var(--space-md);
  }

  .phase-card {
    padding: var(--space-md);
  }

  .welcome-content .study-info {
    padding: var(--space-md);
  }

  .inbox-item-avatar {
    width: 32px;
    height: 32px;
    font-size: var(--font-size-xs);
  }

  .email-detail-avatar {
    width: 36px;
    height: 36px;
    font-size: var(--font-size-sm);
  }

  .timer-bar-container {
    padding: var(--space-xs) var(--space-md);
  }
}

/* ----------------------------------------
   ACCESSIBILITY: REDUCED MOTION
   ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .screen.active {
    animation: none;
  }
}

/* ----------------------------------------
   ACCESSIBILITY: HIGH CONTRAST
   ---------------------------------------- */
@media (prefers-contrast: high) {
  :root {
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
    --shadow-xl: none;
    --shadow-card: 0 0 0 2px var(--color-gray-900);
    --shadow-card-hover: 0 0 0 3px var(--color-gray-900);
  }

  .btn {
    border-width: 2px;
  }

  .card,
  .phase-card,
  .inbox-wrapper,
  .email-detail-card {
    border: 2px solid var(--color-gray-800);
  }
}

/* ----------------------------------------
   FOCUS VISIBLE (keyboard navigation)
   ---------------------------------------- */
:focus-visible {
  outline: 3px solid var(--color-accent-teal);
  outline-offset: 2px;
}

/* Remove focus outline for mouse clicks */
:focus:not(:focus-visible) {
  outline: none;
}

/* ----------------------------------------
   PRINT STYLES (admin export)
   ---------------------------------------- */
@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  .app-header,
  .timer-bar-container,
  .game-status-bar,
  .btn,
  .btn-group,
  .classify-actions,
  .test-actions,
  .feedback-modal-overlay,
  .toast-container,
  .loading-overlay {
    display: none !important;
  }

  .screen {
    display: block !important;
    page-break-inside: avoid;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  .card,
  .phase-card,
  .inbox-wrapper,
  .email-detail-card {
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }

  .score-item .score-number {
    font-size: 24pt;
  }

  .results-table {
    width: 100%;
    border-collapse: collapse;
  }

  .results-table th,
  .results-table td {
    border: 1px solid #ccc;
    padding: 4pt 8pt;
  }

  .inbox-item {
    border-bottom: 1px solid #ccc;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666 !important;
  }

  h1, h2, h3, h4 {
    page-break-after: avoid;
  }

  @page {
    margin: 2cm;
  }
}

/* ----------------------------------------
   UTILITY CLASSES
   ---------------------------------------- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-sm { font-size: var(--font-size-sm); }
.text-xs { font-size: var(--font-size-xs); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }

.text-muted { color: var(--color-gray-500); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-teal { color: var(--color-accent-teal); }
.text-coral { color: var(--color-accent-coral); }
.text-white { color: var(--color-white); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-mono { font-family: var(--font-mono); }

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

.mx-auto { margin-left: auto; margin-right: auto; }

.p-0 { padding: 0; }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

.d-flex { display: flex; }
.d-grid { display: grid; }
.d-block { display: block; }
.d-inline-block { display: inline-block; }
.d-none { display: none; }

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.w-100 { width: 100%; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.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;
}

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.no-select {
  user-select: none;
}

.cursor-pointer {
  cursor: pointer;
}

/* ============================================================
   INTEGRATION OVERRIDES
   Ensures all class names used in index.html / app.js
   resolve to proper styles.
   ============================================================ */

/* --- Layout aliases --- */
.container-sm { max-width: 540px; margin: 0 auto; padding: 0 var(--space-xl); }
.container-md { max-width: 780px; margin: 0 auto; padding: 0 var(--space-xl); }
.card-centered { text-align: center; }

/* --- Header --- */
/* --- Main content area --- */
.app-main {
  padding-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

.header-inner {
  display: flex; justify-content: space-between; align-items: center;
  max-width: var(--container-max); margin: 0 auto; padding: 0 var(--space-xl);
  height: 100%;
}
.logo { display: flex; align-items: center; gap: var(--space-sm); }
.logo-icon { height: 42px; width: auto; object-fit: contain; border-radius: 4px; }
.logo-text { font-size: var(--font-size-lg); font-weight: 700; color: var(--color-white); }
.header-right { display: flex; align-items: center; gap: var(--space-sm); }

/* --- Badge --- */
.badge {
  display: inline-block; padding: 0.2em 0.65em; font-size: var(--font-size-xs);
  font-weight: 600; border-radius: var(--radius-full); background: var(--color-gray-200);
  color: var(--color-gray-800);
}
.badge-info { background: var(--color-info-bg); color: #0c5460; }

/* --- Welcome --- */
.welcome-container {
  min-height: calc(100vh - var(--header-height));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--space-3xl) var(--space-xl); text-align: center;
}
.welcome-red-accent {
  width: 60px; height: 4px; background: var(--color-lu-red);
  border-radius: 2px; margin: 0 auto var(--space-lg);
}
.welcome-hero h1 { font-size: var(--font-size-3xl); color: var(--color-white); margin-bottom: var(--space-sm); }
.welcome-hero .subtitle { font-size: var(--font-size-lg); color: var(--color-gray-300); margin-bottom: var(--space-xl); }

.research-project-box {
  text-align: center; max-width: 700px; margin-bottom: var(--space-2xl);
  padding: var(--space-xl) var(--space-2xl);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  border-top: 3px solid var(--color-lu-red);
}
.research-project-title {
  display: inline-block; font-size: var(--font-size-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px; color: var(--color-lu-red-light);
  margin-bottom: var(--space-sm);
}
.research-project-box h2 {
  font-size: var(--font-size-xl); color: var(--color-white);
  margin-bottom: var(--space-xs); line-height: var(--line-height-tight);
}
.research-project-full {
  font-size: var(--font-size-sm); color: var(--color-gray-400);
  margin-bottom: var(--space-md);
}
.research-project-meta {
  font-size: var(--font-size-xs); color: var(--color-gray-500);
  display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-xs);
}
.research-sep { color: var(--color-lu-red); }
.study-info-box {
  background: var(--color-white); border: 1px solid var(--color-gray-200);
  border-top: 3px solid var(--color-lu-red);
  border-radius: var(--radius-sm); padding: var(--space-xl); max-width: 640px;
  text-align: left; margin-bottom: var(--space-2xl); line-height: var(--line-height-relaxed);
  color: var(--color-gray-700);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.study-info-box h2 { margin-bottom: var(--space-md); font-size: var(--font-size-xl); color: var(--color-lu-grey); }
.study-info-box .text-muted { color: var(--color-gray-500); }
.lang-toggle {
  display: flex; gap: 4px; margin-bottom: var(--space-xl);
  background: rgba(255,255,255,0.06); border-radius: 8px; padding: 4px; border: 1px solid rgba(255,255,255,0.1);
}
.lang-btn {
  padding: 6px 20px; border: none; border-radius: 6px; cursor: pointer;
  font-size: var(--font-size-sm); font-weight: 600; transition: all 0.2s;
  background: transparent; color: var(--color-gray-400);
}
.lang-btn.active { background: var(--color-lu-red); color: #fff; }
.lang-btn:not(.active):hover { background: rgba(255,255,255,0.08); color: var(--color-white); }
.welcome-cards {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md); max-width: 820px; margin-bottom: var(--space-2xl); width: 100%;
}
.welcome-card {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; padding: var(--space-lg) var(--space-xl);
  text-align: left; transition: transform 0.2s, border-color 0.2s, background 0.2s;
  position: relative; overflow: hidden;
}
.welcome-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--color-lu-red); opacity: 0; transition: opacity 0.2s;
}
.welcome-card:hover { transform: translateY(-3px); border-color: rgba(181,18,27,0.4); background: rgba(255,255,255,0.08); }
.welcome-card:hover::before { opacity: 1; }
.welcome-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-md); }
.welcome-card-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.welcome-card-icon svg { width: 22px; height: 22px; }
.welcome-card-icon.icon-red { background: rgba(181,18,27,0.15); color: #ff6b6b; }
.welcome-card-icon.icon-blue { background: rgba(59,130,246,0.15); color: #60a5fa; }
.welcome-card-icon.icon-green { background: rgba(74,222,128,0.15); color: #4ade80; }
.welcome-card-icon.icon-purple { background: rgba(168,85,247,0.15); color: #c084fc; }
.welcome-card-number { font-size: 1.6rem; font-weight: 800; color: rgba(255,255,255,0.06); line-height: 1; }
.welcome-card h3 { color: var(--color-white); font-size: var(--font-size-md); font-weight: 600; margin-bottom: var(--space-xs); }
.welcome-card p { color: var(--color-gray-400); font-size: 0.82rem; line-height: 1.6; }
[dir="rtl"] .welcome-card { text-align: right; }
@media (max-width: 600px) { .welcome-cards { grid-template-columns: 1fr; } }
.welcome-actions { display: flex; gap: var(--space-md); margin-bottom: var(--space-md); flex-wrap: wrap; justify-content: center; }
.welcome-help-links { display: flex; gap: var(--space-md); flex-wrap: wrap; justify-content: center; margin-bottom: var(--space-md); }
.welcome-footer {
  margin-top: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* --- Consent --- */
.consent-document {
  background: var(--color-white); border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md); padding: var(--space-xl); margin-bottom: var(--space-xl);
  max-height: 50vh; overflow-y: auto; text-align: left; line-height: var(--line-height-relaxed);
}
.consent-document h3 { margin-bottom: var(--space-md); }
.consent-document h4 { margin-top: var(--space-lg); margin-bottom: var(--space-sm); color: var(--color-lu-red); }
.consent-document ul, .consent-document ol { padding-left: var(--space-xl); margin-bottom: var(--space-md); }
.consent-document li { margin-bottom: var(--space-xs); }
.consent-checkboxes { margin-bottom: var(--space-xl); text-align: left; }
.checkbox-label {
  display: flex; align-items: flex-start; gap: var(--space-sm);
  padding: var(--space-sm) 0; cursor: pointer; line-height: var(--line-height-normal);
}
.checkbox-label input[type="checkbox"] { margin-top: 4px; accent-color: var(--color-lu-red); }

/* --- Dashboard --- */
.dashboard-header { text-align: center; margin-bottom: var(--space-2xl); }
.dashboard-header h1 { font-size: var(--font-size-2xl); margin-bottom: var(--space-sm); }
.phase-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-xl); margin-bottom: var(--space-2xl);
}
.phase-card {
  background: var(--color-white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); overflow: hidden; transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}
.phase-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); }
.phase-card-header {
  padding: var(--space-md) var(--space-lg); color: var(--color-white);
  display: flex; justify-content: space-between; align-items: center;
}
.phase-header-1 { background: linear-gradient(135deg, #3498db, #2980b9); }
.phase-header-2 { background: linear-gradient(135deg, var(--color-lu-red), var(--color-lu-red-dark)); }
.phase-header-3 { background: linear-gradient(135deg, #e67e22, #d35400); }
.phase-header-4 { background: linear-gradient(135deg, #555656, #1e1f1f); }
.phase-number { font-weight: 700; font-size: var(--font-size-md); }
.phase-status {
  font-size: var(--font-size-xs); padding: 0.2em 0.6em;
  border-radius: var(--radius-full); font-weight: 600;
}
.status-available { background: rgba(255,255,255,0.9); color: #27ae60; }
.status-completed { background: rgba(255,255,255,0.9); color: var(--color-gray-600); }
.status-locked { background: rgba(255,255,255,0.3); color: rgba(255,255,255,0.8); }
.phase-card-body { padding: var(--space-lg); }
.phase-card-body h3 { margin-bottom: var(--space-sm); font-size: var(--font-size-lg); }
.phase-card-body p { color: var(--color-gray-600); margin-bottom: var(--space-sm); line-height: var(--line-height-relaxed); }
.phase-card-body ul { padding-left: var(--space-xl); margin-bottom: var(--space-sm); color: var(--color-gray-600); }
.phase-card-body li { margin-bottom: var(--space-xs); }
.phase-card-footer { padding: 0 var(--space-lg) var(--space-lg); }
.dashboard-footer { text-align: center; padding: var(--space-xl) 0; }

/* --- Alert --- */
.alert {
  padding: var(--space-md) var(--space-lg); border-radius: var(--radius-md);
  margin-bottom: var(--space-lg); border-left: 4px solid transparent;
}
.alert h4 { margin-bottom: var(--space-sm); }
.alert ol, .alert ul { padding-left: var(--space-xl); }
.alert li { margin-bottom: var(--space-xs); }
.alert-info { background: var(--color-info-bg); border-color: var(--color-info); color: #0c5460; }
.alert-success { background: var(--color-success-bg); border-color: var(--color-success-border); color: #155724; }
.alert-warning { background: var(--color-warning-bg); border-color: var(--color-warning); color: #856404; }
.alert-danger { background: var(--color-danger-bg); border-color: var(--color-danger-border); color: #721c24; }

/* --- Text Utilities --- */
.text-primary { color: var(--color-lu-red-light); }
.text-muted { color: var(--color-gray-500); }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }

/* --- Email Display (shared between test and game) --- */
.email-container {
  background: var(--color-white); border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg); overflow: hidden; margin-bottom: var(--space-xl);
  box-shadow: var(--shadow-card);
}
.email-header-bar {
  background: linear-gradient(135deg, #1e1f1f, #2a2b2b);
  color: var(--color-white); padding: var(--space-sm) var(--space-lg);
  display: flex; justify-content: space-between; align-items: center;
  font-size: var(--font-size-sm); font-weight: 600;
}
.email-label { opacity: 0.9; }
.email-badge {
  display: inline-block; padding: 0.15em 0.55em; border-radius: var(--radius-full);
  font-size: var(--font-size-xs); font-weight: 700; text-transform: uppercase;
}
.badge-easy, .email-badge.badge-easy { background: var(--color-success); color: var(--color-white); }
.badge-medium, .email-badge.badge-medium { background: var(--color-warning); color: var(--color-gray-900); }
.badge-hard, .email-badge.badge-hard { background: var(--color-danger); color: var(--color-white); }
.email-meta { padding: var(--space-lg); border-bottom: 1px solid var(--color-gray-100); }
.email-meta-row {
  display: flex; margin-bottom: var(--space-xs); font-size: var(--font-size-sm);
}
.email-meta-label {
  width: 70px; font-weight: 600; color: var(--color-gray-600); flex-shrink: 0;
}
.email-meta-value { color: var(--color-gray-800); word-break: break-all; }
.email-meta-value.email-subject { font-weight: 700; font-size: var(--font-size-base); color: var(--color-gray-900); }
.email-body {
  padding: var(--space-lg); line-height: var(--line-height-relaxed);
  color: var(--color-gray-800); font-size: var(--font-size-base);
  min-height: 120px;
}

/* --- Test screen --- */
.test-progress { margin-bottom: var(--space-lg); }
.progress-bar-container {
  width: 100%; height: 8px; background: var(--color-gray-200);
  border-radius: var(--radius-full); overflow: hidden; margin-bottom: var(--space-xs);
}
.progress-bar {
  height: 100%; background: linear-gradient(90deg, var(--color-accent-teal), var(--color-accent-teal-dark));
  border-radius: var(--radius-full); transition: width 0.4s ease; width: 0;
}
.progress-text { font-size: var(--font-size-sm); color: var(--color-gray-600); font-weight: 500; }

.test-actions {
  display: flex; gap: var(--space-lg); justify-content: center;
  margin-top: var(--space-lg); flex-wrap: wrap;
}
.test-actions .btn { min-width: 180px; font-size: var(--font-size-lg); padding: var(--space-md) var(--space-2xl); }

/* --- Feedback card (test & game) --- */
.feedback-card {
  background: var(--color-white); border-radius: var(--radius-lg);
  padding: var(--space-2xl); text-align: center; box-shadow: var(--shadow-lg);
  border-top: 5px solid var(--color-gray-300); max-width: 640px; margin: 0 auto;
}
.feedback-card.feedback-correct { border-top-color: var(--color-success); }
.feedback-card.feedback-incorrect { border-top-color: var(--color-danger); }
.feedback-icon { font-size: 3rem; margin-bottom: var(--space-md); display: flex; align-items: center; justify-content: center; }
.feedback-icon svg { width: 48px; height: 48px; }
.feedback-card.feedback-correct .feedback-icon { color: var(--color-success); }
.feedback-card.feedback-incorrect .feedback-icon { color: var(--color-danger); }
.feedback-card h2 { margin-bottom: var(--space-sm); }
.feedback-card.feedback-correct h2 { color: var(--color-success); }
.feedback-card.feedback-incorrect h2 { color: var(--color-danger); }
.feedback-explanation {
  text-align: left; background: var(--color-gray-50); border-radius: var(--radius-md);
  padding: var(--space-lg); margin: var(--space-lg) 0;
}
.feedback-explanation h4 { margin-bottom: var(--space-sm); color: var(--color-lu-grey); }
.feedback-explanation p { line-height: var(--line-height-relaxed); color: var(--color-gray-700); }
.feedback-indicators {
  text-align: left; margin: var(--space-md) 0;
  background: #fff5f5; border-radius: var(--radius-md); padding: var(--space-lg);
}
.feedback-indicators h4 { color: var(--color-danger); margin-bottom: var(--space-sm); }
.feedback-indicators ul { padding-left: var(--space-xl); }
.feedback-indicators li { margin-bottom: var(--space-xs); color: var(--color-gray-700); }

/* --- Feedback score --- */
.feedback-score-display { margin: var(--space-md) 0; }
.feedback-points {
  font-size: var(--font-size-2xl); font-weight: 700; color: var(--color-success);
}
.feedback-speed-bonus { font-size: var(--font-size-sm); color: var(--color-gray-500); display: block; }

/* --- Score display --- */
.score-display { padding: var(--space-xl) 0; }
.score-big {
  font-size: var(--font-size-4xl); font-weight: 800; color: var(--color-lu-red);
  animation: scoreReveal 0.6s ease-out;
}
.score-label { font-size: var(--font-size-md); color: var(--color-gray-600); margin-top: var(--space-sm); }
.score-percentage { font-size: var(--font-size-2xl); font-weight: 700; color: var(--color-accent-teal); margin-top: var(--space-sm); }
@keyframes scoreReveal { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* --- Level intro --- */
.level-badge {
  display: inline-block; padding: 0.4em 1.2em; border-radius: var(--radius-full);
  font-weight: 700; font-size: var(--font-size-lg); color: var(--color-white);
  margin-bottom: var(--space-md);
}
.level-badge.badge-easy { background: var(--color-success); }
.level-badge.badge-medium { background: var(--color-warning); color: var(--color-gray-900); }
.level-badge.badge-hard { background: var(--color-danger); }
.level-stats-preview {
  display: flex; justify-content: center; gap: var(--space-2xl); margin: var(--space-xl) 0;
}
.stat-item { text-align: center; }
.stat-value { display: block; font-size: var(--font-size-2xl); font-weight: 700; color: var(--color-bg-deep); }
.stat-label { display: block; font-size: var(--font-size-sm); color: var(--color-gray-500); margin-top: var(--space-xs); }

/* --- Level complete --- */
.level-results { display: flex; justify-content: center; gap: var(--space-2xl); margin: var(--space-xl) 0; }

/* --- Game status bar --- */
.game-status-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--space-md) var(--space-xl);
  background: linear-gradient(135deg, #1e1f1f, #2a2b2b);
  color: var(--color-white); border-radius: var(--radius-md); margin-bottom: var(--space-lg);
}
.game-stat { text-align: center; }
.game-stat-label { display: block; font-size: var(--font-size-xs); opacity: 0.7; text-transform: uppercase; }
.game-stat-value { display: block; font-size: var(--font-size-lg); font-weight: 700; }

/* --- Game complete --- */
.game-complete-hero {
  text-align: center; padding: var(--space-2xl) 0;
}
.game-complete-hero h1 { font-size: var(--font-size-3xl); margin-bottom: var(--space-sm); }
.game-complete-hero .subtitle { font-size: var(--font-size-lg); color: var(--color-gray-600); }
.game-results-breakdown { margin: var(--space-xl) 0; }
.results-table {
  width: 100%; border-collapse: collapse; background: var(--color-white);
  border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm);
}
.results-table th, .results-table td {
  padding: var(--space-md) var(--space-lg); text-align: left;
  border-bottom: 1px solid var(--color-gray-100);
}
.results-table thead th {
  background: var(--color-bg-dark); color: var(--color-white); font-weight: 600;
}
.results-table tbody tr:hover { background: var(--color-gray-50); }
.results-total td { background: var(--color-gray-50); font-weight: 600; }

/* --- Narrative / Game Intro --- */
.narrative-card {
  background: var(--color-white); border-radius: var(--radius-lg);
  padding: var(--space-2xl); text-align: center; box-shadow: var(--shadow-lg);
  max-width: 700px; margin: 0 auto;
}
.narrative-avatar {
  margin-bottom: var(--space-lg);
  width: 80px; height: 80px;
  background: var(--color-gray-100); border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
.narrative-avatar svg {
  width: 48px; height: 48px;
}
.narrative-text { text-align: left; line-height: var(--line-height-relaxed); margin-bottom: var(--space-xl); }
.narrative-text p { margin-bottom: var(--space-md); }
.callout {
  background: var(--color-info-bg); border-left: 4px solid var(--color-info);
  border-radius: var(--radius-md); padding: var(--space-lg); margin: var(--space-lg) 0;
  text-align: left;
}
.callout h4 { margin-bottom: var(--space-sm); color: #0c5460; }
.callout ul { padding-left: var(--space-xl); margin-top: var(--space-sm); }
.callout li { margin-bottom: var(--space-xs); }

/* --- SeBIS questionnaire --- */
.sebis-container { margin: var(--space-xl) 0; }
.sebis-question {
  background: var(--color-white); border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md); padding: var(--space-lg); margin-bottom: var(--space-md);
  transition: border-color var(--transition-fast);
}
.sebis-question:hover { border-color: var(--color-gray-400); }
.sebis-question-text { font-weight: 500; margin-bottom: var(--space-md); line-height: var(--line-height-normal); }
.sebis-options { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.sebis-option {
  display: inline-flex; align-items: center; gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md); border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-md); cursor: pointer; font-size: var(--font-size-sm);
  transition: all var(--transition-fast); user-select: none;
}
.sebis-option:hover { border-color: var(--color-accent-teal); background: rgba(181,18,27,0.05); }
.sebis-option.selected {
  border-color: var(--color-accent-teal); background: rgba(181,18,27,0.1);
  color: var(--color-accent-teal-dark); font-weight: 600;
}
.sebis-option input[type="radio"] { accent-color: var(--color-accent-teal); }

/* --- Control group --- */
.control-content { text-align: left; margin-bottom: var(--space-xl); }
.info-section {
  background: var(--color-white); border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md); padding: var(--space-xl); margin-bottom: var(--space-lg);
}
.info-section h2 { color: var(--color-bg-deep); margin-bottom: var(--space-md); }
.info-section h4 { margin-top: var(--space-md); margin-bottom: var(--space-sm); }
.info-section ul, .info-section ol { padding-left: var(--space-xl); margin-bottom: var(--space-md); line-height: var(--line-height-relaxed); }
.info-section li { margin-bottom: var(--space-sm); }

/* --- Qualitative feedback --- */
.feedback-question-group { margin-bottom: var(--space-lg); }
.feedback-question-group label { font-weight: 500; line-height: var(--line-height-normal); display: block; margin-bottom: var(--space-sm); }
.feedback-question-group textarea {
  width: 100%; padding: var(--space-md); border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-md); font-family: var(--font-primary);
  font-size: var(--font-size-base); resize: vertical; transition: border-color var(--transition-fast);
}
.feedback-question-group textarea:focus { outline: none; border-color: var(--color-accent-teal); box-shadow: 0 0 0 3px rgba(181,18,27,0.15); }

/* --- Phase complete --- */
.completion-icon { font-size: 3rem; color: var(--color-success); margin-bottom: var(--space-md); }
.participant-id-display { margin: var(--space-xl) 0; }
.id-box {
  display: inline-block; font-family: var(--font-mono); font-size: var(--font-size-2xl);
  font-weight: 700; background: var(--color-gray-100); border: 2px dashed var(--color-gray-400);
  border-radius: var(--radius-md); padding: var(--space-md) var(--space-xl);
  letter-spacing: 2px; color: var(--color-bg-deep); margin: var(--space-md) 0;
}

/* --- Toast notifications --- */
.toast-container {
  position: fixed; bottom: var(--space-xl); right: var(--space-xl);
  z-index: var(--z-toast); display: flex; flex-direction: column-reverse; gap: var(--space-sm);
}
.toast {
  padding: var(--space-md) var(--space-xl); border-radius: var(--radius-md);
  color: var(--color-white); font-weight: 500; box-shadow: var(--shadow-lg);
  transform: translateX(120%); transition: transform 0.35s ease;
  max-width: 400px;
}
.toast-show { transform: translateX(0); }
.toast-info { background: var(--color-info); }
.toast-success { background: var(--color-success-border); }
.toast-danger { background: var(--color-danger); }

/* --- Loading overlay --- */
.loading-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: var(--z-overlay); color: var(--color-white);
}
.spinner {
  width: 40px; height: 40px; border: 4px solid rgba(255,255,255,0.3);
  border-top-color: var(--color-white); border-radius: 50%;
  animation: spinAnim 0.8s linear infinite; margin-bottom: var(--space-md);
}
@keyframes spinAnim { to { transform: rotate(360deg); } }

/* --- Form inputs (ensure registration/login forms styled) --- */
.form select, .form input[type="text"], .form input[type="number"] {
  width: 100%; padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-gray-300); border-radius: var(--radius-md);
  font-family: var(--font-primary); font-size: var(--font-size-base);
  color: var(--color-gray-900); background: var(--color-white);
  transition: border-color var(--transition-fast);
}
.form select:focus, .form input:focus {
  outline: none; border-color: var(--color-accent-teal);
  box-shadow: 0 0 0 3px rgba(181,18,27,0.15);
}
.form label { display: block; font-weight: 500; margin-bottom: var(--space-xs); color: var(--color-gray-700); }
.form small { font-size: var(--font-size-xs); color: var(--color-gray-500); display: block; margin-top: var(--space-xs); }

/* --- Game feedback timeout alert --- */
#game-feedback-timeout { margin-top: var(--space-md); }

/* --- Responsive overrides --- */
@media (max-width: 768px) {
  .phase-cards { grid-template-columns: 1fr; }
  .level-stats-preview, .level-results { flex-direction: column; gap: var(--space-md); }
  .test-actions { flex-direction: column; align-items: center; }
  .test-actions .btn { min-width: 260px; }
  .game-status-bar { flex-wrap: wrap; gap: var(--space-sm); justify-content: center; }
  .sebis-options { flex-direction: column; }
  .welcome-actions { flex-direction: column; }
  .container-sm, .container-md { padding: 0 var(--space-md); }
}

/* ----------------------------------------
   LOGIN CARD TEXT FIX
   ---------------------------------------- */
#login-screen .card {
  color: var(--color-gray-700);
}
#login-screen .card h1 {
  color: var(--color-bg-dark);
}
#login-screen .card label {
  color: var(--color-gray-700);
}

/* ----------------------------------------
   LIST STYLE RESTORE
   (global reset removes all bullets;
   restore them where content needs them)
   ---------------------------------------- */
.consent-document ul { list-style: disc; }
.consent-document ol { list-style: decimal; }
.phase-card-body ul { list-style: disc; }
.info-section ul { list-style: disc; }
.info-section ol { list-style: decimal; }
.alert ol { list-style: decimal; }
.alert ul { list-style: disc; }
.callout ul { list-style: disc; }
.feedback-indicators ul { list-style: disc; }
.narrative-text ul { list-style: disc; }
.tutorial-step-content ul { list-style: disc; }
.tutorial-step-content ol { list-style: decimal; }

/* ----------------------------------------
   UNIVERSITY BRANDING
   ---------------------------------------- */
.university-branding {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
  padding: var(--space-2xl) var(--space-2xl);
}
.university-logo {
  flex-shrink: 0;
}
.university-logo img, .university-logo svg {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: var(--radius-md);
}
.university-info {
  text-align: center;
}
.university-name {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-white);
  letter-spacing: 0.5px;
  line-height: 1.3;
}
.university-dept {
  font-size: var(--font-size-sm);
  color: var(--color-gray-400);
  margin-top: 4px;
}

/* ----------------------------------------
   TUTORIAL SCREEN
   ---------------------------------------- */
.tutorial-container {
  min-height: calc(100vh - var(--header-height));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl) var(--space-xl);
}
.tutorial-card {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 720px;
  width: 100%;
  overflow: hidden;
  animation: tutorialFadeIn 0.5s ease-out;
}
@keyframes tutorialFadeIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.tutorial-header {
  background: linear-gradient(135deg, #1e1f1f 0%, var(--color-lu-red) 100%);
  color: var(--color-white);
  padding: var(--space-xl) var(--space-2xl);
  text-align: center;
  position: relative;
}
.tutorial-home-btn {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--color-white);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.tutorial-home-btn:hover {
  background: rgba(255,255,255,0.3);
  transform: scale(1.08);
}
[dir="rtl"] .tutorial-home-btn {
  left: auto;
  right: var(--space-md);
}
.tutorial-header h1 {
  color: var(--color-white);
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-xs);
}
.tutorial-header p {
  color: var(--color-gray-300);
  font-size: var(--font-size-sm);
  margin-bottom: 0;
}
.tutorial-steps-indicator {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-xl) 0;
}
.step-dot {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background: var(--color-gray-300);
  transition: all var(--transition-normal);
  cursor: pointer;
}
.step-dot.active {
  background: var(--color-accent-teal);
  width: 32px;
}
.step-dot.completed {
  background: var(--color-success);
}
.tutorial-step {
  display: none;
  padding: var(--space-2xl);
  animation: stepSlideIn 0.4s ease-out;
}
.tutorial-step.active {
  display: block;
}
@keyframes stepSlideIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
.tutorial-step-icon {
  text-align: center;
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tutorial-step-icon svg {
  width: 56px;
  height: 56px;
}
.tutorial-step h2 {
  text-align: center;
  margin-bottom: var(--space-lg);
  color: var(--color-bg-dark);
  font-size: var(--font-size-xl);
}
.tutorial-step-content {
  color: var(--color-gray-700);
  line-height: var(--line-height-relaxed);
  font-size: var(--font-size-base);
}
.tutorial-step-content p {
  margin-bottom: var(--space-md);
}
.tutorial-step-content ul,
.tutorial-step-content ol {
  padding-left: var(--space-xl);
  margin-bottom: var(--space-md);
}
.tutorial-step-content li {
  margin-bottom: var(--space-sm);
}
.tutorial-step-content .highlight-box {
  background: var(--color-info-bg);
  border-left: 4px solid var(--color-info);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-md) 0;
  font-size: var(--font-size-sm);
  color: #0c5460;
}
.tutorial-step-content .warning-box {
  background: var(--color-warning-bg);
  border-left: 4px solid var(--color-warning);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-md) 0;
  font-size: var(--font-size-sm);
  color: #856404;
}
.tutorial-step-content .success-box {
  background: var(--color-success-bg);
  border-left: 4px solid var(--color-success);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-md) 0;
  font-size: var(--font-size-sm);
  color: #155724;
}
.tutorial-phase-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}
.tutorial-phase-card {
  background: var(--color-gray-50);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  border-left: 4px solid var(--color-accent-teal);
  text-align: left;
}
.tutorial-phase-card h4 {
  font-size: var(--font-size-sm);
  color: var(--color-bg-dark);
  margin-bottom: var(--space-xs);
}
.tutorial-phase-card p {
  font-size: var(--font-size-xs);
  color: var(--color-gray-600);
  margin-bottom: 0;
}
.tutorial-email-preview {
  background: var(--color-gray-50);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: var(--space-lg) 0;
}
.tutorial-email-preview .preview-header {
  background: var(--color-gray-200);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-gray-700);
}
.tutorial-email-preview .preview-body {
  padding: var(--space-md);
  font-size: var(--font-size-sm);
  color: var(--color-gray-600);
}
.tutorial-scoring-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-md) 0;
}
.tutorial-scoring-table th,
.tutorial-scoring-table td {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--color-gray-200);
  font-size: var(--font-size-sm);
}
.tutorial-scoring-table th {
  background: var(--color-gray-100);
  font-weight: 600;
  color: var(--color-gray-800);
}
.tutorial-scoring-table td {
  color: var(--color-gray-700);
}
.tutorial-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg) var(--space-2xl) var(--space-2xl);
  border-top: 1px solid var(--color-gray-200);
}
.tutorial-footer .step-counter {
  font-size: var(--font-size-sm);
  color: var(--color-gray-500);
  font-weight: 600;
}
.tutorial-nav-buttons {
  display: flex;
  gap: var(--space-sm);
}

@media (max-width: 768px) {
  .tutorial-phase-cards {
    grid-template-columns: 1fr;
  }
  .tutorial-footer {
    flex-direction: column;
    gap: var(--space-md);
  }
  .university-branding {
    flex-direction: column;
    text-align: center;
  }
  .university-info {
    text-align: center;
  }
}

/* ----------------------------------------
   ENHANCED ANIMATIONS
   ---------------------------------------- */
@keyframes emailSlideIn {
  from { opacity: 0; transform: translateY(25px); }
  to { opacity: 1; transform: translateY(0); }
}
.email-container {
  animation: emailSlideIn 0.45s ease-out;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}
.feedback-card {
  animation: fadeInUp 0.4s ease-out;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(181, 18, 27, 0.3); }
  50% { box-shadow: 0 0 0 8px rgba(181, 18, 27, 0); }
}
.btn-primary:not(:disabled):hover {
  animation: pulseGlow 1.5s ease-in-out infinite;
}

@keyframes scorePopIn {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
.score-big {
  animation: scorePopIn 0.6s ease-out;
}
.feedback-points {
  animation: scorePopIn 0.5s ease-out 0.15s both;
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
.progress-bar {
  background: linear-gradient(
    90deg,
    var(--color-accent-teal) 0%,
    var(--color-accent-teal-dark) 40%,
    #5de0d3 50%,
    var(--color-accent-teal-dark) 60%,
    var(--color-accent-teal) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2.5s ease-in-out infinite;
}

@keyframes levelBadgePop {
  0% { transform: scale(0) rotate(-12deg); }
  50% { transform: scale(1.2) rotate(3deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.level-badge {
  animation: levelBadgePop 0.5s ease-out;
}

@keyframes statCountUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.stat-item {
  animation: statCountUp 0.4s ease-out backwards;
}
.stat-item:nth-child(1) { animation-delay: 0.1s; }
.stat-item:nth-child(2) { animation-delay: 0.2s; }
.stat-item:nth-child(3) { animation-delay: 0.3s; }

@keyframes cardHoverFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.phase-card:hover {
  animation: cardHoverFloat 0.5s ease-out;
}

@keyframes timerUrgent {
  0%, 100% { transform: scaleX(1); }
  50% { transform: scaleX(1.01); }
}
.timer-bar-fill.timer-red {
  animation: timerPulse 1s ease-in-out infinite, timerUrgent 0.5s ease-in-out infinite;
}

@keyframes checkmarkDraw {
  from { transform: scale(0) rotate(-45deg); opacity: 0; }
  to { transform: scale(1) rotate(0deg); opacity: 1; }
}
.completion-icon {
  animation: checkmarkDraw 0.6s ease-out;
}

@keyframes heroTitleReveal {
  from { opacity: 0; transform: translateY(-20px); letter-spacing: 8px; }
  to { opacity: 1; transform: translateY(0); letter-spacing: normal; }
}
.welcome-hero h1 {
  animation: heroTitleReveal 0.8s ease-out;
}

@keyframes heroSubtitleFade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.welcome-hero .subtitle {
  animation: heroSubtitleFade 0.8s ease-out 0.3s both;
}

@keyframes studyInfoSlide {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.study-info-box {
  animation: studyInfoSlide 0.6s ease-out 0.5s both;
}

@keyframes buttonFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.welcome-actions {
  animation: buttonFadeIn 0.5s ease-out 0.7s both;
}
.university-branding {
  animation: buttonFadeIn 0.5s ease-out 0.9s both;
}

@keyframes gameStatusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.9; }
}
.game-status-bar {
  animation: gameStatusPulse 3s ease-in-out infinite;
}

@keyframes resultsRowSlide {
  from { opacity: 0; transform: translateX(-15px); }
  to { opacity: 1; transform: translateX(0); }
}
.results-table tbody tr {
  animation: resultsRowSlide 0.35s ease-out backwards;
}
.results-table tbody tr:nth-child(1) { animation-delay: 0.1s; }
.results-table tbody tr:nth-child(2) { animation-delay: 0.2s; }
.results-table tbody tr:nth-child(3) { animation-delay: 0.3s; }

/* ----------------------------------------
   COPY BUTTON
   ---------------------------------------- */
.id-copy-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin: var(--space-md) 0;
  flex-wrap: wrap;
}
.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  background: var(--color-white);
  border: 2px solid var(--color-accent-teal);
  border-radius: var(--radius-md);
  color: var(--color-accent-teal);
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
}
.btn-copy:hover {
  background: var(--color-accent-teal);
  color: var(--color-white);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(181, 18, 27, 0.25);
}
.btn-copy.copied {
  background: var(--color-success);
  border-color: var(--color-success);
  color: var(--color-white);
}
.copy-icon { font-size: 1.1em; }

/* ----------------------------------------
   DASHBOARD V2
   ---------------------------------------- */
.dashboard-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 2px solid var(--color-gray-200);
  flex-wrap: wrap;
  gap: var(--space-md);
}
.dashboard-hero h1 {
  font-size: var(--font-size-2xl);
  color: var(--color-bg-dark);
  margin-bottom: var(--space-xs);
}
.dashboard-welcome {
  color: var(--color-gray-600);
  font-size: var(--font-size-md);
  margin-bottom: 0;
}
.dashboard-hero-right {
  text-align: right;
}
.dashboard-badge-row {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}
.dashboard-id-badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-md);
  background: var(--color-bg-dark);
  color: var(--color-white);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.dashboard-group-badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-md);
  background: var(--color-info-bg);
  color: #0c5460;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
}

/* Progress overview bar */
.dashboard-progress-overview {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-xl);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-2xl);
  border: 1px solid var(--color-gray-200);
}
.progress-overview-label {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-gray-700);
  margin-bottom: var(--space-sm);
}
.progress-overview-bar {
  height: 10px;
  background: var(--color-gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-overview-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent-teal), var(--color-success));
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

/* Phase Timeline Layout */
.phase-timeline {
  position: relative;
  margin-bottom: var(--space-2xl);
}
.phase-card-v2 {
  display: flex;
  gap: var(--space-xl);
  margin-bottom: var(--space-lg);
  transition: opacity var(--transition-normal);
}
.phase-card-v2.phase-locked {
  opacity: 0.55;
}
.phase-card-v2.phase-locked .phase-card-v2-content {
  pointer-events: none;
}

/* Step indicator (left column) */
.phase-card-v2-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 48px;
}
.phase-step-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: var(--font-size-lg);
  color: var(--color-white);
  flex-shrink: 0;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}
.phase-step-1 { background: linear-gradient(135deg, #3498db, #2980b9); }
.phase-step-2 { background: linear-gradient(135deg, var(--color-lu-red), var(--color-lu-red-dark)); }
.phase-step-3 { background: linear-gradient(135deg, #e67e22, #d35400); }
.phase-step-4 { background: linear-gradient(135deg, #555656, #1e1f1f); }
.phase-step-circle.status-circle-completed {
  background: linear-gradient(135deg, var(--color-success), #1e8449) !important;
  box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.2);
}
.phase-step-circle.status-circle-available {
  box-shadow: 0 0 0 4px rgba(181, 18, 27, 0.2);
  animation: pulseCircle 2s ease-in-out infinite;
}
@keyframes pulseCircle {
  0%, 100% { box-shadow: 0 0 0 4px rgba(181, 18, 27, 0.2); }
  50% { box-shadow: 0 0 0 8px rgba(181, 18, 27, 0.1); }
}
.phase-step-circle.status-circle-locked {
  background: var(--color-gray-400) !important;
  box-shadow: none;
}
.phase-step-num { color: var(--color-white); }
.phase-step-check { color: var(--color-white); font-size: var(--font-size-lg); }
.phase-step-line {
  width: 3px;
  flex: 1;
  min-height: 20px;
  background: var(--color-gray-300);
  margin: var(--space-xs) 0;
  border-radius: var(--radius-full);
}
.phase-card-v2.phase-completed .phase-step-line {
  background: var(--color-success);
}

/* Card content (right column) */
.phase-card-v2-content {
  flex: 1;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-gray-200);
  overflow: hidden;
  transition: all var(--transition-normal);
}
.phase-card-v2-content:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}
.phase-card-v2.phase-locked .phase-card-v2-content:hover {
  transform: none;
  box-shadow: var(--shadow-card);
}
.phase-card-v2.phase-completed .phase-card-v2-content {
  border-color: var(--color-success);
  border-left: 4px solid var(--color-success);
}

.phase-card-v2-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--space-lg) var(--space-xl) var(--space-sm);
  gap: var(--space-md);
}
.phase-card-v2-header h3 {
  font-size: var(--font-size-lg);
  color: var(--color-bg-dark);
  margin-bottom: 2px;
}
.phase-card-v2-label {
  font-size: var(--font-size-xs);
  color: var(--color-gray-500);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Status badges v2 */
.phase-status-v2 {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  flex-shrink: 0;
}
.status-v2-available {
  background: rgba(181, 18, 27, 0.08);
  color: var(--color-accent-teal-dark);
  border: 1px solid rgba(181, 18, 27, 0.25);
}
.status-v2-completed {
  background: var(--color-success-bg);
  color: var(--color-success-border);
  border: 1px solid rgba(46, 204, 113, 0.3);
}
.status-v2-locked {
  background: var(--color-gray-100);
  color: var(--color-gray-500);
  border: 1px solid var(--color-gray-300);
}

.phase-card-v2-desc {
  padding: 0 var(--space-xl);
  color: var(--color-gray-600);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-md);
}

.phase-card-v2-details {
  padding: 0 var(--space-xl);
  margin-bottom: var(--space-md);
}
.phase-detail-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) 0;
  font-size: var(--font-size-sm);
  color: var(--color-gray-700);
}
.detail-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.detail-icon svg {
  width: 18px;
  height: 18px;
}

.phase-card-v2-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-xl);
  background: var(--color-gray-50);
  border-top: 1px solid var(--color-gray-100);
}
.phase-time-estimate {
  font-size: var(--font-size-xs);
  color: var(--color-gray-500);
  font-weight: 500;
}

/* Completed / Locked button states */
.btn-completed {
  background: var(--color-success-bg) !important;
  color: var(--color-success-border) !important;
  border: 2px solid rgba(46, 204, 113, 0.3) !important;
  cursor: default;
}
.btn-locked {
  background: var(--color-gray-200) !important;
  color: var(--color-gray-500) !important;
  border: 2px solid var(--color-gray-300) !important;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .dashboard-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .dashboard-hero-right {
    text-align: left;
  }
  .phase-card-v2 {
    gap: var(--space-md);
  }
  .phase-card-v2-step {
    width: 36px;
  }
  .phase-step-circle {
    width: 36px;
    height: 36px;
    font-size: var(--font-size-sm);
  }
  .phase-card-v2-header {
    flex-direction: column;
  }
  .phase-card-v2-footer {
    flex-direction: column;
    gap: var(--space-sm);
    align-items: stretch;
  }
  .phase-card-v2-footer .btn {
    width: 100%;
  }
}

/* --- RTL Support --- */
[dir="rtl"] body { text-align: right; }
[dir="rtl"] .app-header .header-inner { flex-direction: row-reverse; }
[dir="rtl"] .logo { flex-direction: row-reverse; }
[dir="rtl"] .welcome-container { text-align: center; }
[dir="rtl"] .welcome-card { text-align: right; }
[dir="rtl"] #consent-screen h1 { text-align: right; }
[dir="rtl"] .consent-document { text-align: right; direction: rtl; }
[dir="rtl"] .consent-document ul, [dir="rtl"] .consent-document ol { padding-right: var(--space-xl); padding-left: 0; }
[dir="rtl"] .consent-checkboxes { text-align: right; }
[dir="rtl"] .checkbox-label { flex-direction: row-reverse; }
[dir="rtl"] .checkbox-label input[type="checkbox"] { margin-left: 0; margin-right: 0; }
[dir="rtl"] .form { text-align: right; }
[dir="rtl"] .card-centered { text-align: center; }
[dir="rtl"] .dashboard-hero { flex-direction: row-reverse; }
[dir="rtl"] .phase-card-v2 { direction: rtl; }
[dir="rtl"] .phase-card-v2-content { text-align: right; }
[dir="rtl"] .phase-card-v2-step { order: 2; }
[dir="rtl"] .phase-card-v2-content { order: 1; }
[dir="rtl"] .phase-detail-item { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .phase-detail-item .detail-icon { margin-right: 0; margin-left: var(--space-sm); }
[dir="rtl"] .phase-card-v2-footer { flex-direction: row-reverse; }
[dir="rtl"] .email-meta-row { flex-direction: row-reverse; }
[dir="rtl"] .email-meta-label { text-align: right; }
[dir="rtl"] .email-body { text-align: right; direction: ltr; }
[dir="rtl"] .test-actions { flex-direction: row-reverse; }
[dir="rtl"] .btn-group { flex-direction: row-reverse; }
[dir="rtl"] .game-status-bar { flex-direction: row-reverse; }
[dir="rtl"] .feedback-card { text-align: right; }
[dir="rtl"] .feedback-card h2, [dir="rtl"] .feedback-card .feedback-icon { text-align: center; }
[dir="rtl"] .feedback-explanation { text-align: right; }
[dir="rtl"] .feedback-indicators ul { padding-right: var(--space-xl); padding-left: 0; }
[dir="rtl"] .level-results, [dir="rtl"] .level-stats-preview { flex-direction: row-reverse; }
[dir="rtl"] .game-results-breakdown table { direction: rtl; }
[dir="rtl"] .narrative-text { text-align: right; }
[dir="rtl"] .callout ul { padding-right: var(--space-xl); padding-left: 0; }
[dir="rtl"] .control-content { text-align: right; }
[dir="rtl"] .control-content ul, [dir="rtl"] .control-content ol { padding-right: var(--space-xl); padding-left: 0; }
[dir="rtl"] .sebis-container { text-align: right; }
[dir="rtl"] .sebis-options { flex-direction: row-reverse; }
[dir="rtl"] .sebis-question-text { text-align: right; }
[dir="rtl"] .tutorial-step-content { text-align: right; }
[dir="rtl"] .tutorial-step-content ol, [dir="rtl"] .tutorial-step-content ul { padding-right: var(--space-xl); padding-left: 0; }
[dir="rtl"] .participant-id-display { text-align: center; }
[dir="rtl"] .id-copy-row { flex-direction: row-reverse; }
[dir="rtl"] .progress-overview-label { flex-direction: row-reverse; }
[dir="rtl"] .dashboard-badge-row { flex-direction: row-reverse; }
[dir="rtl"] .research-project-meta { flex-direction: row-reverse; }
[dir="rtl"] .header-right { flex-direction: row-reverse; }
[dir="rtl"] .lang-toggle { direction: ltr; }
[dir="rtl"] .welcome-help-links { flex-direction: row-reverse; }
[dir="rtl"] .tutorial-phase-card { border-left: none; border-right: 4px solid; }
[dir="rtl"] .tutorial-footer { flex-direction: row-reverse; }
[dir="rtl"] .tutorial-nav-buttons { flex-direction: row-reverse; }
[dir="rtl"] .tutorial-scoring-table { direction: rtl; }
[dir="rtl"] .tutorial-scoring-table th, [dir="rtl"] .tutorial-scoring-table td { text-align: right; }

/* ----------------------------------------
   END OF STYLESHEET
   ---------------------------------------- */
