/* ==========================================================================
   ✦ SMART KURDS PLUS - CCNA ROUTING ARCADE ENHANCED STYLES ✦
   Integrated directly into Subnetting Master (ماستەری سەبنێتینگ)
   Pixel-perfect responsive design for Desktop & Mobile
   ========================================================================== */

.routing-arcade-container {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  width: 100%;
  max-width: 1360px;
  min-height: calc(100vh - 240px);
  margin: 0 auto;
  padding-bottom: 2.5rem;
}

@media (min-width: 1600px) {
  .routing-arcade-container {
    max-width: 1520px;
  }
}

/* ================= HEADER & HUD STATS ================= */
.routing-arcade-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.2rem;
  background: var(--bg-card, rgba(13, 21, 41, 0.9));
  border: 1px solid var(--border-glow, rgba(0, 245, 212, 0.25));
  border-radius: var(--radius-lg, 16px);
  padding: 1.4rem 1.8rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.subnet-arcade-branding {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.subnet-arcade-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(0, 245, 212, 0.12);
  border: 1px solid var(--accent-cyan, #00f5d4);
  color: var(--accent-cyan, #00f5d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 0 20px rgba(0, 245, 212, 0.25);
  flex-shrink: 0;
}

.subnet-arcade-branding h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
  line-height: 1.3;
}

.subnet-arcade-branding p {
  font-size: 0.88rem;
  color: var(--text-muted, #94a3b8);
  margin: 0.25rem 0 0 0;
  line-height: 1.5;
}

.subnet-hud-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.arcade-hud-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill, 9999px);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  font-size: 0.88rem;
  font-weight: 700;
}

.arcade-hud-pill.gold {
  border-color: rgba(255, 190, 11, 0.45);
  color: #ffbe0b;
  box-shadow: 0 0 15px rgba(255, 190, 11, 0.15);
}

.arcade-hud-pill.flame {
  border-color: rgba(244, 63, 94, 0.45);
  color: #fb7185;
  box-shadow: 0 0 15px rgba(244, 63, 94, 0.15);
}

.cyber-btn {
  background: rgba(14, 23, 44, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md, 10px);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 1.1rem;
}

.cyber-btn:hover {
  background: rgba(22, 36, 70, 0.95);
  border-color: var(--accent-cyan, #00f5d4);
  color: var(--accent-cyan, #00f5d4);
  box-shadow: 0 0 18px rgba(0, 245, 212, 0.3);
  transform: translateY(-2px);
}

/* ================= 6 SUBMODE SELECTOR CARDS ================= */
.routing-submode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
  margin-bottom: 1.8rem;
}

.routing-submode-grid .game-submode-btn {
  background: var(--bg-card, rgba(13, 21, 41, 0.85));
  border: 1.5px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-lg, 14px);
  padding: 1.2rem 1.3rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: right;
  gap: 0.45rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

html[dir="ltr"] .routing-submode-grid .game-submode-btn {
  text-align: left;
  align-items: flex-start;
}

.routing-submode-grid .game-submode-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(20, 32, 60, 0.95);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.routing-submode-grid .game-submode-btn.active {
  background: linear-gradient(145deg, rgba(15, 30, 65, 0.95), rgba(8, 16, 38, 0.98)) !important;
  border-color: var(--accent-cyan, #00f5d4) !important;
  box-shadow: 0 0 25px rgba(0, 245, 212, 0.25), 0 8px 30px rgba(0, 0, 0, 0.5) !important;
}

.routing-submode-grid .submode-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.7rem;
  border-radius: 6px;
  border: 1px solid;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.routing-submode-grid .submode-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0.15rem;
}

.routing-submode-grid .submode-desc {
  font-size: 0.84rem;
  color: var(--text-muted, #94a3b8);
  line-height: 1.6;
  margin: 0;
  word-break: break-word;
}

/* ================= PLAY STAGE CARD ================= */
.routing-play-stage-card {
  background: var(--bg-card, rgba(13, 21, 41, 0.92));
  border: 1px solid rgba(0, 245, 212, 0.28);
  border-radius: var(--radius-xl, 20px);
  padding: 2.4rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(0, 245, 212, 0.08);
  position: relative;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* ================= ARCADE TELEMETRY & CHEAT-SHEET STRIP (COLLAPSIBLE ACCORDION) ================= */
.arcade-stage-telemetry-bar {
  margin-top: 1.8rem;
  background: rgba(8, 14, 28, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 12px;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.45);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.arcade-stage-telemetry-bar:hover {
  border-color: rgba(56, 189, 248, 0.45);
}

.telemetry-accordion-toggle {
  width: 100%;
  background: transparent;
  border: none;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  text-align: inherit;
  font-family: inherit;
  color: inherit;
  transition: background 0.25s ease;
  user-select: none;
  box-sizing: border-box;
}

.telemetry-accordion-toggle:hover {
  background: rgba(56, 189, 248, 0.08);
}

.telemetry-bar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.015em;
  text-align: start;
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
  line-height: 1.45;
}

.telemetry-toggle-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.32);
  color: #38bdf8;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  margin-inline-start: auto;
  transition: all 0.25s ease;
  box-sizing: border-box;
}

.telemetry-accordion-toggle:hover .telemetry-toggle-badge {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.55);
  color: #ffffff;
}

.toggle-chevron {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.75rem;
  display: inline-block;
}

/* Accordion Body with smooth height and opacity transition */
.telemetry-accordion-body {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, padding 0.35s ease;
  padding: 0 1.2rem;
  box-sizing: border-box;
}

.arcade-stage-telemetry-bar.open .telemetry-accordion-body {
  max-height: 600px;
  opacity: 1;
  padding: 0.2rem 1.2rem 1.1rem 1.2rem;
}

.arcade-stage-telemetry-bar.open .toggle-chevron {
  transform: rotate(180deg);
}

.arcade-stage-telemetry-bar.open .telemetry-toggle-badge {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.telemetry-accordion-content {
  padding-top: 0.35rem;
}

.telemetry-bar-desc {
  font-size: 0.85rem;
  color: #cbd5e1;
  line-height: 1.6;
}

.telemetry-chips-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.telemetry-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}

.telemetry-chip strong {
  color: #00f5d4;
}

.telemetry-chip.connected {
  border-color: rgba(16, 185, 129, 0.4);
}

.telemetry-chip.connected strong {
  color: #10b981;
}

.telemetry-chip.static {
  border-color: rgba(56, 189, 248, 0.4);
}

.telemetry-chip.static strong {
  color: #38bdf8;
}

.telemetry-chip.ebgp {
  border-color: rgba(234, 179, 8, 0.4);
}

.telemetry-chip.ebgp strong {
  color: #facc15;
}

.telemetry-chip.eigrp {
  border-color: rgba(168, 85, 247, 0.4);
}

.telemetry-chip.eigrp strong {
  color: #c084fc;
}

.telemetry-chip.ospf {
  border-color: rgba(249, 115, 22, 0.4);
}

.telemetry-chip.ospf strong {
  color: #fb923c;
}

.telemetry-chip.isis {
  border-color: rgba(236, 72, 153, 0.4);
}

.telemetry-chip.isis strong {
  color: #f472b6;
}

.telemetry-chip.rip {
  border-color: rgba(239, 68, 68, 0.4);
}

.telemetry-chip.rip strong {
  color: #f87171;
}

.telemetry-chip.ibgp {
  border-color: rgba(148, 163, 184, 0.4);
}

.telemetry-chip.ibgp strong {
  color: #94a3b8;
}

.scenario-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-pill, 9999px);
  background: rgba(0, 245, 212, 0.12);
  border: 1px solid rgba(0, 245, 212, 0.35);
  color: var(--accent-cyan, #00f5d4);
  font-size: 0.86rem;
  font-weight: 700;
}

/* ================= GAME 1: ROUTING DETECTIVE & QUESTION OPTION CARDS ================= */
.route-candidates-grid,
.routes-selection-grid,
.lpm-candidates-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.4rem;
  margin-top: 1.2rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .route-candidates-grid,
  .routes-selection-grid,
  .lpm-candidates-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0.85rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* Option Header Badge Row (First Option vs Second Option) */
.option-header-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.option-number-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.8rem;
  border-radius: var(--radius-pill, 9999px);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  max-width: 100%;
  box-sizing: border-box;
  white-space: nowrap;
}

.option-number-pill.option-1-pill {
  background: rgba(0, 245, 212, 0.16);
  border: 1.5px solid rgba(0, 245, 212, 0.45);
  color: var(--accent-cyan, #00f5d4);
  box-shadow: 0 0 12px rgba(0, 245, 212, 0.2);
}

.option-number-pill.option-2-pill {
  background: rgba(58, 134, 255, 0.16);
  border: 1.5px solid rgba(58, 134, 255, 0.45);
  color: #38bdf8;
  box-shadow: 0 0 12px rgba(58, 134, 255, 0.2);
}

.option-number-pill.option-3-pill {
  background: rgba(255, 190, 11, 0.16);
  border: 1.5px solid rgba(255, 190, 11, 0.45);
  color: #ffbe0b;
}

.option-number-pill.option-4-pill {
  background: rgba(168, 85, 247, 0.16);
  border: 1.5px solid rgba(168, 85, 247, 0.45);
  color: #c084fc;
}

/* Router Memory Architecture Question Cards */
.memory-pick-card {
  min-height: 145px;
  justify-content: space-between;
}

.memory-type-pill {
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.22rem 0.65rem;
  border-radius: 6px;
  border: 1px solid;
}

.memory-type-pill.ram {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #10b981;
}

.memory-type-pill.nvram {
  background: rgba(58, 134, 255, 0.15);
  border-color: rgba(58, 134, 255, 0.4);
  color: #38bdf8;
}

.memory-type-pill.flash {
  background: rgba(255, 190, 11, 0.15);
  border-color: rgba(255, 190, 11, 0.4);
  color: #ffbe0b;
}

.memory-type-pill.rom {
  background: rgba(236, 72, 153, 0.15);
  border-color: rgba(236, 72, 153, 0.4);
  color: #f472b6;
}

.memory-card-title {
  font-size: 1.18rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.4rem;
  line-height: 1.35;
}

.memory-card-desc {
  font-size: 0.92rem;
  color: var(--text-secondary, #cbd5e1);
  line-height: 1.65;
  margin-bottom: 0.85rem;
  flex-grow: 1;
}

.memory-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-cyan, #00f5d4);
  opacity: 0.9;
}

.telemetry-chip.ram {
  border-color: rgba(16, 185, 129, 0.4);
}
.telemetry-chip.ram strong {
  color: #10b981;
}

.telemetry-chip.nvram {
  border-color: rgba(58, 134, 255, 0.4);
}
.telemetry-chip.nvram strong {
  color: #38bdf8;
}

.telemetry-chip.flash {
  border-color: rgba(255, 190, 11, 0.4);
}
.telemetry-chip.flash strong {
  color: #ffbe0b;
}

.telemetry-chip.rom {
  border-color: rgba(236, 72, 153, 0.4);
}
.telemetry-chip.rom strong {
  color: #f472b6;
}

.route-pick-card {
  background: rgba(15, 23, 42, 0.88);
  border: 1.5px solid rgba(56, 189, 248, 0.25);
  border-radius: 16px;
  padding: 1.4rem 1.6rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.route-pick-card:hover {
  border-color: var(--accent-cyan, #00f5d4);
  background: rgba(0, 245, 212, 0.08);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 245, 212, 0.2);
}

.route-pick-card.correct {
  border-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.18) !important;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.35) !important;
}

.route-pick-card.wrong {
  border-color: #f43f5e !important;
  background: rgba(244, 63, 94, 0.18) !important;
  box-shadow: 0 0 25px rgba(244, 63, 94, 0.35) !important;
  animation: shake 0.4s ease;
}

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

.proto-tag {
  font-family: var(--font-mono, monospace);
  font-weight: 800;
  font-size: 0.95rem;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.ad-tag {
  font-size: 0.85rem;
  color: #ffbe0b;
  background: rgba(255, 190, 11, 0.12);
  border: 1px solid rgba(255, 190, 11, 0.3);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 700;
}

.cli-route-preview {
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  color: #34d399;
  direction: ltr !important;
  text-align: left !important;
  overflow-x: auto;
  white-space: nowrap;
}

.route-meta-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: #94a3b8;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 8px;
  margin-top: auto;
}

/* ================= GAME 2: PROTOCOL SORTER ================= */
.sorter-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  max-width: 680px;
  margin: 0 auto;
}

.sorter-btn {
  background: rgba(15, 23, 42, 0.9);
  border: 2px solid rgba(255, 190, 11, 0.3);
  border-radius: 14px;
  padding: 1.8rem 1.4rem;
  color: #fff;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.sorter-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.sorter-btn i {
  font-size: 2.4rem;
}

.sorter-btn.igp {
  border-color: rgba(56, 189, 248, 0.4);
}

.sorter-btn.igp:hover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.25);
}

.sorter-btn.igp i {
  color: #38bdf8;
}

.sorter-btn.egp {
  border-color: rgba(255, 190, 11, 0.4);
}

.sorter-btn.egp:hover {
  border-color: #ffbe0b;
  background: rgba(255, 190, 11, 0.12);
  box-shadow: 0 0 25px rgba(255, 190, 11, 0.25);
}

.sorter-btn.egp i {
  color: #ffbe0b;
}

.sorter-btn.correct {
  border-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.22) !important;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.35) !important;
}

.sorter-btn.wrong {
  border-color: #f43f5e !important;
  background: rgba(244, 63, 94, 0.22) !important;
  box-shadow: 0 0 25px rgba(244, 63, 94, 0.35) !important;
  animation: shake 0.4s ease;
}

.sorter-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  max-width: 650px;
  margin: 0 auto;
}

.sorter-metric-btn {
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 1.1rem 1.3rem;
  color: #f8fafc;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.sorter-metric-btn:hover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  transform: translateY(-2px);
}

.sorter-metric-btn.correct {
  border-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.25) !important;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.35) !important;
}

.sorter-metric-btn.wrong {
  border-color: #f43f5e !important;
  background: rgba(244, 63, 94, 0.25) !important;
  box-shadow: 0 0 25px rgba(244, 63, 94, 0.35) !important;
  animation: shake 0.4s ease;
}

/* ================= GAME 3: ROUTER MEMORY MATCH ================= */
.mem-items-pool {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
  max-width: 860px;
  margin: 0 auto 1.8rem auto;
}

.mem-item-pill {
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px solid rgba(168, 85, 247, 0.35);
  border-radius: var(--radius-md, 10px);
  padding: 0.75rem 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.mem-item-pill:hover {
  border-color: var(--accent-purple, #a855f7);
  background: rgba(168, 85, 247, 0.15);
  transform: translateY(-2px);
}

.mem-item-pill.selected {
  border-color: var(--accent-cyan, #00f5d4) !important;
  background: rgba(0, 245, 212, 0.2) !important;
  box-shadow: 0 0 20px rgba(0, 245, 212, 0.4) !important;
  transform: scale(1.05);
}

.mem-slots-grid,
.memory-match-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
}

.mem-slot {
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px dashed rgba(168, 85, 247, 0.4);
  border-radius: 14px;
  padding: 1.2rem;
  cursor: pointer;
  transition: all 0.25s ease;
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

.mem-slot:hover {
  border-color: var(--accent-purple, #a855f7);
  background: rgba(168, 85, 247, 0.1);
  transform: translateY(-2px);
}

.mem-slot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.mem-slot-header strong {
  font-family: var(--font-mono, monospace);
  font-size: 1.2rem;
  color: var(--accent-purple, #a855f7);
}

.slot-badge {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(168, 85, 247, 0.15);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.3);
  font-weight: 700;
}

.mem-slot p {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.5;
  margin: 0 0 1rem 0;
}

.slot-matched-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
}

.matched-tag {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 0.8rem;
  padding: 5px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono, monospace);
}

/* ================= GAME 4: LONGEST PREFIX MATCH (LPM) ================= */
.lpm-candidates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.lpm-route-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(56, 189, 248, 0.25);
  border-radius: 14px;
  padding: 1.3rem;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.lpm-route-card:hover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(56, 189, 248, 0.25);
}

.lpm-route-card.correct {
  border-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.2) !important;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.35) !important;
}

.lpm-route-card.wrong {
  border-color: #f43f5e !important;
  background: rgba(244, 63, 94, 0.2) !important;
  box-shadow: 0 0 25px rgba(244, 63, 94, 0.35) !important;
  animation: shake 0.4s ease;
}

.lpm-mask-pill {
  font-size: 0.82rem;
  font-family: var(--font-mono, monospace);
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-weight: 700;
}

/* ================= GAME 5: CISCO CLI COMMAND BUILDER ================= */
.cli-mission-box {
  background: rgba(6, 214, 160, 0.08);
  border: 1.5px solid rgba(6, 214, 160, 0.3);
  border-radius: 12px;
  padding: 1.3rem 1.5rem;
  margin-bottom: 1.5rem;
}

.cli-choices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.cli-choice-btn {
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md, 10px);
  padding: 1.1rem 1.4rem;
  color: #f8fafc;
  font-family: var(--font-mono, monospace);
  font-size: 0.95rem;
  cursor: pointer;
  direction: ltr !important;
  text-align: left !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.cli-choice-btn:hover {
  border-color: var(--accent-cyan, #00f5d4);
  background: rgba(0, 245, 212, 0.1);
  transform: translateX(4px);
}

.cli-choice-btn.correct {
  border-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.2) !important;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3) !important;
}

.cli-choice-btn.wrong {
  border-color: #f43f5e !important;
  background: rgba(244, 63, 94, 0.2) !important;
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.3) !important;
  animation: shake 0.4s ease;
}

/* ================= GAME 6: SHOW & DEBUG DIAGNOSTICS ================= */
.diag-issue-card {
  background: rgba(244, 63, 94, 0.08);
  border: 1.5px solid rgba(244, 63, 94, 0.35);
  border-radius: 14px;
  padding: 1.3rem 1.5rem;
  margin-bottom: 1.4rem;
  box-shadow: 0 4px 20px rgba(244, 63, 94, 0.1);
}

.diag-terminal-output {
  background: #020617;
  border: 1.5px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), inset 0 0 25px rgba(0, 0, 0, 0.6);
  margin-bottom: 1.6rem;
  direction: ltr !important;
  text-align: left !important;
}

.diag-terminal-bar {
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  direction: ltr !important;
}

.diag-terminal-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.diag-terminal-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}

.diag-terminal-dot.red {
  background: #ef4444;
}

.diag-terminal-dot.yellow {
  background: #f59e0b;
}

.diag-terminal-dot.green {
  background: #10b981;
}

.diag-terminal-title {
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  color: #38bdf8;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.diag-code-block {
  padding: 1.3rem 1.5rem;
  margin: 0;
  font-family: var(--font-mono, 'Consolas', 'Fira Code', monospace);
  font-size: 0.95rem;
  line-height: 1.75;
  color: #34d399;
  /* Crisp green/cyan terminal font */
  overflow-x: auto;
  direction: ltr !important;
  text-align: left !important;
  white-space: pre-wrap;
  word-break: break-word;
}

.diag-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.1rem;
}

.diag-command-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  color: #f8fafc;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-align: right;
}

html[dir="ltr"] .diag-command-card {
  text-align: left;
}

.diag-command-card:hover {
  border-color: #f43f5e;
  background: rgba(244, 63, 94, 0.12);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(244, 63, 94, 0.25);
}

.diag-command-card.correct {
  border-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.2) !important;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.35) !important;
}

.diag-command-card.wrong {
  border-color: #f43f5e !important;
  background: rgba(244, 63, 94, 0.2) !important;
  box-shadow: 0 0 25px rgba(244, 63, 94, 0.35) !important;
  animation: shake 0.4s ease;
}

.diag-cmd-syntax {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.diag-cmd-syntax code {
  font-family: var(--font-mono, monospace);
  font-size: 1rem;
  font-weight: 700;
  color: #38bdf8;
  direction: ltr !important;
  text-align: left !important;
  background: rgba(56, 189, 248, 0.1);
  padding: 3px 8px;
  border-radius: 6px;
}

.diag-pick-badge {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-weight: 600;
  white-space: nowrap;
}

.diag-command-card:hover .diag-pick-badge {
  background: rgba(244, 63, 94, 0.3);
  color: #fff;
}

.diag-cmd-rationale {
  font-size: 0.9rem;
  color: #cbd5e1;
  line-height: 1.6;
}

/* ================= COMMON FEEDBACK CARD ================= */
.routing-feedback-card {
  display: none;
  margin-top: 1.8rem;
  padding: 1.4rem 1.6rem;
  border-radius: var(--radius-lg, 14px);
  animation: slideUp 0.3s ease-out;
  align-items: center;
  gap: 1.2rem;
}

.routing-feedback-card.correct,
.routing-feedback-card.success {
  background: rgba(6, 36, 26, 0.95);
  border: 1.5px solid #10b981;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}

.routing-feedback-card.wrong,
.routing-feedback-card.error {
  background: rgba(40, 10, 22, 0.95);
  border: 1.5px solid #f43f5e;
  box-shadow: 0 10px 30px rgba(244, 63, 94, 0.3);
}

.feedback-icon {
  font-size: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.routing-feedback-card.correct .feedback-icon,
.routing-feedback-card.success .feedback-icon {
  color: #10b981;
}

.routing-feedback-card.wrong .feedback-icon,
.routing-feedback-card.error .feedback-icon {
  color: #f43f5e;
}

/* ================= CCNA CHEAT SHEET MODAL ================= */
.routing-cheat-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.routing-cheat-card {
  background: #0b1329;
  border: 1px solid var(--accent-cyan, #00f5d4);
  border-radius: 18px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 245, 212, 0.2);
}

/* ================= ANIMATIONS ================= */
@keyframes shake {

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

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

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

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

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

/* ================= RESPONSIVE ADJUSTMENTS ================= */
@media (max-width: 1024px) {
  .routing-submode-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .mem-slots-grid,
  .memory-match-board {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .routing-arcade-container {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .routing-submode-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.55rem !important;
  }

  .routing-submode-grid .game-submode-btn {
    padding: 0.75rem 0.65rem !important;
    min-height: auto !important;
    border-radius: var(--radius-md, 10px) !important;
  }

  .routing-submode-grid .submode-title {
    font-size: 0.85rem !important;
  }

  .routing-submode-grid .submode-badge {
    font-size: 0.65rem !important;
    padding: 0.15rem 0.45rem !important;
  }

  .routing-submode-grid .submode-desc {
    display: none !important;
  }

  .routing-play-stage-card {
    padding: 1.25rem 1rem !important;
    border-radius: var(--radius-md, 12px) !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    min-width: 0 !important;
  }

  #routingStageContent {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
  }

  .routing-play-stage-card h3 {
    font-size: 0.94rem !important;
    line-height: 1.6 !important;
    margin-bottom: 1rem !important;
    word-break: break-word !important;
    padding: 0 4px !important;
    box-sizing: border-box !important;
  }

  .route-candidates-grid,
  .routes-selection-grid,
  .lpm-candidates-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0.85rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .route-pick-card,
  .lpm-route-card,
  .memory-pick-card,
  .diag-command-card {
    padding: 0.95rem 0.85rem !important;
    border-radius: var(--radius-md, 12px) !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .option-header-badge-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.45rem !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 0.5rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .option-number-pill {
    font-size: 0.74rem !important;
    padding: 0.2rem 0.55rem !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
  }

  .ad-tag {
    font-size: 0.76rem !important;
    padding: 0.2rem 0.55rem !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    margin-inline-start: auto !important;
  }

  .route-card-header {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .cli-route-preview {
    font-size: 0.78rem !important;
    padding: 8px 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    white-space: pre-wrap !important;
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
    line-height: 1.45 !important;
    direction: ltr !important;
    text-align: left !important;
    overflow-x: hidden !important;
  }

  .route-meta-footer {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
    justify-content: space-between !important;
    font-size: 0.78rem !important;
    padding-top: 6px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .mem-slots-grid,
  .memory-match-board {
    grid-template-columns: 1fr !important;
  }

  .sorter-pick-grid {
    grid-template-columns: 1fr !important;
  }

  .cli-choices-grid,
  .diag-options-grid {
    grid-template-columns: 1fr !important;
  }

  .diag-code-block {
    font-size: 0.78rem !important;
    line-height: 1.5 !important;
    padding: 0.85rem !important;
    white-space: pre-wrap !important;
    word-break: break-all !important;
    overflow-x: auto !important;
  }

  .arcade-stage-telemetry-bar {
    margin-top: 1.2rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    border-radius: var(--radius-md, 12px) !important;
  }

  .telemetry-accordion-toggle {
    padding: 0.85rem 1.15rem !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.65rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .telemetry-bar-title {
    font-size: 0.85rem !important;
    line-height: 1.45 !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.55rem !important;
    text-align: start !important;
    word-break: break-word !important;
    flex: none !important;
  }

  .telemetry-toggle-badge {
    align-self: flex-start !important;
    margin: 0 !important;
    margin-inline-start: 0 !important;
    font-size: 0.74rem !important;
    padding: 0.32rem 0.85rem !important;
    gap: 0.45rem !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .arcade-stage-telemetry-bar.open .telemetry-accordion-body {
    padding: 0.15rem 1rem 1rem 1rem !important;
  }

  .telemetry-bar-desc {
    font-size: 0.76rem !important;
  }

  .telemetry-chips-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .telemetry-chip {
    font-size: 0.72rem !important;
    padding: 0.25rem 0.5rem !important;
    width: auto !important;
    flex: 1 1 calc(50% - 0.45rem) !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
  }

  .routing-arcade-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .routing-feedback-card {
    flex-direction: column;
    text-align: center;
  }
}