/* ==========================================================================
   ROMANIZED NEPALI UNICODE TYPING TUTOR — PRODUCTION STYLESHEET
   Ultra-Compact Header (50px Height), Auto Line-by-Line Target Box (No Scrollbars)
   Reference Standard: Romanize Keyboard copy.jpg
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Noto+Sans+Devanagari:wght@400;500;600;700;800&family=Alex+Brush&family=Cinzel:wght@600;700;800;900&family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --bg-color: #0f172a;
  --surface-color: #1e293b;
  --card-bg: #1e293b;
  --card-border: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;

  --key-bg: #334155;
  --key-border: #475569;
  --key-text: #f8fafc;
  --key-highlight: #2563eb;
  --key-highlight-glow: rgba(37, 99, 235, 0.4);

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-devnagari: 'Noto Sans Devanagari', 'Inter', sans-serif;
}

/* Light Theme overrides when needed */
body.light-theme {
  --bg-color: #f8fafc;
  --surface-color: #ffffff;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --key-bg: #e2e8f0;
  --key-border: #cbd5e1;
  --key-text: #0f172a;
}

/* High Contrast Mode */
body.high-contrast-mode {
  --bg-color: #000000;
  --surface-color: #111111;
  --card-bg: #181818;
  --card-border: #ffffff;
  --text-main: #ffffff;
  --text-muted: #dddddd;
  --key-bg: #222222;
  --key-border: #ffffff;
  --key-text: #ffffff;
  --key-highlight: #ffcc00;
  --key-highlight-glow: rgba(255, 204, 0, 0.6);
}

/* Large Font Mode */
body.large-font-mode {
  font-size: 105%;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.4;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Devnagari Font Utility */
.devnagari-text, .target-symbol-display, .char-span, .key-top-shift, .key-bottom-normal, .devnagari-symbol {
  font-family: var(--font-devnagari);
}

.text-muted {
  color: var(--text-muted, #94a3b8) !important;
}

/* ==========================================================================
   APP HEADER & NAVIGATION BAR (RESPONSIVE SINGLE LINE & MOBILE DRAWER)
   ========================================================================== */
.app-header {
  background-color: var(--surface-color);
  border-bottom: 1px solid var(--card-border);
  padding: 0.32rem 0.75rem;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  gap: 0.35rem;
  max-width: 100vw;
  box-sizing: border-box;
  overflow: hidden;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  user-select: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
  position: relative;
  z-index: 10;
  margin-right: 0.35rem;
}

.brand-container:hover {
  opacity: 0.9;
}

.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  background: transparent !important;
  padding: 0 !important;
  border: none !important;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.45));
  transition: transform 0.2s ease, filter 0.2s ease;
  display: inline-block;
  vertical-align: middle;
}

.brand-container:hover .brand-logo {
  transform: scale(1.08) rotate(3deg);
  filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.7));
}

.brand-title-text {
  font-size: 1.02rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: 0.02em;
}

/* Mobile hamburger button - hidden on desktop */
.mobile-menu-toggle {
  display: none;
  align-items: center;
  gap: 0.35rem;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--card-border);
  color: #f1f5f9;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 0.4rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  height: 34px;
}

.mobile-menu-toggle:hover {
  background: rgba(37, 99, 235, 0.2);
  border-color: #60a5fa;
  color: #ffffff;
}

.mobile-menu-toggle.active {
  background: #2563eb;
  border-color: #60a5fa;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.45);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.14rem;
  flex: 1 1 auto;
  justify-content: safe center;
  margin: 0 0.2rem;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.main-nav::-webkit-scrollbar {
  display: none;
}

.nav-link {
  color: #94a3b8;
  text-decoration: none;
  padding: 0.24rem 0.36rem;
  border-radius: 0.4rem;
  font-weight: 600;
  font-size: 0.79rem;
  transition: all 0.15s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  flex-shrink: 0;
  border: 1px solid transparent;
}

.nav-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.35), rgba(30, 64, 175, 0.45));
  border-color: rgba(96, 165, 250, 0.4);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  margin-left: 0.35rem;
}

.btn-compact {
  padding: 0.18rem 0.38rem;
  height: 28px;
  font-size: 0.75rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

#nav-active-student-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}

/* Layout Switcher Pill (Romanized / Preeti) */
.layout-toggle-group {
  display: inline-flex;
  align-items: center;
  background: #0b1120;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 9999px;
  padding: 2px;
  gap: 2px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.btn-layout-switch {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.2rem 0.42rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-layout-switch:hover {
  color: #ffffff;
}

.btn-layout-switch.active {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.6);
}

.btn-layout-switch[data-layout="english"].active {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

.btn-layout-switch[data-layout="romanized"].active {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.6);
}

.btn-layout-switch[data-layout="preeti"].active {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS FOR HEADER
   ========================================================================== */

/* 1. Laptops / Mid-Size Desktops (1181px to 1480px) */
@media (max-width: 1480px) {
  .app-header {
    padding: 0.28rem 0.45rem;
    gap: 0.25rem;
    min-height: 50px;
  }

  .brand-container {
    gap: 0.3rem;
    margin-right: 0.2rem;
  }

  .brand-logo {
    width: 28px;
    height: 28px;
  }

  .brand-title-text {
    font-size: 0.90rem;
  }

  .main-nav {
    margin: 0;
    gap: 0.04rem;
    justify-content: safe center;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .nav-link {
    padding: 0.14rem 0.18rem;
    font-size: 0.705rem;
    gap: 0.08rem;
  }

  .header-actions {
    gap: 0.14rem;
    margin-left: 0.14rem;
  }

  .btn-layout-switch {
    font-size: 0.675rem;
    padding: 0.12rem 0.22rem;
  }

  .btn-compact {
    padding: 0.12rem 0.25rem;
    height: 25px;
    font-size: 0.70rem;
    gap: 0.12rem;
  }

  #btn-header-logout {
    padding: 0.12rem 0.25rem;
    font-size: 0.70rem;
  }

  #nav-active-student-name {
    max-width: 120px;
  }
}

/* 2. Tablets, Compact Laptops & Small Screens (<= 1180px) */
@media (max-width: 1180px) {
  .app-header {
    padding: 0.35rem 0.75rem;
    position: sticky;
    top: 0;
    z-index: 250;
    overflow: visible; /* allow nav dropdown to extend below header */
  }

  /* Show Hamburger Menu Toggle button */
  .mobile-menu-toggle {
    display: inline-flex;
    order: 2;
  }

  .brand-container {
    order: 1;
  }

  .header-actions {
    order: 3;
  }

  #nav-active-student-name {
    max-width: 120px;
  }

  /* Main Navigation transforms into a sleek slide-down drawer */
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    margin: 0;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 2px solid #334155;
    padding: 0.75rem 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.75);
    z-index: 240;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
  }

  .main-nav.mobile-open {
    display: flex;
    animation: slideDownMenu 0.2s ease-out;
  }

  .nav-link {
    width: 100%;
    box-sizing: border-box;
    padding: 0.65rem 0.95rem;
    font-size: 0.92rem;
    border-radius: 0.5rem;
    justify-content: flex-start;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
  }

  .nav-link:hover, .nav-link.active {
    background: rgba(37, 99, 235, 0.3);
    border-color: #3b82f6;
    color: #ffffff;
    font-weight: 700;
  }
}

/* 4. Small Mobile Phones (<= 480px) */
@media (max-width: 480px) {
  .app-header {
    padding: 0.3rem 0.5rem;
  }

  .brand-logo {
    width: 30px;
    height: 30px;
  }

  .brand-title-text {
    display: none; /* Keep just the logo on smallest screens */
  }

  .mobile-menu-label {
    display: none; /* Just show ☰ icon */
  }

  .mobile-menu-toggle {
    padding: 0.25rem 0.5rem;
  }

  #nav-active-student-name {
    max-width: 95px;
  }

  .btn-layout-switch {
    font-size: 0.68rem;
    padding: 0.18rem 0.4rem;
  }
}

@keyframes slideDownMenu {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auto-next-label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: #60a5fa;
  cursor: pointer;
  background: rgba(37, 99, 235, 0.15);
  padding: 0.2rem 0.5rem;
  border-radius: 0.35rem;
  border: 1px solid rgba(96, 165, 250, 0.3);
  height: 32px;
  white-space: nowrap;
}

/* Main Container & Views */
.main-container {
  flex: 1;
  padding: 0.85rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

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

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

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

/* Row-by-Row Quick Practice Toolbar */
.row-practice-toolbar {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--card-border);
  padding: 0.4rem 0.65rem;
  border-radius: 0.6rem;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  width: 100%;
  box-sizing: border-box;
}

/* Hide Row Practice Toolbar on Dashboard, Paragraph Typing, Typing Test, Game, Badges, Certificate, Admin, and Weakness Tabs */
body[data-active-view="dashboard-view"] .row-practice-toolbar,
body[data-active-view="paragraph-view"] .row-practice-toolbar,
body[data-active-view="typing-test-view"] .row-practice-toolbar,
body[data-active-view="game-view"] .row-practice-toolbar,
body[data-active-view="achievements-view"] .row-practice-toolbar,
body[data-active-view="certificate-view"] .row-practice-toolbar,
body[data-active-view="admin-view"] .row-practice-toolbar,
body[data-active-view="weakness-view"] .row-practice-toolbar,
body.view-dashboard-active .row-practice-toolbar,
body.view-paragraph-active .row-practice-toolbar,
body.view-typing-test-active .row-practice-toolbar,
body.view-game-active .row-practice-toolbar,
body.view-achievements-active .row-practice-toolbar,
body.view-certificate-active .row-practice-toolbar,
body.view-admin-active .row-practice-toolbar,
body.view-weakness-active .row-practice-toolbar,
body:has(#dashboard-view.active) .row-practice-toolbar,
body:has(#paragraph-view.active) .row-practice-toolbar,
body:has(#typing-test-view.active) .row-practice-toolbar,
body:has(#game-view.active) .row-practice-toolbar,
body:has(#achievements-view.active) .row-practice-toolbar,
body:has(#certificate-view.active) .row-practice-toolbar,
body:has(#admin-view.active) .row-practice-toolbar,
body:has(#weakness-view.active) .row-practice-toolbar,
#dashboard-view.active ~ .row-practice-toolbar,
#paragraph-view.active ~ .row-practice-toolbar,
#typing-test-view.active ~ .row-practice-toolbar,
#game-view.active ~ .row-practice-toolbar,
#achievements-view.active ~ .row-practice-toolbar,
#certificate-view.active ~ .row-practice-toolbar,
#admin-view.active ~ .row-practice-toolbar {
  display: none !important;
}

.row-practice-toolbar::-webkit-scrollbar,
.row-buttons-group::-webkit-scrollbar {
  display: none;
}

.row-toolbar-title {
  font-size: clamp(0.7rem, 0.85vw, 0.78rem);
  font-weight: 700;
  color: #60a5fa;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: center;
  padding: 0.2rem 0;
}

.row-buttons-group {
  display: flex;
  align-items: center;
  gap: clamp(0.25rem, 0.4vw, 0.35rem);
  flex-wrap: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}

.btn-row-select {
  padding: 0.24rem clamp(0.32rem, 0.55vw, 0.55rem);
  border-radius: 0.35rem;
  font-size: clamp(0.65rem, 0.78vw, 0.73rem);
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--card-border);
  background: #1e293b;
  color: var(--text-main);
  transition: all 0.15s ease;
  white-space: nowrap;
  flex: 1 1 auto;
  text-align: center;
}

.btn-row-select:hover, .btn-row-select.active {
  background: var(--primary-color);
  color: #ffffff;
  border-color: #60a5fa;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.4);
}

/* Finger Check Component */
.finger-check-box {
  background: #0f172a;
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  text-align: center;
}

.step-indicator-pill {
  display: inline-block;
  background: #1e3a8a;
  color: #60a5fa;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
}

.finger-key-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin: 1rem 0;
}

.key-cap-symbol {
  font-size: 2.5rem;
  font-weight: 800;
  background: #2563eb;
  color: #ffffff;
  width: 70px;
  height: 70px;
  border-radius: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(37, 99, 235, 0.5);
}

.devnagari-symbol {
  font-size: 2.8rem;
  font-weight: 800;
  color: #4ade80;
}

.finger-name-tag {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  display: inline-block;
}

/* ============================================================
   MODERN ANIMATED DASHBOARD PORTAL
   ============================================================ */

.dash-portal-container {
  position: relative;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 0.25rem 0.1rem;
  animation: dashFadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes dashFadeInUp {
  0% {
    opacity: 0;
    transform: translateY(18px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Ambient Background Lights */
.dash-ambient-glow {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
}

.dash-ambient-glow.glow-1 {
  top: -40px;
  right: 5%;
  width: 320px;
  height: 280px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(147, 51, 234, 0.08) 70%, transparent 100%);
  animation: ambientFloat 8s ease-in-out infinite alternate;
}

.dash-ambient-glow.glow-2 {
  bottom: 10%;
  left: 5%;
  width: 340px;
  height: 260px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.12) 0%, rgba(16, 185, 129, 0.06) 70%, transparent 100%);
  animation: ambientFloat 10s ease-in-out infinite alternate-reverse;
}

@keyframes ambientFloat {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-20px, 15px) scale(1.08); }
  100% { transform: translate(20px, -15px) scale(0.95); }
}

/* 1. Hero Card */
/* 1. Hero Card (Balanced & Modern Glassmorphic Training Portal) */
.dash-hero-card {
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.88) 0%, rgba(15, 23, 42, 0.96) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 1.25rem;
  padding: 1.75rem 2rem;
  display: grid;
  grid-template-columns: 1fr 315px;
  gap: 1.75rem;
  align-items: stretch;
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.dash-hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
  opacity: 0.95;
}

.dash-hero-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
}

/* Top Ribbon */
.dash-hero-top-ribbon {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.dash-badge-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(30, 58, 138, 0.45);
  border: 1px solid rgba(59, 130, 246, 0.35);
  padding: 0.22rem 0.7rem;
  border-radius: 2rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: #93c5fd;
  letter-spacing: 0.2px;
}

.dash-pill-badge {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.25) 0%, rgba(202, 138, 4, 0.15) 100%);
  border: 1px solid rgba(234, 179, 8, 0.45);
  color: #fef08a;
  padding: 0.22rem 0.7rem;
  border-radius: 2rem;
  font-size: 0.78rem;
  font-weight: 800;
  font-family: var(--font-mono, monospace);
}

.dash-learner-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.22rem 0.65rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6ee7b7;
}

.dash-center-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(129, 140, 248, 0.32);
  padding: 0.22rem 0.7rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #c7d2fe;
  letter-spacing: 0.2px;
}

.status-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Dashboard Greeting Profile Row with Student Photo */
.dash-greeting-profile-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 0.25rem 0 0.15rem 0;
}

.dash-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.dash-avatar-box {
  width: 78px;
  height: 78px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: #0f172a;
  border: 2px solid #38bdf8;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), 0 0 14px rgba(56, 189, 248, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.dash-avatar-box:hover {
  transform: scale(1.05);
  border-color: #60a5fa;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), 0 0 24px rgba(56, 189, 248, 0.55);
}

.dash-avatar-box.no-photo {
  border-style: dashed;
  border-color: rgba(56, 189, 248, 0.65);
  background: rgba(56, 189, 248, 0.08);
}

.dash-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dash-avatar-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}

.dash-avatar-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.dash-avatar-hover-tag {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.dash-avatar-box:hover .dash-avatar-hover-tag {
  opacity: 1;
}

.dash-greeting-text-col {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.dash-student-meta-strip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.dash-cert-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #7dd3fc;
  font-family: var(--font-mono, monospace);
}

.btn-dash-quick-photo {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-dash-quick-photo:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #38bdf8;
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .dash-greeting-profile-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }
}

/* Greeting */
.dash-hero-greeting {
  font-size: clamp(1.5rem, 2.3vw, 2.1rem);
  font-weight: 800;
  color: #f8fafc;
  margin: 0;
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dash-student-name {
  background: linear-gradient(135deg, #60a5fa 0%, #38bdf8 50%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
  letter-spacing: -0.3px;
}

.btn-dash-edit-profile {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 2rem;
  padding: 0.22rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  vertical-align: middle;
}

.btn-dash-edit-profile:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.5);
  color: #38bdf8;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.25);
}

.dash-namaste-icon {
  display: inline-block;
  animation: waveHand 2.2s infinite ease-in-out;
  transform-origin: 70% 70%;
}

@keyframes waveHand {
  0%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(14deg); }
  30% { transform: rotate(-10deg); }
  45% { transform: rotate(14deg); }
  60% { transform: rotate(-4deg); }
  75% { transform: rotate(10deg); }
}

.dash-hero-description {
  font-size: 0.94rem;
  color: #94a3b8;
  line-height: 1.6;
  margin: 0;
  max-width: 680px;
}

.dash-hero-description strong {
  color: #e2e8f0;
  font-weight: 600;
}

/* Quick Action Launchpad: 2-Tier Balanced Deck */
.dash-action-launchpad {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
  margin-top: 0.25rem;
}

.dash-primary-action-wrap {
  width: 100%;
}

.dash-btn-primary-glow {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.85rem 1.4rem;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 45%, #4f46e5 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 0.85rem;
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px -3px rgba(37, 99, 235, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.dash-btn-primary-glow .btn-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  animation: shineSweep 3.5s infinite;
}

@keyframes shineSweep {
  0%, 65% { left: -100%; }
  100% { left: 200%; }
}

.dash-btn-primary-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px -4px rgba(59, 130, 246, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 45%, #6366f1 100%);
}

.dash-btn-primary-glow .btn-icon {
  font-size: 1.3rem;
  margin-right: 0.4rem;
}

.dash-btn-primary-glow .btn-text {
  flex: 1;
  text-align: left;
  letter-spacing: 0.2px;
}

.dash-btn-primary-glow .btn-arrow-pulse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  font-size: 0.88rem;
  font-weight: 900;
  animation: arrowBounce 1.8s infinite ease-in-out;
}

@keyframes arrowBounce {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

/* 3-Card Deck Grid */
.dash-row-deck-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  width: 100%;
}

.dash-btn-deck {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.8rem;
  padding: 0.75rem 0.95rem;
  cursor: pointer;
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dash-btn-deck.pill-home:hover {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px -4px rgba(34, 197, 94, 0.25);
}

.dash-btn-deck.pill-bottom:hover {
  border-color: rgba(168, 85, 247, 0.5);
  background: rgba(168, 85, 247, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px -4px rgba(168, 85, 247, 0.25);
}

.dash-btn-deck.pill-top:hover {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px -4px rgba(56, 189, 248, 0.25);
}

.deck-icon-bubble {
  width: 38px;
  height: 38px;
  border-radius: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.deck-icon-bubble.dot-home {
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86efac;
}

.deck-icon-bubble.dot-bottom {
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #d8b4fe;
}

.deck-icon-bubble.dot-top {
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
}

.deck-text-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1;
}

.deck-sublabel {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #94a3b8;
}

.pill-home .deck-sublabel { color: #86efac; }
.pill-bottom .deck-sublabel { color: #d8b4fe; }
.pill-top .deck-sublabel { color: #7dd3fc; }

.deck-mainlabel {
  font-size: 0.78rem;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* Fallback legacy pills */
.dash-btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.65rem;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dash-btn-pill:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(56, 189, 248, 0.4);
  color: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.row-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.row-indicator-dot.dot-home {
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}

.row-indicator-dot.dot-bottom {
  background: #a855f7;
  box-shadow: 0 0 6px #a855f7;
}

.row-indicator-dot.dot-top {
  background: #3b82f6;
  box-shadow: 0 0 6px #3b82f6;
}

/* Hero Side Motivational Widget (Balanced Height & High Visual Interest) */
.dash-hero-side-widget {
  background: linear-gradient(145deg, rgba(30, 58, 138, 0.28) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 1.1rem;
  padding: 1.35rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  gap: 0.85rem;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

.widget-trophy-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.widget-trophy-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(234, 179, 8, 0.28) 0%, rgba(30, 41, 59, 0.7) 100%);
  border: 1.5px solid rgba(234, 179, 8, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  box-shadow: 0 4px 18px rgba(234, 179, 8, 0.28);
  position: relative;
  z-index: 2;
  transition: all 0.25s ease;
}

.widget-trophy-circle.has-photo {
  border: 2px solid #38bdf8;
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.45);
  overflow: visible;
  cursor: pointer;
  background: #0f172a;
}

.widget-trophy-circle.has-photo:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(56, 189, 248, 0.65);
}

.widget-user-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.widget-mini-trophy-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: 1.5px solid #0f172a;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  z-index: 5;
}

.widget-trophy-glow {
  position: absolute;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(234, 179, 8, 0.35) 0%, transparent 70%);
  filter: blur(8px);
  z-index: 1;
  animation: trophyPulse 3s infinite ease-in-out;
}

@keyframes trophyPulse {
  0%, 100% { transform: scale(0.9); opacity: 0.5; }
  50% { transform: scale(1.15); opacity: 0.95; }
}

.trophy-emoji {
  display: inline-block;
  animation: trophyFloat 3s infinite ease-in-out;
}

@keyframes trophyFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.widget-content {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.widget-subtitle {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #38bdf8;
  letter-spacing: 0.5px;
}

.widget-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: #f8fafc;
}

.widget-desc {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.45;
  margin: 0;
}

.widget-stats-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  width: 100%;
}

.widget-pill {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.6rem;
  padding: 0.45rem 0.55rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  text-align: center;
}

.pill-label {
  font-size: 0.66rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.pill-val {
  font-size: 0.78rem;
  font-weight: 700;
  color: #f8fafc;
}

.widget-cta-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 0.65rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #38bdf8;
  cursor: pointer;
  transition: all 0.2s ease;
}

.widget-cta-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-1px);
}

.widget-cta-btn .btn-arrow {
  transition: transform 0.2s ease;
}

.widget-cta-btn:hover .btn-arrow {
  transform: translateX(3px);
}

/* ============================================================
   2. ANIMATED KPI STAT CARDS (5 METRICS)
   ============================================================ */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.9rem;
  position: relative;
  z-index: 1;
}

.dash-kpi-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.75) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 1rem;
  padding: 1.15rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.65rem;
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.dash-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  opacity: 0.7;
  transition: opacity 0.25s ease;
}

.kpi-level-card::before { background: linear-gradient(90deg, #c084fc, #818cf8); }
.kpi-speed-card::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.kpi-acc-card::before { background: linear-gradient(90deg, #10b981, #34d399); }
.kpi-lessons-card::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.kpi-streak-card::before { background: linear-gradient(90deg, #f43f5e, #fb7185); }

.dash-kpi-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 35px -8px rgba(0, 0, 0, 0.6);
}

.kpi-level-card:hover { box-shadow: 0 18px 35px -8px rgba(0, 0, 0, 0.6), 0 0 20px -5px rgba(168, 85, 247, 0.25); border-color: rgba(168, 85, 247, 0.4); }
.kpi-speed-card:hover { box-shadow: 0 18px 35px -8px rgba(0, 0, 0, 0.6), 0 0 20px -5px rgba(245, 158, 11, 0.25); border-color: rgba(245, 158, 11, 0.4); }
.kpi-acc-card:hover { box-shadow: 0 18px 35px -8px rgba(0, 0, 0, 0.6), 0 0 20px -5px rgba(16, 185, 129, 0.25); border-color: rgba(16, 185, 129, 0.4); }
.kpi-lessons-card:hover { box-shadow: 0 18px 35px -8px rgba(0, 0, 0, 0.6), 0 0 20px -5px rgba(59, 130, 246, 0.25); border-color: rgba(59, 130, 246, 0.4); }
.kpi-streak-card:hover { box-shadow: 0 18px 35px -8px rgba(0, 0, 0, 0.6), 0 0 20px -5px rgba(244, 63, 94, 0.25); border-color: rgba(244, 63, 94, 0.4); }

.kpi-card-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.kpi-icon-bubble {
  width: 32px;
  height: 32px;
  border-radius: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.bubble-purple { background: rgba(168, 85, 247, 0.18); border: 1px solid rgba(168, 85, 247, 0.35); }
.bubble-amber { background: rgba(245, 158, 11, 0.18); border: 1px solid rgba(245, 158, 11, 0.35); }
.bubble-emerald { background: rgba(16, 185, 129, 0.18); border: 1px solid rgba(16, 185, 129, 0.35); }
.bubble-blue { background: rgba(59, 130, 246, 0.18); border: 1px solid rgba(59, 130, 246, 0.35); }
.bubble-rose { background: rgba(244, 63, 94, 0.18); border: 1px solid rgba(244, 63, 94, 0.35); }

.streak-flame-anim {
  animation: flameFlicker 2s infinite ease-in-out;
}

@keyframes flameFlicker {
  0%, 100% { transform: scale(1) rotate(0deg); filter: drop-shadow(0 0 4px #f43f5e); }
  50% { transform: scale(1.15) rotate(4deg); filter: drop-shadow(0 0 10px #fb7185); }
}

.kpi-card-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.3px;
  line-height: 1.2;
}

.kpi-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.kpi-val-group {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.kpi-main-val {
  font-size: clamp(1.45rem, 2vw, 1.85rem);
  font-weight: 900;
  color: #f8fafc;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.kpi-unit-tag {
  font-size: 0.78rem;
  font-weight: 700;
  color: #38bdf8;
  text-transform: uppercase;
}

.kpi-badge-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: 2rem;
  width: fit-content;
}

.pill-cyan { background: rgba(56, 189, 248, 0.15); border: 1px solid rgba(56, 189, 248, 0.35); color: #38bdf8; }
.pill-amber { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.35); color: #fbbf24; }
.pill-rose { background: rgba(244, 63, 94, 0.15); border: 1px solid rgba(244, 63, 94, 0.35); color: #fb7185; }

.kpi-mini-track {
  width: 100%;
  height: 5px;
  background: rgba(15, 23, 42, 0.8);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.2rem;
}

.kpi-mini-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.kpi-mini-fill.fill-emerald {
  background: linear-gradient(90deg, #10b981, #34d399);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.kpi-mini-fill.fill-blue {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.kpi-card-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.45rem;
}

.kpi-footer-text {
  font-size: 0.68rem;
  color: #64748b;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   3. LOCATION-BASED SMART TYPING CARD (MODERN)
   ============================================================ */
.dash-location-card {
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.92) 100%);
  border: 1px solid rgba(56, 189, 248, 0.28);
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 1rem;
  padding: 1.15rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  transition: all 0.25s ease;
}

.dash-location-card:hover {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 15px 35px -8px rgba(0, 0, 0, 0.5), 0 0 20px -5px rgba(56, 189, 248, 0.15);
}

.dash-loc-details {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  flex: 1 1 auto;
}

.dash-loc-beacon {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.25) 0%, rgba(15, 23, 42, 0.6) 100%);
  border: 1px solid rgba(56, 189, 248, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.beacon-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.4);
  animation: beaconPing 2.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes beaconPing {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

.dash-loc-pin {
  font-size: 1.5rem;
  position: relative;
  z-index: 1;
}

.dash-loc-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.dash-loc-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dash-loc-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.2px;
}

.dash-loc-live-status {
  font-size: 0.65rem;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.1rem 0.45rem;
  border-radius: 2rem;
  letter-spacing: 0.5px;
}

.dash-loc-heading {
  font-size: 1.15rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: -0.2px;
}

.dash-loc-subtext {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0;
  line-height: 1.4;
}

.dash-loc-btns {
  flex-shrink: 0;
}

.dash-btn-loc-practice {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.75rem;
  padding: 0.75rem 1.35rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.4);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dash-btn-loc-practice:hover {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(2, 132, 199, 0.55);
}

.btn-loc-arrow {
  transition: transform 0.2s ease;
}

.dash-btn-loc-practice:hover .btn-loc-arrow {
  transform: translateX(4px);
}

/* ============================================================
   4. 3-COLUMN FAST ACCESS STRIP (PORTAL HUB)
   ============================================================ */
.dash-feature-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.dash-feature-card {
  position: relative;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.88) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 1rem;
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.dash-feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 18px 35px -8px rgba(0, 0, 0, 0.6);
}

.feature-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.feature-card-icon.bg-amber {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.feature-card-icon.bg-rose {
  background: rgba(244, 63, 94, 0.18);
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.feature-card-icon.bg-cyan {
  background: rgba(6, 182, 212, 0.18);
  border: 1px solid rgba(6, 182, 212, 0.35);
}

.feature-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.feature-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0;
  line-height: 1.3;
}

.feature-card-desc {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.5;
  margin: 0;
}

.feature-card-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #38bdf8;
}

.ft-arrow {
  transition: transform 0.2s ease;
}

.dash-feature-card:hover .ft-arrow {
  transform: translateX(4px);
}

/* Fallback Classes for Legacy Code Compatibility */
.dashboard-hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e293b 100%);
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.6rem;
  margin-top: 1rem;
}

.stat-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.85rem;
  border-radius: 0.5rem;
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-color);
  display: block;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Responsive Dashboard Breakpoints */
@media (max-width: 1024px) {
  .dash-hero-card {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .dash-hero-side-widget {
    flex-direction: column;
    text-align: center;
    align-items: center;
    gap: 1rem;
  }
  .dash-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .dash-feature-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  .dash-row-deck-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }
}

@media (max-width: 768px) {
  .dash-hero-card {
    padding: 1.25rem;
  }
  .dash-btn-primary-glow {
    padding: 0.75rem 1rem;
    font-size: 0.88rem;
  }
  .dash-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }
  .dash-location-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .dash-loc-btns {
    width: 100%;
  }
  .dash-btn-loc-practice {
    width: 100%;
    justify-content: center;
  }
  .dash-feature-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .dash-hero-top-ribbon {
    gap: 0.4rem;
  }
  .dash-hero-greeting {
    font-size: 1.35rem;
  }
  .dash-kpi-grid {
    grid-template-columns: 1fr;
  }
  .widget-stats-pills {
    grid-template-columns: 1fr;
  }
}

/* Virtual Keyboard Component — Computer Screen Fit */
.virtual-keyboard-wrapper {
  position: relative;
  background-color: #090d16;
  border: 2px solid var(--card-border);
  border-radius: 0.75rem;
  padding: 0.5rem 0.6rem;
  box-shadow: 0 8px 20px -5px rgba(0, 0, 0, 0.5);
  user-select: none;
  max-width: 960px;
  margin: clamp(0.4rem, 1vh, 0.65rem) auto clamp(0.35rem, 1.5vh, 1rem);
  width: 100%;
}

.keyboard-row {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 4px;
  margin-bottom: 4px;
  width: 100%;
}

.key {
  background-color: var(--key-bg);
  border: 1px solid var(--key-border);
  border-radius: 0.35rem;
  flex: 1;
  min-width: 42px;
  max-width: 62px;
  height: 46px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2px 4px;
  cursor: pointer;
  transition: all 0.1s ease;
  position: relative;
}


.key:hover { background-color: #475569; }

.key-top-shift {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1;
}

.shift-unicode {
  color: #38bdf8;
  font-weight: 700;
  font-size: 0.78rem;
}

.key-bottom-normal {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 0.75rem;
  line-height: 1;
}

.normal-roman {
  font-weight: 700;
  color: #f8fafc;
}

.normal-unicode {
  color: #4ade80;
  font-weight: 700;
  font-size: 1rem;
}

/* Key Modifiers & Sizing for Screen Adjustments */
.key-backspace {
  flex: 1.9;
  min-width: 82px;
  max-width: 125px;
}

.key-tab {
  flex: 1.5;
  min-width: 72px;
  max-width: 105px;
}

.key-caps {
  flex: 1.8;
  min-width: 82px;
  max-width: 118px;
}

.key-enter {
  flex: 2.2;
  min-width: 98px;
  max-width: 142px;
  background-color: #1e3a8a;
}

.key-shift {
  background-color: #1e3a8a;
}

.key-shift-left {
  flex: 2.3;
  min-width: 105px;
  max-width: 148px;
}

.key-shift-right {
  flex: 2.7;
  min-width: 120px;
  max-width: 168px;
}

.key-ctrl {
  flex: 1.25;
  min-width: 55px;
  max-width: 85px;
}

.key-win {
  flex: 1.2;
  min-width: 52px;
  max-width: 80px;
}

.key-alt {
  flex: 1.2;
  min-width: 52px;
  max-width: 80px;
}

.key-space {
  flex: 7.2;
  min-width: 220px;
  max-width: 480px;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
}

.key-space .roman-label {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  font-size: 0.88rem;
  font-weight: 600;
  color: #e2e8f0;
}

.key-backspace,
.key-tab,
.key-caps,
.key-enter,
.key-shift,
.key-ctrl,
.key-win,
.key-alt {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.key-backspace .roman-label,
.key-tab .roman-label,
.key-caps .roman-label,
.key-enter .roman-label,
.key-shift .roman-label,
.key-ctrl .roman-label,
.key-win .roman-label,
.key-alt .roman-label {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
}

/* Active Key Highlights */
.key-required-highlight {
  background-color: #3b82f6 !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.5) !important;
  transform: scale(1.03);
}

.key-required-highlight span,
.key-required-highlight div {
  color: #ffffff !important;
}

.key-pressed {
  transform: translateY(2px) scale(0.96) !important;
  background-color: #16a34a !important;
}

.shift-active {
  background-color: #2563eb !important;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.8);
}

/* Touch Typing Realistic Hands & Real-Time Finger Guide Overlay (Edclub Style) */
.keyboard-hands-overlay.edclub-hands-svg,
.keyboard-hands-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 148%;
  pointer-events: none;
  z-index: 8;
  overflow: visible;
  transition: opacity 0.25s ease;
}

.keyboard-hands-overlay.hidden {
  display: none !important;
  opacity: 0;
}

/* Base hidden state for all posture groups */
.edclub-hands-svg .st0 {
  display: none;
}

.edclub-hands-svg g.st0[style*="display: block"],
.edclub-hands-svg g.st0[style*="display:block"] {
  display: block !important;
}

/* Ensure hand wrapper layers are always visible */
.edclub-hands-svg .edclub-right-hand-layer,
.edclub-hands-svg .edclub-left-hand-layer {
  display: inline !important;
  pointer-events: none;
}

/* Clean, subtle translucent hand fill (.st1) matching photo */
.edclub-hands-svg .st1 {
  display: inline;
  fill: #94a3b8;
  opacity: 0.2;
  transition: all 0.2s ease;
}

/* Crisp, natural hand contour stroke (.st2) clearly visible on dark keyboard */
.edclub-hands-svg .st2 {
  display: inline;
  fill: none;
  stroke: #cbd5e1;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-miterlimit: 10;
  opacity: 0.95;
}

.edclub-hands-svg .st3 {
  display: inline;
  opacity: 0.5;
}

.edclub-hands-svg .st4 {
  fill: #aeb0b2;
}

/* Active Finger Bold Royal Blue Stroke (.st5) exactly as in uploaded photo */
.edclub-hands-svg .st5 {
  display: inline !important;
  fill: none !important;
  stroke: #38bdf8 !important;
  stroke-width: 3.8 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  stroke-miterlimit: 10;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.75)) !important;
  opacity: 1 !important;
}

/* Shift Key Pinky Helper Highlight on Opposite Hand */
.edclub-hands-svg g[id^="shift-"] .st5 {
  display: inline !important;
  fill: none !important;
  stroke: #a855f7 !important;
  stroke-width: 3.8 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.75)) !important;
}

/* Finger Guide Toggle Button */
.btn-toggle-finger-guide {
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #94a3b8;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.22rem 0.65rem;
  border-radius: 0.375rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-toggle-finger-guide:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.6);
}

.btn-toggle-finger-guide.active {
  background: rgba(37, 99, 235, 0.25);
  color: #38bdf8;
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

/* Live Active Finger Hint Badge */
.finger-hint-badge {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #38bdf8;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.22rem 0.6rem;
  border-radius: 0.375rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  animation: fingerPulse 2s infinite ease-in-out;
}

@keyframes fingerPulse {
  0%, 100% {
    border-color: rgba(56, 189, 248, 0.45);
    box-shadow: 0 0 4px rgba(56, 189, 248, 0.2);
  }
  50% {
    border-color: rgba(56, 189, 248, 0.9);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
  }
}

/* Professional Typing Screen — Auto Line-by-Line Target Box (No Scrollbars) */
.typing-screen-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  padding: clamp(0.6rem, 1.2vh, 1rem) clamp(0.65rem, 1.2vw, 1rem);
  overflow: visible;
  box-sizing: border-box;
}

.metrics-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #18202c;
  border: 1px solid #334155;
  padding: 0.5rem 0.85rem;
  border-radius: 0.5rem;
  margin-bottom: 0.65rem;
}

#lesson-title-display {
  color: #cbd5e1;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Navigation Bar User Avatar Thumbnail */
.nav-profile-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.45rem !important;
  padding: 0.25rem 0.65rem 0.25rem 0.35rem !important;
}

.nav-avatar-box {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #38bdf8;
  background: #0f172a;
  flex-shrink: 0;
  line-height: 1;
}

.nav-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* Typing Screen Active Student Chip */
.typing-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1.5px solid rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
  padding: 0.18rem 0.65rem 0.18rem 0.25rem;
  border-radius: 9999px;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
}

.typing-user-chip:hover {
  transform: scale(1.05);
  border-color: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.45);
}

.typing-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid #10b981;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.typing-user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.typing-user-avatar-empty {
  font-size: 0.95rem;
  line-height: 1;
}

.typing-user-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.typing-chip-divider {
  color: #334155;
  margin: 0 0.1rem;
  font-size: 1.1rem;
  flex-shrink: 0;
  user-select: none;
}

#lesson-desc-display {
  color: #94a3b8 !important;
  font-size: 0.82rem;
  display: inline;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.metric-pill {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.metric-pill .val {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary-color);
}

.metric-pill .lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.metric-pill.timer-paused {
  background: rgba(245, 158, 11, 0.12);
  border-radius: 6px;
  padding: 1px 6px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  transition: all 0.3s ease;
}

.para-metric-pill.timer-paused {
  background: rgba(245, 158, 11, 0.14) !important;
  border-color: rgba(245, 158, 11, 0.45) !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25) !important;
  transition: all 0.3s ease;
}

.metric-pill.timer-paused .val,
.para-metric-pill.timer-paused .m-val {
  color: #f59e0b !important;
}

.timer-pause-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.65rem;
  background: #f59e0b;
  color: #0b0f19;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 800;
  margin-left: 4px;
  letter-spacing: 0.5px;
  animation: timer-pause-pulse 1.4s ease-in-out infinite;
  vertical-align: middle;
}

@keyframes timer-pause-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(0.96); }
}


/* SINGLE-LINE STREAMING TARGET DISPLAY BOX */
.target-text-display-box {
  background-color: #090d16;
  border: 2px solid var(--card-border);
  border-radius: 0.5rem;
  padding: 0 1.25rem;
  font-size: 1.85rem;
  line-height: 64px;
  height: 66px;
  max-height: 66px;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-x: hidden !important;
  overflow-y: hidden !important;
  position: relative;
  user-select: none;
  display: block;
  letter-spacing: 0.04em;
  scroll-behavior: smooth;
  box-sizing: border-box;
  color: #ffffff;
}

/* Hide scrollbar */
.target-text-display-box::-webkit-scrollbar { display: none; }
.target-text-display-box {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.char-span {
  display: inline-block;
  white-space: pre !important;
  vertical-align: baseline !important;
  font-family: 'Inter', var(--font-devnagari), 'Mukta', 'Kalimati', 'Segoe UI', system-ui, sans-serif;
  letter-spacing: normal !important;
  color: #ffffff;
  line-height: 1.02 !important;
  position: relative;
  box-sizing: border-box;
  padding: 1px 1px 2px 1px;
}

.target-chars-stream {
  position: relative;
  display: inline-block;
  white-space: nowrap !important;
  line-height: inherit;
  vertical-align: baseline !important;
}

.char-span.pending { color: #ffffff; }
.char-span.correct { color: #4ade80; }
.char-span.corrected {
  color: #fb923c !important;
  background-color: transparent !important;
  border-radius: 0;
  padding: 1px 1px 2px 1px;
  box-shadow: none;
}
.char-span.incorrect {
  color: #f87171;
  background-color: rgba(239, 68, 68, 0.25);
  border-radius: 3px;
}

.char-base-text {
  display: inline;
  color: #ffffff;
}

.char-partial-overlay {
  position: absolute;
  top: 1px;
  left: 1px;
  padding: 0;
  margin: 0;
  line-height: 1.02 !important;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal !important;
  white-space: pre !important;
  pointer-events: none;
  user-select: none;
}

.cluster-char > .char-partial-overlay {
  top: 0;
  left: 0;
  line-height: inherit !important;
}

/* Monkeytype Authentic Smooth Gliding Caret */
.monkeytype-caret {
  position: absolute;
  width: 2.5px;
  background-color: #e2b714;
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(226, 183, 20, 0.85), 0 0 2px #e2b714;
  pointer-events: none;
  z-index: 50;
  transform: translateZ(0);
  /* left is animated by JS lerp in lessons.js & typing-test.js */
  transition: top 0.08s ease,
              height 0.08s ease,
              background-color 0.15s ease,
              box-shadow 0.15s ease;
  will-change: left, top;
}


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

.monkeytype-caret.blinking {
  animation: monkeytypeCaretBlink 1s infinite ease-in-out;
}

.monkeytype-caret.typing {
  animation: none !important;
  opacity: 1 !important;
}

.monkeytype-caret.caret-error {
  background-color: #ef4444 !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.95), 0 0 3px #ef4444 !important;
}

.char-span.current-target-char {
  color: #ffffff;
  background-color: transparent !important;
  border-bottom: none !important;
  box-shadow: none !important;
  padding-bottom: 1px;
}

.char-span.current-target-char.char-error-shake {
  color: #ef4444 !important;
  background-color: transparent !important;
  border-bottom: none !important;
  box-shadow: none !important;
  animation: charErrorShakeAnim 0.25s ease-in-out;
}

@keyframes charErrorShakeAnim {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.char-span.current-partial {
  color: #93c5fd;
  background-color: transparent !important;
  border-bottom: none !important;
}

.guided-instruction-bar {
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.3);
  padding: 0.4rem 0.75rem;
  border-radius: 0.35rem;
  margin-top: 0.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
}

/* Profiles Selector Grid */
.profiles-select-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.profile-select-card {
  background: #0f172a;
  border: 1px solid var(--card-border);
  padding: 0.65rem 0.75rem;
  border-radius: 0.35rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-select-card.active-profile {
  border-color: var(--primary-color);
  background: rgba(37, 99, 235, 0.15);
}

.profile-card-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profile-avatar-icon { font-size: 1.2rem; }

.auto-next-banner {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  padding: 0.4rem 0.75rem;
  border-radius: 0.35rem;
  font-size: 0.82rem;
}

/* Conjunct Step-by-Step Breakdown */
.conjunct-breakdown-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.conjunct-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.target-symbol-display {
  font-size: 3rem;
  font-weight: 800;
  background: #1e3a8a;
  color: #ffffff;
  width: 80px;
  height: 80px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #3b82f6;
}

.formula-sequence {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0.6rem 0;
  background: #0f172a;
  padding: 0.6rem 0.85rem;
  border-radius: 0.5rem;
}

.key-step-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: #334155;
  border: 1px solid #475569;
  padding: 0.35rem 0.75rem;
  border-radius: 0.35rem;
  margin-right: 0.35rem;
}

.key-step-pill.active {
  background: var(--primary-color);
  border-color: #60a5fa;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.6);
}

.key-step-pill .step-num { font-size: 0.6rem; color: var(--text-muted); }
.key-step-pill .step-key { font-weight: 800; font-size: 0.95rem; }

/* Learning Path Grid */
.learning-levels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.85rem;
}

/* EdClub-style progress bar */
.lp-progress-bar-wrap {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--card-border);
  border-radius: 0.55rem;
  padding: 0.65rem 0.9rem;
  margin-bottom: 1rem;
}
.lp-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}
.lp-pct-badge {
  font-weight: 700;
  color: #60a5fa;
  font-size: 0.9rem;
}
.lp-progress-track {
  height: 7px;
  background: #1e293b;
  border-radius: 4px;
  overflow: hidden;
}
.lp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #10b981);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.lesson-card {
  background-color: var(--card-bg);
  border: 1px solid var(--lesson-accent, var(--card-border));
  border-left: 3px solid var(--lesson-accent, #2563eb);
  border-radius: 0.5rem;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: box-shadow 0.15s ease;
}
.lesson-card.unlocked:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.lesson-card.completed { border-color: var(--success-color); }
.lesson-card.locked { opacity: 0.55; }

.lesson-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.lesson-card-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.3rem; }
.lesson-card-desc { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.lesson-card-hint {
  font-size: 0.76rem;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
  border-left: 2px solid #fbbf24;
  padding: 0.3rem 0.5rem;
  border-radius: 0 0.3rem 0.3rem 0;
  margin-bottom: 0.6rem;
  line-height: 1.4;
}
.lesson-card-stats {
  display: flex;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
.lesson-card-stats strong {
  color: #10b981;
}


/* Buttons & Badges */
.btn {
  padding: 0.4rem 0.85rem;
  border-radius: 0.35rem;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-primary { background-color: var(--primary-color); color: #ffffff; }
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-secondary { background-color: #334155; color: #ffffff; }
.btn-secondary:hover { background-color: #475569; }
.btn-danger { background-color: var(--error-color); color: #ffffff; }
.btn-disabled { background-color: #334155; color: #64748b; cursor: not-allowed; }
.btn-sm, .btn-compact { padding: 0.25rem 0.6rem; font-size: 0.78rem; }

.badge {
  font-size: 0.68rem;
  padding: 0.18rem 0.4rem;
  border-radius: 0.2rem;
  font-weight: 600;
}

.badge-level { background: #1e3a8a; color: #60a5fa; }
.badge-difficulty.basic { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge-difficulty.intermediate { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.badge-difficulty.advanced { background: rgba(239, 68, 68, 0.2); color: #f87171; }

/* Admin Data Table */
.admin-data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.65rem;
  font-size: 0.82rem;
}

.admin-data-table th, .admin-data-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--card-border);
  text-align: left;
}

.admin-data-table th { background-color: #0f172a; color: var(--text-muted); }

.input-inline {
  background: #0f172a;
  border: 1px solid var(--card-border);
  color: #ffffff;
  padding: 0.25rem 0.4rem;
  border-radius: 0.2rem;
  font-size: 0.82rem;
  width: 100%;
}

/* Admin Student Management & Dashboard */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.admin-stat-card {
  background: #1e293b;
  border: 1px solid var(--card-border);
  border-radius: 0.6rem;
  padding: 0.85rem 1rem;
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.admin-stat-card:hover {
  border-color: #3b82f6;
  transform: translateY(-2px);
}

.admin-stat-num {
  font-size: 1.55rem;
  font-weight: 800;
  display: block;
  margin-bottom: 0.2rem;
  letter-spacing: -0.5px;
}

.admin-stat-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.badge-cert {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 0.35rem;
  font-family: monospace;
  font-size: 0.84rem;
  display: inline-block;
}

.badge-active-user {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
  border: 1px solid #10b981;
  font-weight: 700;
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  margin-left: 0.45rem;
  display: inline-block;
  vertical-align: middle;
}

.table-actions-cell {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn-admin-tab {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 0.4rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-admin-tab.active {
  background: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.4);
}


/* Modal Popup */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 0.75rem;
  overflow-y: auto;
  box-sizing: border-box;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  max-width: 520px;
  width: 95%;
  max-height: calc(100vh - 30px);
  overflow-y: auto;
  scrollbar-width: thin;
  text-align: center;
  box-shadow: 0 15px 25px -5px rgba(0,0,0,0.5);
  position: relative;
  box-sizing: border-box;
  margin: auto;
}

/* Result Modal User Profile Avatar Strip */
.result-modal-card {
  max-width: 480px;
}

.result-student-profile-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  gap: 0.35rem;
}

.result-avatar-wrapper {
  position: relative;
  width: 76px;
  height: 76px;
  cursor: pointer;
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  user-select: none;
}

.result-avatar-wrapper:hover {
  transform: scale(1.08);
}

.result-avatar-box {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  border: 3px solid #10b981;
  background: #0f172a;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.45), 0 0 14px rgba(56, 189, 248, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-avatar-box.is-retry {
  border-color: #ef4444 !important;
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.45) !important;
}

.result-avatar-box.no-photo {
  border-style: dashed;
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.65);
}

.result-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.result-avatar-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, #1e293b 0%, #0f172a 100%);
  color: #94a3b8;
}

.result-avatar-icon {
  font-size: 2.3rem;
  line-height: 1;
}

.result-avatar-hover-tag {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: #38bdf8;
  opacity: 0;
  transition: opacity 0.2s ease;
  border-radius: 50%;
  text-align: center;
  line-height: 1.2;
}

.result-avatar-wrapper:hover .result-avatar-hover-tag {
  opacity: 1;
}

.result-avatar-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #0f172a;
  border: 2px solid #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  z-index: 2;
  transition: border-color 0.2s ease;
}

.result-avatar-box.is-retry + .result-avatar-badge {
  border-color: #ef4444 !important;
}

.result-student-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.result-student-name {
  font-size: 0.98rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: 0.02em;
}

.result-student-role-pill {
  font-size: 0.68rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.1rem 0.55rem;
  border-radius: 9999px;
}


.modal-close-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  font-size: 1.1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
  z-index: 10;
}

.modal-close-btn:hover {
  color: #ffffff;
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
}

/* Next Level Up Confirmation Prompt */
.next-level-prompt-card {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.35), rgba(15, 23, 42, 0.9));
  border: 2px solid #3b82f6;
  border-radius: 0.75rem;
  padding: 1rem 0.85rem;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
  text-align: center;
  animation: pulseGlow 2.5s infinite alternate;
}

@keyframes pulseGlow {
  from { box-shadow: 0 0 10px rgba(59, 130, 246, 0.25); border-color: #3b82f6; }
  to { box-shadow: 0 0 22px rgba(59, 130, 246, 0.55); border-color: #60a5fa; }
}

.next-level-icon {
  font-size: 2.2rem;
  margin-bottom: 0.2rem;
}

.next-level-question {
  font-size: 1.25rem;
  font-weight: 800;
  color: #60a5fa;
  margin: 0.4rem 0;
  letter-spacing: 0.3px;
}

/* ==========================================================================
   KOTAHI TRAINING CENTER — MODERN LUXURY A4 LANDSCAPE CERTIFICATE
   ========================================================================== */
.cert-page-container {
  max-width: 1100px;
  margin: 1rem auto 3rem auto;
  padding: 0 1rem;
}

.cert-customizer-toolbar {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 0.85rem;
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.cert-toolbar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
  flex-wrap: wrap;
  gap: 0.85rem;
}

/* Layout Picker Toolbar Controls */
.cert-layout-picker {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  background: rgba(15, 23, 42, 0.85) !important;
  padding: 4px 8px !important;
  border-radius: 9999px !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
}

.cert-layout-picker-label {
  font-size: 0.74rem !important;
  color: #94a3b8 !important;
  font-weight: 700 !important;
  padding: 0 4px !important;
  letter-spacing: 0.3px !important;
}

.btn-cert-layout-toggle {
  background: rgba(30, 41, 59, 0.6) !important;
  color: #94a3b8 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 9999px !important;
  padding: 3px 10px !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  transition: all 0.18s ease !important;
  user-select: none !important;
  outline: none !important;
}

.btn-cert-layout-toggle:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #f1f5f9 !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  transform: translateY(-1px) !important;
}

.btn-cert-layout-toggle.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  color: #ffffff !important;
  border-color: #60a5fa !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.45) !important;
  transform: translateY(-1px) !important;
}

.btn-cert-layout-toggle.active::before {
  content: '✓';
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 900;
  color: #67e8f9;
}

.btn-cert-combo {
  background: rgba(30, 41, 59, 0.6) !important;
  color: #94a3b8 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 6px !important;
  padding: 0.35rem 0.65rem !important;
  font-size: 0.76rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.18s ease !important;
}

.btn-cert-combo:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #f8fafc !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
}

.btn-cert-combo.active {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  color: #ffffff !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4) !important;
  font-weight: 700 !important;
}

.cert-toolbar-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: 0.3px;
}

.cert-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.cert-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.cert-form-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cert-form-input {
  background: #090d16;
  border: 1.5px solid #334155;
  border-radius: 0.45rem;
  padding: 0.5rem 0.75rem;
  color: #f8fafc;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.cert-form-input:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.cert-preset-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.btn-cert-preset {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-cert-preset:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border-color: #38bdf8;
}

/* Certificate Preview Wrapper */
.cert-preview-outer {
  background: #090d16;
  padding: 2rem 1.5rem;
  border-radius: 1rem;
  border: 1.5px solid var(--card-border);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: auto;
}

/* The Modern A4 Landscape Certificate Sheet (1050px x 742px = 1.415 A4 ratio) */
#printable-certificate-card {
  width: 1050px;
  height: 742px;
  aspect-ratio: 297 / 210;
  background: #ffffff radial-gradient(circle at 50% 45%, #ffffff 65%, #f8fafc 100%);
  position: relative;
  box-sizing: border-box;
  color: #002865;
  overflow: hidden;
  user-select: none;
  flex-shrink: 0;
  border: 10px solid #002865;
  border-bottom: none;
  box-shadow: none !important; border: 1px solid #cbd5e1;
  font-family: 'Montserrat', sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 18px 36px 0 36px;
}

/* Inner borders removed per specification for pristine executive appearance */
#printable-certificate-card::before {
  display: none !important;
}

#printable-certificate-card::after {
  display: none !important;
}

/* Modern Geometric Navy & Gold Corner Accents */
.cert-corner-geo {
  position: absolute;
  width: 150px;
  height: 150px;
  pointer-events: none;
  z-index: 2;
}
.cert-corner-geo-tl {
  top: 0;
  left: 0;
  width: 65px;
  height: 65px;
  z-index: 1;
  pointer-events: none;
}
.cert-corner-geo-br {
  display: none !important;
}

/* Bottom Navy Full-Width Strip */
.cert-bottom-navy-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 27px;
  background: #002865;
  border-top: 1.5px solid #d4af37;
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2.4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-transform: uppercase;
  z-index: 4;
}
.cert-bar-dot {
  color: #f59e0b;
  font-size: 11px;
}

/* Background Watermarks (Typing hands, World map, Logo) - Richer Coverage */
.cert-watermark-left {
  position: absolute;
  left: 14px;
  top: 210px;
  width: 255px;
  height: 290px;
  object-fit: contain;
  opacity: 0.85;
  filter: contrast(1.08) brightness(1.03);
  pointer-events: none;
  z-index: 1;
}

.cert-watermark-right {
  position: absolute;
  left: 36px;
  right: 36px;
  top: 140px;
  width: calc(100% - 72px);
  height: 335px;
  object-fit: fill;
  opacity: 0.26;
  pointer-events: none;
  z-index: 1;
}

/* Official Kotahi Training Center Logo Watermark */
.cert-watermark-bg {
  position: absolute;
  top: 52%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 270px;
  height: 270px;
  object-fit: contain;
  opacity: 0.032;
  filter: grayscale(1) !important;
  pointer-events: none;
  z-index: 0;
  user-select: none;
}

/* Top Gold Accent Line (as in reference header) */
.cert-top-gold-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  background: linear-gradient(90deg, #d97706 0%, #fde047 30%, #eab308 70%, #b45309 100%);
  z-index: 3;
}

/* Header: Logo, Title, Photo */
.cert-modern-header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.cert-logo-badge {
  width: 104px;
  height: 104px;
  margin-left: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cert-logo-img {
  width: 98px;
  height: 98px;
  object-fit: contain;
  filter: none !important;
  display: block;
}

.cert-center-brand {
  text-align: center;
  flex: 1;
  padding: 0 10px;
  min-width: 0;
}

.cert-org-name {
  font-family: 'Montserrat', sans-serif;
  font-size: 32px;
  font-weight: 900;
  color: #00205b;
  letter-spacing: 2px;
  margin: 0;
  line-height: 1.15;
  text-transform: uppercase;
  text-shadow: none;
}

.cert-tagline-motto {
  font-family: 'Montserrat', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  margin: 3px 0 0 0;
  color: #00205b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.motto-text-block {
  display: inline-block;
  white-space: nowrap;
  letter-spacing: 0.3px;
}
.motto-dash {
  display: inline-block;
  width: 42px;
  height: 1.5px;
  background: #00205b;
  vertical-align: middle;
}
.cert-tagline-motto .green-text { color: #16a34a; font-weight: 800; }
.cert-tagline-motto .red-text { color: #dc2626; font-weight: 800; }

.cert-reg-info {
  font-size: 9.5px;
  font-weight: 700;
  color: #00205b;
  letter-spacing: 1.2px;
  margin-top: 4px;
  text-transform: uppercase;
}

.cert-sub-center-type {
  font-size: 9px;
  font-weight: 700;
  color: #00205b;
  letter-spacing: 1.4px;
  margin-top: 2px;
  text-transform: uppercase;
}

/* Header Script: Learn Practice Grow */
.cert-header-right-col {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.cert-header-motto-script {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'Alex Brush', cursive;
  font-size: 22px;
  color: #00205b;
  line-height: 0.95;
  white-space: nowrap;
  pointer-events: none;
}
.cert-gold-swoosh {
  width: 58px;
  height: 9px;
  margin-top: 2px;
}

/* Passport Photo Frame Wrapper */
.cert-photo-frame-wrap {
  width: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  top: 0.2in;
}

/* Passport Photo Frame */
.cert-photo-frame {
  width: 96px;
  height: 118px;
  border: 2px solid #eab308;
  outline: 1.5px solid #00205b;
  border-radius: 3px;
  background: #ffffff !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  box-shadow: none !important;
  transition: all 0.2s ease;
  position: relative;
}


.cert-photo-frame:hover {
  outline-color: #2563eb;
}

.cert-photo-frame.drag-over {
  border-color: #2563eb !important;
  background: #eff6ff !important;
  transform: scale(1.04);
}

@keyframes certPhotoPulse {
  0%, 100% { border-color: #d4af37; box-shadow: none; }
  50% { border-color: #f59e0b; box-shadow: none; }
}

.cert-photo-frame.photo-required-pulse {
  animation: certPhotoPulse 2s infinite ease-in-out;
}

.cert-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.cert-photo-frame .photo-hint {
  font-size: 8.5px;
  color: #1e3a8a !important;
  text-align: center;
  padding: 4px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 100%;
}

/* Main Body: Title, Student Name, Citation */
.cert-modern-body {
  position: relative;
  z-index: 3;
  text-align: center;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 0;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}

/* Golden Ribbon: Professional Typing Certification */
.cert-ribbon-banner-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center !important;
  width: auto !important;
  max-width: 520px !important;
  margin: 0 auto 4px auto !important;
  box-sizing: border-box;
  z-index: 3;
}

.cert-ribbon-banner-img {
  width: 520px !important;
  max-width: 100% !important;
  height: auto !important;
  aspect-ratio: 983 / 107 !important;
  display: block !important;
  object-fit: contain !important;
  pointer-events: none !important;
  user-select: none !important;
  filter: none !important;
}

.cert-title-lead {
  font-family: 'Cinzel', serif;
  font-size: 29px;
  font-weight: 900;
  letter-spacing: 2.6px;
  color: #00205b;
  background: transparent;
  margin: 4px 0 3px 0;
  text-transform: uppercase;
  text-shadow: none !important;
  line-height: 1.15;
}

.cert-pres-to {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 2.8px;
  color: #b45309;
  text-transform: uppercase;
  margin: 5px 0 4px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.cert-gold-dash {
  display: inline-block;
  width: 65px;
  height: 1px;
  background: #d4af37;
}

.cert-student-highlight {
  font-family: 'Alex Brush', cursive;
  font-size: 58px;
  font-weight: 700;
  color: #00205b;
  letter-spacing: 0.5px;
  margin: 4px 0 4px 0;
  line-height: 1.15;
  position: relative;
  z-index: 2;
  text-shadow: none !important;
}

.cert-name-divider {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 4px auto 14px auto !important;
  width: 100% !important;
  max-width: 540px !important;
}

.cert-name-divider-svg {
  width: 540px !important;
  max-width: 100% !important;
  height: 18px !important;
  display: block !important;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

.cert-name-divider .line {
  flex: 1 1 auto;
  height: 1px;
  background: #d4af37;
}

.cert-name-divider .diamond {
  color: #f59e0b;
  font-size: 12px;
  transform: translateY(-0.5px);
}

.cert-citation-paragraph {
  font-size: 13.5px;
  color: #1e293b;
  line-height: 1.55;
  max-width: 860px;
  margin: 0 auto 20px auto;
  font-weight: 500;
}

.cert-citation-paragraph strong {
  color: #00205b;
  font-weight: 800;
}

/* 4-Item Typing Performance Badges Grid with Floating Circle Icons */
.cert-modern-metrics {
  display: flex !important;
  justify-content: space-between !important;
  align-items: stretch !important;
  gap: 16px !important;
  margin: 16px auto 0 auto !important;
  max-width: 960px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.cert-metric-pill {
  position: relative;
  flex: 1 1 0 !important;
  min-width: 0 !important;
  border-radius: 11px;
  padding: 18px 12px 10px 12px;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: none !important;
  box-sizing: border-box;
}

.cert-metric-pill.pill-course {
  background: linear-gradient(180deg, #ffffff 0%, #f0f7ff 100%);
  border: 1.5px solid #93c5fd;
}
.cert-metric-pill.pill-accuracy {
  background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
  border: 1.5px solid #86efac;
}
.cert-metric-pill.pill-speed {
  background: linear-gradient(180deg, #ffffff 0%, #f5f3ff 100%);
  border: 1.5px solid #c4b5fd;
}
.cert-metric-pill.pill-certno {
  background: linear-gradient(180deg, #ffffff 0%, #fefce8 100%);
  border: 1.5px solid #fde68a;
}

.cert-card-icon-bubble {
  position: absolute;
  top: -21px;
  left: 50%;
  transform: translateX(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 3.5px #ffffff, 0 3px 6px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.4);
  z-index: 5;
  box-sizing: border-box;
}
.cert-card-icon-bubble svg {
  width: 23px;
  height: 23px;
  display: block;
}
.bubble-course { background: radial-gradient(circle at 35% 30%, #2575fc 0%, #0047cc 70%, #002b80 100%); }
.bubble-accuracy { background: radial-gradient(circle at 35% 30%, #34d399 0%, #059669 70%, #064e3b 100%); }
.bubble-speed { background: radial-gradient(circle at 35% 30%, #818cf8 0%, #4f46e5 70%, #312e81 100%); }
.bubble-certno { background: radial-gradient(circle at 35% 30%, #fbbf24 0%, #d97706 70%, #92400e 100%); }

.cert-pill-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: block;
  margin-bottom: 2px;
}

.cert-pill-val {
  font-size: 15.5px;
  font-weight: 800;
  color: #00205b;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.cert-editable-no,
#cert-render-enroll {
  cursor: default !important;
  user-select: text;
  outline: none !important;
}
.cert-editable-no:hover, .cert-editable-no:focus,
#cert-render-enroll:hover, #cert-render-enroll:focus {
  background: transparent !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Footer: Signatures, Gold Seal, Security Badge, QR Code */
.cert-modern-footer {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-top: 0;
  border-top: none;
  min-height: 86px;
  margin-top: 50px;
  margin-bottom: 0;
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}

.cert-sig-col {
  width: 175px;
  text-align: center;
  flex-shrink: 0;
}
.sig-right {
  margin-right: 30px;
}
.sig-left {
  margin-left: 18px;
}

.cert-sig-script {
  font-family: 'Alex Brush', cursive;
  font-size: 28px;
  color: #00205b;
  line-height: 1;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cert-sig-issued-text {
  font-family: 'Alex Brush', cursive !important;
  font-size: 28px !important;
  color: #00205b !important;
}

.cert-sig-rule {
  width: 135px;
  height: 1.5px;
  background: #00205b;
  margin: 3px auto 4px auto;
}
.sig-left .cert-sig-rule {
  background: #eab308;
}

.cert-footer-address {
  font-size: 9px;
  font-weight: 700;
  color: #00205b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin-top: 1px;
}

.cert-footer-types {
  font-size: 8px;
  font-weight: 600;
  color: #475569;
  margin-top: 1px;
}

.cert-sig-name {
  font-size: 10.5px;
  font-weight: 800;
  color: #00205b;
  margin: 0;
  letter-spacing: 0.3px;
}

.cert-sig-role {
  font-size: 8px;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 2px 0 0 0;
  font-weight: 700;
}

/* Symmetrical 3-Insignia Center Cluster (Top Aligned & Same 56px Size) */
.cert-footer-center-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  box-sizing: border-box;
}

.cert-footer-v-divider {
  width: 1px;
  height: 48px;
  background: #cbd5e1;
  flex-shrink: 0;
  margin-bottom: 8px;
}

.cert-insignia-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 125px;
  box-sizing: border-box;
}

.cert-insignia-col-center {
  width: 155px;
}

/* Uniform 56px x 56px Insignia Graphics */
.cert-sec-box {
  width: 48px;
  height: 48px;
  border: 1.5px solid #d4af37;
  border-radius: 6px;
  padding: 2px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: none !important;
  flex-shrink: 0;
  box-sizing: border-box;
  margin-bottom: 4px;
}

.cert-gold-medal {
  width: 48px;
  height: 48px;
  filter: none !important;
  display: block;
  flex-shrink: 0;
  margin-bottom: 4px;
}

.cert-qr-verify {
  cursor: pointer;
  transition: transform 0.15s ease;
}

.cert-qr-verify:hover {
  transform: translateY(-2px);
}

.cert-qr-code-box,
.cert-qr-code-img {
  width: 48px;
  height: 48px;
  border: 1.5px solid #d4af37;
  border-radius: 6px;
  padding: 2px;
  background: #ffffff;
  box-shadow: none !important;
  flex-shrink: 0;
  box-sizing: border-box;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cert-qr-code-box img,
.cert-qr-code-box canvas,
.cert-qr-code-img img,
.cert-qr-code-img canvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  display: block;
}

@keyframes certSpinner {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.cert-verify-spinner {
  animation: certSpinner 0.8s linear infinite;
}

.cert-verify-text {
  font-size: 9px;
  color: #64748b;
  line-height: 1.35;
  text-align: center;
}
.cert-verify-text strong {
  color: #0f172a;
  display: block;
  font-size: 9px;
}

.cert-seal-dates {
  font-size: 9px;
  color: #475569;
  line-height: 1.35;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cert-seal-dates div {
  white-space: nowrap;
}
.cert-seal-dates strong {
  color: #0f172a;
  display: block;
  font-size: 9px;
}
.cert-seal-dates span {
  color: #1e3a8a;
  font-weight: 700;
}

/* ==========================================================================
   A4 PRINT MEDIA RULES (EXACT 297mm x 210mm ZERO-MARGIN PRINTING)
   ========================================================================== */
@page {
  size: A4 landscape;
  margin: 0;
}

@media print {
  html, body {
    width: 297mm !important;
    height: 210mm !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    overflow: hidden !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body * {
    visibility: hidden !important;
  }

  #printable-certificate-card, #printable-certificate-card * {
    visibility: visible !important;
  }

  #printable-certificate-card {
    position: fixed !important;
    left: 5.5mm !important;
    top: 5mm !important;
    width: 286mm !important;
    height: 200mm !important;
    margin: 0 !important;
    padding: 4mm 8mm 0 8mm !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    border: 3.5mm solid #002865 !important;
    border-bottom: none !important;
    box-shadow: none !important;
    z-index: 9999999 !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
    overflow: hidden !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  #printable-certificate-card::before {
    display: none !important;
  }

  #printable-certificate-card::after {
    display: none !important;
  }

  .cert-corner-geo {
    position: absolute !important;
    display: block !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    z-index: 2 !important;
  }
  .cert-corner-geo-tl {
    top: 0 !important;
    left: 0 !important;
    width: 24mm !important;
    height: 24mm !important;
    z-index: 2 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .cert-logo-badge {
    width: 27mm !important;
    height: 27mm !important;
    margin-left: 4.5mm !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
  }
  .cert-logo-img {
    width: 26mm !important;
    height: 26mm !important;
    object-fit: contain !important;
    filter: none !important;
    display: block !important;
  }
  .cert-corner-geo-br {
    bottom: 0 !important;
    right: 0 !important;
    width: 30mm !important;
    height: 30mm !important;
    z-index: 12 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .cert-bottom-navy-bar {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 7.2mm !important;
    background: #002865 !important;
    border-top: 0.4mm solid #d4af37 !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4mm !important;
    z-index: 20 !important;
    font-size: 7.5pt !important;
    font-weight: 700 !important;
    letter-spacing: 1.8px !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .cert-bottom-navy-bar * {
    color: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .cert-bar-dot {
    color: #f59e0b !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .cert-top-gold-line {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 0.8mm !important;
    background: #eab308 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    z-index: 3 !important;
  }

  .cert-org-name {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 24pt !important;
    font-weight: 900 !important;
    letter-spacing: 2pt !important;
    color: #00205b !important;
    -webkit-print-color-adjust: exact !important;
  }

  .cert-ribbon-banner-wrap,
  .cert-ribbon-banner-img,
  .cert-card-icon-bubble,
  .bubble-course,
  .bubble-accuracy,
  .bubble-speed,
  .bubble-certno,
  .cert-watermark-left,
  .cert-watermark-right {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .cert-ribbon-banner-img {
    width: 520px !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 983 / 107 !important;
    display: block !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .cert-card-icon-bubble svg {
    display: block !important;
  }

  .bubble-course { background: #0284c7 !important; }
  .bubble-accuracy { background: #16a34a !important; }
  .bubble-speed { background: #6366f1 !important; }
  .bubble-certno { background: #d97706 !important; }

  .cert-typing-tag {
    background: #eef2ff !important;
    border: 1px solid #1e3a8a !important;
    color: #1e3a8a !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .cert-metric-pill {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    min-height: 18mm !important;
    padding: 3mm 2mm !important;
    box-sizing: border-box !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .cert-watermark-bg {
    opacity: 0.08 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .cert-customizer-toolbar, .app-header, .main-nav, .row-practice-toolbar, .cert-photo-notice {
    display: none !important;
  }

  .cert-photo-frame-wrap {
    width: 30mm !important;
    position: relative !important;
    top: 0.2in !important;
  }

  .cert-photo-frame {
    width: 27mm !important;
    height: 33mm !important;
    border: 0.6mm solid #eab308 !important;
    outline: 0.4mm solid #00205b !important;
    background: #ffffff !important;
    box-shadow: none !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .cert-photo-frame .photo-hint {
    display: none !important;
  }
}

/* ==========================================
   BUBBLE TYPING GAME COMPONENT
   ========================================== */
.game-container-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.game-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Bubble Game Top Bar - Centered Title & Subtitle */
.bubble-top-bar {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  gap: 0.85rem !important;
}

.bubble-game-branding {
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
}

.bubble-game-title {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  font-size: 1.45rem !important;
  font-weight: 800 !important;
  color: #f8fafc !important;
  margin: 0 0 0.35rem 0 !important;
  letter-spacing: -0.01em;
}

.bubble-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bubble-game-subtitle {
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  margin: 0 !important;
  font-size: 0.88rem !important;
  color: #94a3b8 !important;
}

.bubble-hud-bar {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 0.6rem !important;
  width: 100% !important;
}

.game-hud-bar {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.game-hud-item {
  background: #0f172a;
  border: 1px solid var(--card-border);
  border-radius: 0.5rem;
  padding: 0.35rem 0.75rem;
  text-align: center;
  min-width: 75px;
}

.hud-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.hud-val {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
}

.game-config-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--card-border);
  padding: 0.6rem 0.85rem;
  border-radius: 0.5rem;
}

.game-config-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.config-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #94a3b8;
}

.btn-group-pill {
  display: inline-flex;
  gap: 0.25rem;
  background: #020617;
  padding: 0.2rem;
  border-radius: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-game-opt {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 0.25rem 0.6rem;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 0.3rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-game-opt:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.btn-game-opt.active {
  background: var(--primary-color);
  color: #ffffff;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.5);
}

.toggle-game-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-muted);
}

.toggle-game-label input {
  cursor: pointer;
}

.game-actions-group {
  display: flex;
  gap: 0.4rem;
}

/* Bubble Config Bar - Strictly Single-Line Layout */
.bubble-config-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  gap: 0.5rem !important;
  padding: 0.45rem 0.75rem !important;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
}

.bubble-config-bar::-webkit-scrollbar {
  height: 4px;
}

.bubble-config-bar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.bubble-config-bar .game-config-group {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  flex-shrink: 0 !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
}

.bubble-config-bar .btn-group-pill {
  padding: 0.15rem 0.25rem !important;
  gap: 0.2rem !important;
}

.bubble-config-bar .btn-game-opt {
  padding: 0.22rem 0.5rem !important;
  font-size: 0.76rem !important;
  white-space: nowrap !important;
}

.bubble-config-bar .config-label,
.bubble-config-bar .toggle-game-label {
  font-size: 0.78rem !important;
  white-space: nowrap !important;
}

.bubble-config-bar .game-actions-group {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

.bubble-config-bar .game-actions-group .btn {
  padding: 0.32rem 0.8rem !important;
  font-size: 0.8rem !important;
  white-space: nowrap !important;
}

/* Bubble Arena */
.bubble-arena-wrapper {
  position: relative;
  width: 100%;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 2px solid #1e3a8a;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(30, 58, 138, 0.2);
}

.bubble-arena {
  position: relative;
  width: 100%;
  height: 520px;
  background: radial-gradient(ellipse at 50% 100%, #172554 0%, #0b132b 55%, #050814 100%);
  overflow: hidden;
  outline: none;
  user-select: none;
}

.bubble-arena.arena-flash-red {
  animation: flashRed 0.2s ease-out;
}

@keyframes flashRed {
  0% { box-shadow: inset 0 0 40px rgba(239, 68, 68, 0.7); }
  100% { box-shadow: inset 0 0 0px transparent; }
}

/* Ceiling Warning Danger Line */
.bubble-arena::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #ef4444, #f59e0b, #ef4444);
  opacity: 0.75;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.8);
  z-index: 5;
}

/* Individual Floating Bubble */
.bubble-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  z-index: 10;
  will-change: transform;
  transition: box-shadow 0.15s ease;
}

/* Glassmorphic Bubble Glow Variations */
.bubble-theme-blue {
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.7), rgba(59, 130, 246, 0.35) 45%, rgba(30, 58, 138, 0.75) 90%);
  border: 2px solid rgba(147, 197, 253, 0.8);
  box-shadow: inset 0 0 16px rgba(255, 255, 255, 0.45), 0 0 18px rgba(59, 130, 246, 0.45);
}

.bubble-theme-emerald {
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.7), rgba(16, 185, 129, 0.35) 45%, rgba(6, 78, 59, 0.75) 90%);
  border: 2px solid rgba(110, 231, 183, 0.8);
  box-shadow: inset 0 0 16px rgba(255, 255, 255, 0.45), 0 0 18px rgba(16, 185, 129, 0.45);
}

.bubble-theme-amber {
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.7), rgba(245, 158, 11, 0.35) 45%, rgba(120, 53, 15, 0.75) 90%);
  border: 2px solid rgba(252, 211, 77, 0.8);
  box-shadow: inset 0 0 16px rgba(255, 255, 255, 0.45), 0 0 18px rgba(245, 158, 11, 0.45);
}

.bubble-theme-purple {
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.7), rgba(168, 85, 247, 0.35) 45%, rgba(88, 28, 135, 0.75) 90%);
  border: 2px solid rgba(216, 180, 254, 0.8);
  box-shadow: inset 0 0 16px rgba(255, 255, 255, 0.45), 0 0 18px rgba(168, 85, 247, 0.45);
}

.bubble-theme-rose {
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.7), rgba(244, 63, 94, 0.35) 45%, rgba(136, 19, 55, 0.75) 90%);
  border: 2px solid rgba(253, 164, 175, 0.8);
  box-shadow: inset 0 0 16px rgba(255, 255, 255, 0.45), 0 0 18px rgba(244, 63, 94, 0.45);
}

.bubble-char {
  font-family: var(--font-devnagari);
  font-size: 1.95rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
  pointer-events: none;
}

.bubble-key-hint {
  font-size: 0.68rem;
  font-weight: 700;
  color: #f1f5f9;
  background: rgba(0, 0, 0, 0.65);
  padding: 0.05rem 0.35rem;
  border-radius: 0.6rem;
  margin-top: 1px;
  line-height: 1.2;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Popping Burst Animation */
.bubble-pop-burst {
  position: absolute;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  pointer-events: none;
  animation: bubblePopEffect 0.35s ease-out forwards;
  z-index: 20;
}

@keyframes bubblePopEffect {
  0% { transform: scale(1); opacity: 1; border: 3px solid #ffffff; }
  50% { transform: scale(1.6); opacity: 0.8; border: 2px solid #60a5fa; }
  100% { transform: scale(2.2); opacity: 0; border: 1px solid transparent; }
}

.floating-score-tag {
  position: absolute;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fbbf24;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  animation: floatScore 0.7s ease-out forwards;
  z-index: 30;
}

@keyframes floatScore {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-40px); opacity: 0; }
}

/* Overlay Banners (Start / Pause / Game Over) */
.game-arena-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  text-align: center;
  padding: 1.5rem;
}

.overlay-content {
  max-width: 480px;
  background: #0f172a;
  border: 1px solid var(--card-border);
  padding: 1.75rem;
  border-radius: 0.75rem;
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.6);
}

.game-footer-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ==========================================================================
   GAME HUB: SUB-GAME SWITCHER TABS
   ========================================================================== */
.game-hub-switcher-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.65rem;
  background: #090d16;
  padding: 0.5rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.btn-subgame-tab {
  flex: 1 1 180px;
  min-height: 52px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  padding: 0.65rem 1rem;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: 0.6rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.45rem;
  user-select: none;
  box-sizing: border-box;
}

.btn-subgame-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.btn-subgame-tab.active {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #ffffff;
  border-color: rgba(147, 197, 253, 0.4);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.btn-subgame-tab[data-subgame="shooter"].active {
  background: linear-gradient(135deg, #b45309, #ea580c, #dc2626);
  border-color: rgba(253, 186, 116, 0.5);
  box-shadow: 0 4px 16px rgba(234, 88, 12, 0.45);
}

.btn-subgame-tab[data-subgame="carrace"].active {
  background: linear-gradient(135deg, #0f766e, #0284c7, #2563eb);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.45);
}

.btn-subgame-tab[data-subgame="fishing"].active {
  background: linear-gradient(135deg, #0369a1, #0284c7, #06b6d4);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.45);
}

.btn-subgame-tab[data-subgame="battleroyale"].active {
  background: linear-gradient(135deg, #0284c7, #2563eb, #7c3aed);
  border-color: rgba(0, 243, 255, 0.6);
  box-shadow: 0 4px 18px rgba(0, 243, 255, 0.45);
}

@media (max-width: 992px) {
  .game-hub-switcher-bar {
    gap: 0.5rem;
    padding: 0.4rem;
  }
  .btn-subgame-tab {
    flex: 1 1 150px;
    font-size: 0.84rem;
    padding: 0.55rem 0.75rem;
    min-height: 46px;
  }
}

@media (max-width: 600px) {
  .game-hub-switcher-bar {
    gap: 0.4rem;
    padding: 0.35rem;
  }
  .btn-subgame-tab {
    flex: 1 1 100%;
    min-height: 44px;
    font-size: 0.85rem;
  }
  .row-practice-toolbar {
    padding: 0.35rem 0.5rem;
    gap: 0.3rem;
    flex-wrap: nowrap;
  }
  .row-toolbar-title {
    font-size: 0.7rem;
    width: auto;
    flex-shrink: 0;
  }
  .row-buttons-group {
    width: auto;
    flex-wrap: nowrap;
  }
  .btn-row-select {
    font-size: 0.68rem;
    padding: 0.2rem 0.45rem;
    flex-shrink: 0;
  }
}

.subgame-panel {
  width: 100%;
}

/* ==========================================================================
/* ==========================================================================
   FREE FIRE STYLE WORD SHOOTER BATTLEGROUND (MODERN TACTICAL CYBER LOOKS)
   ========================================================================== */
.ff-container-theme {
  position: relative;
  background: radial-gradient(120% 100% at 50% 0%, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.95) 55%, rgba(7, 11, 20, 0.98) 100%);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 1.25rem;
  padding: 1.5rem;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.75), 0 0 35px rgba(245, 158, 11, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.ff-container-theme::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #ef4444 0%, #f59e0b 35%, #eab308 65%, #38bdf8 100%);
  opacity: 0.95;
}

/* 1. Header & Title Area */
.ff-top-bar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
  width: 100%;
}

.ff-top-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  width: 100%;
}

.ff-header-right-cluster {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ff-header-rank-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

.ff-header-rank-pill .pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseDot 1.5s infinite alternate;
}

@keyframes pulseDot {
  0% { transform: scale(0.8); opacity: 0.7; }
  100% { transform: scale(1.3); opacity: 1; }
}

.ff-btn-map-pill {
  background: rgba(30, 41, 59, 0.85) !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  color: #38bdf8 !important;
  font-weight: 700 !important;
  padding: 0.35rem 0.85rem !important;
  border-radius: 999px !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ff-btn-map-pill:hover {
  background: rgba(56, 189, 248, 0.2) !important;
  border-color: #38bdf8 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3) !important;
}

.ff-brand-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.ff-badge-flame {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  background: linear-gradient(135deg, #dc2626 0%, #ea580c 55%, #f59e0b 100%);
  color: #ffffff;
  padding: 0.25rem 0.7rem;
  border-radius: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 14px rgba(234, 88, 12, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
}

.ff-game-heading {
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  font-weight: 900;
  margin: 0;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, #ffffff 0%, #fef08a 35%, #f59e0b 70%, #ea580c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 20px rgba(245, 158, 11, 0.25);
}

.ff-game-subdesc {
  font-size: 0.88rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.55;
  max-width: 600px;
}

.text-booyah {
  background: linear-gradient(135deg, #fef08a, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
  letter-spacing: 0.5px;
}

/* 2. Cyber Battleground Metrics HUD - Full 100% Width Stretched */
.ff-hud-bar {
  display: flex;
  align-items: stretch;
  width: 100%;
  gap: 0.65rem;
  flex-wrap: nowrap;
}

.ff-hud-bar .game-hud-item {
  flex: 1 1 0;
  min-width: 0;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.75) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 0.65rem;
  padding: 0.45rem 0.65rem;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.ff-hud-bar .game-hud-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
}

.ff-hud-bar .game-hud-item:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5), 0 0 10px rgba(245, 158, 11, 0.15);
}

.ff-hud-bar .hud-label {
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
  margin-bottom: 0.15rem;
  white-space: nowrap;
}

.ff-hud-bar .hud-val {
  font-size: 1.15rem;
  font-weight: 900;
  font-family: var(--font-mono, monospace);
  line-height: 1.2;
  white-space: nowrap;
}

/* Free Fire Health (HP) HUD Bar */
.ff-hp-hud-item {
  flex: 2 1 0 !important;
  min-width: 0 !important;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.95) 100%) !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
  padding: 0.45rem 0.85rem !important;
  align-items: stretch !important;
}

.ff-hp-hud-item::before {
  background: #10b981 !important;
}

.ff-hp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 0.3rem;
}

.hp-heart-icon {
  display: inline-block;
  animation: heartPulse 1.6s infinite ease-in-out;
}

@keyframes heartPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

.ff-hp-digits {
  font-size: 0.82rem;
  font-weight: 900;
  color: #34d399;
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.3px;
}

.ff-hp-track {
  width: 100%;
  height: 8px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.7);
}

.ff-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #059669 0%, #10b981 60%, #34d399 100%);
  border-radius: 999px;
  transition: width 0.25s ease, background-color 0.25s ease;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
}

/* HUD Item Accent Themes */
.hud-stat-kills .hud-val { color: #f87171; text-shadow: 0 0 8px rgba(239, 68, 68, 0.4); }
.hud-stat-kills::before { background: #ef4444 !important; }

.hud-stat-score .hud-val { color: #fbbf24; text-shadow: 0 0 8px rgba(245, 158, 11, 0.4); }
.hud-stat-score::before { background: #f59e0b !important; }

.hud-stat-streak .hud-val { color: #34d399; text-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }
.hud-stat-streak::before { background: #10b981 !important; }

.hud-stat-level .hud-val { color: #fde047; text-shadow: 0 0 8px rgba(234, 179, 8, 0.4); }
.hud-stat-level::before { background: #eab308 !important; }

.hud-stat-target .hud-val { color: #38bdf8; text-shadow: 0 0 8px rgba(56, 189, 248, 0.4); }
.hud-stat-target::before { background: #38bdf8 !important; }

.hud-stat-highscore .hud-val { color: #c084fc; text-shadow: 0 0 8px rgba(192, 132, 252, 0.4); }
.hud-stat-highscore::before { background: #c084fc !important; }

/* 3. Free Fire Controls & Weapon Arsenal Bar - Structured 2-Row Balanced Dashboard */
.ff-config-bar {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.65) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.85rem;
  padding: 0.75rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  width: 100%;
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.4);
}

.ff-config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.ff-config-row-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.09), transparent);
  width: 100%;
}

.ff-subgroup-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ff-combat-speed-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.3);
  color: #38bdf8;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 0.5rem;
}

.ff-combat-speed-badge strong {
  color: #7dd3fc;
  font-weight: 800;
}

.ff-weapon-pill-group {
  display: inline-flex;
  gap: 0.35rem;
  background: rgba(10, 15, 28, 0.9);
  padding: 0.25rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ff-weapon-pill-group .btn-game-opt {
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 0.45rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ff-weapon-pill-group .btn-game-opt:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
}

.ff-weapon-pill-group .btn-game-opt[data-weapon].active {
  background: linear-gradient(135deg, #ea580c 0%, #d97706 100%);
  color: #ffffff;
  border-color: rgba(251, 191, 36, 0.5);
  box-shadow: 0 2px 10px rgba(234, 88, 12, 0.5);
  font-weight: 800;
}

.ff-hint-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(10, 15, 28, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.35rem 0.75rem;
  border-radius: 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ff-hint-toggle:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(56, 189, 248, 0.4);
  color: #ffffff;
}

.ff-btn-voice {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(245, 158, 11, 0.12) !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  color: #fbbf24 !important;
  padding: 0.38rem 0.8rem !important;
  border-radius: 0.55rem !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ff-btn-voice:hover {
  background: rgba(245, 158, 11, 0.25) !important;
  border-color: #f59e0b !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* Battle Action Buttons */
.ff-actions-group {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.ff-btn-start-battle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #ea580c 0%, #dc2626 50%, #991b1b 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  border-radius: 0.65rem !important;
  padding: 0.55rem 1.25rem !important;
  font-size: 0.92rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(234, 88, 12, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.ff-btn-start-battle:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(234, 88, 12, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  background: linear-gradient(135deg, #f97316 0%, #ea580c 50%, #b91c1c 100%) !important;
}

.btn-flame-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  animation: shineSweep 3.5s infinite;
}

.ff-btn-pause-battle, .ff-btn-restart-battle, .ff-btn-exit-battle {
  background: rgba(15, 23, 42, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #e2e8f0 !important;
  border-radius: 0.6rem !important;
  padding: 0.5rem 0.95rem !important;
  font-size: 0.84rem !important;
  font-weight: 700 !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ff-btn-pause-battle:hover, .ff-btn-restart-battle:hover, .ff-btn-exit-battle:hover {
  background: rgba(30, 41, 59, 0.95) !important;
  border-color: rgba(245, 158, 11, 0.5) !important;
  color: #ffffff !important;
  transform: translateY(-1px);
}

/* Battleground Arena Container */
.ff-battleground-wrapper {
  position: relative;
  width: 100%;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 2px solid #b45309;
  box-shadow: inset 0 0 35px rgba(0, 0, 0, 0.8), 0 0 25px rgba(234, 88, 12, 0.2);
}

.ff-battleground-arena {
  position: relative;
  width: 100%;
  height: 520px;
  background: #070b14;
  overflow: hidden;
  outline: none;
  user-select: none;
  perspective: 600px;
}

/* Sky and 3D Perspective Battlefield Grid */
.ff-arena-sky {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 140px;
  background: radial-gradient(ellipse at 50% 0%, #311b92 0%, #1e1b4b 45%, #070b14 100%);
  opacity: 0.85;
  pointer-events: none;
}

.ff-arena-grid {
  position: absolute;
  top: 60px;
  left: -20%;
  width: 140%;
  height: 500px;
  background-image: 
    linear-gradient(rgba(234, 88, 12, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(234, 88, 12, 0.12) 1px, transparent 1px);
  background-size: 50px 50px;
  transform: rotateX(60deg);
  transform-origin: top center;
  opacity: 0.55;
  pointer-events: none;
}

/* Danger Perimeter Line */
.ff-defense-line {
  position: absolute;
  bottom: 92px;
  left: 0;
  right: 0;
  height: 24px;
  background: repeating-linear-gradient(
    45deg,
    rgba(220, 38, 38, 0.85),
    rgba(220, 38, 38, 0.85) 15px,
    rgba(15, 23, 42, 0.95) 15px,
    rgba(15, 23, 42, 0.95) 30px
  );
  border-top: 2px solid #ef4444;
  border-bottom: 2px solid #ef4444;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
}

.ff-defense-line span {
  font-size: 0.65rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 1px;
  text-shadow: 0 0 4px #000000;
  background: rgba(0, 0, 0, 0.6);
  padding: 0 0.5rem;
  border-radius: 4px;
}

/* Layer for Enemies, Tracers, Particles */
.ff-enemies-layer,
.ff-particles-layer {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 15;
}

.ff-tracers-svg {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: 20;
}

/* Laser Bullet Tracer Beam */
.laser-tracer-beam {
  filter: drop-shadow(0 0 8px #ff9100) drop-shadow(0 0 14px #ff5722);
  animation: tracerFlash 0.12s ease-out forwards;
}

@keyframes tracerFlash {
  0% { opacity: 1; stroke-width: 4px; }
  100% { opacity: 0.15; stroke-width: 1.5px; }
}

/* Individual Advancing Combat Bot */
.ff-combat-bot {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
  will-change: transform;
  transition: filter 0.1s ease;
  pointer-events: auto;
  z-index: 16;
}

.bot-avatar-wrap {
  position: relative;
  width: 46px;
  height: 46px;
  background: radial-gradient(circle, #1e293b 0%, #0b0f19 90%);
  border: 2px solid #ea580c;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(234, 88, 12, 0.45);
}

.bot-avatar {
  font-size: 1.45rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

.bot-radar-ping {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid #ea580c;
  animation: botRadar 1.6s infinite ease-out;
  pointer-events: none;
}

@keyframes botRadar {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* Bot Word Card */
.bot-word-card {
  margin-top: 0.35rem;
  background: rgba(15, 23, 42, 0.92);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.5rem;
  padding: 0.35rem 0.65rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  backdrop-filter: blur(4px);
  min-width: 90px;
}

.bot-target-word {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

/* Character highlight states */
.char-hit {
  color: #10b981;
  text-shadow: 0 0 8px rgba(16, 185, 129, 0.85);
}

.char-active {
  color: #f59e0b;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.95);
  text-decoration: underline;
  text-underline-offset: 3px;
  animation: activeCharPulse 0.4s infinite alternate ease-in-out;
}

@keyframes activeCharPulse {
  0% { opacity: 0.8; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.15); }
}

.char-pending {
  color: #f8fafc;
}

/* Key Hints Crumb under Word */
.bot-key-hints {
  display: flex;
  gap: 0.2rem;
  margin-top: 0.25rem;
  flex-wrap: wrap;
  justify-content: center;
}

.key-crumb {
  font-size: 0.65rem;
  font-weight: 700;
  background: #334155;
  color: #cbd5e1;
  padding: 0.08rem 0.32rem;
  border-radius: 0.25rem;
  border: 1px solid #475569;
}

.key-crumb.crumb-done {
  background: #065f46;
  border-color: #10b981;
  color: #a7f3d0;
}

.key-crumb.crumb-next {
  background: #d97706;
  border-color: #fbbf24;
  color: #ffffff;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.8);
}

.key-crumb.crumb-space {
  font-family: inherit;
  padding: 0.08rem 0.45rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.key-crumb.crumb-space-pending {
  opacity: 0.6;
  border-style: dashed;
}

.key-crumb.crumb-space-ready {
  background: linear-gradient(135deg, #f59e0b, #ef4444) !important;
  border-color: #fef08a !important;
  color: #ffffff !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.95), 0 0 18px rgba(239, 68, 68, 0.6) !important;
  animation: spaceCrumbPulse 0.75s infinite alternate ease-in-out;
}

@keyframes spaceCrumbPulse {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.08); filter: brightness(1.25); box-shadow: 0 0 14px rgba(245, 158, 11, 1), 0 0 22px rgba(239, 68, 68, 0.85); }
}

/* Word space badge indicator */
.word-space-indicator {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  padding: 0.1rem 0.42rem;
  border-radius: 0.3rem;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.word-space-indicator.ready {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  border: 1px solid #fde047;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.9), 0 0 20px rgba(239, 68, 68, 0.5);
  animation: spaceGlowPulse 0.7s infinite alternate ease-in-out;
}

@keyframes spaceGlowPulse {
  0% { transform: scale(0.96); box-shadow: 0 0 8px rgba(245, 158, 11, 0.7); }
  100% { transform: scale(1.06); box-shadow: 0 0 16px rgba(245, 158, 11, 1), 0 0 26px rgba(239, 68, 68, 0.7); }
}

/* Ready for Space bot state */
.ff-combat-bot.bot-ready-space .bot-avatar-wrap {
  border-color: #f59e0b !important;
  box-shadow: 0 0 24px rgba(245, 158, 11, 1), 0 0 32px rgba(239, 68, 68, 0.8) !important;
  animation: spaceCrumbPulse 0.75s infinite alternate ease-in-out;
}

.ff-combat-bot.bot-ready-space .bot-word-card {
  border-color: #f59e0b !important;
  background: rgba(30, 27, 75, 0.95) !important;
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.85), inset 0 0 12px rgba(245, 158, 11, 0.3) !important;
}

/* Locked Bot State */
.bot-locked .bot-avatar-wrap {
  border-color: #ef4444;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.9);
}

.bot-locked .bot-word-card {
  border-color: #ef4444;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.6);
}

/* Player Crosshair Sight Reticle */
.ff-crosshair {
  position: absolute;
  top: 0;
  left: 0;
  width: 70px;
  height: 70px;
  pointer-events: none;
  z-index: 22;
  transition: transform 0.08s ease-out, opacity 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ff-crosshair-ring {
  position: absolute;
  width: 52px;
  height: 52px;
  border: 2px dashed #00e5ff;
  border-radius: 50%;
  animation: crosshairRotate 5s linear infinite;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.6);
}

@keyframes crosshairRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.ff-crosshair.locked .ff-crosshair-ring {
  border-color: #ef4444;
  border-style: solid;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.9);
}

.ff-crosshair-dot {
  width: 6px;
  height: 6px;
  background: #00e5ff;
  border-radius: 50%;
  box-shadow: 0 0 8px #00e5ff;
}

.ff-crosshair.locked .ff-crosshair-dot {
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
}

.ff-crosshair-target-tag {
  position: absolute;
  bottom: -18px;
  font-size: 0.6rem;
  font-weight: 800;
  color: #ef4444;
  background: rgba(0, 0, 0, 0.75);
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  letter-spacing: 0.5px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.ff-crosshair.locked .ff-crosshair-target-tag {
  opacity: 1;
}

/* ==========================================================================
   FIRST-PERSON SHOOTER WEAPON RIG & ACTION DYNAMICS
   ========================================================================== */
.ff-gun-rig {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
  z-index: 26;
  perspective: 500px;
}

.ff-gun-model {
  position: relative;
  width: 140px;
  height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  transform-origin: bottom center;
  transition: transform 0.06s cubic-bezier(0.1, 0.9, 0.2, 1);
}

.ff-gun-model.recoil {
  animation: fpsGunKick 0.12s ease-out forwards;
}

@keyframes fpsGunKick {
  0% { transform: translateY(0) scale(1); }
  25% { transform: translateY(18px) scale(0.92) rotate(-1.5deg); }
  60% { transform: translateY(8px) scale(0.97); }
  100% { transform: translateY(0) scale(1); }
}

/* Gun Components */
.gun-muzzle-brake {
  width: 20px;
  height: 16px;
  background: linear-gradient(90deg, #1e293b, #475569, #1e293b);
  border: 1px solid #94a3b8;
  border-radius: 3px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
  margin-bottom: -2px;
  z-index: 3;
}

.gun-barrel-tube {
  width: 14px;
  height: 38px;
  background: linear-gradient(90deg, #0f172a, #334155, #0f172a);
  border-left: 1px solid #475569;
  border-right: 1px solid #475569;
  z-index: 2;
}

.gun-handguard {
  width: 38px;
  height: 35px;
  background: linear-gradient(90deg, #78350f, #b45309, #78350f);
  border-radius: 6px 6px 4px 4px;
  border: 1px solid rgba(251, 191, 36, 0.4);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.7);
  z-index: 4;
}

.gun-holographic-optic {
  position: absolute;
  top: 32px;
  width: 32px;
  height: 22px;
  background: rgba(15, 23, 42, 0.9);
  border: 2px solid #38bdf8;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
  z-index: 6;
}

.optic-reticle-dot {
  width: 5px;
  height: 5px;
  background: #ff0055;
  border-radius: 50%;
  box-shadow: 0 0 8px #ff0055, 0 0 14px #ff0055;
  animation: dotPulse 1.5s infinite alternate ease-in-out;
}

@keyframes dotPulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.2); opacity: 1; }
}

.gun-receiver {
  position: relative;
  width: 52px;
  height: 48px;
  background: linear-gradient(180deg, #334155 0%, #1e293b 60%, #0f172a 100%);
  border: 1.5px solid #64748b;
  border-radius: 6px 6px 0 0;
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.15), 0 5px 15px rgba(0, 0, 0, 0.8);
  z-index: 5;
}

.gun-bolt {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 14px;
  height: 8px;
  background: #f59e0b;
  border-radius: 2px;
}

.gun-magazine {
  position: absolute;
  bottom: -22px;
  left: 14px;
  width: 24px;
  height: 32px;
  background: linear-gradient(135deg, #1e293b, #090d16);
  border: 1px solid #475569;
  border-radius: 3px;
  transform: rotate(-12deg);
}

/* Combat Tactical Hands Gripping Gun */
.tactical-hand {
  position: absolute;
  width: 42px;
  height: 46px;
  background: linear-gradient(135deg, #475569 0%, #1e293b 100%);
  border: 1.5px solid #64748b;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
  z-index: 7;
}

.tactical-hand.hand-l {
  left: -22px;
  bottom: 24px;
  transform: rotate(-25deg);
}

.tactical-hand.hand-r {
  right: -22px;
  bottom: 12px;
  transform: rotate(20deg);
}

/* Weapon Skins: AK47, MP40, AWM */
.ff-gun-model.mp40 .gun-handguard {
  background: linear-gradient(90deg, #1e293b, #334155, #1e293b);
  border-color: #fbbf24;
  height: 28px;
}

.ff-gun-model.awm .gun-barrel-tube {
  height: 52px;
  border-left-color: #00e5ff;
  border-right-color: #00e5ff;
}

.ff-gun-model.awm .gun-handguard {
  background: linear-gradient(90deg, #064e3b, #047857, #064e3b);
  border-color: #34d399;
}

/* Explosive Muzzle Flash */
.ff-muzzle-flash {
  position: absolute;
  top: -38px;
  left: 50%;
  transform: translateX(-50%) scale(0.3);
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, #ffffff 0%, #fff7ed 25%, #ffb703 45%, #ea580c 75%, transparent 100%);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  z-index: 28;
  filter: drop-shadow(0 0 20px #ff9100) drop-shadow(0 0 35px #dc2626);
}

.ff-muzzle-flash.active {
  animation: explosiveMuzzleFire 0.09s ease-out forwards;
}

@keyframes explosiveMuzzleFire {
  0% { opacity: 1; transform: translateX(-50%) scale(1.6) rotate(15deg); }
  50% { opacity: 0.9; transform: translateX(-50%) scale(1.8) rotate(-10deg); }
  100% { opacity: 0; transform: translateX(-50%) scale(0.5); }
}

/* Brass Shell Ejection */
.ejected-shell {
  position: absolute;
  top: 50px;
  right: 40px;
  width: 12px;
  height: 5px;
  background: linear-gradient(90deg, #fef08a, #d97706);
  border-radius: 2px;
  box-shadow: 0 0 4px #fbbf24;
  pointer-events: none;
  z-index: 25;
  animation: shellSpinEject 0.4s cubic-bezier(0.2, 0.8, 0.4, 1) forwards;
}

@keyframes shellSpinEject {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  60% { transform: translate(45px, -35px) rotate(360deg); opacity: 0.9; }
  100% { transform: translate(75px, 30px) rotate(720deg); opacity: 0; }
}

/* Rising Barrel Smoke */
.barrel-smoke-puff {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  background: radial-gradient(circle, rgba(203, 213, 225, 0.6) 0%, rgba(148, 163, 184, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: smokeRise 0.6s ease-out forwards;
}

@keyframes smokeRise {
  0% { transform: translateX(-50%) scale(0.6); opacity: 0.8; }
  100% { transform: translateX(calc(-50% + 15px)) translateY(-45px) scale(2.5); opacity: 0; }
}

/* Arena Camera Recoil Micro-Kick */
.ff-battleground-arena.arena-cam-kick {
  animation: camMicroKick 0.08s ease-out;
}

@keyframes camMicroKick {
  0% { transform: translateY(0); }
  40% { transform: translateY(3px) scale(0.998); }
  100% { transform: translateY(0) scale(1); }
}

/* Floating Free Fire Damage Numbers (Yellow & Red) */
.ff-damage-layer {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 32;
}

.ff-dmg-num {
  position: absolute;
  font-family: 'Impact', sans-serif, system-ui;
  font-size: 1.45rem;
  font-weight: 900;
  color: #ffea00;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.9), 0 2px 4px #b45309;
  pointer-events: none;
  animation: dmgFloat 0.65s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
  letter-spacing: 0.5px;
}

.ff-dmg-num.critical {
  font-size: 2.2rem;
  color: #ff1744;
  text-shadow: 0 0 12px #ff1744, 0 0 20px #ff6b00, 0 2px 6px #000;
  animation: criticalJump 0.85s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes dmgFloat {
  0% { transform: translate(-50%, 0) scale(0.5); opacity: 1; }
  30% { transform: translate(-50%, -18px) scale(1.3); opacity: 1; }
  100% { transform: translate(-50%, -45px) scale(0.9); opacity: 0; }
}

@keyframes criticalJump {
  0% { transform: translate(-50%, 0) scale(0.4) rotate(-8deg); opacity: 1; }
  35% { transform: translate(-50%, -28px) scale(1.45) rotate(4deg); opacity: 1; }
  75% { transform: translate(-50%, -48px) scale(1.2) rotate(0deg); opacity: 1; }
  100% { transform: translate(-50%, -75px) scale(0.85); opacity: 0; }
}

/* Atmospheric Warzone Fire Embers Layer */
.ff-embers-layer {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 8;
  overflow: hidden;
}

.warzone-ember {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #ff9100;
  border-radius: 50%;
  box-shadow: 0 0 6px #ff5722, 0 0 10px #ff9100;
  opacity: 0.8;
  animation: emberDrift var(--duration) linear infinite;
}

@keyframes emberDrift {
  0% { transform: translate(0, 520px) scale(1); opacity: 0; }
  15% { opacity: 0.85; }
  85% { opacity: 0.7; }
  100% { transform: translate(var(--drift-x), -30px) scale(0.3); opacity: 0; }
}

.ff-muzzle-flash.active {
  animation: muzzleBlast 0.08s ease-out forwards;
}

@keyframes muzzleBlast {
  0% { opacity: 1; transform: scale(1.4); }
  100% { opacity: 0; transform: scale(0.6); }
}

/* Hit Sparks & Explosion Particles */
.hit-spark-particle {
  position: absolute;
  width: 5px;
  height: 5px;
  background: #ffea00;
  border-radius: 50%;
  pointer-events: none;
  animation: hitSparkFly 0.32s ease-out forwards;
}

@keyframes hitSparkFly {
  0% { transform: translate(0, 0) scale(1.4); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; }
}

.ff-shockwave-ring {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid #ff6b00;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: shockwaveExpand 0.45s ease-out forwards;
}

@keyframes shockwaveExpand {
  0% { transform: translate(-50%, -50%) scale(0.3); opacity: 1; border-width: 4px; }
  100% { transform: translate(-50%, -50%) scale(2.4); opacity: 0; border-width: 1px; }
}

.explosion-fire-particle {
  position: absolute;
  width: 7px;
  height: 7px;
  background: radial-gradient(circle, #fff, #ff9100, #dc2626);
  border-radius: 50%;
  pointer-events: none;
  animation: fireFly 0.42s ease-out forwards;
}

@keyframes fireFly {
  0% { transform: translate(0, 0) scale(1.5); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0.1); opacity: 0; }
}

/* Free Fire Kill Announcement Banner */
.ff-announcement-banner {
  position: absolute;
  top: 65px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.95), rgba(180, 83, 9, 0.95));
  border: 2px solid #fde047;
  padding: 0.5rem 1.6rem;
  border-radius: 0.5rem;
  box-shadow: 0 0 25px rgba(234, 88, 12, 0.8), 0 8px 20px rgba(0, 0, 0, 0.8);
  text-align: center;
  pointer-events: none;
  z-index: 35;
}

.ff-announcement-banner.banner-pop {
  animation: bannerPopIn 1.1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes bannerPopIn {
  0% { opacity: 0; transform: translateX(-50%) scale(0.4) rotate(-4deg); }
  25% { opacity: 1; transform: translateX(-50%) scale(1.15) rotate(0deg); }
  35% { transform: translateX(-50%) scale(1); }
  85% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-25px); }
}

.ff-banner-title {
  font-size: 1.45rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

.ff-banner-sub {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fef08a;
  letter-spacing: 0.5px;
}

/* Arena Damage Shake */
.ff-shake-red {
  animation: shakeDamage 0.35s ease-out;
}

@keyframes shakeDamage {
  0% { box-shadow: inset 0 0 60px rgba(239, 68, 68, 0.9); transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(4px); }
  100% { box-shadow: inset 0 0 0px transparent; transform: translateX(0); }
}

/* Free Fire Overlays */
.ff-overlay {
  background: rgba(3, 7, 18, 0.88);
}

.ff-overlay-card {
  max-width: 520px;
  background: #0b0f19;
  border: 1.5px solid rgba(234, 88, 12, 0.5);
  box-shadow: 0 0 35px rgba(234, 88, 12, 0.3), 0 20px 40px rgba(0, 0, 0, 0.8);
}

.ff-title-gold {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #fef08a 0%, #f59e0b 50%, #ea580c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ff-flame-icon {
  font-size: 3.5rem;
  animation: flameBounce 1.5s infinite alternate ease-in-out;
}

@keyframes flameBounce {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-8px) scale(1.08); }
}

.ff-features-pills {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.86rem;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.6rem 0.85rem;
  border-radius: 0.5rem;
}

.ff-btn-glow {
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.75);
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* BOOYAH Celebration Overlay */
.booyah-card {
  border-color: #eab308;
  box-shadow: 0 0 50px rgba(234, 179, 8, 0.5), 0 25px 50px rgba(0, 0, 0, 0.9);
}

.booyah-trophy-anim {
  font-size: 3.8rem;
  animation: booyahTrophy 1.2s infinite alternate ease-in-out;
}

@keyframes booyahTrophy {
  0% { transform: scale(1) rotate(-4deg); }
  100% { transform: scale(1.18) rotate(4deg); }
}

.ff-booyah-text {
  font-size: 3.8rem;
  font-weight: 900;
  letter-spacing: 3px;
  background: linear-gradient(180deg, #ffffff 0%, #fef08a 35%, #eab308 70%, #ca8a04 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 15px rgba(234, 179, 8, 0.8));
  margin: 0.2rem 0;
}

/* ------------------------------------------------------------- */
/* 10FASTFINGERS SPEED TYPING TEST SYSTEM STYLES                */
/* ------------------------------------------------------------- */

.test-container-card {
  max-width: 1040px;
  margin: 0 auto;
  background: var(--bg-card, #1e293b);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: 1rem;
  padding: 1.2rem 1.6rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   REDESIGNED MODERN 2-TIER TYPING TEST HEADER & CONTROLS (गति परीक्षण ढाँचा)
   ========================================================================== */
.test-toolbar-bar {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.88) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.22);
  border-radius: 0.9rem;
  padding: 0.75rem 1.15rem;
  margin-bottom: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

/* Tier 1: Brand & Category Segmented Bar & Restart */
.test-toolbar-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: nowrap;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.test-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-width: 0;
}

.test-title-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.test-badge-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.test-title-main {
  font-size: 1.05rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.2px;
}

.test-title-nepali {
  font-size: 0.8rem;
  font-weight: 500;
  color: #94a3b8;
  margin-left: 0.15rem;
}

.test-categories-bar {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap !important;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.45rem;
  padding: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.test-categories-bar::-webkit-scrollbar {
  display: none;
}

.btn-test-cat {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 0.32rem 0.62rem;
  font-size: 0.81rem;
  font-weight: 600;
  border-radius: 0.35rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap !important;
  flex-shrink: 0;
}

.btn-test-cat:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.06);
}

.btn-test-cat.active {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.35);
}

.test-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: auto;
}

.btn-test-restart-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  padding: 0.32rem 0.75rem;
  border-radius: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-test-restart-pill:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  transform: translateY(-1px);
}

.restart-kbd {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  padding: 0.08rem 0.35rem;
  font-size: 0.68rem;
  font-family: inherit;
  color: #94a3b8;
}

/* Tier 2: Parameters Strip */
.test-toolbar-row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.test-params-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-width: 0;
}

.test-params-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  margin-left: auto;
}

.test-param-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.test-control-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
}

.test-select {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f8fafc;
  padding: 0.28rem 0.65rem;
  border-radius: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.test-select:focus {
  border-color: #38bdf8;
}

.btn-group-segmented {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.45rem;
  padding: 2px;
}

.btn-test-diff,
.btn-test-time {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 0.28rem 0.65rem;
  font-size: 0.81rem;
  font-weight: 600;
  border-radius: 0.35rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-test-diff:hover,
.btn-test-time:hover {
  color: #f8fafc;
}

.btn-test-diff.active,
.btn-test-time.active {
  background: #3b82f6;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.btn-test-topic-action {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #cbd5e1;
  padding: 0.25rem 0.6rem;
  border-radius: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-test-topic-action:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.btn-test-topic-news {
  background: rgba(14, 165, 233, 0.18);
  border-color: rgba(14, 165, 233, 0.4);
  color: #38bdf8;
}

.btn-test-topic-news:hover {
  background: rgba(14, 165, 233, 0.3);
  color: #ffffff;
}

.badge-test-topic {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #7dd3fc;
  padding: 0.22rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-test-topic.is-news-live {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: #4ade80;
}

.badge-test-topic.is-news-fallback {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.badge-test-topic.is-news-loading {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

@media (max-width: 900px) {
  .test-toolbar-row-top {
    flex-wrap: wrap;
  }
  .test-header-left {
    flex-wrap: wrap;
  }
  .test-header-right {
    margin-left: auto;
  }
}

@media (max-width: 680px) {
  .test-container-card {
    padding: 1rem 0.85rem;
  }
  .test-categories-bar {
    width: 100%;
    overflow-x: auto;
  }
  .test-params-right {
    margin-left: 0;
    width: 100%;
  }
}

/* 10FastFingers Word Stream Box (Single Line with Smooth Horizontal Auto-Scroll) */
.test-words-wrapper {
  background: rgba(15, 23, 42, 0.75);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.85rem;
  padding: 0.75rem 1.4rem;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  cursor: text;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,1) 2%, rgba(0,0,0,1) 98%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,1) 2%, rgba(0,0,0,1) 98%, transparent 100%);
}

.test-words-wrapper:focus-within,
.test-words-wrapper.is-focused {
  border-color: rgba(250, 204, 21, 0.55);
  box-shadow: 0 0 25px rgba(250, 204, 21, 0.15), inset 0 2px 12px rgba(0, 0, 0, 0.4);
}

.test-words-stream-box {
  position: relative;
  height: 58px; /* Single horizontal line of words */
  max-height: 58px;
  width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  overflow-x: hidden !important;
  overflow-y: hidden !important;
  font-size: 1.5rem;
  line-height: 58px;
  font-family: inherit;
  user-select: none;
  scroll-behavior: smooth;
  outline: none;
  cursor: text;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE / Edge */
}

.test-words-inner {
  display: inline-flex;
  align-items: center;
  white-space: nowrap !important;
  flex-shrink: 0;
  position: relative;
  gap: 0.35em; /* Natural typographical space between words */
}

.test-words-stream-box::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
}

.stream-word {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  white-space: nowrap !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 4px;
  transition: color 0.15s ease, opacity 0.15s ease;
  color: #64748b;
  height: 44px;
  line-height: 1;
}

.stream-word.current {
  background: transparent !important;
  color: #ffffff;
  border: none;
  box-shadow: none;
  font-weight: 700;
  transform: none;
}

.stream-word.current.has-error {
  background: transparent !important;
  color: #ef4444 !important;
  border: none !important;
  box-shadow: none !important;
}

.cluster-char {
  display: inline-block;
  white-space: pre !important;
  vertical-align: baseline !important;
  position: relative;
  line-height: inherit;
  box-sizing: border-box;
  padding: 0;
}

.cluster-char.pending {
  color: #ffffff;
}

.cluster-char.correct {
  color: #4ade80;
  background-color: transparent;
}

.cluster-char.corrected {
  color: #fb923c !important;
  background-color: transparent !important;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.cluster-char.current {
  color: #ffffff;
}

.cluster-char.current-partial {
  color: #93c5fd;
}

.cluster-char.incorrect,
.cluster-char.extra-wrong {
  color: #f87171 !important;
  background-color: rgba(239, 68, 68, 0.25) !important;
  border-radius: 3px;
  padding: 0 1px;
}



.stream-word.correct {
  color: #10b981;
  font-weight: 600;
  opacity: 0.85;
}

.stream-word.wrong {
  color: #ef4444 !important;
  font-weight: 600;
  text-decoration: none;
  opacity: 0.95;
}

/* Monkeytype-Style Caret for Speed Test */
#test-monkeytype-caret {
  position: absolute;
  width: 3.5px !important;
  background-color: #facc15 !important;
  border-radius: 2px !important;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.95), 0 0 4px #facc15 !important;
  pointer-events: none;
  z-index: 60;
  will-change: left, top;
}

#test-monkeytype-caret.blinking {
  animation: testCaretPulse 1s infinite ease-in-out !important;
}

#test-monkeytype-caret.typing {
  animation: none !important;
  opacity: 1 !important;
}

#test-monkeytype-caret.caret-error {
  background-color: #ef4444 !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.95), 0 0 4px #ef4444 !important;
}

@keyframes testCaretPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.15; }
}

/* Hidden Typing Input capturing keystrokes */
.test-typing-input-hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  border: none;
  background: transparent;
  outline: none;
}

/* Live Countdown Timer & Status Bar (Above Word Stream) */
.test-timer-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  margin-bottom: 0.65rem;
  padding: 0 0.25rem;
}

.test-focus-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
  user-select: none;
}

.test-focus-indicator .focus-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
  display: inline-block;
}

.test-timer-badge {
  min-width: 90px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(250, 204, 21, 0.45);
  color: #facc15;
  font-size: 1.35rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  border-radius: 0.55rem;
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.15);
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.test-timer-badge.timer-warning {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #f87171;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
  animation: timerPulse 0.8s infinite alternate ease-in-out;
}

@keyframes timerPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

.test-hints-footer {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.84rem;
  color: #94a3b8;
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* 10FastFingers Result Scorecard Modal */
#test-results-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-in-out;
}

#test-results-modal.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.test-results-card {
  max-width: 520px;
  width: 92%;
  max-height: 94vh;
  overflow-y: auto;
  text-align: center;
  padding: 1.5rem 1.8rem;
  background: #1e293b;
  border: 2px solid #3b82f6;
  border-radius: 1.25rem;
  box-shadow: 0 0 50px rgba(59, 130, 246, 0.4), 0 25px 60px rgba(0, 0, 0, 0.9);
  animation: testModalPopIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes testModalPopIn {
  0% { transform: scale(0.82) translateY(25px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* ==========================================================================
   TYPING TEST RESULT MODAL STUDENT PROFILE STRIP
   ========================================================================== */
.test-student-profile-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  gap: 0.3rem;
}

.test-avatar-wrapper {
  position: relative;
  width: 72px;
  height: 72px;
  cursor: pointer;
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  user-select: none;
}

.test-avatar-wrapper:hover {
  transform: scale(1.08);
}

.test-avatar-box {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  border: 3px solid #3b82f6;
  background: #0f172a;
  box-shadow: 0 4px 18px rgba(59, 130, 246, 0.45), 0 0 14px rgba(56, 189, 248, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.test-avatar-box.no-photo {
  border-style: dashed;
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.65);
}

.test-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.test-avatar-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, #1e293b 0%, #0f172a 100%);
  color: #94a3b8;
}

.test-avatar-icon {
  font-size: 2.1rem;
  line-height: 1;
}

.test-avatar-hover-tag {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  color: #38bdf8;
  opacity: 0;
  transition: opacity 0.2s ease;
  border-radius: 50%;
  text-align: center;
  line-height: 1.2;
}

.test-avatar-wrapper:hover .test-avatar-hover-tag {
  opacity: 1;
}

.test-avatar-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 2px solid #3b82f6;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.test-student-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.test-student-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: 0.3px;
}

.test-student-role-pill {
  font-size: 0.72rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.18rem 0.55rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.test-res-rank-badge {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ffffff;
  background: #3b82f6;
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
  margin-bottom: 0.5rem;
}

.test-score-hero {
  margin: 1rem 0;
  background: rgba(15, 23, 42, 0.7);
  padding: 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.test-hero-wpm {
  display: block;
  font-size: 4rem;
  font-weight: 900;
  color: #10b981;
  line-height: 1;
}

.test-hero-label {
  font-size: 0.95rem;
  color: #94a3b8;
  font-weight: 600;
  margin-top: 0.35rem;
}

.test-results-stats-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem 1.25rem;
  border-radius: 0.6rem;
}

.test-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}

.test-stat-row .lbl {
  color: #94a3b8;
}

.test-stat-row .val {
  font-weight: 700;
  color: #f8fafc;
}

.test-stat-row .val-correct {
  color: #10b981;
}

.test-stat-row .val-wrong {
  color: #ef4444;
}

.test-res-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
}

#btn-test-modal-retry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: all 0.2s ease;
}

#btn-test-modal-retry:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}

#btn-test-modal-retry .restart-kbd {
  display: inline-block;
  margin-left: 0.35rem;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  padding: 0.12rem 0.45rem;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.25);
  letter-spacing: 0.5px;
}

/* ========================================================
   STARTUP STUDENT NAME MODAL & PERSISTENCE STYLING
   ======================================================== */
#welcome-name-modal {
  z-index: 10002;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#welcome-name-modal.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

#welcome-name-modal .modal-card {
  max-width: 580px;
  width: 95%;
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border: 2px solid #3b82f6;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 35px rgba(59, 130, 246, 0.25);
  animation: testModalPopIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}


#welcome-modal-corner-logo {
  position: absolute;
  top: 1rem;
  left: 1.25rem;
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.55));
  transition: transform 0.25s ease, filter 0.25s ease;
  user-select: none;
}

#welcome-modal-corner-logo:hover {
  transform: scale(1.08) rotate(3deg);
  filter: drop-shadow(0 0 14px rgba(168, 85, 247, 0.75));
}

@media (max-width: 520px) {
  #welcome-modal-corner-logo {
    width: 38px;
    height: 38px;
    top: 0.75rem;
    left: 0.85rem;
  }
}

.startup-name-input {
  width: 100%;
  background: #090d16;
  border: 2px solid #334155;
  border-radius: 0.6rem;
  padding: 0.85rem 1.1rem;
  font-size: 1.2rem;
  color: #f8fafc;
  text-align: center;
  font-weight: 600;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  box-sizing: border-box;
}

.startup-name-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.45);
  background: #0d1527;
}

.welcome-user-card {
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
  contain: layout style;
  box-sizing: border-box;
}

#welcome-existing-users-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.5rem !important;
  height: 125px !important;
  min-height: 125px !important;
  max-height: 125px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-right: 6px !important;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #3b82f6 rgba(15, 23, 42, 0.6);
  box-sizing: border-box;
}

.welcome-users-no-results {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  min-height: 110px;
  color: #94a3b8;
  font-size: 0.84rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1.5px dashed rgba(255, 255, 255, 0.12);
  border-radius: 0.6rem;
  padding: 0.75rem 1rem;
  box-sizing: border-box;
  animation: fadeIn 0.15s ease;
}

#welcome-existing-users-list::-webkit-scrollbar {
  width: 6px;
}

#welcome-existing-users-list::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 8px;
}

#welcome-existing-users-list::-webkit-scrollbar-thumb {
  background: #3b82f6;
  border-radius: 8px;
}

#welcome-existing-users-list::-webkit-scrollbar-thumb:hover {
  background: #60a5fa;
}

.welcome-user-card:hover {
  background: rgba(59, 130, 246, 0.22) !important;
  border-color: #38bdf8 !important;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2);
}

.welcome-user-card.is-active {
  background: rgba(59, 130, 246, 0.2) !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.3);
}

/* Student Auth Tabs */
.student-auth-tabs {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 0.95rem;
  background: rgba(15, 23, 42, 0.75);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.student-auth-tab {
  flex: 1;
  padding: 0.55rem 0.65rem;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.student-auth-tab:hover {
  filter: brightness(1.15);
}

/* First-time registration certificate popup styling */
#student-cert-popup-modal .modal-card {
  animation: certPopupScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes certPopupScale {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

#btn-header-logout {
  display: none;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.85rem;
  background: rgba(239, 68, 68, 0.16);
  border: 1.5px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  padding: 0.45rem 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

#btn-header-logout:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #dc2626 !important;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

#btn-modal-logout {
  transition: all 0.2s ease;
}

#btn-modal-logout:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #dc2626 !important;
  transform: translateY(-1px);
}

#btn-edit-student-name:hover {
  background: #3b82f6;
  color: #ffffff;
  border-color: #60a5fa;
}

/* ========================================================
   FREE FIRE 5-LEVEL PROGRESSION STYLING (EASY TO PRO)
   ======================================================== */
.btn-ff-lvl {
  font-weight: 700;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.btn-ff-lvl[data-level="1"].active {
  background: linear-gradient(135deg, #cd7f32, #8b4513) !important;
  color: #ffffff !important;
  border-color: #f59e0b !important;
  box-shadow: 0 0 12px rgba(205, 127, 50, 0.5);
}

.btn-ff-lvl[data-level="2"].active {
  background: linear-gradient(135deg, #64748b, #475569) !important;
  color: #ffffff !important;
  border-color: #94a3b8 !important;
  box-shadow: 0 0 12px rgba(148, 163, 184, 0.5);
}

.btn-ff-lvl[data-level="3"].active {
  background: linear-gradient(135deg, #d97706, #b45309) !important;
  color: #ffffff !important;
  border-color: #fde047 !important;
  box-shadow: 0 0 12px rgba(217, 119, 6, 0.6);
}

.btn-ff-lvl[data-level="4"].active {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  color: #ffffff !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 14px rgba(2, 132, 199, 0.65);
}

.btn-ff-lvl[data-level="5"].active {
  background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
  color: #ffffff !important;
  border-color: #fb7185 !important;
  box-shadow: 0 0 16px rgba(220, 38, 38, 0.8), 0 0 30px rgba(249, 115, 22, 0.4);
  animation: ffProPulse 1.4s infinite alternate;
}

@keyframes ffProPulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 5px #ef4444); }
  100% { transform: scale(1.04); filter: drop-shadow(0 0 12px #f97316); }
}

.btn-ff-lvl.locked {
  opacity: 0.5;
  cursor: not-allowed;
  position: relative;
  filter: grayscale(0.5);
}

.btn-ff-lvl.passed {
  border-color: #10b981 !important;
}

.btn-ff-lvl.active {
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.7);
}

/* 4. Dynamic Mission Briefing Banner */
.ff-level-info-bar {
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.78) 0%, rgba(15, 23, 42, 0.94) 100%);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-left: 4px solid #f59e0b;
  border-radius: 0.65rem;
  padding: 0.65rem 1.15rem;
  font-size: 0.9rem;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
}

.ff-level-info-bar strong {
  color: #fbbf24;
  font-weight: 700;
}

.ff-level-target-chip {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 0.4rem;
  padding: 0.22rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: #fef08a;
  letter-spacing: 0.2px;
}

/* ========================================================
   VISUAL LEVEL PROGRESSION MAP (ROW-BY-ROW CARDS)
   ======================================================== */
.ff-level-map-section {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.85) 0%, rgba(8, 13, 24, 0.95) 100%);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 0.95rem;
  padding: 1.25rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ff-level-map-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.75rem;
}

.ff-level-map-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fbbf24;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  letter-spacing: -0.2px;
}

/* Unified Single-Line Tier Filter Bar & Toggle Button */
.shooter-tier-bar-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 0.25rem 0 0.4rem 0;
  -webkit-overflow-scrolling: touch;
}

.shooter-tier-bar-row::-webkit-scrollbar {
  height: 5px;
}

.shooter-tier-bar-row::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 4px;
}

.shooter-tier-bar-row::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.4);
  border-radius: 4px;
}

.shooter-tier-bar-row::-webkit-scrollbar-thumb:hover {
  background: rgba(245, 158, 11, 0.8);
}

.ff-btn-toggle-map {
  background: rgba(15, 23, 42, 0.85) !important;
  border: 1px solid rgba(59, 130, 246, 0.45) !important;
  color: #93c5fd !important;
  border-radius: 2rem !important;
  padding: 0.38rem 0.85rem !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  cursor: pointer;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
  transition: all 0.2s ease;
  user-select: none;
}

.ff-btn-toggle-map:hover {
  background: rgba(30, 58, 138, 0.5) !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
}

/* Tier Filter Bar Tabs (Sleek Cyber Tactical Chips) */
.shooter-tier-tabs,
.shooter-tier-bar-row .shooter-tier-tabs {
  display: flex !important;
  gap: 0.5rem !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

.btn-shooter-tier-tab {
  background: rgba(15, 23, 42, 0.78) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
  border-radius: 2rem !important;
  padding: 0.38rem 0.85rem !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
  user-select: none;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.btn-shooter-tier-tab:hover {
  background: rgba(30, 41, 59, 0.95) !important;
  border-color: rgba(245, 158, 11, 0.5) !important;
  color: #ffffff !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
}

.btn-shooter-tier-tab.active {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%) !important;
  border-color: rgba(254, 240, 138, 0.6) !important;
  color: #000000 !important;
  font-weight: 800 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.45) !important;
}

.tier-tab-icon {
  font-size: 0.95rem;
}

/* Level Cards Grid Items */
.shooter-lvl-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 0.75rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.65rem;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.shooter-lvl-card:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.shooter-lvl-card.active-level-card {
  border-color: #f59e0b !important;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.35);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.95) 100%);
}

.shooter-lvl-card.completed {
  border-color: rgba(16, 185, 129, 0.35);
}

.shooter-lvl-card.locked {
  opacity: 0.65;
  filter: grayscale(0.2);
}

.badge-difficulty.very-easy {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.badge-difficulty.easy {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}

.badge-difficulty.medium {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.badge-difficulty.hard {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.badge-difficulty.extreme {
  background: rgba(168, 85, 247, 0.25);
  color: #c084fc;
}

.badge-difficulty.promaster {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.4), rgba(249, 115, 22, 0.4));
  color: #fde047;
  border: 1px solid #f97316;
}

#btn-shooter-exit-levels {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #e2e8f0;
  border-radius: 0.55rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

#btn-shooter-exit-levels:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: #f59e0b;
  color: #fbbf24;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

/* ==========================================================================
   CAR TYPING RACE GAME STYLES
   ========================================================================== */
.carrace-view-container {
  width: 100%;
}

.carrace-container-theme {
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.15), 0 15px 35px rgba(0, 0, 0, 0.6);
  position: relative;
  background: linear-gradient(180deg, #0b1120 0%, #0f172a 100%);
}

/* Car Race Top Header & Telemetry */
.carrace-header-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.9) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 14px;
  padding: 1.15rem 1.4rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.carrace-brand-col {
  flex: 1 1 320px;
}

.carrace-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  flex-wrap: wrap;
}

.carrace-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
}

.carrace-pill-badge.f1-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: #0b1120;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.4);
}

.carrace-pill-badge.live-telemetry-badge {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.carrace-pill-badge .live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  animation: telemetryPulse 1.4s infinite ease-in-out;
}

@keyframes telemetryPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}

.carrace-title-glow {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.2px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #ffffff 40%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.carrace-title-glow .title-icon {
  -webkit-text-fill-color: initial;
}

.carrace-title-glow .title-sub {
  font-size: 0.98rem;
  font-weight: 600;
  color: #94a3b8;
  -webkit-text-fill-color: #94a3b8;
}

.carrace-subtitle {
  color: #94a3b8;
  font-size: 0.84rem;
  margin: 0.35rem 0 0 0;
  line-height: 1.4;
}

/* Telemetry HUD Cards */
.carrace-telemetry-hud {
  display: grid;
  grid-template-columns: repeat(6, minmax(82px, 1fr));
  gap: 0.55rem;
  flex: 0 0 auto;
}

@media (max-width: 991px) {
  .carrace-telemetry-hud {
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }
}

@media (max-width: 576px) {
  .carrace-telemetry-hud {
    grid-template-columns: repeat(2, 1fr);
  }
}

.telemetry-card {
  position: relative;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.55rem 0.65rem 0.5rem;
  text-align: center;
  overflow: hidden;
  transition: all 0.22s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.telemetry-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.telemetry-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.card-wpm::before { background: #38bdf8; box-shadow: 0 0 8px #38bdf8; }
.card-cpm::before { background: #818cf8; box-shadow: 0 0 8px #818cf8; }
.card-acc::before { background: #10b981; box-shadow: 0 0 8px #10b981; }
.card-time::before { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.card-prog::before { background: #06b6d4; box-shadow: 0 0 8px #06b6d4; }
.card-bot::before { background: #ef4444; box-shadow: 0 0 8px #ef4444; }

.telemetry-lbl {
  font-size: 0.64rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.telemetry-val {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
}

#carrace-hud-wpm { color: #38bdf8; text-shadow: 0 0 10px rgba(56, 189, 248, 0.5); }
#carrace-hud-cpm { color: #a5b4fc; text-shadow: 0 0 10px rgba(165, 180, 252, 0.4); }
#carrace-hud-acc { color: #34d399; text-shadow: 0 0 10px rgba(52, 211, 153, 0.4); }
#carrace-hud-time { color: #fbbf24; text-shadow: 0 0 10px rgba(251, 191, 36, 0.4); }
#carrace-hud-prog { color: #22d3ee; text-shadow: 0 0 10px rgba(34, 211, 238, 0.4); }
#carrace-bot-speed-label { color: #f87171; text-shadow: 0 0 10px rgba(248, 113, 113, 0.4); }

/* Broadcast Race Level Info Banner */
.carrace-broadcast-banner {
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.12) 0%, rgba(15, 23, 42, 0.9) 50%, rgba(99, 102, 241, 0.12) 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 10px;
  padding: 0.65rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.carrace-broadcast-banner .banner-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.84rem;
}

.carrace-broadcast-banner .pill-label {
  font-weight: 800;
  font-size: 0.68rem;
  letter-spacing: 0.8px;
  color: #94a3b8;
  text-transform: uppercase;
}

.carrace-broadcast-banner .pill-value {
  color: #e2e8f0;
  font-weight: 600;
}

.carrace-broadcast-banner .stage-pill .pill-value {
  color: #38bdf8;
  font-weight: 700;
}

.carrace-broadcast-banner .target-pill strong {
  color: #fbbf24;
}

.carrace-broadcast-banner .unlock-pill .pill-value {
  color: #34d399;
  font-weight: 700;
}

/* Map Section & Header */
.carrace-map-section {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
}

.carrace-map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.carrace-map-title-box {
  flex: 1 1 300px;
}

.map-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.carrace-map-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0;
  letter-spacing: -0.2px;
}

.carrace-levels-count-chip {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
}

.carrace-map-desc {
  color: #94a3b8;
  font-size: 0.82rem;
  margin: 0.3rem 0 0 0;
  line-height: 1.4;
}

.carrace-map-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Language Switcher */
.carrace-lang-pill-switch {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 30px;
  padding: 3px;
  gap: 3px;
}

.btn-carrace-lang {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.38rem 0.85rem;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-carrace-lang:hover {
  color: #ffffff;
}

.btn-carrace-lang.active {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.45);
}

/* Cleared Glass Card */
.carrace-cleared-glass-card {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 12px;
  padding: 0.4rem 0.95rem;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.12);
}

.carrace-cleared-glass-card .trophy-pulse {
  font-size: 1.3rem;
  animation: trophyBounce 2s infinite ease-in-out;
}

@keyframes trophyBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.carrace-cleared-glass-card .cleared-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.carrace-cleared-glass-card .cleared-label {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #34d399;
  text-transform: uppercase;
}

.carrace-cleared-glass-card .cleared-counter {
  font-size: 0.88rem;
  font-weight: 800;
  color: #ecfdf5;
}

/* Tier Filter Bar Tabs */
.carrace-tier-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.carrace-tier-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  border-radius: 22px;
  padding: 0.42rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.carrace-tier-tab:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(56, 189, 248, 0.45);
  color: #ffffff;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.carrace-tier-tab.active {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.5) !important;
}

.carrace-tier-tab .tier-tab-icon {
  font-size: 0.92rem;
}

/* 100 Levels Grid */
.carrace-levels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.carrace-lvl-card {
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.carrace-lvl-card:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.55);
}

.carrace-lvl-card.active-level-card {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.35);
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.12) 0%, rgba(15, 23, 42, 0.92) 100%);
}

.carrace-lvl-card.completed {
  border-color: rgba(16, 185, 129, 0.4);
}

.carrace-lvl-card.locked {
  opacity: 0.6;
  filter: grayscale(0.25);
}

.carrace-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.carrace-chip {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
}

.carrace-chip.chip-category {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.carrace-chip.chip-status.status-passed {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.carrace-chip.chip-status.status-open {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.carrace-chip.chip-status.status-locked {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
}

.carrace-card-title-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.carrace-card-lvl-num {
  font-family: monospace;
  font-size: 0.85rem;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
}

.carrace-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
  line-height: 1.3;
}

.carrace-card-desc {
  font-size: 0.78rem;
  color: #94a3b8;
  margin: 0.3rem 0 0 0;
  line-height: 1.4;
}

.carrace-card-stats-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  margin-top: 0.5rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.carrace-card-stats-box .stat-col {
  display: flex;
  flex-direction: column;
}

.carrace-card-stats-box .s-lbl {
  font-size: 0.64rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}

.carrace-card-stats-box .s-val {
  font-family: monospace;
  font-size: 0.85rem;
  font-weight: 700;
}

.carrace-card-footer {
  margin-top: 0.65rem;
}

.btn-carrace-race-btn {
  width: 100%;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.btn-carrace-race-btn.race-start {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: #000;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.btn-carrace-race-btn.race-start:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.5);
}

.btn-carrace-race-btn.race-again {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.btn-carrace-race-btn.race-again:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.5);
}

.btn-carrace-race-btn.race-locked {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #64748b;
  cursor: not-allowed;
}

.carrace-config-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.6rem 0.85rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Visual Race Track */
.carrace-track-wrapper {
  position: relative;
  width: 100%;
  margin-top: 1rem;
}

.carrace-track-markers {
  position: relative;
  width: 100%;
  height: 22px;
  margin-bottom: 4px;
}

.carrace-marker {
  position: absolute;
  transform: translateX(-50%);
  font-size: 0.72rem;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.5px;
  background: rgba(15, 23, 42, 0.85);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.carrace-marker:first-child {
  transform: translateX(0);
}

.carrace-marker:last-child {
  transform: translateX(-100%);
  color: #fde047;
  border-color: rgba(253, 224, 71, 0.3);
}

.carrace-track {
  position: relative;
  width: 100%;
  min-height: 170px;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 50%, #1e293b 100%);
  border-radius: 10px;
  border: 2px solid #334155;
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.9), 0 8px 25px rgba(0, 0, 0, 0.5);
}

/* Start & Finish Checkered Lines */
.carrace-start-line {
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 18px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.carrace-start-line .checkered-stripe {
  width: 8px;
  height: 100%;
  background: repeating-linear-gradient(0deg, #ffffff, #ffffff 8px, #000000 8px, #000000 16px);
  opacity: 0.75;
  border-radius: 2px;
}

.carrace-start-line .line-label {
  position: absolute;
  top: 8px;
  left: -2px;
  font-size: 0.6rem;
  font-weight: 900;
  color: #38bdf8;
  writing-mode: vertical-rl;
  letter-spacing: 2px;
  opacity: 0.8;
}

.carrace-finish-line {
  position: absolute;
  right: 25px;
  top: 0;
  bottom: 0;
  width: 20px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.carrace-finish-line .checkered-stripe {
  width: 14px;
  height: 100%;
  background-image: 
    linear-gradient(45deg, #000 25%, transparent 25%),
    linear-gradient(-45deg, #000 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #000 75%),
    linear-gradient(-45deg, transparent 75%, #000 75%);
  background-size: 14px 14px;
  background-position: 0 0, 0 7px, 7px -7px, -7px 0px;
  background-color: #ffffff;
  border-left: 2px solid #ef4444;
  border-right: 2px solid #ef4444;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.carrace-finish-line .line-label {
  position: absolute;
  top: 8px;
  right: -18px;
  font-size: 0.65rem;
  font-weight: 900;
  color: #fde047;
  writing-mode: vertical-rl;
  letter-spacing: 2px;
  text-shadow: 0 0 6px rgba(253, 224, 71, 0.8);
}

/* Lanes */
.carrace-lane {
  position: relative;
  height: 84px;
  display: flex;
  align-items: center;
  padding-left: 45px;
  padding-right: 45px;
}

.carrace-lane-info {
  position: absolute;
  left: 45px;
  top: 6px;
  z-index: 2;
  pointer-events: none;
}

.driver-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(15, 23, 42, 0.7);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.driver-badge.bot-badge {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
}

/* Divider Line */
.carrace-divider-line {
  width: 100%;
  height: 3px;
  background: repeating-linear-gradient(90deg, #f59e0b, #f59e0b 24px, transparent 24px, transparent 48px);
  opacity: 0.75;
}

/* Road Kerb Rumble Strips */
.carrace-road-kerb {
  width: 100%;
  height: 7px;
  background: repeating-linear-gradient(45deg, #ef4444, #ef4444 14px, #f8fafc 14px, #f8fafc 28px);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

/* Racing Cars */
.carrace-car {
  position: absolute;
  left: 42px;
  top: 50%;
  margin-top: -19px;
  z-index: 10;
  transition: transform 0.08s linear;
  will-change: transform;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.carrace-car-tag {
  font-size: 0.68rem;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(15, 23, 42, 0.88);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  white-space: nowrap;
  margin-bottom: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  transform: translateY(-4px);
}

.carrace-car-tag.bot-tag {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
}

.car-sprite {
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.7));
  transition: transform 0.1s ease;
}

/* Nitro Acceleration Flame */
.nitro-flame {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.has-nitro .car-player-sprite {
  animation: carEngineShake 0.1s infinite alternate;
}

.has-nitro .nitro-flame {
  opacity: 1;
  animation: nitroPulse 0.12s infinite alternate;
}

@keyframes carEngineShake {
  0% { transform: translateY(0); }
  100% { transform: translateY(-1.2px); }
}

@keyframes nitroPulse {
  0% { transform: scaleX(1); opacity: 0.85; filter: drop-shadow(0 0 6px #38bdf8); }
  100% { transform: scaleX(1.6); opacity: 1; filter: drop-shadow(0 0 12px #0284c7); }
}

/* Typing Prompt Card */
.carrace-typing-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(56, 189, 248, 0.25);
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.carrace-prompt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.5rem;
}

.prompt-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #e2e8f0;
}

.carrace-prompt-display {
  font-size: 1.4rem;
  line-height: 1.5;
  letter-spacing: normal;
  height: 64px;
  min-height: 64px;
  max-height: 64px;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  align-items: center;
  user-select: none;
  cursor: text;
  font-family: var(--font-devnagari), 'Mukta', 'Kalimati', sans-serif;
  padding: 0.35rem 1.25rem;
  background: rgba(10, 15, 29, 0.75);
  border-radius: 0.6rem;
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE 10+ */
  scroll-behavior: smooth;
}

.carrace-prompt-display::-webkit-scrollbar {
  display: none; /* WebKit */
}

/* Intact Word Elements - Zero Dotted Circles & Single-Line Flex */
.carrace-word {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  font-family: var(--font-devnagari), 'Mukta', 'Kalimati', sans-serif;
  font-size: 1.35rem;
  line-height: 1.4;
  padding: 4px 10px;
  margin: 0 4px;
  border-radius: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.carrace-word.word-pending {
  color: #94a3b8;
}

.carrace-word.word-current {
  color: #ffffff;
  background: rgba(56, 189, 248, 0.25);
  border: 2px solid #38bdf8;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.45);
  transform: scale(1.04);
}

.carrace-word.word-current.word-error {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
  animation: wordShake 0.22s ease-in-out;
}

.carrace-word.word-correct {
  color: #4ade80;
  text-shadow: 0 0 8px rgba(74, 222, 128, 0.45);
}

.carrace-word.word-wrong {
  color: #ef4444 !important;
  font-weight: 600;
  text-decoration: none;
  opacity: 0.95;
}

@keyframes wordShake {
  0% { transform: scale(1.04) translateX(0); }
  25% { transform: scale(1.04) translateX(-4px); }
  75% { transform: scale(1.04) translateX(4px); }
  100% { transform: scale(1.04) translateX(0); }
}

/* Dedicated Active Typing Input Box */
.carrace-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.carrace-typing-input {
  flex: 1;
  font-family: var(--font-devnagari), 'Mukta', 'Kalimati', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffffff;
  background: #0f172a;
  border: 2px solid #38bdf8;
  border-radius: 0.6rem;
  padding: 0.75rem 1.15rem;
  outline: none;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
  transition: all 0.2s ease;
}

.carrace-typing-input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.4);
}

.carrace-typing-input.input-has-error {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.45);
}

#carrace-btn-skip-word {
  white-space: nowrap;
  padding: 0.75rem 1rem;
  font-weight: 700;
}

/* Race Duration / Laps Selector Group */
.carrace-laps-group {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 9999px;
  padding: 3px;
  gap: 3px;
}

.btn-carrace-laps {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-carrace-laps:hover {
  color: #ffffff;
  background: rgba(56, 189, 248, 0.15);
}

.btn-carrace-laps.active {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
}

/* Countdown Overlay */
.carrace-countdown-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 7, 18, 0.88);
  backdrop-filter: blur(5px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
}

.countdown-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.countdown-lights {
  display: flex;
  gap: 1rem;
  background: #0f172a;
  padding: 0.5rem 1.2rem;
  border-radius: 9999px;
  border: 2px solid #334155;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

.light-bulb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  opacity: 0.25;
  transition: all 0.2s ease;
}

.light-red { background: #ef4444; box-shadow: 0 0 15px #ef4444; opacity: 1; }
.light-yellow { background: #f59e0b; box-shadow: 0 0 15px #f59e0b; opacity: 0.3; }
.light-green { background: #10b981; box-shadow: 0 0 15px #10b981; opacity: 0.3; }

.countdown-number {
  font-size: 5rem;
  font-weight: 900;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 0 30px rgba(56, 189, 248, 0.8), 0 4px 10px rgba(0, 0, 0, 0.9);
}

.countdown-num-pulse {
  animation: numPulse 0.85s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.countdown-go {
  color: #4ade80 !important;
  text-shadow: 0 0 40px rgba(74, 222, 128, 0.9), 0 4px 12px rgba(0, 0, 0, 0.9) !important;
}

@keyframes numPulse {
  0% { transform: scale(0.4); opacity: 0; }
  40% { transform: scale(1.2); opacity: 1; }
  70% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.9; }
}

.countdown-label {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #94a3b8;
}

/* Result Modal */
.carrace-result-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 7, 18, 0.92);
  backdrop-filter: blur(8px);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
}

.carrace-result-card {
  background: #0f172a;
  border: 2px solid #38bdf8;
  border-radius: 1rem;
  padding: 2rem 2.5rem;
  max-width: 580px;
  width: 90%;
  text-align: center;
  box-shadow: 0 0 40px rgba(56, 189, 248, 0.3), 0 20px 50px rgba(0, 0, 0, 0.9);
  animation: modalScaleUp 0.35s ease-out;
}

@keyframes modalScaleUp {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.res-title-victory {
  font-size: 2rem;
  font-weight: 900;
  color: #fde047;
  text-shadow: 0 0 25px rgba(253, 224, 71, 0.6);
  margin-bottom: 0.25rem;
}

.res-title-defeat {
  font-size: 2rem;
  font-weight: 900;
  color: #f87171;
  text-shadow: 0 0 25px rgba(248, 113, 113, 0.5);
  margin-bottom: 0.25rem;
}

.res-subtitle {
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.carrace-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.metric-box {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.metric-box .m-val {
  font-size: 1.35rem;
  font-weight: 900;
}

.metric-box .m-lbl {
  font-size: 0.68rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.4px;
}

.carrace-modal-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Responsiveness */
@media (max-width: 768px) {
  .carrace-lane {
    height: 72px;
  }
  .carrace-car svg {
    width: 68px;
    height: 30px;
  }
  .carrace-prompt-display {
    font-size: 1.15rem;
    height: 56px;
    min-height: 56px;
  }
  .carrace-result-card {
    padding: 1.5rem 1.25rem;
  }
  .countdown-number {
    font-size: 3.5rem;
  }
}

/* ==========================================================================
   FISHING TYPER & TIER NAVIGATION STYLING
   ========================================================================== */
.shooter-tier-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.shooter-tier-btn {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.shooter-tier-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.shooter-tier-btn.active {
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: #ffffff;
  border-color: #38bdf8;
  box-shadow: 0 0 15px rgba(2, 132, 199, 0.5);
}

.fishing-container-theme {
  border: 1px solid rgba(2, 132, 199, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 25px rgba(2, 132, 199, 0.15);
}

.fishing-lang-switcher {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 9999px;
  padding: 0.15rem;
  gap: 0.2rem;
}

.btn-fishing-lang {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-fishing-lang:hover {
  color: #ffffff;
}

.btn-fishing-lang.active {
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

/* Fishing Duration Selector Group */
.fishing-duration-group {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 9999px;
  padding: 3px;
  gap: 3px;
}

.btn-fishing-duration {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-fishing-duration:hover {
  color: #ffffff;
  background: rgba(56, 189, 248, 0.15);
}

.btn-fishing-duration.active {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
}

/* Battle Royale 100 Level System Styles */
.br-level-banner {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
  border: 1.5px solid rgba(0, 243, 255, 0.4);
  border-radius: 0.85rem;
  padding: 0.85rem 1.2rem;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.15);
  text-align: left;
}

.br-tier-filter-btn {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.br-tier-filter-btn:hover,
.br-tier-filter-btn.active {
  color: #ffffff;
  background: rgba(0, 243, 255, 0.2);
  border-color: #00f3ff;
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

.br-lvl-btn {
  aspect-ratio: 1;
  border-radius: 0.65rem;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  background: rgba(15, 23, 42, 0.9);
  color: #ffffff;
  font-weight: 900;
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
}


.br-lvl-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.05);
  border-color: #00f3ff;
  box-shadow: 0 0 12px rgba(0, 243, 255, 0.4);
}

.br-lvl-btn.active {
  border: 2px solid #00f3ff;
  background: rgba(0, 243, 255, 0.25);
  box-shadow: 0 0 16px rgba(0, 243, 255, 0.6);
}

.br-lvl-btn.locked {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.05);
  background: rgba(5, 8, 17, 0.6);
}

.br-lvl-btn.tier-1 { border-color: rgba(16, 185, 129, 0.4); color: #34d399; }
.br-lvl-btn.tier-2 { border-color: rgba(56, 189, 248, 0.4); color: #38bdf8; }
.br-lvl-btn.tier-3 { border-color: rgba(168, 85, 247, 0.4); color: #c084fc; }
.br-lvl-btn.tier-4 { border-color: rgba(245, 158, 11, 0.4); color: #fbbf24; }
.br-lvl-btn.tier-5 { border-color: rgba(239, 68, 68, 0.5); color: #f87171; }

/* Battle Royale Lobby Slot & Team Styles */
.player-slot-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.75rem;
  padding: 0.85rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  transition: all 0.2s ease;
  position: relative;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.player-slot-card.is-self {
  border-color: rgba(56, 189, 248, 0.8);
  background: rgba(56, 189, 248, 0.1);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.25);
}
.player-slot-card.is-bot {
  border-color: #a855f7;
  background: rgba(168, 85, 247, 0.08);
}
.player-slot-card.empty-slot {
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 82px;
  color: #94a3b8;
}
.player-slot-avatar {
  font-size: 2rem;
  background: rgba(0, 0, 0, 0.4);
  width: 48px;
  height: 48px;
  min-width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.player-slot-info {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.player-slot-name {
  font-weight: 800;
  font-size: 0.95rem;
  color: #f8fafc;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.player-slot-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  display: inline-block;
  align-self: flex-start;
}
.tag-host { background: rgba(245, 158, 11, 0.25); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.5); }
.tag-ready { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.tag-bot { background: rgba(168, 85, 247, 0.25); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }
.player-slot-card.team-a {
  border-color: rgba(0, 243, 255, 0.7);
  background: rgba(0, 243, 255, 0.08);
  box-shadow: 0 0 14px rgba(0, 243, 255, 0.15);
}
.player-slot-card.team-b {
  border-color: rgba(255, 51, 102, 0.7);
  background: rgba(255, 51, 102, 0.08);
  box-shadow: 0 0 14px rgba(255, 51, 102, 0.15);
}
.badge-team-tag {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 0.12rem 0.45rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.badge-team-tag.team-a {
  background: rgba(0, 243, 255, 0.2);
  color: #00f3ff;
  border: 1px solid rgba(0, 243, 255, 0.6);
}
.badge-team-tag.team-b {
  background: rgba(255, 51, 102, 0.2);
  color: #ff3366;
  border: 1px solid rgba(255, 51, 102, 0.6);
}
.btn-swap-team {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
  border-radius: 9999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-swap-team:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #00f3ff;
}
.combatant-card {
  background: rgba(10, 15, 29, 0.95);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.85rem;
  padding: 0.85rem;
  position: relative;
  transition: all 0.2s ease;
}
.combatant-card.is-self {
  border-color: #00f3ff;
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.25);
}
.combatant-card.is-dead {
  opacity: 0.45;
  filter: grayscale(1);
}
.combatant-card.team-a {
  border-left: 4px solid #00f3ff;
}
.combatant-card.team-b {
  border-left: 4px solid #ff3366;
}

/* Battle Royale Single-Line Word Stream */
.word-stream-display {
  font-family: 'Segoe UI', 'Nirmala UI', system-ui, -apple-system, sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: hidden !important;
  overflow-y: hidden !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  white-space: nowrap !important;
  align-items: center !important;
  gap: 0.85rem;
  padding: 0.75rem 1.25rem;
  height: 60px;
  min-height: 60px;
  max-height: 60px;
  background: rgba(15, 23, 42, 0.75);
  border-radius: 0.75rem;
  border: 1.5px solid rgba(0, 243, 255, 0.3);
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 243, 255, 0.1);
  margin-bottom: 1rem;
  position: relative;
  user-select: none;
}

.word-stream-display::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.stream-track {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  white-space: nowrap;
  will-change: transform;
  /* No transition: page jumps are instant so text appears fixed on screen */
}

.stream-track .stream-word {
  color: #94a3b8;
  padding: 0.28rem 0.75rem;
  border-radius: 8px;
  transition: transform 0.28s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.25s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  display: inline-flex;
  align-items: center;
  user-select: none;
}

.stream-word.active-word {
  color: #ffffff;
  background: rgba(0, 243, 255, 0.22);
  border: 1.5px solid #00f3ff;
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.55), inset 0 0 10px rgba(0, 243, 255, 0.2);
  transform: scale(1.06);
  font-weight: 900;
}

.stream-word.completed-word {
  color: rgba(16, 185, 129, 0.65);
  opacity: 0.45;
  transform: scale(0.92);
}

.stream-word.active-word.has-error {
  color: #ffb8b8 !important;
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.6), inset 0 0 10px rgba(239, 68, 68, 0.25) !important;
}

#br-battle-typing-input {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

#br-battle-typing-input.has-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.45), inset 0 0 10px rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
}

.input-shake {
  animation: brInputShake 0.3s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes brInputShake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-5px, 0, 0); }
  40%, 60% { transform: translate3d(5px, 0, 0); }
}

/* ==========================================================================
   COMPREHENSIVE GLOBAL RESPONSIVE SUITE (MOBILE, TABLET, LAPTOP, DESKTOP)
   ========================================================================== */

/* Universal Responsive Base */
html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100%;
}

img, svg, canvas {
  max-width: 100%;
  height: auto;
}

/* 1. MEDIUM SCREENS / TABLETS IN LANDSCAPE (<= 1024px) */
@media (max-width: 1024px) {
  .main-container {
    padding: 0.75rem;
    max-width: 100%;
  }

  .virtual-keyboard-wrapper {
    max-width: 100%;
    padding: 0.4rem;
  }

  .keyboard-row {
    justify-content: space-between;
  }

  .key {
    min-width: 34px;
    max-width: 54px;
    height: 42px;
  }

  .key-tab { min-width: 62px; max-width: 88px; }
  .key-caps { min-width: 70px; max-width: 98px; }
  .key-shift-left { min-width: 82px; max-width: 110px; }
  .key-shift-right { min-width: 95px; max-width: 125px; }
  .key-shift { min-width: 70px; max-width: 88px; }
  .key-ctrl { min-width: 44px; max-width: 65px; }
  .key-win { min-width: 42px; max-width: 62px; }
  .key-alt { min-width: 42px; max-width: 62px; }
  .key-space { min-width: 170px; max-width: 260px; }
  .key-enter { min-width: 60px; max-width: 78px; }
  .key-backspace { min-width: 58px; max-width: 72px; }

  .hero-stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }
}

/* 2. TABLETS & LARGE PHONES (<= 768px) */
@media (max-width: 768px) {
  .main-container {
    padding: 0.5rem;
  }

  /* Dashboard View */
  .dashboard-hero {
    padding: 1rem 0.85rem;
    margin-bottom: 0.85rem;
  }

  .dashboard-hero h2 {
    font-size: 1.35rem;
  }

  .hero-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.45rem;
  }

  .stat-card {
    padding: 0.65rem;
  }

  .stat-value {
    font-size: 1.25rem;
  }

  /* Typing Screen & Metrics */
  .typing-screen-card {
    padding: 0.75rem 0.5rem;
  }

  .metrics-header-bar {
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.45rem 0.65rem;
    justify-content: space-between;
  }

  .metric-pill {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-width: auto;
    white-space: nowrap;
  }

  .metric-pill .val {
    font-size: 0.92rem;
    display: inline;
  }

  .metric-pill .lbl {
    font-size: 0.65rem;
  }

  .target-text-display-box {
    font-size: clamp(1.2rem, 4vw, 1.85rem) !important;
    height: 58px !important;
    line-height: 56px !important;
    padding: 0 0.85rem !important;
  }

  .guided-instruction-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
  }

  /* Virtual Keyboard - Smooth Touch Scrolling & Auto Scale */
  .virtual-keyboard-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.35rem 0.2rem;
  }

  .virtual-keyboard-wrapper::-webkit-scrollbar {
    display: none;
  }

  .keyboard-row {
    justify-content: space-between;
    gap: 3px;
    margin-bottom: 3px;
  }

  .key {
    min-width: 24px;
    max-width: 44px;
    height: 38px;
    padding: 2px 2px;
  }

  .key-tab { min-width: 46px; max-width: 65px; }
  .key-caps { min-width: 52px; max-width: 72px; }
  .key-shift-left { min-width: 60px; max-width: 82px; }
  .key-shift-right { min-width: 68px; max-width: 95px; }
  .key-shift { min-width: 52px; max-width: 70px; }
  .key-ctrl { min-width: 32px; max-width: 50px; }
  .key-win { min-width: 30px; max-width: 48px; }
  .key-alt { min-width: 30px; max-width: 48px; }
  .key-space { min-width: 120px; max-width: 200px; }
  .key-enter { min-width: 48px; max-width: 65px; }
  .key-backspace { min-width: 46px; max-width: 60px; }

  .normal-unicode { font-size: 0.85rem; }
  .normal-roman { font-size: 0.65rem; }
  .shift-unicode { font-size: 0.65rem; }
  .key-top-shift { font-size: 0.55rem; }

  /* Learning Path Cards */
  .learning-levels-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  /* Game Hub Navigation & Panes */
  .game-hub-switcher-bar {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: 0.35rem;
    padding: 0.35rem;
  }

  .game-hub-switcher-bar::-webkit-scrollbar {
    display: none;
  }

  .btn-subgame-tab {
    flex-shrink: 0;
    min-width: auto;
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
    min-height: 40px;
  }

  /* Car Race Game Responsive */
  .carrace-top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .carrace-hud-bar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
  }

  .carrace-track-wrapper {
    overflow-x: hidden;
  }

  .carrace-lane {
    height: 64px;
  }

  .carrace-car svg {
    width: 62px;
    height: 28px;
  }

  .carrace-input-wrapper {
    flex-direction: column;
    gap: 0.5rem;
  }

  .carrace-input-wrapper .carrace-typing-input {
    width: 100%;
    font-size: 1.15rem;
  }

  .carrace-input-wrapper .btn {
    width: 100%;
  }

  .carrace-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .carrace-modal-actions {
    flex-direction: column;
    width: 100%;
  }

  .carrace-modal-actions .btn {
    width: 100%;
  }

  /* Free Fire Word Shooter Responsive */
  .ff-top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }

  .ff-top-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .ff-header-right-cluster {
    width: 100%;
    justify-content: space-between;
  }

  .ff-hud-bar {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
  }

  .ff-hp-hud-item {
    grid-column: 1 / -1;
    width: 100% !important;
  }

  .ff-config-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .ff-config-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .ff-combat-speed-badge {
    justify-content: center;
  }

  .ff-subgroup-left {
    width: 100%;
    justify-content: space-between;
  }

  .ff-weapon-pill-group {
    width: 100%;
    display: flex;
    justify-content: space-between;
  }

  .ff-weapon-pill-group .btn-game-opt {
    flex: 1;
    text-align: center;
  }

  .ff-actions-group {
    width: 100%;
  }

  .ff-btn-start-battle {
    width: 100%;
    justify-content: center;
  }

  .ff-battleground-arena {
    height: 360px;
    max-height: 55vh;
  }

  .ff-gun-rig {
    transform: scale(0.65);
    transform-origin: bottom center;
  }

  /* Battle Royale Arena Responsive */
  .br-level-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .br-players-grid {
    grid-template-columns: 1fr;
  }

  .word-stream-display {
    font-size: 1.1rem;
    height: 52px;
    padding: 0.4rem 0.75rem;
    gap: 0.5rem;
  }

  .stream-track .stream-word {
    font-size: 1.05rem;
    padding: 0.2rem 0.5rem;
  }

  /* Modals Across Entire App */
  .modal-card {
    max-width: 95vw !important;
    width: 95vw !important;
    margin: 1rem auto;
    padding: 1.25rem 0.9rem !important;
    max-height: 90vh;
    overflow-y: auto;
  }

  .modal-backdrop {
    padding: 0.5rem;
  }

  .modal-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .modal-actions .btn {
    width: 100%;
  }

  /* Analytics, Badges & Weakness */
  .weak-keys-grid, .badges-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
}

/* 3. SMALL PHONES & COMPACT PORTRAIT (<= 480px) */
@media (max-width: 480px) {
  .main-container {
    padding: 0.35rem;
  }

  .dashboard-hero {
    padding: 0.85rem 0.65rem;
  }

  .hero-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
  }

  .stat-card {
    padding: 0.5rem;
  }

  .stat-value {
    font-size: 1.1rem;
  }

  /* Ultra-compact keyboard on smallest mobile */
  .key {
    min-width: 18px;
    max-width: 36px;
    height: 34px;
    padding: 1px 1px;
    border-radius: 0.25rem;
  }

  .normal-unicode { font-size: 0.76rem; }
  .normal-roman { font-size: 0.55rem; }
  .shift-unicode { font-size: 0.58rem; }
  .key-top-shift { font-size: 0.5rem; }
  .key-space { min-width: 90px; }
  .key-shift { min-width: 44px; }
  .key-enter { min-width: 42px; }

  .target-text-display-box {
    font-size: 1.2rem !important;
    height: 52px !important;
    line-height: 50px !important;
  }

  .carrace-lane {
    height: 56px;
  }

  .carrace-car svg {
    width: 52px;
    height: 24px;
  }

  .countdown-number {
    font-size: 2.8rem;
  }

  .carrace-result-card {
    padding: 1.25rem 0.85rem;
  }

  .res-title-victory, .res-title-defeat {
    font-size: 1.5rem;
  }
}

/* ========================================================
   PARAGRAPH TYPING PRACTICE ARENA (NEAT & CLEAN REDESIGN)
   ======================================================== */
.para-arena-container {
  max-width: 1260px;
  width: 100%;
  margin: 0 auto;
  padding: 0.35rem clamp(0.5rem, 2vw, 1.25rem) 2rem clamp(0.5rem, 2vw, 1.25rem);
  box-sizing: border-box;
}

/* Header & Controls Bar */
/* ==========================================================================
   REDESIGNED MODERN PARAGRAPH ARENA HEADER & CONTROLS (व्यावसायिक ढाँचा)
   ========================================================================== */

.para-header-bar {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.88) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.22);
  border-radius: 0.9rem;
  padding: 0.8rem 1.15rem;
  margin-bottom: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

/* Tier 1: Top Brand, Topic Pill & Status Actions */
.para-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.para-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1 1 auto;
}

.para-title-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.para-badge-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.para-title-main {
  font-size: 1.15rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.2px;
}

.para-title-nepali {
  font-size: 0.82rem;
  font-weight: 500;
  color: #94a3b8;
  margin-left: 0.2rem;
}

/* Topic Pill: Sleek and Ellipsis-safe */
.para-topic-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 2rem;
  padding: 0.2rem 0.65rem 0.2rem 0.55rem;
  font-size: 0.82rem;
  color: #38bdf8;
  max-width: 460px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.para-topic-pill .topic-icon {
  font-size: 0.95rem;
  line-height: 1;
  flex-shrink: 0;
}

.para-topic-pill .topic-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.para-topic-pill .topic-count {
  font-size: 0.74rem;
  font-weight: 700;
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.2);
  border-radius: 0.8rem;
  padding: 0.05rem 0.45rem;
  margin-left: 0.2rem;
  flex-shrink: 0;
}

.para-header-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  margin-left: auto;
}

/* Tier 2: Balanced Controls & Navigation Strip */
.para-header-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.para-controls-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

.para-control-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.para-control-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  margin: 0;
  white-space: nowrap;
}

.para-select {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #f1f5f9;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.38rem 0.7rem;
  border-radius: 0.5rem;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.para-select:focus,
.para-select:hover {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.para-layout-group {
  display: inline-flex;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.3);
  background: rgba(15, 23, 42, 0.8);
}

.btn-para-layout {
  background: transparent;
  color: #94a3b8;
  border: none;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-para-layout:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #f1f5f9;
}

.btn-para-layout.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.4);
}

.para-toggles-cluster {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-toggle-pill {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  padding: 0.35rem 0.65rem;
  border-radius: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-toggle-pill:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(148, 163, 184, 0.35);
  color: #f1f5f9;
}

.btn-toggle-pill.active {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: #4ade80;
}

.btn-custom-pill {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: #d8b4fe;
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-custom-pill:hover {
  background: rgba(168, 85, 247, 0.3);
  border-color: #c084fc;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.35);
  transform: translateY(-1px);
}

/* Right Navigation & Standout Next Button */
.para-controls-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  margin-left: auto;
}

.para-nav-cluster {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-nav-icon {
  width: 33px;
  height: 33px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #f1f5f9;
  border-radius: 0.45rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-nav-icon:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  transform: translateY(-1px);
}

.btn-para-next {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #ffffff;
  padding: 0.38rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 0.5rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}

.btn-para-next:hover {
  background: linear-gradient(135deg, #0369a1, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.5);
}

.btn-para-next .btn-next-arrow {
  font-size: 0.85rem;
  line-height: 1;
}

/* Metrics Bar (Strict Single Line Layout) */
.para-metrics-strip {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: nowrap !important;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.para-metrics-strip::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.para-metric-pill {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 0.5rem;
  padding: 0.35rem 0.65rem;
  display: flex;
  align-items: baseline;
  gap: 0.38rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
  white-space: nowrap;
}

.para-metric-pill .m-lbl {
  font-size: 0.68rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.para-metric-pill .m-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: #f8fafc;
  font-family: var(--font-mono, monospace);
}

#para-metric-wpm { color: #38bdf8; }
#para-metric-accuracy { color: #4ade80; }
#para-metric-progress { color: #c084fc; }
#para-metric-time { color: #fbbf24; }

/* Latest News Feature in Metrics Bar (Right-Aligned in Same Single Line) */
.para-metrics-news-wrap {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
  flex-shrink: 1;
  min-width: 0;
}

.para-news-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--card-bg, #111827);
  border: 1px solid var(--card-border, #1f2937);
  border-radius: 0.5rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #93c5fd;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  max-width: 580px;
  min-width: 0;
  flex-shrink: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  user-select: none;
}

.para-news-pill:hover {
  background: rgba(30, 58, 138, 0.35);
  border-color: rgba(96, 165, 250, 0.6);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.para-news-pill .live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
  flex-shrink: 0;
  animation: pulseLiveDot 1.8s infinite;
}

.para-news-pill.is-live {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.45);
  color: #86efac;
}

.para-news-pill.is-fallback {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fde68a;
}

.para-news-pill.is-fallback .live-dot {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.8);
}

.para-news-pill.is-loading {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
}

.para-news-pill.is-loading .live-dot {
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
}

.para-news-pill .para-news-headline {
  max-width: 520px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
  min-width: 0;
}

.news-source-badge {
  display: inline-block;
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.08rem 0.35rem;
  border-radius: 0.3rem;
  margin-right: 0.3rem;
  line-height: 1.2;
  vertical-align: middle;
}

.news-trending-icon {
  display: inline-block;
  margin-right: 0.2rem;
  font-size: 0.85rem;
  vertical-align: middle;
}

.btn-para-news-fetch {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(59, 130, 246, 0.15));
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93c5fd;
  border-radius: 0.5rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.btn-para-news-fetch:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.4), rgba(59, 130, 246, 0.3));
  border-color: rgba(96, 165, 250, 0.7);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-para-news-fetch.is-loading {
  opacity: 0.85;
  pointer-events: none;
}

.btn-para-news-fetch.is-loading .news-btn-icon {
  display: inline-block;
  animation: spinNewsIcon 1s linear infinite;
}

@keyframes spinNewsIcon {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulseLiveDot {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.8);
    opacity: 0.45;
  }
}

/* Progress Bar Track */
.para-progress-bar-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.55rem;
}

.para-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #3b82f6, #8b5cf6);
  transition: width 0.2s ease;
}

/* Main Typing Stage (Large, Modern, Responsive Monkeytype Arena) */
.para-text-stage {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.88) 0%, rgba(10, 15, 26, 0.96) 100%);
  border: 2px solid rgba(56, 189, 248, 0.28);
  border-radius: 1.1rem;
  padding: clamp(1.4rem, 2.8vw, 2.4rem) clamp(1.6rem, 3.2vw, 2.8rem);
  min-height: clamp(280px, 42vh, 440px);
  max-height: clamp(380px, 56vh, 560px);
  overflow-y: auto;
  position: relative;
  cursor: text;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.45), inset 0 2px 10px rgba(0, 0, 0, 0.4);
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.35) rgba(15, 23, 42, 0.5);
}

.para-text-stage:hover {
  border-color: rgba(56, 189, 248, 0.45);
}

.para-text-stage:focus-within,
.para-text-stage.is-focused {
  border-color: rgba(250, 204, 21, 0.75) !important;
  box-shadow: 0 0 25px rgba(250, 204, 21, 0.18), 0 10px 35px rgba(0, 0, 0, 0.45), inset 0 2px 10px rgba(0, 0, 0, 0.4);
}

/* Custom Sleek Dark-Themed Scrollbar (Replaces Ugly Native White Scrollbar) */
.para-text-stage::-webkit-scrollbar {
  width: 9px;
}

.para-text-stage::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.55);
  border-radius: 9px;
  margin: 8px 0;
}

.para-text-stage::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.3);
  border-radius: 9px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background 0.2s ease;
}

.para-text-stage::-webkit-scrollbar-thumb:hover {
  background: rgba(250, 204, 21, 0.65);
}

.para-words-stream {
  font-size: clamp(1.4rem, 2.35vw, 1.75rem);
  line-height: clamp(2.45rem, 3.8vw, 3.05rem);
  letter-spacing: normal;
  word-spacing: normal;
  user-select: none;
  font-family: var(--font-devanagari, 'Kalimati', 'Mukta', 'Segoe UI', sans-serif);
  position: relative;
  word-break: break-word;
}

/* Word States */
.p-word {
  display: inline-block;
  margin: 0 0 0.25rem 0;
  padding: 0 0.04rem;
  border-radius: 0.25rem;
  transition: color 0.1s ease, background-color 0.1s ease;
}

.p-word.word-pending {
  color: #64748b;
}

.p-word.word-correct {
  color: #4ade80;
}

.p-word.word-wrong {
  color: #ef4444 !important;
  text-decoration: underline wavy rgba(239, 68, 68, 0.85) !important;
}

.p-word.word-current {
  background: rgba(250, 204, 21, 0.1);
  border-radius: 0.3rem;
}

/* Characters inside current word */
.p-char {
  transition: color 0.08s ease;
}

.p-char.char-pending {
  color: #94a3b8;
}

.p-char.char-correct {
  color: #4ade80;
  text-shadow: 0 0 10px rgba(74, 222, 128, 0.3);
}

.p-char.char-wrong {
  color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.25) !important;
  border-radius: 2px;
}

.p-char.char-extra-wrong {
  color: #ef4444 !important;
  text-decoration: underline !important;
  background: rgba(239, 68, 68, 0.3) !important;
  border-radius: 2px;
}

/* Monkeytype-Style Glowing Yellow Caret for Paragraph Typing */
#para-monkeytype-caret {
  position: absolute;
  width: 3.5px !important;
  background-color: #facc15 !important;
  border-radius: 2px !important;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.95), 0 0 4px #facc15 !important;
  pointer-events: none;
  z-index: 50;
  will-change: left, top;
}

#para-monkeytype-caret.blinking {
  animation: paraCaretPulse 1s infinite ease-in-out !important;
}

#para-monkeytype-caret.typing {
  animation: none !important;
  opacity: 1 !important;
}

#para-monkeytype-caret.caret-error {
  background-color: #ef4444 !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.95), 0 0 5px #ef4444 !important;
}

@keyframes paraCaretPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.15; }
}

/* Hidden Capture Input for Paragraph Practice (Old visible box removed) */
.para-typing-input-hidden {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  left: 0 !important;
  top: 0 !important;
  width: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  outline: none !important;
  clip: rect(0, 0, 0, 0) !important;
  z-index: -1 !important;
}

.para-input-box-wrap {
  display: none !important;
}

/* Responsive Breakpoints for Paragraph Arena */
@media (max-width: 1024px) {
  .para-arena-container {
    max-width: 100%;
    padding: 0.35rem 0.65rem 1.5rem 0.65rem;
  }
  .para-text-stage {
    min-height: 250px;
    max-height: 380px;
    padding: 1.25rem 1.6rem;
  }
  .para-words-stream {
    font-size: 1.42rem;
    line-height: 2.45rem;
  }
}

@media (max-width: 768px) {
  .para-arena-container {
    padding: 0.25rem 0.4rem 1.25rem 0.4rem;
  }
  .para-text-stage {
    min-height: 210px;
    max-height: 320px;
    padding: 1rem 1.2rem;
    border-radius: 0.85rem;
  }
  .para-words-stream {
    font-size: 1.25rem;
    line-height: 2.15rem;
  }
  .p-word {
    margin: 0 0 0.15rem 0;
    padding: 0 0.03rem;
  }
}

@media (max-width: 480px) {
  .para-text-stage {
    min-height: 180px;
    max-height: 280px;
    padding: 0.85rem 0.95rem;
  }
  .para-words-stream {
    font-size: 1.15rem;
    line-height: 1.95rem;
  }
}

.para-input-inner-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.para-typing-input {
  width: 100%;
  padding: 0.75rem 2.6rem 0.75rem 1.15rem;
  border-radius: 0.65rem;
  font-size: 1.15rem;
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid rgba(56, 189, 248, 0.35);
  color: #f8fafc;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: var(--font-devanagari, 'Kalimati', 'Mukta', 'Segoe UI', sans-serif);
}

.para-typing-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

.para-typing-input.input-has-error {
  border-color: #f87171 !important;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.25) !important;
}

.btn-clear-input-inline {
  position: absolute;
  right: 12px;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  font-size: 0.88rem;
  font-weight: 800;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
  line-height: 1;
  padding: 0;
}

.btn-clear-input-inline:hover {
  background: rgba(239, 68, 68, 0.45);
  color: #ffffff;
  transform: scale(1.1);
}

/* Completion Banner Overlay */
.para-completion-banner {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(8px);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.85rem;
  animation: fadeInPara 0.25s ease-out;
}

@keyframes fadeInPara {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.completion-banner-inner {
  text-align: center;
  padding: 1.5rem;
  max-width: 520px;
  width: 90%;
  margin: 0 auto;
}

.completion-hero-text .confetti-icon {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 0.35rem;
}

.completion-hero-text h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #4ade80;
  margin: 0 0 1rem 0;
}

.completion-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.c-stat {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 0.5rem;
  padding: 0.6rem 0.4rem;
  display: flex;
  flex-direction: column;
}

.c-val {
  font-size: 1.2rem;
  font-weight: 800;
  color: #f8fafc;
  font-family: var(--font-mono, monospace);
}

.c-lbl {
  font-size: 0.7rem;
  font-weight: 700;
  color: #94a3b8;
  margin-top: 0.15rem;
}

.completion-next-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.para-countdown-msg {
  font-size: 0.88rem;
  color: #cbd5e1;
  font-weight: 600;
}

/* Virtual Keyboard Area */
.para-virtual-keyboard-wrap {
  margin-top: 0.5rem;
}

/* Custom Paragraph Modal & File Uploader */
.custom-para-modal-card {
  max-width: 660px;
  width: 95%;
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 1rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75), 0 0 25px rgba(56, 189, 248, 0.2);
  padding: 1.6rem 1.8rem;
  color: #f8fafc;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  text-align: left;
}

.custom-modal-header {
  margin-bottom: 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.85rem;
  padding-right: 2rem;
}

.custom-modal-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.custom-modal-subtitle {
  margin: 0.35rem 0 0 0;
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.45;
}

.custom-upload-zone {
  background: rgba(15, 23, 42, 0.75);
  border: 2px dashed rgba(56, 189, 248, 0.35);
  border-radius: 0.75rem;
  padding: 1.1rem 1.25rem;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
  margin-bottom: 1rem;
}

.custom-upload-zone:hover,
.custom-upload-zone.dragover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.15);
}

.custom-upload-actions {
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.65rem;
}

.custom-file-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
  font-size: 0.84rem;
  font-weight: 600;
  margin-top: 0.65rem;
}

.custom-textarea {
  width: 100%;
  box-sizing: border-box;
  background: #1e293b;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.65rem;
  padding: 0.85rem 1rem;
  color: #f8fafc;
  font-family: inherit;
  font-size: 1.05rem;
  line-height: 1.7;
  resize: vertical;
  min-height: 150px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.custom-textarea:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.3);
}

.custom-meta-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  margin-bottom: 0.85rem;
  font-size: 0.85rem;
  color: #94a3b8;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.custom-lang-pill {
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* Image Preview & OCR Styles */
.custom-image-preview-card {
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: 0.75rem;
  padding: 0.85rem;
  margin-bottom: 0.9rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.custom-image-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ocr-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.ocr-status-badge.loading {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.45);
}

.ocr-status-badge.success {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.45);
}

.ocr-status-badge.error {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.45);
}

.custom-select-sm {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.35rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.custom-select-sm:focus {
  border-color: #38bdf8;
}

.custom-image-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.custom-img-thumb-wrap {
  position: relative;
  max-height: 180px;
  overflow: hidden;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #020617;
  display: flex;
  justify-content: center;
  align-items: center;
}

.custom-img-thumb-wrap img {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
  display: block;
}

.custom-ocr-progress-container {
  margin-top: 0.35rem;
}

.custom-ocr-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  overflow: hidden;
}

.custom-ocr-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #10b981);
  transition: width 0.2s ease;
}

.custom-ocr-progress-label {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 600;
  margin-top: 0.25rem;
  text-align: right;
}

/* Floating Image Reference Pill & Drawer in Typing Arena */
.para-img-ref-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 0.5rem;
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  cursor: pointer;
  transition: all 0.2s;
}

.para-img-ref-btn:hover {
  background: rgba(14, 165, 233, 0.28);
  border-color: #38bdf8;
}

.para-img-ref-drawer {
  background: #090d16;
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  border-radius: 0.75rem;
  padding: 0.65rem;
  margin-bottom: 0.85rem;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.para-img-ref-drawer img {
  max-width: 100%;
  max-height: 250px;
  object-fit: contain;
  border-radius: 0.4rem;
}

/* ==========================================================================
   LOCATION-BASED TYPING PRACTICE STYLES (स्थान अनुसार टाइपिङ अभ्यास)
   ========================================================================== */

/* 1. Dashboard Location Banner Card */
.dash-location-card {
  margin-top: 0.9rem;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.dash-location-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, #38bdf8, #818cf8);
}

.dash-loc-details {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1 1 auto;
}

.dash-loc-pin {
  font-size: 1.7rem;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(56, 189, 248, 0.4));
}

.dash-loc-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.dash-loc-sub {
  font-size: 0.76rem;
  color: #94a3b8;
  font-weight: 500;
}

.dash-loc-heading {
  font-size: 0.95rem;
  color: #38bdf8;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.dash-loc-btns {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* 2. Paragraph View Location Chip (100% Auto-Detected Badge) */
.para-location-chip {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 2rem;
  padding: 0.2rem 0.65rem 0.2rem 0.55rem;
  gap: 0.45rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  user-select: none;
  vertical-align: middle;
}

.para-location-chip .chip-pin {
  font-size: 0.95rem;
  line-height: 1;
}

.para-location-chip .chip-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #f1f5f9;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.para-location-chip .chip-auto-tag {
  font-size: 0.68rem;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 0.8rem;
  padding: 0.08rem 0.45rem;
  letter-spacing: 0.2px;
}

/* 3. Location Selector Modal */
.location-modal-card {
  max-width: 780px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  text-align: left;
  border: 1.5px solid rgba(56, 189, 248, 0.3);
  background: #0f172a;
}

.loc-modal-header {
  text-align: center;
  margin-bottom: 1rem;
}

.loc-modal-icon {
  font-size: 2.4rem;
  margin-bottom: 0.25rem;
  filter: drop-shadow(0 2px 8px rgba(56, 189, 248, 0.4));
}

.loc-modal-title {
  color: #38bdf8;
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.loc-modal-subtitle {
  color: #94a3b8;
  font-size: 0.84rem;
  line-height: 1.4;
  max-width: 580px;
  margin: 0 auto;
}

.loc-gps-detect-bar {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 0.65rem;
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}

.loc-gps-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.loc-sat-icon {
  font-size: 1.5rem;
}

.loc-modal-divider {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 700;
  margin: 0.8rem 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.loc-modal-divider::before,
.loc-modal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(148, 163, 184, 0.2);
}

.loc-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.loc-card-btn {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 0.65rem;
  padding: 0.65rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.loc-card-btn:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: #38bdf8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2);
}

.loc-card-btn.active {
  background: rgba(14, 165, 233, 0.22);
  border: 1.5px solid #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.loc-card-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.loc-card-content {
  flex: 1;
  min-width: 0;
}

.loc-card-name {
  font-weight: 700;
  font-size: 0.86rem;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loc-card-prov {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loc-card-badge {
  font-size: 0.62rem;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
  position: absolute;
  top: 0.3rem;
  right: 0.35rem;
}

.loc-card-btn.active .loc-card-badge {
  background: #38bdf8;
  color: #0f172a;
}

.loc-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  flex-wrap: wrap;
}

.loc-current-status {
  font-size: 0.82rem;
  color: #94a3b8;
}

.loc-current-status strong {
  color: #38bdf8;
}

@media (max-width: 768px) {
  .dash-location-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .dash-loc-btns {
    width: 100%;
  }
  .dash-loc-btns button {
    flex: 1 1 auto;
  }
  .loc-grid-container {
    grid-template-columns: 1fr;
  }
  .para-header-top {
    flex-direction: column;
    align-items: flex-start;
  }
  .para-header-right {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }
  .para-header-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .para-controls-right {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
  .para-topic-pill {
    max-width: 100%;
  }
}

/* ==========================================================================
   AI WEAKNESS DIAGNOSTICS & SMART IMPROVEMENT SYSTEM (कमजोरी विश्लेषण ढाँचा)
   ========================================================================== */
.analytics-arena-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.5rem 0.5rem 2.5rem 0.5rem;
}

/* 1. Hero Card */
.analytics-hero-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.9) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.25);
  border-radius: 1rem;
  padding: 1.25rem 1.6rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.analytics-hero-main {
  flex: 1 1 540px;
}

.analytics-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.analytics-hero-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 0.35rem 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.analytics-student-tag {
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  padding: 0.15rem 0.6rem;
  border-radius: 0.4rem;
}

.analytics-hero-sub {
  color: #94a3b8;
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0;
}

.analytics-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.analytics-cta-btn {
  background: linear-gradient(135deg, #0284c7, #38bdf8) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.4);
  border: none !important;
  transition: all 0.2s;
}

.analytics-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.55);
}

/* Empty State */
.analytics-empty-state {
  background: rgba(30, 41, 59, 0.6);
  border: 1.5px dashed rgba(255, 255, 255, 0.15);
  border-radius: 1rem;
  padding: 3rem 1.5rem;
  text-align: center;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

/* 2. KPI Summary Cards Grid */
.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.analytics-kpi-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.85rem;
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}

.analytics-kpi-card:hover {
  transform: translateY(-2px);
}

.analytics-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.analytics-kpi-card.kpi-danger::before { background: linear-gradient(90deg, #ef4444, #f87171); }
.analytics-kpi-card.kpi-warning::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.analytics-kpi-card.kpi-info::before { background: linear-gradient(90deg, #0284c7, #38bdf8); }
.analytics-kpi-card.kpi-accent::before { background: linear-gradient(90deg, #8b5cf6, #c084fc); }

.kpi-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.kpi-icon {
  font-size: 1.1rem;
}

.kpi-lbl {
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.kpi-main-val {
  font-size: 1.55rem;
  font-weight: 800;
  color: #ffffff;
}

.kpi-main-val.text-sm {
  font-size: 1.15rem;
}

.kpi-sub-count {
  font-size: 0.82rem;
  font-weight: 700;
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
  padding: 0.1rem 0.5rem;
  border-radius: 9999px;
}

.kpi-footer-note {
  font-size: 0.8rem;
  color: #94a3b8;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.4rem;
}

.kpi-hand-progress {
  display: flex;
  height: 6px;
  border-radius: 9999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  margin: 0.2rem 0;
}

.hand-bar-left {
  background: #38bdf8;
  height: 100%;
}

.hand-bar-right {
  background: #a855f7;
  height: 100%;
}

/* 3. Section Cards */
.analytics-section-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.95rem;
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.section-card-header {
  margin-bottom: 1.15rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sec-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.sec-icon {
  font-size: 1.35rem;
  line-height: 1.2;
}

.sec-title {
  font-size: 1.12rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0 0 0.25rem 0;
}

.sec-sub {
  color: #94a3b8;
  font-size: 0.84rem;
  margin: 0;
}

/* Smart Suggestions Grid */
.analytics-suggestions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.suggestion-box {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 4px solid #38bdf8;
  border-radius: 0.65rem;
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s, background-color 0.2s;
}

.suggestion-box:hover {
  transform: translateY(-2px);
  background: rgba(30, 41, 59, 0.85);
}

.suggestion-box.suggestion-finger { border-left-color: #f59e0b; }
.suggestion-box.suggestion-halant { border-left-color: #c084fc; }
.suggestion-box.suggestion-matra { border-left-color: #34d399; }
.suggestion-box.suggestion-balance { border-left-color: #38bdf8; }
.suggestion-box.suggestion-accuracy { border-left-color: #f87171; }

.suggestion-header {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.sugg-icon {
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
}

.sugg-title-wrap {
  flex: 1;
}

.sugg-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 0.15rem;
}

.sugg-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.35;
}

.sugg-desc {
  font-size: 0.84rem;
  color: #cbd5e1;
  line-height: 1.5;
  margin: 0;
}

.sugg-tip-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 0.45rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #e2e8f0;
}

.tip-label {
  font-weight: 700;
  color: #38bdf8;
  display: block;
  margin-bottom: 0.2rem;
}

/* 4. Details Breakdown Grid */
.analytics-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.detail-panel {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.85rem;
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-header h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
}

.panel-count {
  font-size: 0.75rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1rem 0.5rem;
  border-radius: 9999px;
}

.weak-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.weak-row-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.weak-key-pill {
  width: 40px;
  height: 40px;
  background: rgba(239, 68, 68, 0.15);
  border: 1.5px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  flex-shrink: 0;
}

.weak-key-pill.char-pill {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}

.weak-meta-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.weak-meta-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.wk-finger {
  color: #94a3b8;
}

.wk-count {
  color: #f87171;
}

.wk-progress-track {
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
}

.wk-progress-bar {
  height: 100%;
  border-radius: 9999px;
}

.wk-progress-bar.danger { background: linear-gradient(90deg, #ef4444, #f87171); }
.wk-progress-bar.warning { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.anatomy-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.anatomy-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.anat-lbl-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #cbd5e1;
}

.anat-progress-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
}

.anat-progress-bar {
  height: 100%;
  border-radius: 9999px;
}

.anat-progress-bar.home { background: linear-gradient(90deg, #10b981, #34d399); }
.anat-progress-bar.top { background: linear-gradient(90deg, #0284c7, #38bdf8); }
.anat-progress-bar.bottom { background: linear-gradient(90deg, #8b5cf6, #c084fc); }

.anatomy-summary-box {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.5rem;
  padding: 0.65rem 0.85rem;
  display: flex;
  justify-content: space-between;
}

.anat-sum-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.anat-sum-lbl {
  font-size: 0.74rem;
  color: #94a3b8;
}

.text-cyan {
  color: #38bdf8 !important;
}

/* 5. Targeted Drills Launch Grid */
.targeted-drills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.drill-action-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.8rem;
  padding: 1.15rem 1.25rem;
  display: flex;
  gap: 0.85rem;
  transition: transform 0.2s, border-color 0.2s;
}

.drill-action-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.4);
}

.drill-icon-badge {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
}

.drill-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.drill-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.drill-desc {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.45;
  margin: 0;
  flex-grow: 1;
}

@media (max-width: 768px) {
  .analytics-hero-card {
    flex-direction: column;
    align-items: stretch;
  }
  .analytics-hero-actions {
    width: 100%;
  }
  .analytics-hero-actions .btn {
    width: 100%;
  }
  .analytics-kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   CLOUD DATABASE AUTO-SYNC STATUS STYLES
   ========================================================================== */
.cloud-sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.28rem 0.65rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
}

.cloud-sync-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.cloud-sync-pill.status-synced {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.cloud-sync-pill.status-offline {
  background: rgba(249, 115, 22, 0.15);
  border-color: rgba(249, 115, 22, 0.4);
  color: #fb923c;
}

.cloud-sync-pill.status-syncing {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.45);
  color: #60a5fa;
}

.cloud-sync-pill.status-syncing #nav-cloud-sync-icon,
.cloud-sync-pill.status-syncing #admin-cloud-sync-icon {
  display: inline-block;
  animation: spinSync 1s linear infinite;
}

@keyframes spinSync {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.cloud-sync-pill.status-error {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.cloud-sync-pill.status-unconfigured {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.25);
  color: #94a3b8;
}

/* ==========================================================================
   SIDE-TO-SIDE EXECUTIVE CERTIFICATE ALIGNMENT (MATCHING REFERENCE IMAGE)
   ========================================================================== */

#printable-certificate-card {
  width: 1050px !important;
  height: 742px !important;
  aspect-ratio: 297 / 210 !important;
  position: relative !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  background: #ffffff !important;
  border: 10px solid #002865 !important;
  border-bottom: none !important;
  padding: 18px 36px 0 36px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  font-family: 'Montserrat', sans-serif !important;
  user-select: none !important;
}

/* 1. Inner Gold Frame (8px inside outer navy border) */
.cert-inner-gold-frame {
  position: absolute !important;
  top: 8px !important;
  left: 8px !important;
  right: 8px !important;
  bottom: 27px !important; /* sits flush above bottom navy bar */
  border: 1.5px solid #d4af37 !important;
  pointer-events: none !important;
  z-index: 2 !important;
  border-radius: 2px !important;
  box-sizing: border-box !important;
}

/* 2. Side-to-Side Corner Geometrics */
.cert-corner-geo {
  position: absolute !important;
  pointer-events: none !important;
  z-index: 3 !important;
}
.cert-corner-geo-tl {
  top: 0 !important;
  left: 0 !important;
  width: 68px !important;
  height: 68px !important;
}
.cert-corner-geo-br {
  display: block !important;
  bottom: 0 !important;
  right: 0 !important;
  width: 140px !important;
  height: 94px !important;
  z-index: 1 !important;
  pointer-events: none !important;
}

/* 3. Left Side Watermark: Typing Hands on Laptop Keyboard */
.cert-watermark-left {
  position: absolute !important;
  display: block !important;
  left: 14px !important;
  top: 210px !important;
  width: 255px !important;
  height: 290px !important;
  object-fit: contain !important;
  opacity: 0.85 !important;
  filter: contrast(1.08) brightness(1.03) !important;
  pointer-events: none !important;
  z-index: 1 !important;
  user-select: none !important;
}

/* 4. Full-Width Background Watermark: World Map Dot-Matrix (Spanning side to side) */
.cert-watermark-right {
  position: absolute !important;
  display: block !important;
  left: 36px !important;
  right: 36px !important;
  top: 140px !important;
  width: calc(100% - 72px) !important;
  height: 335px !important;
  object-fit: fill !important;
  opacity: 0.26 !important;
  pointer-events: none !important;
  z-index: 1 !important;
  user-select: none !important;
}

/* 5. Center Faint Logo Watermark (Hidden to keep certificate crisp and shadow-free) */
.cert-watermark-bg {
  display: none !important;
}

/* 6. Right Flank Cursive Motto: Better Typing Brighter Future */
.cert-side-motto-right {
  position: absolute !important;
  right: 42px !important;
  top: 240px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  font-family: 'Alex Brush', cursive !important;
  font-size: 21px !important;
  color: #00205b !important;
  line-height: 0.95 !important;
  white-space: nowrap !important;
  pointer-events: none !important;
  z-index: 2 !important;
  transform: rotate(2deg) !important;
}
.cert-side-motto-right .cert-gold-swoosh {
  width: 58px !important;
  height: 9px !important;
  margin-top: 2px !important;
}

/* 7. Header Alignment */
.cert-modern-header {
  position: relative !important;
  z-index: 3 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 6px !important;
  flex-shrink: 0 !important;
}

/* 8. Main Body Alignment */
.cert-modern-body {
  position: relative !important;
  z-index: 3 !important;
  text-align: center !important;
  flex: 0 0 auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: center !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* 8A. Realistic Folded Ribbon Banner (Matching Uploaded Reference) */
.cert-ribbon-banner-wrap {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: center !important;
  width: auto !important;
  max-width: 520px !important;
  margin: 0 auto 4px auto !important;
  box-sizing: border-box !important;
  z-index: 3 !important;
}

.cert-ribbon-banner-img {
  width: 520px !important;
  max-width: 100% !important;
  height: auto !important;
  aspect-ratio: 983 / 107 !important;
  display: block !important;
  object-fit: contain !important;
  pointer-events: none !important;
  user-select: none !important;
  filter: none !important;
}

/* 8B. Citation Paragraph Centering & Width */
.cert-citation-paragraph {
  max-width: 590px !important;
  font-size: 11.5px !important;
  line-height: 1.55 !important;
  color: #00205b !important;
  margin: 0 auto 16px auto !important;
  text-align: center !important;
}
.cert-citation-paragraph strong {
  color: #00205b !important;
  font-weight: 800 !important;
}

/* 9. 4-Column Metric Cards Alignment */
.cert-modern-metrics {
  display: flex !important;
  justify-content: space-between !important;
  align-items: stretch !important;
  gap: 16px !important;
  margin: 16px auto 0 auto !important;
  max-width: 920px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.cert-metric-pill {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  border-radius: 12px !important;
  padding: 26px 10px 10px 10px !important;
  min-height: 78px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  box-sizing: border-box !important;
  position: relative !important;
}

.cert-pill-label {
  font-size: 10px !important;
  font-weight: 700 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.8px !important;
  display: block !important;
  margin-bottom: 2px !important;
}

.cert-pill-val {
  font-size: 15px !important;
  font-weight: 800 !important;
  color: #00205b !important;
  display: block !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  width: 100% !important;
}

.cert-card-icon-bubble {
  position: absolute !important;
  top: -21px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 42px !important;
  height: 42px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 0 0 3.5px #ffffff, 0 3px 6px rgba(0, 0, 0, 0.12) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  z-index: 5 !important;
  box-sizing: border-box !important;
}

.cert-card-icon-bubble svg {
  width: 23px !important;
  height: 23px !important;
  display: block !important;
}

.bubble-course {
  background: radial-gradient(circle at 35% 30%, #2575fc 0%, #0047cc 70%, #002b80 100%) !important;
}

.bubble-accuracy {
  background: radial-gradient(circle at 35% 30%, #34d399 0%, #059669 70%, #064e3b 100%) !important;
}

.bubble-speed {
  background: radial-gradient(circle at 35% 30%, #818cf8 0%, #4f46e5 70%, #312e81 100%) !important;
}

.bubble-certno {
  background: radial-gradient(circle at 35% 30%, #fbbf24 0%, #d97706 70%, #92400e 100%) !important;
}

/* 10. Footer Alignment */
.cert-modern-footer {
  position: relative !important;
  z-index: 3 !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: space-between !important;
  min-height: 86px !important;
  margin-top: 50px !important;
  margin-bottom: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  padding: 0 10px !important;
}

.cert-sig-col {
  width: 185px !important;
  text-align: center !important;
  flex-shrink: 0 !important;
}
.sig-left {
  margin-left: 20px !important;
}
.sig-right {
  margin-right: 20px !important;
}

.cert-sig-script {
  font-family: 'Alex Brush', cursive !important;
  font-size: 28px !important;
  color: #00205b !important;
  line-height: 1 !important;
  min-height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-bottom: 2px !important;
}

.cert-sig-rule {
  width: 165px !important;
  height: 1.5px !important;
  background: #00205b !important;
  margin: 3px auto 4px auto !important;
}

.cert-sig-col-issued .cert-sig-rule {
  background: #d4af37 !important;
}

.sig-right .cert-sig-rule {
  background: #00205b !important;
}

.motto-text-block {
  display: inline-block !important;
  white-space: nowrap !important;
  padding: 0 4px !important;
  overflow: visible !important;
}

.cert-sig-name {
  font-size: 10.5px !important;
  font-weight: 800 !important;
  color: #00205b !important;
  margin: 0 !important;
  letter-spacing: 0.3px !important;
  padding: 0 4px !important;
  overflow: visible !important;
  white-space: nowrap !important;
}

.cert-footer-center-group {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 16px !important;
}

.cert-footer-v-divider {
  width: 1px !important;
  height: 48px !important;
  background: #cbd5e1 !important;
  margin: 0 4px !important;
  flex-shrink: 0 !important;
}

/* 11. Bottom Navy Bar */
.cert-bottom-navy-bar {
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 27px !important;
  background: #002865 !important;
  border-top: 1.5px solid #d4af37 !important;
  color: #ffffff !important;
  font-size: 9px !important;
  font-weight: 700 !important;
  letter-spacing: 2.2px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 14px !important;
  text-transform: uppercase !important;
  z-index: 4 !important;
  white-space: nowrap !important;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

.cert-bottom-navy-bar .bar-dash {
  display: inline-block !important;
  width: 80px !important;
  height: 1.5px !important;
  background: #ffffff !important;
  opacity: 0.9 !important;
  vertical-align: middle !important;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

.cert-bottom-navy-bar .cert-bar-dot {
  color: #f59e0b !important;
  font-weight: 900 !important;
  margin: 0 4px !important;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

/* 12. A4 Print Specific Overrides */
@media print {
  @page {
    size: A4 landscape;
    margin: 0;
  }
  html, body {
    width: 297mm !important;
    height: 210mm !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    overflow: hidden !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  #printable-certificate-card {
    position: fixed !important;
    left: 5.5mm !important;
    top: 5mm !important;
    width: 286mm !important;
    height: 200mm !important;
    margin: 0 !important;
    padding: 4mm 8mm 0 8mm !important;
    border: 3.5mm solid #002865 !important;
    border-bottom: none !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    overflow: hidden !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .cert-inner-gold-frame {
    display: block !important;
    position: absolute !important;
    top: 2mm !important;
    left: 2mm !important;
    right: 2mm !important;
    bottom: 7.2mm !important;
    border: 0.5mm solid #d4af37 !important;
    z-index: 2 !important;
    box-sizing: border-box !important;
  }
  .cert-photo-frame {
    width: 27mm !important;
    height: 33mm !important;
    border: 0.6mm solid #eab308 !important;
    outline: 0.4mm solid #00205b !important;
    background: #ffffff !important;
    box-shadow: none !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .cert-photo-frame .photo-hint {
    display: none !important;
  }
  .cert-bottom-navy-bar {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 7.2mm !important;
    background: #002865 !important;
    border-top: 0.4mm solid #d4af37 !important;
    color: #ffffff !important;
    font-size: 7.5pt !important;
    font-weight: 700 !important;
    letter-spacing: 1.8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    text-transform: uppercase !important;
    z-index: 20 !important;
    white-space: nowrap !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .cert-bottom-navy-bar * {
    color: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .cert-bottom-navy-bar .bar-dash {
    display: inline-block !important;
    width: 20mm !important;
    height: 0.4mm !important;
    background: #ffffff !important;
    opacity: 0.9 !important;
    vertical-align: middle !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .cert-bottom-navy-bar .cert-bar-dot {
    color: #f59e0b !important;
    font-weight: 900 !important;
    margin: 0 4px !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .cert-corner-geo-br {
    display: block !important;
    position: absolute !important;
    bottom: 0 !important;
    right: 0 !important;
    width: 28mm !important;
    height: 28mm !important;
    z-index: 12 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .cert-corner-geo-tl {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 24mm !important;
    height: 24mm !important;
    z-index: 2 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .cert-name-divider {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 1.5mm auto 3.5mm auto !important;
    max-width: 145mm !important;
  }
  .cert-name-divider-svg {
    width: 145mm !important;
    height: 5mm !important;
    display: block !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .cert-watermark-left {
    display: block !important;
    position: absolute !important;
    left: 4mm !important;
    top: 55mm !important;
    width: 72mm !important;
    height: 82mm !important;
    opacity: 0.80 !important;
    filter: contrast(1.06) brightness(1.02) !important;
    z-index: 1 !important;
  }
  .cert-watermark-right {
    display: block !important;
    position: absolute !important;
    left: 8mm !important;
    right: 8mm !important;
    top: 36mm !important;
    width: calc(100% - 16mm) !important;
    height: 95mm !important;
    object-fit: fill !important;
    opacity: 0.26 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    z-index: 1 !important;
    pointer-events: none !important;
  }
  .cert-side-motto-right {
    display: flex !important;
    position: absolute !important;
    right: 12mm !important;
    top: 60mm !important;
    z-index: 2 !important;
  }
  .cert-modern-footer {
    margin-top: auto !important;
    margin-bottom: 11.5mm !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: space-between !important;
    position: relative !important;
    z-index: 6 !important;
    padding: 0 4mm !important;
  }
  .cert-sig-col {
    width: 48mm !important;
    text-align: center !important;
    flex-shrink: 0 !important;
  }
  .cert-sig-script {
    font-family: 'Alex Brush', cursive !important;
    font-size: 24pt !important;
    color: #00205b !important;
    line-height: 1 !important;
    min-height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 2px !important;
  }
  .cert-sig-rule {
    width: 40mm !important;
    height: 1.5px !important;
    background: #00205b !important;
    margin: 2px auto 3px auto !important;
  }
  .cert-sig-col-issued .cert-sig-rule {
    background: #d4af37 !important;
  }
  .cert-footer-address {
    font-size: 7.5pt !important;
    font-weight: 700 !important;
    color: #00205b !important;
    margin-top: 1px !important;
    white-space: nowrap !important;
  }
  .cert-footer-types {
    font-size: 6.8pt !important;
    font-weight: 600 !important;
    color: #475569 !important;
    margin-top: 1px !important;
    white-space: nowrap !important;
  }
  .cert-sig-name {
    font-size: 8.5pt !important;
    font-weight: 800 !important;
    color: #00205b !important;
    margin: 0 !important;
    white-space: nowrap !important;
  }
  .cert-sig-role {
    font-size: 6.8pt !important;
    font-weight: 700 !important;
    color: #475569 !important;
    text-transform: uppercase !important;
    margin-top: 1px !important;
    white-space: nowrap !important;
  }
  .cert-footer-center-group {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4mm !important;
  }
  .cert-sec-box {
    width: 12mm !important;
    height: 12mm !important;
    border: 0.4mm solid #d4af37 !important;
    border-radius: 1.5mm !important;
    padding: 0.5mm !important;
    background: #ffffff !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 1.5mm !important;
  }
  .cert-gold-medal {
    width: 12mm !important;
    height: 12mm !important;
    margin-bottom: 1.5mm !important;
    display: block !important;
  }
  .cert-qr-code-box, .cert-qr-code-img {
    width: 12mm !important;
    height: 12mm !important;
    margin-bottom: 1.5mm !important;
  }
  .cert-verify-text, .cert-seal-dates {
    font-size: 6.8pt !important;
    line-height: 1.25 !important;
  }
  .cert-verify-text strong, .cert-seal-dates strong {
    font-size: 7.2pt !important;
  }
  .cert-footer-v-divider {
    width: 0.3mm !important;
    height: 11mm !important;
    background: #cbd5e1 !important;
    margin: 0 1.5mm !important;
  }
}


/* ==========================================================================
   MODERN ANIMATED & ATTRACTIVE ACHIEVEMENTS VIEW
   ========================================================================== */

.achievements-dashboard {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.5rem 0 3rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeIn 0.4s ease-out;
}

/* 1. Hero Overview Glass Card */
.achieve-hero-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.75) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 2.2rem 2.5rem;
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
  position: relative;
  overflow: hidden;
}

.achieve-hero-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.18) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.achieve-hero-main {
  flex: 1 1 540px;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  min-width: 0;
}

.achieve-hero-left {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  flex: 1 1 auto;
}

.achieve-trophy-orb {
  width: 90px;
  height: 90px;
  border-radius: 26px;
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 46px;
  position: relative;
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.4);
  animation: trophyFloat 3.5s ease-in-out infinite;
  flex-shrink: 0;
}

.achieve-trophy-glow {
  position: absolute;
  inset: -6px;
  border-radius: 32px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.5) 0%, transparent 70%);
  z-index: -1;
  animation: trophyPulse 2.5s ease-in-out infinite alternate;
}

@keyframes trophyFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-7px) rotate(2deg); }
}

@keyframes trophyPulse {
  0% { transform: scale(0.95); opacity: 0.6; }
  100% { transform: scale(1.15); opacity: 1; }
}

.achieve-hero-title-group {
  display: flex;
  flex-direction: column;
}

.achieve-rank-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
  width: fit-content;
  margin-bottom: 0.6rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.rank-sparkle {
  color: #f59e0b;
  font-size: 0.9rem;
}

.achieve-hero-title {
  font-size: 1.85rem;
  font-weight: 900;
  color: #ffffff;
  margin: 0 0 0.4rem 0;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.achieve-hero-subtitle {
  font-size: 0.92rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.5;
  max-width: 520px;
}

.achieve-hero-stats {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  flex: 0 1 auto;
}

.achieve-stat-item {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 1.4rem;
  border-radius: 18px;
  min-width: 135px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.25s ease;
}

.achieve-stat-item:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.18);
}

.achieve-stat-item .stat-label {
  font-size: 0.74rem;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: block;
  margin-bottom: 0.35rem;
}

.achieve-stat-item .stat-value {
  font-size: 1.65rem;
  font-weight: 900;
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  line-height: 1.1;
}

.achieve-stat-item .stat-value small {
  font-size: 0.88rem;
  color: #64748b;
  font-weight: 700;
}

.achieve-stat-item .text-speed {
  color: #38bdf8;
}
.achieve-stat-item .text-accuracy {
  color: #34d399;
}

/* Logged-in User Profile & Photo Card (Right side of Achievements Hero) */
.achieve-hero-user-card {
  flex: 0 1 375px;
  min-width: 310px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.88) 0%, rgba(30, 41, 59, 0.7) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.32);
  border-radius: 20px;
  padding: 1rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 1.35rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  backdrop-filter: blur(14px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.achieve-hero-user-card::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.22) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.achieve-hero-user-card:hover {
  border-color: rgba(56, 189, 248, 0.65);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(56, 189, 248, 0.25);
  transform: translateY(-2px);
}

.achieve-user-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.achieve-user-avatar-box {
  width: 125px;
  height: 125px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: #0f172a;
  border: 2.5px solid #38bdf8;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.achieve-user-avatar-box:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6), 0 0 26px rgba(56, 189, 248, 0.6);
}

.achieve-user-avatar-box.no-photo {
  border-style: dashed;
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(56, 189, 248, 0.08);
}

.achieve-user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.achieve-avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  color: #38bdf8;
  font-size: 0.75rem;
  font-weight: 700;
}

.achieve-user-avatar-box:hover .achieve-avatar-overlay {
  opacity: 1;
}

.achieve-avatar-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  text-align: center;
  padding: 0.5rem;
  color: #94a3b8;
}

.achieve-avatar-placeholder .avatar-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.achieve-avatar-placeholder .avatar-upload-hint {
  font-size: 0.68rem;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
}

.achieve-user-info-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.45rem;
}

.achieve-user-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 800;
  color: #34d399;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.achieve-user-status-badge .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.achieve-user-name {
  font-size: 1.35rem;
  font-weight: 900;
  color: #f8fafc;
  margin: 0;
  line-height: 1.25;
  word-break: break-word;
  letter-spacing: -0.3px;
}

.achieve-user-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.15rem;
}

.meta-tag {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.18rem 0.55rem;
  border-radius: 6px;
  color: #94a3b8;
  font-weight: 600;
}

.meta-tag.cert-tag {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.25);
  background: rgba(56, 189, 248, 0.08);
}

.achieve-user-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.btn-achieve-photo-action {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0.42rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 3px 10px rgba(2, 132, 199, 0.3);
}

.btn-achieve-photo-action:hover {
  background: linear-gradient(135deg, #0369a1, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(2, 132, 199, 0.45);
}

.btn-achieve-photo-remove {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 0.42rem 0.55rem;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-achieve-photo-remove:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  transform: translateY(-1px);
}

.btn-achieve-switch-user {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0.42rem 0.55rem;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-achieve-switch-user:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  transform: translateY(-1px);
}

@media (max-width: 992px) {
  .achieve-hero-user-card {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

/* 2. Overall Progress Banner Widget */
.achieve-progress-banner {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  padding: 1.1rem 1.6rem;
  backdrop-filter: blur(10px);
}

.progress-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.92rem;
  font-weight: 800;
}

.progress-title {
  color: #f1f5f9;
}

.progress-percent {
  color: #fbbf24;
  letter-spacing: 0.4px;
}

.achieve-progress-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 0.75rem;
  position: relative;
}


.achieve-progress-bar {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #3b82f6 0%, #10b981 50%, #f59e0b 100%);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.5);
  transition: width 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 3. Interactive Filter Tabs & Search Bar */
.achieve-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.achieve-filter-tabs {
  display: flex;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.65);
  padding: 0.4rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.achieve-tab-btn {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.achieve-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.achieve-tab-btn.active {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.45);
}

.tab-count {
  font-size: 0.78rem;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.15);
  font-weight: 900;
}

.count-unlocked {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
}

.count-locked {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
}

.achieve-search-box {
  position: relative;
  min-width: 260px;
  flex: 0 1 320px;
}

.achieve-search-box .search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 0.95rem;
  pointer-events: none;
}

.achieve-search-box input {
  width: 100%;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.65rem 1rem 0.65rem 2.6rem;
  color: #f8fafc;
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
  transition: all 0.25s ease;
  box-sizing: border-box;
}

.achieve-search-box input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
  background: rgba(15, 23, 42, 0.9);
}

/* 4. Achievements Grid */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 1.5rem;
  margin-top: 0.5rem;
}

/* 5. Achievement Card */
.achievement-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 290px;
  box-sizing: border-box;
  animation: cardEntrance 0.55s ease-out backwards;
}

@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Card Glow Effect */
.card-glow-bg {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background: radial-gradient(circle at 50% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Unlocked Card Styles */
.achievement-card.unlocked {
  border: 1.5px solid rgba(245, 158, 11, 0.5);
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.85) 0%, rgba(18, 25, 44, 0.95) 100%);
  box-shadow: 0 12px 30px -8px rgba(245, 158, 11, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.achievement-card.unlocked:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: #f59e0b;
  box-shadow: 0 20px 42px -10px rgba(245, 158, 11, 0.38), inset 0 0 22px rgba(245, 158, 11, 0.12);
}

.achievement-card.unlocked .card-glow-bg {
  background: radial-gradient(circle at 50% 20%, rgba(245, 158, 11, 0.14) 0%, transparent 70%);
}

/* Shimmer Sweep Animation */
.card-shimmer {
  position: absolute;
  top: 0;
  left: 0;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: translateX(-150%) skewX(-25deg);
  pointer-events: none;
  animation: shimmerSweep 6s infinite;
}

@keyframes shimmerSweep {
  0% { transform: translateX(-150%) skewX(-25deg); }
  25%, 100% { transform: translateX(250%) skewX(-25deg); }
}

/* Locked Card Styles */
.achievement-card.locked {
  opacity: 0.88;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.achievement-card.locked:hover {
  opacity: 1;
  transform: translateY(-5px);
  border-color: rgba(96, 165, 250, 0.35);
  box-shadow: 0 14px 30px -8px rgba(0, 0, 0, 0.6);
}

/* Card Top Row */
.card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.card-cat-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

.card-cat-pill.cat-speed {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.card-cat-pill.cat-accuracy {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.card-cat-pill.cat-keyboard, .card-cat-pill.cat-lesson {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.card-cat-pill.cat-mastery {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}
.card-cat-pill.cat-streak {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.card-status-pill {
  font-size: 0.72rem;
  font-weight: 900;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  letter-spacing: 0.6px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.status-unlocked {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.status-locked {
  background: rgba(100, 116, 139, 0.18);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

/* Badge Shield Centerpiece */
.card-badge-shield {
  width: 76px;
  height: 76px;
  margin: 0.5rem auto 1rem auto;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  position: relative;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.achievement-card:hover .card-badge-shield {
  transform: translateY(-4px) scale(1.08);
}

.shield-unlocked {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(217, 119, 6, 0.15) 100%);
  border: 1.5px solid rgba(245, 158, 11, 0.5);
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.shield-locked {
  background: rgba(15, 23, 42, 0.75);
  border: 1.5px dashed rgba(255, 255, 255, 0.15);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.shield-emoji {
  display: inline-block;
  user-select: none;
  transition: filter 0.4s ease, opacity 0.4s ease, transform 0.3s ease;
}

.shield-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.72) 20%, rgba(15, 23, 42, 0.4) 100%);
  border-radius: 20px;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.3s ease;
}

.shield-lock-overlay .lock-glyph {
  font-size: 1.35rem;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8));
  animation: pulseLock 2.5s ease-in-out infinite;
}

.shield-lock-overlay .lock-mini-pct {
  font-size: 0.65rem;
  font-weight: 800;
  color: #fbbf24;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(251, 191, 36, 0.4);
  padding: 1px 5px;
  border-radius: 8px;
  margin-top: 3px;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

@keyframes pulseLock {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.shield-halo {
  position: absolute;
  inset: -4px;
  border-radius: 26px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.3) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.shield-unlocked .shield-halo {
  opacity: 1;
}

/* Card Text */
.card-text-group {
  text-align: center;
  flex: 1 1 auto;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 0.25rem 0;
  letter-spacing: -0.3px;
}

.card-subtitle-ne {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fbbf24;
  margin: 0 0 0.5rem 0;
}

.achievement-card.locked .card-subtitle-ne {
  color: #94a3b8;
}

.card-desc {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.45;
  margin: 0;
}

/* Card Footer */
.card-footer {
  margin-top: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.card-completed-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: #34d399;
}

.card-completed-badge .check-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #34d399;
}

.card-req-box {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.req-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.req-label {
  color: #64748b;
}

.req-val {
  color: #38bdf8;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
}

.card-mini-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
}

.card-mini-bar {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #3b82f6, #38bdf8);
  transition: width 0.8s ease;
}

/* ==========================================================================
   INTERACTIVE BADGE DETAIL CELEBRATION MODAL
   ========================================================================== */
.badge-modal-content {
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 26px;
  padding: 2.5rem;
  max-width: 480px;
  width: 90%;
  text-align: center;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
  animation: modalScaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.badge-modal-shield {
  width: 110px;
  height: 110px;
  margin: 0 auto 1.5rem auto;
  border-radius: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 58px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3) 0%, rgba(217, 119, 6, 0.15) 100%);
  border: 2px solid rgba(245, 158, 11, 0.6);
  box-shadow: 0 15px 35px rgba(245, 158, 11, 0.4), inset 0 2px 6px rgba(255, 255, 255, 0.4);
  animation: trophyFloat 3s ease-in-out infinite;
}

.badge-modal-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: #ffffff;
  margin: 0 0 0.3rem 0;
}

.badge-modal-subne {
  font-size: 1rem;
  font-weight: 700;
  color: #fbbf24;
  margin: 0 0 1rem 0;
}

.badge-modal-desc {
  font-size: 0.95rem;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}


/* ==========================================================================
   ADMIN AUTHENTICATION & CREDENTIALS STYLES
   ========================================================================== */
.admin-auth-pwd-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.admin-auth-pwd-wrap input {
  padding-right: 2.85rem !important;
}

.admin-auth-toggle-pwd {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, color 0.15s ease;
  user-select: none;
  z-index: 2;
}

.admin-auth-toggle-pwd:hover {
  color: #38bdf8;
  transform: scale(1.15);
}

.admin-auth-error {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  font-size: 0.82rem;
  margin-top: 0.6rem;
  font-weight: 600;
  display: none;
  animation: fadeIn 0.25s ease-out;
  text-align: left;
}

.admin-auth-success {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  font-size: 0.82rem;
  margin-top: 0.6rem;
  font-weight: 600;
  display: none;
  animation: fadeIn 0.25s ease-out;
  text-align: left;
}


/* ==========================================================================
   EMAIL DISPATCH INBOX TOAST NOTIFICATION (DISABLED - NEVER LEAK OTP ON SCREEN)
   ========================================================================== */
.email-dispatch-toast {
  display: none !important;
}

@keyframes slideDownToast {
  from {
    opacity: 0;
    transform: translateY(-25px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.email-toast-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 0.5rem;
}

.email-toast-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #38bdf8;
  font-weight: 800;
  font-size: 0.95rem;
}

.email-toast-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 0.3rem;
  line-height: 1;
  transition: color 0.15s ease;
}

.email-toast-close:hover {
  color: #ef4444;
}

.email-toast-body {
  font-size: 0.86rem;
  color: #cbd5e1;
  line-height: 1.45;
}

.email-toast-otp-box {
  background: rgba(3, 7, 18, 0.75);
  border: 1.5px dashed #38bdf8;
  border-radius: 10px;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.5rem 0;
}

.email-toast-otp-code {
  font-family: monospace;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 5px;
  color: #fbbf24;
}

.email-toast-autofill-btn {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0.45rem 0.95rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.email-toast-autofill-btn:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
}

/* --- PREETI FONT CHART KEYBOARD & ALT CODES TABLE (KOTAHI TRAINING CENTER) --- */
.key.key-preeti-cyan {
  background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%) !important;
  border: 1.5px solid #7dd3fc !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.45) !important;
}

.key.key-preeti-cyan .shift-roman,
.key.key-preeti-cyan .normal-roman,
.key.key-preeti-cyan .shift-unicode,
.key.key-preeti-cyan .normal-unicode {
  color: #020617 !important;
  font-weight: 800 !important;
  text-shadow: none !important;
}

.preeti-alt-table-wrap {
  position: relative;
  z-index: 25;
  display: flex;
  align-items: stretch;
  justify-content: center;
  margin-top: 1.25rem;
  background: #ffffff;
  color: #000000;
  border: 2px solid #000000;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.preeti-alt-side-banner {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: 'Times New Roman', serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: #1e3a8a;
  letter-spacing: 1px;
  padding: 0.75rem 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  user-select: none;
}

.preeti-alt-side-banner.left {
  border-right: 2px solid #000000;
}

.preeti-alt-side-banner.right {
  border-left: 2px solid #000000;
}

.preeti-alt-main-card {
  flex: 1;
  background: #ffffff;
  overflow-x: auto;
}

.preeti-alt-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Times New Roman', 'Preeti', 'Kantipur', serif;
}

.preeti-alt-table td.preeti-alt-cell {
  border: 1.5px solid #000000;
  padding: 0.28rem 0.6rem;
  font-size: 0.96rem;
  font-weight: 700;
  color: #000000;
  text-align: center;
  background: #ffffff;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.preeti-alt-table td.preeti-alt-cell:hover {
  background: #e0f2fe;
}

.preeti-alt-table td.preeti-alt-cell .alt-code-lbl {
  font-family: Arial, sans-serif;
  font-size: 0.86rem;
  font-weight: 800;
  color: #0f172a;
  margin-right: 0.35rem;
}

.preeti-alt-table td.preeti-alt-cell .alt-char-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: #000000;
}

.preeti-alt-table td.preeti-alt-cell.empty {
  background: #f8fafc;
}

.preeti-alt-table td.preeti-alt-cell.alt-cell-active-press {
  background: #0284c7 !important;
  color: #ffffff !important;
}

.preeti-alt-table td.preeti-alt-cell.alt-cell-required-highlight {
  background: #fde047 !important;
  color: #0f172a !important;
  box-shadow: inset 0 0 0 2px #d97706, 0 0 12px rgba(234, 179, 8, 0.8) !important;
  font-weight: 800 !important;
}
