/* ════════════════════════════════════════════════════════════════════════════════
   FRAOULA ACADEMY: ENTERPRISE GAMIFIED LMS PLATFORM
   Brand Identity: Fraoula (fraoula.co)
   Palette: Strictly Two-Coloured (#341539 Deep Aubergine and #FFFFC5 Vanilla Cream)
   Zero Emojis. Zero Em Dashes.
   ════════════════════════════════════════════════════════════════════════════════ */

:root {
  --bg-base: #341539;
  --bg-aubergine: #341539;
  --bg-surface: rgba(255, 255, 197, 0.04);
  --bg-elevated: rgba(255, 255, 197, 0.08);
  --fg-cream: #FFFFC5;
  --fg-muted: rgba(255, 255, 197, 0.75);
  --fg-dim: rgba(255, 255, 197, 0.45);
  
  --border-subtle: rgba(255, 255, 197, 0.15);
  --border-default: rgba(255, 255, 197, 0.25);
  --border-bright: rgba(255, 255, 197, 0.6);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 255, 197, 0.04);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 35px rgba(255, 255, 197, 0.08);

  --font-heading: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-code: 'JetBrains Mono', monospace;
  
  --max-width: 1400px;
  --transition-fast: all 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Reset and Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  background-color: var(--bg-aubergine);
  background-image: 
    radial-gradient(ellipse 90% 70% at 50% 0%, rgba(255, 255, 197, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 85% 80%, rgba(255, 255, 197, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse 70% 60% at 15% 90%, rgba(255, 255, 197, 0.03) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--fg-cream);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  letter-spacing: -0.025em;
  color: var(--fg-cream);
  line-height: 1.15;
}

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

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: transparent;
  color: inherit;
}

/* Typography and Headings */
.gradient-heading {
  color: var(--fg-cream);
  display: inline-block;
  text-shadow: 0 0 35px rgba(255, 255, 197, 0.25);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 700;
  transition: var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--fg-cream);
  color: var(--bg-aubergine);
  border: 1.5px solid var(--fg-cream);
  box-shadow: 0 4px 18px rgba(255, 255, 197, 0.2);
}

.btn-primary:hover {
  background: var(--fg-cream);
  color: var(--bg-aubergine);
  opacity: 0.95;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 255, 197, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 197, 0.06);
  color: var(--fg-cream);
  border: 1px solid var(--border-default);
}

.btn-secondary:hover {
  background: rgba(255, 255, 197, 0.14);
  border-color: var(--border-bright);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.78rem;
}

/* Badges and Tags */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--border-default);
  background: rgba(255, 255, 197, 0.08);
  color: var(--fg-cream);
}

/* Master App Layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Navigation Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(52, 21, 57, 0.94);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition-fast);
}

.hdr-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.75rem;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
}

.brand-logo-img {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  display: block;
}

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

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--fg-cream);
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-cream);
  opacity: 0.8;
}

/* Header Navigation Links */
.header-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg-muted);
  transition: var(--transition-fast);
  border: 1px solid transparent;
}

.nav-link:hover, .nav-link.active {
  color: var(--fg-cream);
  background: rgba(255, 255, 197, 0.1);
  border-color: var(--border-subtle);
}

/* Header Stats Bar */
.hdr-gamification-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  background: rgba(255, 255, 197, 0.08);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--fg-cream);
  transition: var(--transition-fast);
}

.stat-pill:hover {
  background: rgba(255, 255, 197, 0.15);
  border-color: var(--border-bright);
}

.hdr-user-stats {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
}

.user-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.85rem 0.35rem 0.4rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 197, 0.08);
  border: 1px solid var(--border-default);
  color: var(--fg-cream);
  font-weight: 600;
  font-size: 0.82rem;
}

.avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--fg-cream);
  color: var(--bg-aubergine);
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Main View Container */
.main-view-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.75rem 5rem;
  width: 100%;
  flex: 1;
}

.app-view {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.app-view.active-view {
  display: block;
}

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

/* Dashboard View */
.dashboard-hero {
  position: relative;
  background: rgba(255, 255, 197, 0.04);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-md);
}

.hero-content-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

.hero-title {
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 800;
  margin-bottom: 1rem;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--fg-muted);
  max-width: 540px;
  line-height: 1.7;
  margin-bottom: 1.75rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* User Progress Card in Hero */
.hero-level-card {
  background: rgba(52, 21, 57, 0.7);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 1.75rem;
}

.level-badge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.level-title-large {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--fg-cream);
}

.xp-progress-bar-wrap {
  margin-bottom: 1rem;
}

.xp-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--fg-dim);
  margin-bottom: 0.4rem;
}

.xp-bar-track {
  height: 8px;
  background: rgba(255, 255, 197, 0.1);
  border-radius: var(--radius-pill);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 197, 0.2);
}

.xp-bar-fill {
  height: 100%;
  background: var(--fg-cream);
  border-radius: var(--radius-pill);
  transition: width 0.5s ease;
}

.stats-micro-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
}

.micro-stat-item {
  text-align: center;
}

.micro-stat-value {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--fg-cream);
}

.micro-stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  margin-top: 0.2rem;
}

/* Section Headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--fg-muted);
  margin-top: 0.25rem;
}

/* Course Grid and Cards */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.75rem;
  margin-bottom: 3.5rem;
}

.course-card {
  background: rgba(255, 255, 197, 0.04);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition-smooth);
  cursor: pointer;
}

.course-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-bright);
  background: rgba(255, 255, 197, 0.08);
  box-shadow: var(--shadow-md);
}

.course-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.1rem;
}

.course-category-tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-cream);
  opacity: 0.85;
}

.course-duration {
  font-size: 0.75rem;
  color: var(--fg-dim);
}

.course-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.course-summary {
  font-size: 0.88rem;
  color: var(--fg-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex: 1;
}

.course-meta-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.course-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border-subtle);
}

.course-xp-reward {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--fg-cream);
}

.course-progress-mini {
  width: 80px;
  height: 6px;
  background: rgba(255, 255, 197, 0.12);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.course-progress-mini-fill {
  height: 100%;
  background: var(--fg-cream);
}

/* Slide Player Layout */
.player-wrapper {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 1.75rem;
  min-height: 80vh;
}

.player-sidebar {
  background: rgba(255, 255, 197, 0.04);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 120px);
  position: sticky;
  top: 90px;
  overflow-y: auto;
}

.sidebar-course-info {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-back-btn {
  font-size: 0.78rem;
  color: var(--fg-dim);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.sidebar-back-btn:hover {
  color: var(--fg-cream);
}

.sidebar-course-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}

.slide-stepper-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
}

.slide-step-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--fg-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid transparent;
}

.slide-step-item:hover {
  background: rgba(255, 255, 197, 0.08);
  color: var(--fg-cream);
}

.slide-step-item.active-step {
  background: rgba(255, 255, 197, 0.14);
  border-color: var(--border-default);
  color: var(--fg-cream);
  font-weight: 700;
}

.slide-step-item.completed-step {
  border-color: rgba(255, 255, 197, 0.3);
}

.step-num-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 197, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.slide-step-item.active-step .step-num-icon {
  background: var(--fg-cream);
  color: var(--bg-aubergine);
}

.slide-step-item.completed-step .step-num-icon {
  background: rgba(255, 255, 197, 0.3);
  color: var(--fg-cream);
}

/* Center Slide Canvas */
.player-main-stage {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 197, 0.04);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: relative;
}

.slide-top-header {
  padding: 1.25rem 2rem;
  background: rgba(52, 21, 57, 0.6);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.slide-breadcrumbs {
  font-size: 0.8rem;
  color: var(--fg-dim);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.slide-counter-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 197, 0.1);
  color: var(--fg-cream);
}

.slide-canvas {
  padding: 2.5rem;
  flex: 1;
  overflow-y: auto;
}

.slide-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-cream);
  opacity: 0.8;
  margin-bottom: 0.6rem;
}

.slide-main-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.slide-body-prose {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--fg-muted);
  margin-bottom: 2rem;
}

.slide-body-prose p {
  margin-bottom: 1.2rem;
}

.slide-body-prose ul {
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.slide-body-prose li {
  margin-bottom: 0.5rem;
}

/* Architecture Diagram Cards */
.arch-diagram-card {
  background: rgba(52, 21, 57, 0.8);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 2rem;
  margin: 2rem 0;
}

.diagram-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--fg-cream);
  text-transform: uppercase;
}

.diagram-interactive-flow {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 0;
}

.flow-node {
  background: rgba(255, 255, 197, 0.06);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  text-align: center;
  min-width: 140px;
  transition: var(--transition-fast);
}

.flow-node:hover, .flow-node.highlighted {
  border-color: var(--fg-cream);
  background: rgba(255, 255, 197, 0.12);
}

.flow-node-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--fg-cream);
}

.flow-node-sub {
  font-size: 0.68rem;
  color: var(--fg-dim);
  margin-top: 0.2rem;
}

.flow-arrow {
  color: var(--fg-cream);
  font-size: 1.2rem;
  opacity: 0.6;
}

/* Code Snippet Box */
.slide-code-box {
  background: rgba(255, 255, 197, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin: 1.5rem 0;
  overflow: hidden;
  font-family: var(--font-code);
}

.code-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 197, 0.05);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--fg-dim);
}

.code-copy-btn {
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 197, 0.08);
  color: var(--fg-cream);
  border: 1px solid var(--border-subtle);
}

.code-copy-btn:hover {
  background: rgba(255, 255, 197, 0.2);
}

.code-content {
  padding: 1.25rem;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--fg-cream);
  overflow-x: auto;
}

/* Checkpoint Question Cards */
.slide-checkpoint-card {
  background: rgba(255, 255, 197, 0.04);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-md);
  padding: 2rem;
  margin-top: 2.5rem;
}

.checkpoint-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.checkpoint-badge {
  background: rgba(255, 255, 197, 0.1);
  color: var(--fg-cream);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-default);
}

.checkpoint-xp-val {
  color: var(--fg-cream);
  font-size: 0.85rem;
  font-weight: 700;
}

.checkpoint-question-text {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.4;
  color: var(--fg-cream);
}

.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.quiz-opt-btn {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 197, 0.05);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--fg-cream);
  text-align: left;
  font-size: 0.92rem;
  line-height: 1.5;
  transition: var(--transition-fast);
}

.quiz-opt-btn:hover:not(:disabled) {
  background: rgba(255, 255, 197, 0.12);
  border-color: var(--border-bright);
}

.opt-letter {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 197, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}

.quiz-opt-btn.correct-choice {
  background: var(--fg-cream) !important;
  border-color: var(--fg-cream) !important;
  color: var(--bg-aubergine) !important;
  font-weight: 700;
}

.quiz-opt-btn.correct-choice .opt-letter {
  background: var(--bg-aubergine) !important;
  color: var(--fg-cream) !important;
}

.quiz-opt-btn.wrong-choice {
  background: transparent !important;
  border: 1px dashed var(--border-bright) !important;
  opacity: 0.6;
}

.quiz-feedback-box {
  display: none;
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  margin-top: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.6;
  background: rgba(255, 255, 197, 0.06);
  border: 1px solid var(--border-default);
  color: var(--fg-cream);
}

.quiz-feedback-box.show-correct, .quiz-feedback-box.show-wrong {
  display: block;
}

/* Bottom Slide Controls */
.slide-bottom-bar {
  padding: 1.2rem 2rem;
  background: rgba(52, 21, 57, 0.8);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Inbuilt AI Copilot Drawer */
.ai-copilot-drawer {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 440px;
  max-width: calc(100vw - 2rem);
  height: 600px;
  max-height: calc(100vh - 100px);
  background: var(--bg-aubergine);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  z-index: 1200;
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.ai-copilot-drawer.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.ai-drawer-header {
  padding: 1.1rem 1.4rem;
  background: rgba(255, 255, 197, 0.05);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-header-name {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--fg-cream);
}

.ai-status-pill {
  font-size: 0.65rem;
  color: var(--fg-cream);
  opacity: 0.8;
}

.ai-persona-bar {
  display: flex;
  gap: 0.4rem;
  padding: 0.5rem 1.4rem;
  background: rgba(255, 255, 197, 0.02);
  border-bottom: 1px solid var(--border-subtle);
}

.persona-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 197, 0.06);
  border: 1px solid transparent;
  color: var(--fg-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.persona-chip.active {
  background: var(--fg-cream);
  color: var(--bg-aubergine);
  font-weight: 700;
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-bubble {
  max-width: 85%;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  line-height: 1.55;
}

.bubble-assistant {
  background: rgba(255, 255, 197, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--fg-cream);
  align-self: flex-start;
  border-top-left-radius: 4px;
}

.bubble-user {
  background: var(--fg-cream);
  color: var(--bg-aubergine);
  font-weight: 600;
  align-self: flex-end;
  border-top-right-radius: 4px;
}

.ai-quick-prompts {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.6rem 1.25rem;
  background: rgba(255, 255, 197, 0.03);
  border-top: 1px solid var(--border-subtle);
  scrollbar-width: none;
}

.quick-prompt-btn {
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 197, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--fg-cream);
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.quick-prompt-btn:hover {
  background: rgba(255, 255, 197, 0.18);
  border-color: var(--border-bright);
}

.ai-input-wrapper {
  padding: 0.85rem 1.25rem 1.1rem;
  background: var(--bg-aubergine);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 0.6rem;
}

.ai-text-input {
  flex: 1;
  background: rgba(255, 255, 197, 0.06);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  padding: 0.65rem 1.1rem;
  color: var(--fg-cream);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
}

.ai-text-input:focus {
  border-color: var(--fg-cream);
  background: rgba(255, 255, 197, 0.1);
}

.ai-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--fg-cream);
  color: var(--bg-aubergine);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.floating-ai-trigger {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-pill);
  background: var(--bg-aubergine);
  border: 1.5px solid var(--fg-cream);
  color: var(--fg-cream);
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 255, 197, 0.2);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  z-index: 1100;
}

.floating-ai-trigger:hover {
  background: rgba(255, 255, 197, 0.12);
}

/* Architecture Lab Styles */
.lab-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}

.lab-panel {
  background: rgba(255, 255, 197, 0.04);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
}

.lab-panel-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.lab-panel-sub {
  font-size: 0.82rem;
  color: var(--fg-dim);
  margin-bottom: 1.25rem;
}

.lab-editor-box {
  width: 100%;
  height: 280px;
  background: rgba(255, 255, 197, 0.02);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 1rem;
  color: var(--fg-cream);
  font-family: var(--font-code);
  font-size: 0.85rem;
  resize: vertical;
  outline: none;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.lab-editor-box:focus {
  border-color: var(--fg-cream);
}

.lab-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  gap: 1rem;
}

.simulation-output-console {
  background: rgba(255, 255, 197, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  height: 280px;
  overflow-y: auto;
  font-family: var(--font-code);
  font-size: 0.82rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.log-entry {
  margin-bottom: 0.35rem;
  display: flex;
  gap: 0.6rem;
}

.log-time { color: var(--fg-dim); }
.log-pass { color: var(--fg-cream); font-weight: 700; }
.log-warn { color: var(--fg-cream); opacity: 0.85; }
.log-fail { color: var(--fg-cream); font-weight: 700; text-decoration: underline; }
.log-latency { color: var(--fg-cream); font-weight: 600; }

/* Leaderboard Podium */
.leaderboard-podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1.5rem;
  margin: 3rem 0 3.5rem;
}

.podium-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.podium-slot-1 { order: 2; transform: translateY(-15px); }
.podium-slot-2 { order: 1; }
.podium-slot-3 { order: 3; }

.podium-avatar-wrap {
  position: relative;
  margin-bottom: 0.85rem;
}

.podium-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--bg-aubergine);
  border: 1.5px solid var(--fg-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--fg-cream);
}

.podium-slot-1 .podium-avatar {
  width: 84px;
  height: 84px;
  box-shadow: 0 0 25px rgba(255, 255, 197, 0.3);
}

.podium-rank-tag {
  position: absolute;
  bottom: -6px;
  right: -4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--fg-cream);
  color: var(--bg-aubergine);
  font-weight: 800;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.podium-block {
  background: rgba(255, 255, 197, 0.04);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  width: 140px;
  padding: 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.podium-slot-1 .podium-block { height: 160px; }
.podium-slot-2 .podium-block { height: 120px; }
.podium-slot-3 .podium-block { height: 95px; }

.podium-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.2rem; }
.podium-xp { font-size: 0.8rem; font-weight: 700; color: var(--fg-cream); }

/* Leaderboard Table */
.leaderboard-table-card {
  background: rgba(255, 255, 197, 0.04);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.rank-row {
  display: grid;
  grid-template-columns: 60px 1.5fr 1fr 1fr 100px;
  padding: 1rem 1.5rem;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.9rem;
}

.rank-row.current-user-row {
  background: rgba(255, 255, 197, 0.1);
  border-left: 3px solid var(--fg-cream);
  font-weight: 700;
}

.rank-idx { font-weight: 800; font-size: 1rem; color: var(--fg-dim); }

/* Badges Grid */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.badge-card {
  background: rgba(255, 255, 197, 0.04);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.badge-card.unlocked {
  border-color: var(--border-bright);
}

.badge-card.locked {
  opacity: 0.55;
}

.badge-icon-box {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 197, 0.08);
  border: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
}

.badge-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.badge-desc {
  font-size: 0.8rem;
  color: var(--fg-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

/* Certificate Modal */
.cert-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(52, 21, 57, 0.95);
  backdrop-filter: blur(20px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.cert-modal-backdrop.is-open {
  display: flex;
}

.cert-modal-card {
  background: var(--bg-aubergine);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  max-width: 860px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 2rem;
}

.cert-canvas-container {
  background: var(--bg-aubergine);
  border: 2px solid var(--fg-cream);
  padding: 3rem;
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--fg-cream);
}

.cert-watermark {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fg-cream);
  opacity: 0.8;
  margin-bottom: 1rem;
  font-weight: 700;
}

.cert-main-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
}

.cert-recipient-name {
  font-size: 2rem;
  font-family: var(--font-heading);
  color: var(--fg-cream);
  font-weight: 700;
  border-bottom: 1.5px solid var(--fg-cream);
  display: inline-block;
  padding-bottom: 0.2rem;
  margin: 1.5rem 0 1rem;
}

.cert-hash-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 197, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--fg-dim);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast-message {
  pointer-events: auto;
  background: var(--bg-aubergine);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-pill);
  padding: 0.75rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg-cream);
}

/* Confetti Canvas */
#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* Responsive */
@media (max-width: 960px) {
  .hero-content-grid { grid-template-columns: 1fr; }
  .player-wrapper { grid-template-columns: 1fr; }
  .player-sidebar { display: none; }
  .lab-container { grid-template-columns: 1fr; }
  .ai-copilot-drawer { width: 100%; right: 0; bottom: 0; }
  .header-nav { display: none; }
}
