/* PERF-04: Google Fonts loaded via <link> tags in index.html for non-blocking rendering */

/* ───────────────────────────────────────────────
   Design Tokens — 2050 Neural Threat Console
   ─────────────────────────────────────────────── */

@property --border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

:root {
  color-scheme: dark;

  /* Void */
  --void: #05070e;
  --void-lighter: #0a0f1e;
  --void-card: #0c1125;

  /* Surfaces */
  --surface: rgba(12, 17, 35, 0.65);
  --surface-solid: #0e1329;
  --surface-hover: rgba(18, 25, 50, 0.8);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-border-hover: rgba(255, 255, 255, 0.12);

  /* Neon palette */
  --neon-cyan: #00f0ff;
  --neon-cyan-dim: rgba(0, 240, 255, 0.15);
  --neon-cyan-glow: rgba(0, 240, 255, 0.35);
  --neon-magenta: #ff2daa;
  --neon-magenta-dim: rgba(255, 45, 170, 0.15);
  --neon-magenta-glow: rgba(255, 45, 170, 0.35);
  --neon-violet: #a855f7;
  --neon-violet-dim: rgba(168, 85, 247, 0.12);
  --neon-amber: #ffb020;
  --neon-amber-dim: rgba(255, 176, 32, 0.15);
  --neon-green: #00ff88;
  --neon-green-dim: rgba(0, 255, 136, 0.15);

  /* Text */
  --text: #e0e6f0;
  --text-bright: #ffffff;
  --text-muted: #5a6a8a;
  --text-dim: #3a4a6a;

  /* Layout */
  --radius: 20px;
  --radius-sm: 12px;
  --radius-xs: 8px;

  /* Shadows */
  --shadow-elevated: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 1px rgba(0, 240, 255, 0.1);
  --shadow-neon-cyan: 0 0 20px rgba(0, 240, 255, 0.3), 0 0 60px rgba(0, 240, 255, 0.1);
  --shadow-neon-magenta: 0 0 20px rgba(255, 45, 170, 0.3), 0 0 60px rgba(255, 45, 170, 0.1);

  /* Grid */
  --grid-color: rgba(0, 240, 255, 0.03);
  --grid-size: 60px;

  /* Stat / card fills (used as vars for theme switching) */
  --stat-bg: rgba(255, 255, 255, 0.03);
  --stat-hover-bg: rgba(255, 255, 255, 0.05);
  --email-bg: rgba(255, 255, 255, 0.02);
  --status-bg: rgba(255, 255, 255, 0.03);
  --textarea-bg: rgba(255, 255, 255, 0.02);
  --ghost-border: rgba(255, 255, 255, 0.12);
  --ghost-hover-border: rgba(255, 255, 255, 0.25);
  --ghost-hover-bg: rgba(255, 255, 255, 0.04);
  --ring-bg-stroke: rgba(255, 255, 255, 0.06);
  --particle-color: 0, 240, 255;
  --scan-color: rgba(0, 240, 255, 0.03);
  --stat-line-opacity: 0.4;
}

/* ───────────────────────────────────────────────
   Light Mode Token Overrides
   ─────────────────────────────────────────────── */

[data-theme="light"] {
  color-scheme: light;

  /* Void → luminous white */
  --void: #f0f2f8;
  --void-lighter: #e8ebf2;
  --void-card: #ffffff;

  /* Surfaces — frosted white glass */
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --surface-hover: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-border-hover: rgba(0, 0, 0, 0.14);

  /* Neon — deeper/saturated for contrast on white */
  --neon-cyan: #0099aa;
  --neon-cyan-dim: rgba(0, 153, 170, 0.1);
  --neon-cyan-glow: rgba(0, 153, 170, 0.25);
  --neon-magenta: #d6248f;
  --neon-magenta-dim: rgba(214, 36, 143, 0.1);
  --neon-magenta-glow: rgba(214, 36, 143, 0.25);
  --neon-violet: #7c3aed;
  --neon-violet-dim: rgba(124, 58, 237, 0.08);
  --neon-amber: #d48800;
  --neon-amber-dim: rgba(212, 136, 0, 0.1);
  --neon-green: #059652;
  --neon-green-dim: rgba(5, 150, 82, 0.1);

  /* Text */
  --text: #1a1e2e;
  --text-bright: #0a0e18;
  --text-muted: #5c6578;
  --text-dim: #9ca3b4;

  /* Shadows — softer */
  --shadow-elevated: 0 24px 60px rgba(0, 0, 0, 0.1), 0 0 1px rgba(0, 0, 0, 0.05);
  --shadow-neon-cyan: 0 0 16px rgba(0, 153, 170, 0.2), 0 0 40px rgba(0, 153, 170, 0.06);
  --shadow-neon-magenta: 0 0 16px rgba(214, 36, 143, 0.2), 0 0 40px rgba(214, 36, 143, 0.06);

  /* Grid — subtle warm */
  --grid-color: rgba(0, 0, 0, 0.03);

  /* Component fills */
  --stat-bg: rgba(0, 0, 0, 0.03);
  --stat-hover-bg: rgba(0, 0, 0, 0.05);
  --email-bg: rgba(0, 0, 0, 0.02);
  --status-bg: rgba(0, 0, 0, 0.03);
  --textarea-bg: rgba(0, 0, 0, 0.02);
  --ghost-border: rgba(0, 0, 0, 0.12);
  --ghost-hover-border: rgba(0, 0, 0, 0.22);
  --ghost-hover-bg: rgba(0, 0, 0, 0.04);
  --ring-bg-stroke: rgba(0, 0, 0, 0.08);
  --particle-color: 0, 100, 150; /* Darker cyan for light mode contrast */
  --scan-color: rgba(0, 100, 170, 0.04);
  --stat-line-opacity: 0.3;
}

/* ───────────────────────────────────────────────
   Reset & Base
   ─────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--void);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Animated grid overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(0deg, var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  pointer-events: none;
  z-index: 0;
}

/* Radial ambient light */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(0, 240, 255, 0.06), transparent),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(168, 85, 247, 0.05), transparent),
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(255, 45, 170, 0.03), transparent);
  pointer-events: none;
  z-index: -1;
  transition: background 0.5s ease;
}

[data-theme="light"] body::after {
  background:
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(0, 153, 170, 0.07), transparent),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(124, 58, 237, 0.05), transparent),
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(214, 36, 143, 0.03), transparent);
}

/* ───────────────────────────────────────────────
   Particle Canvas (injected by JS)
   ─────────────────────────────────────────────── */

#particle-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ───────────────────────────────────────────────
   Shell — Main Layout
   ─────────────────────────────────────────────── */

.shell {
  position: relative;
  z-index: 1;
  width: 85%;
  margin: 0 auto;
  padding: 56px 24px 72px;
  display: grid;
  gap: 36px;
}

/* ───────────────────────────────────────────────
   Hero Section
   ─────────────────────────────────────────────── */

.hero {
  display: grid;
  gap: 18px;
  text-align: left;
  animation: fadeInUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero h1 {
  font-family: 'Orbitron', monospace;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--neon-cyan) 0%, var(--neon-violet) 50%, var(--neon-magenta) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 30px rgba(0, 240, 255, 0.3));
  line-height: 1.15;
}

.hero p {
  max-width: 540px;
  color: var(--text-muted);
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.7;
}

/* Badge */
.badge {
  width: fit-content;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--neon-cyan-dim);
  color: var(--neon-cyan);
  font-family: 'Orbitron', monospace;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.65rem;
  border: 1px solid rgba(0, 240, 255, 0.2);
  animation: float 4s ease-in-out infinite, fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
  position: relative;
}

.badge::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 8px var(--neon-cyan);
  animation: pulse 2s ease-in-out infinite;
}

.badge {
  padding-left: 24px;
}

/* ───────────────────────────────────────────────
   Board — Main Card (Holographic Border)
   ─────────────────────────────────────────────── */

.board-wrapper {
  position: relative;
  border-radius: var(--radius);
  padding: 1px;
  background: conic-gradient(from var(--border-angle),
      var(--neon-cyan) 0%,
      var(--neon-violet) 25%,
      var(--neon-magenta) 50%,
      var(--neon-cyan) 75%,
      var(--neon-cyan) 100%);
  animation: borderRotate 6s linear infinite, fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
  box-shadow: var(--shadow-elevated);
}

.board-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: conic-gradient(from var(--border-angle),
      var(--neon-cyan) 0%,
      var(--neon-violet) 25%,
      var(--neon-magenta) 50%,
      var(--neon-cyan) 75%,
      var(--neon-cyan) 100%);
  filter: blur(20px);
  opacity: 0.25;
  z-index: -1;
  animation: borderRotate 6s linear infinite;
}

.board {
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-radius: calc(var(--radius) - 1px);
  padding: 36px;
  display: grid;
  gap: 28px;
}

/* ───────────────────────────────────────────────
   Stats — HUD Readouts
   ─────────────────────────────────────────────── */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stat {
  background: var(--stat-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  transition: border-color 0.3s ease, background 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  opacity: var(--stat-line-opacity);
}

.stat:hover {
  border-color: var(--glass-border-hover);
  background: var(--stat-hover-bg);
}

/* Timer stat special */
.stat--timer {
  position: relative;
}

.timer-ring-container {
  position: relative;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-ring-svg {
  position: absolute;
  inset: 0;
  width: 64px;
  height: 64px;
  transform: rotate(-90deg);
}

.timer-ring-bg {
  fill: none;
  stroke: var(--ring-bg-stroke);
  stroke-width: 3;
}

.timer-ring-progress {
  fill: none;
  stroke: var(--neon-cyan);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 175.93;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.9s linear, stroke 0.5s ease;
  filter: drop-shadow(0 0 6px var(--neon-cyan-glow));
}

.timer-ring-progress.warning {
  stroke: var(--neon-amber);
  filter: drop-shadow(0 0 6px rgba(255, 176, 32, 0.4));
}

.timer-ring-progress.critical {
  stroke: var(--neon-magenta);
  filter: drop-shadow(0 0 6px var(--neon-magenta-glow));
  animation: pulse 0.6s ease-in-out infinite;
}

.stat span {
  font-family: 'Orbitron', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 0.04em;
}

.stat--timer span {
  font-size: 1.1rem;
}

.stat small {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.6rem;
  font-family: 'Orbitron', monospace;
  font-weight: 400;
}

/* ───────────────────────────────────────────────
   Email Card
   ─────────────────────────────────────────────── */

.email-card {
  background: var(--email-bg);
  border-radius: var(--radius-sm);
  padding: 28px;
  border: 1px solid var(--glass-border);
  min-height: 140px;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease, background 0.3s ease;
  white-space: pre-wrap;
}

/* Left holographic accent bar */
.email-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--neon-cyan), var(--neon-violet), var(--neon-magenta));
  border-radius: 3px 0 0 3px;
}

/* Scan-line effect */
.email-card::after {
  content: '';
  position: absolute;
  left: 0;
  top: -100%;
  width: 100%;
  height: 50%;
  background: linear-gradient(180deg,
      transparent,
      var(--scan-color),
      transparent);
  animation: scanLine 4s ease-in-out infinite;
  pointer-events: none;
}

/* ───────────────────────────────────────────────
   Action Buttons
   ─────────────────────────────────────────────── */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.button {
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 28px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
}

.button::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Phishing — Magenta neon */
.button.primary {
  background: linear-gradient(135deg, rgba(255, 45, 170, 0.2), rgba(255, 45, 170, 0.1));
  color: var(--neon-magenta);
  border: 1px solid rgba(255, 45, 170, 0.3);
  box-shadow: 0 0 20px rgba(255, 45, 170, 0.1);
}

.button.primary:hover {
  background: linear-gradient(135deg, rgba(255, 45, 170, 0.35), rgba(255, 45, 170, 0.2));
  border-color: rgba(255, 45, 170, 0.5);
  box-shadow: var(--shadow-neon-magenta);
  transform: translateY(-2px);
}

.button.primary:active {
  transform: translateY(0px);
}

/* Legitimate — Cyan neon */
.button.secondary {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(0, 240, 255, 0.05));
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 240, 255, 0.25);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.08);
}

.button.secondary:hover {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.3), rgba(0, 240, 255, 0.15));
  border-color: rgba(0, 240, 255, 0.5);
  box-shadow: var(--shadow-neon-cyan);
  transform: translateY(-2px);
}

.button.secondary:active {
  transform: translateY(0px);
}

/* Ghost — Pause / Send */
.button.ghost {
  background: transparent;
  border: 1px dashed var(--ghost-border);
  color: var(--text-muted);
}

.button.ghost:hover {
  border-color: var(--ghost-hover-border);
  border-style: solid;
  color: var(--text);
  background: var(--ghost-hover-bg);
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* ───────────────────────────────────────────────
   Status Bar
   ─────────────────────────────────────────────── */

.status {
  padding: 16px 20px;
  border-radius: var(--radius-xs);
  background: var(--status-bg);
  color: var(--text-muted);
  font-weight: 500;
  min-height: 50px;
  display: flex;
  align-items: center;
  border: 1px solid var(--glass-border);
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
  font-size: 0.95rem;
}

/* Left edge light indicator */
.status::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--text-dim);
  border-radius: 3px 0 0 3px;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.status[data-tone='success'] {
  background: var(--neon-green-dim);
  color: var(--neon-green);
  border-color: rgba(0, 255, 136, 0.15);
}

.status[data-tone='success']::before {
  background: var(--neon-green);
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.5);
}

.status[data-tone='warning'] {
  background: var(--neon-amber-dim);
  color: var(--neon-amber);
  border-color: rgba(255, 176, 32, 0.15);
}

.status[data-tone='warning']::before {
  background: var(--neon-amber);
  box-shadow: 0 0 12px rgba(255, 176, 32, 0.5);
}

.status[data-tone='error'] {
  background: var(--neon-magenta-dim);
  color: var(--neon-magenta);
  border-color: rgba(255, 45, 170, 0.15);
}

.status[data-tone='error']::before {
  background: var(--neon-magenta);
  box-shadow: 0 0 12px rgba(255, 45, 170, 0.5);
}

/* ───────────────────────────────────────────────
   Feedback Section
   ─────────────────────────────────────────────── */

.feedback {
  display: grid;
  gap: 12px;
}

.feedback label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.feedback textarea {
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  padding: 16px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 110px;
  background: var(--textarea-bg);
  color: var(--text);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  line-height: 1.6;
}

.feedback textarea::placeholder {
  color: var(--text-dim);
}

.feedback textarea:focus {
  outline: none;
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.08), 0 0 20px rgba(0, 240, 255, 0.06);
}

.feedback .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-dim);
  font-size: 0.82rem;
  font-family: 'Space Grotesk', sans-serif;
}

/* ───────────────────────────────────────────────
   Footer
   ─────────────────────────────────────────────── */

.footer-note {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  padding-top: 8px;
  animation: fadeInUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.footer-note .version-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--neon-violet-dim);
  color: var(--neon-violet);
  font-family: 'Orbitron', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  font-weight: 500;
  vertical-align: middle;
}

/* ───────────────────────────────────────────────
   Keyframe Animations
   ─────────────────────────────────────────────── */

@keyframes borderRotate {
  to {
    --border-angle: 360deg;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

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

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

@keyframes scanLine {
  0% {
    top: -50%;
  }

  100% {
    top: 150%;
  }
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-6px);
  }

  40% {
    transform: translateX(6px);
  }

  60% {
    transform: translateX(-4px);
  }

  80% {
    transform: translateX(4px);
  }
}

@keyframes correctPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.4);
  }

  70% {
    box-shadow: 0 0 0 12px rgba(0, 255, 136, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(0, 255, 136, 0);
  }
}

/* Answer feedback classes (toggled by JS) */
.email-card.shake {
  animation: shake 0.5s ease-in-out;
}

.email-card.correct-pulse {
  animation: correctPulse 0.7s ease-out;
  border-color: rgba(0, 255, 136, 0.3) !important;
}

/* ───────────────────────────────────────────────
   Scrollbar
   ─────────────────────────────────────────────── */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--void);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.22);
}

/* ───────────────────────────────────────────────
   Selection
   ─────────────────────────────────────────────── */

::selection {
  background: rgba(0, 240, 255, 0.25);
  color: var(--text-bright);
}

[data-theme="light"] ::selection {
  background: rgba(0, 153, 170, 0.2);
  color: #0a0e18;
}

/* ───────────────────────────────────────────────
   Theme Toggle Button
   ─────────────────────────────────────────────── */

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  line-height: 1;
}

.theme-toggle:hover {
  transform: scale(1.1) rotate(15deg);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 20px var(--neon-cyan-dim);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  position: absolute;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Dark mode: show sun (to switch to light) */
.theme-toggle .icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.theme-toggle .icon-moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

/* Light mode: show moon (to switch to dark) */
[data-theme="light"] .theme-toggle .icon-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

[data-theme="light"] .theme-toggle .icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

[data-theme="light"] .theme-toggle {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Light mode heading — use deeper gradient for readability */
[data-theme="light"] .hero h1 {
  filter: drop-shadow(0 0 20px rgba(0, 153, 170, 0.2));
}

/* Light mode board wrapper glow — softer */
[data-theme="light"] .board-wrapper::before {
  opacity: 0.12;
}

/* ───────────────────────────────────────────────
   Consensus Badge — Dual-AI Verified Indicator
   ─────────────────────────────────────────────── */

@keyframes badgeSlideIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.92);
  }

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

.consensus-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.18), rgba(0, 255, 136, 0.08));
  border: 1px solid rgba(0, 255, 136, 0.28);
  box-shadow: 0 0 16px rgba(0, 255, 136, 0.15), inset 0 0 8px rgba(0, 255, 136, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: badgeSlideIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
  z-index: 2;
  cursor: default;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.consensus-badge:hover {
  box-shadow: 0 0 24px rgba(0, 255, 136, 0.3), inset 0 0 10px rgba(0, 255, 136, 0.08);
  border-color: rgba(0, 255, 136, 0.45);
}

.consensus-badge__icon {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--neon-green);
  filter: drop-shadow(0 0 4px rgba(0, 255, 136, 0.6));
  line-height: 1;
}

.consensus-badge__text {
  font-family: 'Orbitron', monospace;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--neon-green);
}

.consensus-badge__round {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.62rem;
  font-weight: 500;
  color: rgba(0, 255, 136, 0.6);
  padding-left: 4px;
  border-left: 1px solid rgba(0, 255, 136, 0.2);
}

/* Light-mode badge adjustments */
[data-theme="light"] .consensus-badge {
  background: linear-gradient(135deg, rgba(5, 150, 82, 0.14), rgba(5, 150, 82, 0.06));
  border-color: rgba(5, 150, 82, 0.25);
  box-shadow: 0 0 12px rgba(5, 150, 82, 0.12), inset 0 0 6px rgba(5, 150, 82, 0.04);
}

[data-theme="light"] .consensus-badge__icon,
[data-theme="light"] .consensus-badge__text {
  color: var(--neon-green);
  filter: none;
}

[data-theme="light"] .consensus-badge__round {
  color: rgba(5, 150, 82, 0.65);
  border-left-color: rgba(5, 150, 82, 0.2);
}

/* ── Quality Tier: Elite (Score 5) — Gold ────── */

@keyframes eliteGlow {
  0%, 100% { box-shadow: 0 0 16px rgba(255, 200, 0, 0.25), inset 0 0 8px rgba(255, 200, 0, 0.05); }
  50% { box-shadow: 0 0 28px rgba(255, 200, 0, 0.4), inset 0 0 12px rgba(255, 200, 0, 0.08); }
}

.consensus-badge.quality-elite {
  background: linear-gradient(135deg, rgba(255, 200, 0, 0.22), rgba(255, 160, 0, 0.10));
  border-color: rgba(255, 200, 0, 0.35);
  animation: badgeSlideIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both,
             eliteGlow 2.5s ease-in-out infinite 0.45s;
}

.consensus-badge.quality-elite:hover {
  box-shadow: 0 0 32px rgba(255, 200, 0, 0.45), inset 0 0 14px rgba(255, 200, 0, 0.1);
  border-color: rgba(255, 200, 0, 0.55);
}

.consensus-badge.quality-elite .consensus-badge__icon {
  color: #ffc800;
  filter: drop-shadow(0 0 6px rgba(255, 200, 0, 0.7));
  font-size: 0.9rem;
}

.consensus-badge.quality-elite .consensus-badge__text {
  color: #ffc800;
}

.consensus-badge.quality-elite .consensus-badge__round {
  color: rgba(255, 200, 0, 0.65);
  border-left-color: rgba(255, 200, 0, 0.25);
}

[data-theme="light"] .consensus-badge.quality-elite {
  background: linear-gradient(135deg, rgba(200, 140, 0, 0.16), rgba(200, 140, 0, 0.06));
  border-color: rgba(200, 140, 0, 0.3);
}

[data-theme="light"] .consensus-badge.quality-elite .consensus-badge__icon,
[data-theme="light"] .consensus-badge.quality-elite .consensus-badge__text {
  color: #b88a00;
  filter: none;
}

[data-theme="light"] .consensus-badge.quality-elite .consensus-badge__round {
  color: rgba(160, 120, 0, 0.65);
  border-left-color: rgba(160, 120, 0, 0.2);
}

/* ── Quality Tier: Creative (Score 4) — Cyan ─── */

@keyframes creativeGlow {
  0%, 100% { box-shadow: 0 0 14px rgba(0, 210, 255, 0.2), inset 0 0 6px rgba(0, 210, 255, 0.04); }
  50% { box-shadow: 0 0 22px rgba(0, 210, 255, 0.35), inset 0 0 10px rgba(0, 210, 255, 0.06); }
}

.consensus-badge.quality-creative {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.18), rgba(100, 80, 255, 0.10));
  border-color: rgba(0, 210, 255, 0.30);
  animation: badgeSlideIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both,
             creativeGlow 3s ease-in-out infinite 0.45s;
}

.consensus-badge.quality-creative:hover {
  box-shadow: 0 0 28px rgba(0, 210, 255, 0.4), inset 0 0 12px rgba(0, 210, 255, 0.08);
  border-color: rgba(0, 210, 255, 0.5);
}

.consensus-badge.quality-creative .consensus-badge__icon {
  color: var(--neon-cyan);
  filter: drop-shadow(0 0 5px rgba(0, 210, 255, 0.6));
  font-size: 0.9rem;
}

.consensus-badge.quality-creative .consensus-badge__text {
  color: var(--neon-cyan);
}

.consensus-badge.quality-creative .consensus-badge__round {
  color: rgba(0, 210, 255, 0.6);
  border-left-color: rgba(0, 210, 255, 0.2);
}

[data-theme="light"] .consensus-badge.quality-creative {
  background: linear-gradient(135deg, rgba(0, 140, 180, 0.14), rgba(80, 60, 200, 0.06));
  border-color: rgba(0, 140, 180, 0.25);
}

[data-theme="light"] .consensus-badge.quality-creative .consensus-badge__icon,
[data-theme="light"] .consensus-badge.quality-creative .consensus-badge__text {
  color: #0099aa;
  filter: none;
}

[data-theme="light"] .consensus-badge.quality-creative .consensus-badge__round {
  color: rgba(0, 140, 180, 0.6);
  border-left-color: rgba(0, 140, 180, 0.2);
}

/* ───────────────────────────────────────────────
   Responsive — Mobile
   ─────────────────────────────────────────────── */

@media (max-width: 720px) {
  .shell {
    padding: 32px 16px 48px;
    gap: 24px;
  }

  .board {
    padding: 24px 18px;
  }

  .stats {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
  }

  .stat {
    padding: 14px 10px;
  }

  .stat span {
    font-size: 1.2rem;
  }

  .timer-ring-container {
    width: 52px;
    height: 52px;
  }

  .timer-ring-svg {
    width: 52px;
    height: 52px;
  }

  .stat--timer span {
    font-size: 0.95rem;
  }

  .actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
    padding: 16px 24px;
    font-size: 1rem;
  }

  .hero h1 {
    font-size: clamp(1.6rem, 6vw, 2.2rem);
  }

  .email-card {
    padding: 20px;
    padding-left: 22px;
    font-size: 0.98rem;
  }

  .theme-toggle {
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    font-size: 1.05rem;
  }
}

@media (max-width: 400px) {
  .stats {
    grid-template-columns: 1fr;
  }

  .stat {
    flex-direction: row;
    justify-content: space-between;
  }

  .timer-ring-container {
    width: 44px;
    height: 44px;
  }

  .timer-ring-svg {
    width: 44px;
    height: 44px;
  }
}