/* ==========================================================================
   PBX COMMANDER: OPERATION P-SERIES
   Cyber-Telecom Neo-Arcade Theme (Thai + English)
   ========================================================================== */

:root {
  --bg-deep: #070c18;
  --bg-panel: rgba(15, 23, 42, 0.86);
  --bg-card: rgba(20, 31, 56, 0.88);
  --bg-card-hover: rgba(30, 46, 82, 0.94);
  --border: rgba(148, 163, 184, 0.16);
  --border-bright: rgba(56, 189, 248, 0.42);

  --text-main: #f1f5f9;
  --text-sub: #94a3b8;
  --text-dim: #64748b;

  --cyan: #38bdf8;
  --emerald: #10b981;
  --amber: #f59e0b;
  --gold: #fbbf24;
  --rose: #f43f5e;
  --violet: #a855f7;

  --font-ui: 'Prompt', 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 20px 50px rgba(2, 6, 23, 0.55);
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-ui);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input {
  font-family: inherit;
}

.hidden {
  display: none !important;
}

/* ==================== ANIMATED CYBER-TELECOM BACKDROP ==================== */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 25%, black 35%, transparent 90%);
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.25;
}

.bg-glow-1 {
  width: 520px;
  height: 520px;
  top: -160px;
  left: -120px;
  background: radial-gradient(circle, #0284c7, transparent 70%);
}

.bg-glow-2 {
  width: 540px;
  height: 540px;
  bottom: -180px;
  right: -120px;
  background: radial-gradient(circle, #9333ea, transparent 70%);
}

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

/* ==================== TOPBAR ==================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 12, 24, 0.84);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  text-align: left;
  padding: 0;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(168, 85, 247, 0.25));
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
}

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

.brand-title {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  background: linear-gradient(90deg, #e0f2fe, #38bdf8, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 0.74rem;
  color: var(--text-sub);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: var(--text-sub);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-pill:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.nav-pill.active {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.nav-pill-live {
  text-decoration: none;
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(192, 132, 252, 0.45);
  color: #f5d0fe;
}

.nav-pill-live:hover {
  background: linear-gradient(135deg, #9333ea, #ec4899);
  color: #fff;
}

.live-arena-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.24), rgba(236, 72, 153, 0.16), rgba(14, 165, 233, 0.2));
  border: 1.5px solid rgba(192, 132, 252, 0.52);
  box-shadow: 0 14px 36px rgba(147, 51, 234, 0.18);
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.live-arena-left { flex: 1; min-width: 260px; }

.live-arena-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.2);
  border: 1px solid rgba(251, 191, 36, 0.5);
  color: #fde047;
  margin-bottom: 8px;
}

.live-arena-title {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 800;
}

.live-arena-desc {
  margin: 0;
  font-size: 0.88rem;
  color: #e2e8f0;
}

.live-arena-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.arena-link-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.career-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 12px;
  background: rgba(251, 191, 36, 0.09);
  border: 1px solid rgba(251, 191, 36, 0.32);
}

.chip-icon {
  font-size: 1.15rem;
}

.chip-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.chip-label {
  font-size: 0.66rem;
  color: var(--text-sub);
}

.chip-val {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--gold);
}

.ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 13px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(30, 41, 59, 0.8);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.ctrl-btn:hover {
  border-color: var(--cyan);
  transform: translateY(-1px);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.25);
}

.lang-btn {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(14, 165, 233, 0.14);
}

.icon-btn {
  width: 38px;
  padding: 0;
}

/* ==================== MAIN CONTAINER & VIEWS ==================== */
.app-shell {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 20px 70px;
}

.view {
  display: none;
  animation: fadeSlideIn 0.28s ease;
}

.view.active {
  display: block;
}

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

/* ==================== HERO & PROFILE PANEL ==================== */
.hero-card {
  display: grid;
  grid-template-columns: 1.35fr 0.95fr;
  gap: 24px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(22, 33, 62, 0.88));
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--gold));
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.3); }
}

.hero-title {
  margin: 0 0 10px;
  font-size: clamp(1.65rem, 2.8vw, 2.35rem);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.01em;
}

.hero-desc {
  margin: 0 0 18px;
  color: #cbd5e1;
  font-size: 0.96rem;
}

.double-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(234, 88, 12, 0.14));
  border: 1px solid rgba(251, 191, 36, 0.45);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.12);
}

.double-badge-pill {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 800;
  color: #1c1917;
  background: linear-gradient(135deg, #fde047, #f59e0b);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.55);
  animation: floatSlow 2.6s ease-in-out infinite;
}

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

.double-banner-title {
  font-weight: 700;
  color: #fde68a;
  font-size: 0.92rem;
}

.double-banner-desc {
  font-size: 0.82rem;
  color: #fef3c7;
  opacity: 0.88;
}

/* Profile Panel */
.profile-panel {
  height: 100%;
  background: rgba(9, 14, 28, 0.72);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.rack-leds {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.led {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.led.green { background: var(--emerald); box-shadow: 0 0 8px var(--emerald); }
.led.cyan  { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.led.amber { background: var(--amber); box-shadow: 0 0 8px var(--amber); }

.rack-label {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
}

.rank-showcase {
  display: flex;
  align-items: center;
  gap: 14px;
}

.rank-emblem {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(168, 85, 247, 0.2));
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.mini-label {
  font-size: 0.72rem;
  color: var(--text-sub);
}

.rank-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: #f8fafc;
}

.xp-bar-wrap {
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--emerald), var(--gold));
  transition: width 0.5s ease;
}

.xp-caption {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-sub);
  text-align: right;
  margin-top: -8px;
}

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

.p-stat {
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10px 8px;
  text-align: center;
}

.p-stat-val {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--cyan);
}

.p-stat-lbl {
  font-size: 0.7rem;
  color: var(--text-sub);
}

/* ==================== GAME MODE CARDS ==================== */
.modes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.mode-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: all 0.22s ease;
  position: relative;
  overflow: hidden;
}

.mode-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(2, 6, 23, 0.5);
}

.mode-arcade {
  border-color: rgba(56, 189, 248, 0.35);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.16), rgba(30, 41, 59, 0.88));
}
.mode-arcade:hover { border-color: var(--cyan); }

.mode-double {
  border-color: rgba(251, 191, 36, 0.5);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(154, 52, 18, 0.3));
}
.mode-double:hover {
  border-color: var(--gold);
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.25);
}

.mode-repair {
  border-color: rgba(244, 63, 94, 0.35);
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.14), rgba(30, 41, 59, 0.88));
}
.mode-repair:hover { border-color: var(--rose); }
.mode-repair:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.mode-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.mode-body {
  flex: 1;
}

.mode-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mode-title {
  font-weight: 700;
  font-size: 1.02rem;
}

.mode-desc {
  font-size: 0.8rem;
  color: #cbd5e1;
  margin-top: 2px;
}

.mini-2x {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--gold);
  color: #1c1917;
}

.missed-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(244, 63, 94, 0.28);
  border: 1px solid rgba(244, 63, 94, 0.5);
  color: #fda4af;
}

.mode-arrow {
  font-size: 1rem;
  opacity: 0.65;
  transition: transform 0.2s;
}

.mode-card:hover .mode-arrow {
  transform: translateX(4px);
  opacity: 1;
}

/* ==================== SECTORS GRID ==================== */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.section-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.section-sub {
  margin: 4px 0 0;
  font-size: 0.86rem;
  color: var(--text-sub);
}

.sectors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}

.sector-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: all 0.22s ease;
  position: relative;
  overflow: hidden;
}

.sector-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--sec-color, var(--cyan));
}

.sector-card:hover {
  transform: translateY(-4px);
  border-color: var(--sec-color, var(--cyan));
  background: var(--bg-card-hover);
  box-shadow: 0 16px 32px rgba(2, 6, 23, 0.55);
}

.sector-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sector-code {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--sec-color, var(--cyan));
}

.sector-stars {
  font-size: 0.95rem;
  letter-spacing: 2px;
}

.sector-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sector-icon {
  font-size: 1.9rem;
}

.sector-name {
  font-weight: 700;
  font-size: 1.05rem;
}

.sector-desc {
  font-size: 0.82rem;
  color: var(--text-sub);
  margin: 0;
}

.sector-progress-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
}

.sector-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--sec-color, var(--cyan));
  transition: width 0.4s ease;
}

.sector-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-sub);
  margin-top: auto;
  padding-top: 4px;
}

.sector-badges {
  display: flex;
  gap: 6px;
  align-items: center;
}

.sec-pill {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.12);
}

.sec-pill.gold {
  background: rgba(251, 191, 36, 0.18);
  color: #fde047;
  font-weight: 700;
}

.sec-launch {
  font-weight: 700;
  color: var(--sec-color, var(--cyan));
}

/* ==================== GAMEPLAY HUD & MISSION CONSOLE ==================== */
.game-hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 12px;
  margin-bottom: 14px;
  align-items: stretch;
}

.hud-box {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hud-lbl {
  font-size: 0.7rem;
  color: var(--text-sub);
}

.hud-val {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 800;
}

.score-val { color: var(--gold); }
.streak-val { color: var(--cyan); }
.streak-val.hot { color: #fb923c; text-shadow: 0 0 14px rgba(251, 146, 60, 0.65); }
.shields-val { font-size: 1.05rem; letter-spacing: 2px; }

.quit-btn {
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(244, 63, 94, 0.35);
  background: rgba(244, 63, 94, 0.12);
  color: #fda4af;
  font-weight: 600;
  font-size: 0.84rem;
  cursor: pointer;
  transition: all 0.2s;
}

.quit-btn:hover {
  background: rgba(244, 63, 94, 0.25);
  color: #fff;
}

/* PBX Rack Strip */
.pbx-rack-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  background: rgba(9, 14, 28, 0.88);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.rack-ports {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.port-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #94a3b8;
}

.speed-meter {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
}

.speed-lbl {
  font-size: 0.74rem;
  color: var(--text-sub);
  white-space: nowrap;
}

.speed-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
}

.speed-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald), var(--cyan));
  transition: width 0.2s linear;
}

.speed-pts {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: #6ee7b7;
  min-width: 34px;
  text-align: right;
}

/* Main Mission Card */
.mission-card {
  background: var(--bg-panel);
  border: 1.5px solid var(--border-bright);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.mission-card.is-hard {
  border-color: rgba(251, 191, 36, 0.72);
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.18), var(--shadow-card);
}

.mission-card.is-boss {
  border-color: rgba(244, 63, 94, 0.85);
  box-shadow: 0 0 48px rgba(244, 63, 94, 0.25), 0 0 24px rgba(251, 191, 36, 0.2), var(--shadow-card);
}

.mission-card.shake {
  animation: shakeAnim 0.38s ease;
}

@keyframes shakeAnim {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(4px); }
}

.mission-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.mission-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.diff-badge {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.diff-badge.normal {
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
}

.diff-badge.hard {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #fff;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.45);
  animation: glowGold 1.8s ease-in-out infinite;
}

.diff-badge.boss {
  background: linear-gradient(135deg, #e11d48, #f59e0b);
  color: #fff;
  box-shadow: 0 0 22px rgba(244, 63, 94, 0.55);
  animation: glowGold 1.3s ease-in-out infinite;
}

@keyframes glowGold {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.18); }
}

.mission-tag {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
}

.peek-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.12);
  color: #bae6fd;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}

.peek-btn:hover, .peek-btn.active {
  background: rgba(56, 189, 248, 0.28);
  color: #fff;
}

.overclock-banner {
  margin-bottom: 14px;
  padding: 8px 14px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.24), rgba(245, 158, 11, 0.12));
  border: 1px solid var(--gold);
  color: #fde047;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.84rem;
  text-align: center;
  letter-spacing: 0.05em;
}

.scenario-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 15px;
  border-radius: 12px;
  background: rgba(14, 165, 233, 0.09);
  border-left: 3px solid var(--cyan);
  margin-bottom: 16px;
}

.scenario-icon {
  font-size: 1.15rem;
  margin-top: 1px;
}

.scenario-text {
  font-size: 0.88rem;
  color: #bae6fd;
}

.question-block {
  margin-bottom: 18px;
}

.question-text {
  margin: 0;
  font-size: clamp(1.12rem, 2vw, 1.38rem);
  font-weight: 700;
  line-height: 1.45;
  color: #ffffff;
}

.question-alt {
  margin-top: 6px;
  font-size: 0.92rem;
  color: #7dd3fc;
  padding-left: 10px;
  border-left: 2px solid rgba(125, 211, 252, 0.45);
}

.alt-lang-text {
  margin-top: 4px;
  font-size: 0.8rem;
  color: #7dd3fc;
  opacity: 0.9;
}

/* Gadgets */
.gadgets-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.gadget-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 11px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(30, 41, 59, 0.78);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}

.gadget-btn:hover:not(:disabled) {
  border-color: var(--cyan);
  background: rgba(56, 189, 248, 0.16);
  transform: translateY(-2px);
}

.gadget-btn.gadget-gold {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(245, 158, 11, 0.14);
  color: #fde68a;
}

.gadget-btn.gadget-gold:hover:not(:disabled) {
  border-color: var(--gold);
  background: rgba(245, 158, 11, 0.28);
}

.gadget-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.gadget-qty {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
}

/* Hint Box */
.hint-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 15px;
  border-radius: 12px;
  background: rgba(168, 85, 247, 0.14);
  border: 1px solid rgba(168, 85, 247, 0.45);
  margin-bottom: 16px;
  animation: fadeSlideIn 0.22s ease;
}

.hint-text {
  font-size: 0.88rem;
  color: #e9d5ff;
}

/* Switchboard Answer Choices */
.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.option-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1.5px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.75);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--cyan);
  background: rgba(30, 58, 138, 0.34);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(14, 165, 233, 0.2);
}

.option-key {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.86rem;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
}

.option-content {
  flex: 1;
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.45;
  padding-top: 3px;
}

.option-btn.eliminated {
  opacity: 0.24;
  text-decoration: line-through;
  pointer-events: none;
  filter: grayscale(1);
}

.option-btn.correct {
  border-color: var(--emerald);
  background: rgba(16, 185, 129, 0.2);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.3);
}

.option-btn.correct .option-key {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #022c22;
}

.option-btn.wrong {
  border-color: var(--rose);
  background: rgba(244, 63, 94, 0.2);
}

.option-btn.wrong .option-key {
  background: var(--rose);
  border-color: var(--rose);
  color: #fff;
}

.option-btn:disabled {
  cursor: default;
}

/* Floating Score Popup */
.float-score {
  position: fixed;
  z-index: 90;
  pointer-events: none;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--emerald);
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
  animation: floatUpScore 1.15s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.float-score.gold {
  color: #fde047;
  font-size: 1.55rem;
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.8), 0 4px 14px rgba(0, 0, 0, 0.8);
}

@keyframes floatUpScore {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.75); }
  20% { opacity: 1; transform: translate(-50%, -18px) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -95px) scale(0.95); }
}

/* Feedback Panel */
.feedback-panel {
  border-radius: var(--radius-md);
  padding: 18px 20px;
  border: 1.5px solid var(--border);
  margin-top: 10px;
  animation: fadeSlideIn 0.24s ease;
}

.feedback-panel.is-win {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.5);
}

.feedback-panel.is-double-win {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(16, 185, 129, 0.14));
  border-color: rgba(251, 191, 36, 0.7);
}

.feedback-panel.is-fail {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.5);
}

.feedback-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.feedback-icon {
  font-size: 1.8rem;
}

.feedback-title {
  font-weight: 800;
  font-size: 1.08rem;
}

.feedback-breakdown {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #fde68a;
  margin-top: 2px;
}

.feedback-correct-row {
  padding: 10px 13px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.35);
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.fb-label {
  color: #6ee7b7;
  font-weight: 700;
  margin-right: 6px;
}

.feedback-tip {
  padding: 11px 14px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border);
  margin-bottom: 14px;
}

.fb-tip-lbl {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--cyan);
  margin-bottom: 3px;
}

.fb-tip-text {
  font-size: 0.9rem;
  color: #e2e8f0;
}

.feedback-actions {
  display: flex;
  justify-content: flex-end;
}

.kbd-hint {
  margin-top: 14px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Buttons */
.primary-btn, .gold-btn, .warn-btn, .ghost-btn, .danger-ghost-btn {
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all 0.18s ease;
}

.primary-btn {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #fff;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.35);
}

.primary-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.gold-btn {
  background: linear-gradient(135deg, #fbbf24, #ea580c);
  color: #1c1917;
  font-weight: 800;
}

.gold-btn:hover { transform: translateY(-2px); filter: brightness(1.08); }

.warn-btn {
  background: rgba(244, 63, 94, 0.2);
  border: 1px solid rgba(244, 63, 94, 0.55);
  color: #fda4af;
}

.warn-btn:hover { background: rgba(244, 63, 94, 0.32); color: #fff; }

.ghost-btn {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border);
  color: var(--text-main);
}

.ghost-btn:hover { border-color: var(--cyan); }

.danger-ghost-btn {
  padding: 8px 14px;
  font-size: 0.82rem;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af;
}

.danger-ghost-btn:hover { background: rgba(244, 63, 94, 0.25); color: #fff; }

/* ==================== RESULTS SCREEN ==================== */
.result-card {
  max-width: 780px;
  margin: 10px auto;
  background: var(--bg-panel);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.result-stars {
  font-size: 2.8rem;
  letter-spacing: 8px;
  margin-bottom: 8px;
}

.result-title {
  margin: 0 0 14px;
  font-size: 1.75rem;
  font-weight: 800;
}

.rankup-banner {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.25), rgba(168, 85, 247, 0.25));
  border: 1px solid var(--gold);
  color: #fde047;
  font-weight: 700;
  margin-bottom: 18px;
}

.result-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin: 18px 0 24px;
}

.r-stat {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 10px;
}

.r-stat.highlight {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(14, 165, 233, 0.14);
}

.r-stat.gold {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(245, 158, 11, 0.12);
}

.r-stat-val {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
}

.r-stat.gold .r-stat-val { color: var(--gold); }
.r-stat.highlight .r-stat-val { color: var(--cyan); }

.r-stat-lbl {
  font-size: 0.74rem;
  color: var(--text-sub);
  margin-top: 4px;
}

.save-score-box {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 22px;
}

.save-title {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: #fde68a;
}

.save-row {
  display: flex;
  gap: 10px;
  max-width: 460px;
  margin: 0 auto;
}

.callsign-input, .search-input {
  flex: 1;
  padding: 11px 14px;
  border-radius: 11px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(7, 12, 24, 0.85);
  color: var(--text-main);
  font-size: 0.92rem;
  outline: none;
}

.callsign-input:focus, .search-input:focus {
  border-color: var(--cyan);
}

.save-status {
  margin-top: 8px;
  font-size: 0.84rem;
  color: #6ee7b7;
  font-weight: 600;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==================== CODEX ==================== */
.codex-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.75);
  color: var(--text-sub);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.filter-pill.active {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #082f49;
}

.codex-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.codex-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.codex-item.hard-item {
  border-color: rgba(251, 191, 36, 0.38);
}

.codex-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.72rem;
}

.codex-q {
  font-weight: 700;
  font-size: 0.94rem;
}

.codex-ans {
  font-size: 0.86rem;
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.11);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 9px;
  padding: 8px 10px;
}

.codex-tip {
  font-size: 0.82rem;
  color: #cbd5e1;
}

/* ==================== HALL OF FAME & BADGES ==================== */
.board-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 18px;
}

.board-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.panel-heading {
  margin: 0 0 16px;
  font-size: 1.08rem;
  font-weight: 800;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border);
}

.lb-row.top1 {
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(245, 158, 11, 0.14);
}

.lb-rank {
  font-family: var(--font-mono);
  font-weight: 800;
  width: 30px;
  text-align: center;
  font-size: 1rem;
}

.lb-info { flex: 1; }
.lb-name { font-weight: 700; font-size: 0.95rem; }
.lb-sub { font-size: 0.74rem; color: var(--text-sub); }
.lb-score {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--gold);
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.badge-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border);
  opacity: 0.45;
  filter: grayscale(0.9);
}

.badge-card.unlocked {
  opacity: 1;
  filter: none;
  border-color: rgba(251, 191, 36, 0.5);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.14), rgba(30, 41, 59, 0.8));
}

.badge-ico { font-size: 1.65rem; }
.badge-name { font-weight: 700; font-size: 0.88rem; }
.badge-desc { font-size: 0.75rem; color: var(--text-sub); }

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-container {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 13px;
  background: rgba(15, 23, 42, 0.96);
  border: 1.5px solid var(--gold);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  color: #fff;
  animation: fadeSlideIn 0.25s ease;
}

.toast-ico { font-size: 1.4rem; }
.toast-title { font-weight: 700; font-size: 0.86rem; color: #fde047; }
.toast-sub { font-size: 0.76rem; color: #cbd5e1; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 960px) {
  .hero-card { grid-template-columns: 1fr; }
  .modes-grid { grid-template-columns: 1fr; }
  .board-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .options-grid { grid-template-columns: 1fr; }
  .game-hud { grid-template-columns: repeat(2, 1fr); }
  .quit-btn { grid-column: 1 / -1; padding: 10px; }
  .badges-grid { grid-template-columns: 1fr; }
  .top-nav { order: 3; width: 100%; justify-content: center; }
  .mission-card { padding: 18px; }
  .save-row { flex-direction: column; }
}


/* ==========================================================================
   MEMBER AUTH BUTTON & MODAL (MySQL MEMBER SYSTEM)
   ========================================================================== */
.member-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.18), rgba(168, 85, 247, 0.2));
  color: #e0f2fe;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-chip-btn:hover {
  border-color: #38bdf8;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.22);
}

.member-chip-btn.logged-in {
  border-color: rgba(16, 185, 129, 0.55);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(56, 189, 248, 0.18));
  color: #ecfdf5;
}

.member-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(3, 7, 18, 0.78);
  backdrop-filter: blur(10px);
}

.member-modal-backdrop.hidden { display: none !important; }

.member-modal-box {
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 22px;
  padding: 24px 24px 22px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  color: #f8fafc;
}

.mm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.mm-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
}

.mm-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5e1;
  font-size: 1rem;
  cursor: pointer;
}

.mm-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(7, 12, 24, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.mm-tab {
  padding: 9px 12px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}

.mm-tab.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.32), rgba(168, 85, 247, 0.32));
  color: #fff;
}

.mm-err {
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(244, 63, 94, 0.16);
  border: 1px solid rgba(244, 63, 94, 0.5);
  color: #fda4af;
  font-size: 0.84rem;
  margin-bottom: 12px;
}

.mm-err.hidden { display: none !important; }

.mm-field { margin-bottom: 12px; }
.mm-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 5px;
}

.mm-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(7, 12, 24, 0.78);
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.9rem;
}

.mm-input:focus {
  outline: none;
  border-color: #38bdf8;
}

.mm-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mm-avatars {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mm-av {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid rgba(148, 163, 184, 0.25);
  background: rgba(7, 12, 24, 0.75);
  font-size: 1.2rem;
  cursor: pointer;
}

.mm-av.selected {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.24);
}

.mm-profile-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(56, 189, 248, 0.14));
  border: 1px solid rgba(16, 185, 129, 0.35);
  margin-bottom: 16px;
}

.mm-profile-av {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.85rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.mm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
}

.mm-sync-badge {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
  margin-left: 8px;
}


/* ==========================================================================
   CONFIDENTIAL CLASS ACCESS GATE & ACTIVE CLASS BANNER
   ========================================================================== */
.class-gate {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(circle at 20% 20%, rgba(14, 165, 233, 0.2), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(244, 63, 94, 0.16), transparent 45%),
    rgba(4, 8, 20, 0.96);
  backdrop-filter: blur(18px);
}

.class-gate.hidden { display: none !important; }

.class-gate-card {
  width: 100%;
  max-width: 460px;
  padding: 32px 28px 26px;
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(56, 189, 248, 0.42);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.72), 0 0 45px rgba(56, 189, 248, 0.12);
  color: #f8fafc;
}

.cg-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.cg-head {
  text-align: center;
  margin-bottom: 22px;
}

.cg-title {
  margin: 0 0 6px;
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(90deg, #6ee7b7, #38bdf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cg-sub {
  margin: 0;
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.55;
}

.cg-code-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 13px;
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  background: rgba(7, 12, 24, 0.85);
  color: #7dd3fc;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.cg-code-input:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.cg-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.8rem;
}

.cg-footer a {
  color: #7dd3fc;
  text-decoration: none;
  font-weight: 600;
}

.cg-footer a:hover { text-decoration: underline; }

.class-status-bar {
  position: relative;
  z-index: 35;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.14), rgba(56, 189, 248, 0.14), rgba(168, 85, 247, 0.14));
  border-bottom: 1px solid rgba(56, 189, 248, 0.3);
  padding: 8px 20px;
}

.class-status-bar.hidden { display: none !important; }

.class-status-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.82rem;
}

.cs-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cs-pill {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
}

.cs-timer {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: #fde68a;
}

.cs-leave-btn {
  padding: 4px 11px;
  border-radius: 8px;
  border: 1px solid rgba(244, 63, 94, 0.45);
  background: rgba(244, 63, 94, 0.12);
  color: #fda4af;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.cs-leave-btn:hover { background: rgba(244, 63, 94, 0.25); }
