/* ==========================================================================
   AvtoTest 2026 Telegram Mini App - Main Layout & Components CSS
   ========================================================================== */

#app {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
}

.screen {
  display: none;
  flex-direction: column;
  padding: 16px;
  padding-bottom: 32px;
  animation: fadeIn 0.25s ease-in-out;
}

.screen.active {
  display: flex;
}

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

/* ==========================================================================
   1. HOME SCREEN (Screenshot 1)
   ========================================================================== */
.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #1d6fa5, #00aaff);
  color: white;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.avatar-online {
  width: 12px;
  height: 12px;
  background-color: var(--accent-green);
  border: 2px solid var(--bg-color);
  border-radius: var(--radius-full);
  position: absolute;
  bottom: 0;
  right: 0;
}

.user-info .user-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.user-info .user-rank {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-green);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}

.icon-btn:active {
  transform: scale(0.92);
  background-color: var(--surface-hover);
}

/* Home Progress Card */
.progress-card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.progress-left {
  flex: 1;
}

.progress-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.progress-percentage {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3ecf29, #00aaff);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.audio-explain-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 90px;
  text-align: center;
  cursor: pointer;
}

.audio-icon {
  font-size: 22px;
  color: var(--text-primary);
}

.audio-text {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

/* Home Action Cards Grid */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.grid-card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 106px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.12s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.15s ease, border-color 0.2s ease;
}

/* 3D Tactile Press Depth Down */
.grid-card:active {
  transform: translateY(4px) scale(0.97) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

.grid-card.full-width {
  grid-column: span 2;
  flex-direction: row;
  align-items: center;
  min-height: 88px;
}

.grid-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
}

.grid-card.full-width .grid-card-icon {
  margin-bottom: 0;
  width: 50px;
  height: 50px;
  font-size: 26px;
}

.grid-card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.grid-card-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 2px;
}

/* Featured Accent Cards */
.grid-card.card-darslik {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.grid-card.card-darslik .grid-card-icon {
  background: rgba(255, 255, 255, 0.22);
  color: white;
}

.grid-card.card-test-yechish {
  background: linear-gradient(135deg, #10b981, #059669);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.grid-card.card-test-yechish .grid-card-icon {
  background: white;
  color: #059669;
}

.grid-card.card-oktagon {
  background: linear-gradient(135deg, #dc2626, #ea580c);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.grid-card.card-oktagon .grid-card-icon {
  background: white;
  color: #dc2626;
}

/* ==========================================================================
   2. QUIZ / QUESTION SCREEN (Screenshot 2)
   ========================================================================== */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.btn-back {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.quiz-timer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-yellow);
}

.top-nav-icons {
  display: flex;
  gap: 8px;
}

.nav-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
}
.nav-icon.active {
  color: var(--accent-yellow);
  border-color: var(--accent-yellow);
}

/* Horizontal Pager Bar */
.question-pager-wrapper {
  overflow-x: auto;
  white-space: nowrap;
  margin-bottom: 16px;
  padding-bottom: 4px;
}

.question-pager {
  display: inline-flex;
  gap: 8px;
}

.pager-pill {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pager-pill.active {
  background-color: transparent;
  border: 2px solid var(--accent-blue);
  color: var(--text-primary);
}

.pager-pill.correct {
  background-color: var(--accent-green);
  border-color: var(--accent-green);
  color: white;
}

.pager-pill.wrong {
  background-color: var(--accent-red);
  border-color: var(--accent-red);
  color: white;
}

/* Question Title */
.question-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 16px;
  line-height: 1.4;
}

/* Question Image Box */
.question-image-box {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
}

.question-image-box img {
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: contain;
  display: block;
}

/* Options Container */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.option-pill {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 48px;
}

.option-pill:active {
  transform: scale(0.98);
}

.option-badge {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.option-pill.correct {
  background-color: rgba(62, 207, 41, 0.15);
  border-color: var(--accent-green);
  color: #4ade80;
}
.option-pill.correct .option-badge {
  background-color: var(--accent-green);
  color: white;
}

.option-pill.wrong {
  background-color: rgba(255, 77, 79, 0.15);
  border-color: var(--accent-red);
  color: #f87171;
}
.option-pill.wrong .option-badge {
  background-color: var(--accent-red);
  color: white;
}

/* Learn/Explanation Button */
.btn-learn {
  align-self: flex-end;
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   3. TOPICS / MAVZULAR SCREEN (Screenshot 3)
   ========================================================================== */
.search-bar {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.search-bar input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  width: 100%;
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

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

.topic-card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.topic-card:active {
  transform: scale(0.98);
}

.topic-info .topic-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.topic-info .topic-count {
  font-size: 12px;
  color: var(--text-secondary);
}

.topic-arrow {
  color: var(--text-muted);
  font-size: 16px;
}

/* ==========================================================================
   4. TICKETS / BILETLAR SCREEN (Screenshot 4)
   ========================================================================== */
.tab-switcher {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 4px;
  display: flex;
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background-color: var(--accent-blue);
  color: white;
}

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

.ticket-card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 8px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease;
}

.ticket-card:active {
  transform: scale(0.95);
  border-color: var(--accent-blue);
}

/* ==========================================================================
   5. ROAD SIGNS CATEGORIES & SUB-GRID (Screenshots 5 & 6)
   ========================================================================== */
.signs-cat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.sign-cat-card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.sign-cat-card:active {
  transform: scale(0.96);
}

.sign-cat-thumb {
  width: 54px;
  height: 54px;
  object-fit: contain;
  margin-bottom: 10px;
}

.sign-cat-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;

  /* Line clamp for title */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sign-cat-count {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ==========================================================================
   6. MODAL OVERLAYS & BOTTOM SHEETS (Screenshot 7 & Settings/Language)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
  animation: fadeInOverlay 0.2s ease;
}

@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

.bottom-sheet {
  background-color: var(--surface-color);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px;
  box-shadow: var(--shadow-lg);
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.modal-overlay.active .bottom-sheet {
  transform: translateY(0);
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background-color: var(--border-color);
  border-radius: var(--radius-full);
  margin: 0 auto 16px auto;
}

.sheet-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 12px;
}

.sheet-image {
  max-width: 120px;
  max-height: 120px;
  object-fit: contain;
  margin: 0 auto 16px auto;
  display: block;
}

.sheet-content {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.btn-close-sheet {
  width: 100%;
  background-color: var(--border-color);
  border: none;
  color: var(--text-primary);
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;

  transition: background 0.2s ease;
}

.btn-close-sheet:active {
  background-color: var(--surface-hover);
}

/* Settings Items */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}


/* ==========================================================================
   7. AQLI TAKRORLASH (SMART REVISION SCREEN)
   ========================================================================== */
.smart-intro-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  text-align: center;
  min-height: 80vh;
}

.brain-hero-icon {
  font-size: 72px;
  margin-bottom: 16px;
  filter: drop-shadow(0 8px 16px rgba(238, 108, 138, 0.4));
  animation: brainPulse 2.5s infinite ease-in-out;
}

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

.smart-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.smart-features-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 400px;
  margin-bottom: 32px;
}

.smart-feature-card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
}

.smart-feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.smart-feature-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.btn-start-smart {
  width: 100%;
  max-width: 400px;
  background: linear-gradient(135deg, #3ecf29, #25a414);
  border: none;
  color: white;
  padding: 16px;
  border-radius: var(--radius-full);
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(62, 207, 41, 0.4);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.btn-start-smart:active {
  transform: scale(0.97);
}

/* Oktagon 1v1 Battle Live Header */
.oktagon-vs-header {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(245, 158, 11, 0.15));
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.vs-player-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vs-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0088cc, #00aaff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 136, 204, 0.4);
}

.vs-avatar.bot {
  background: linear-gradient(135deg, #ef4444, #f59e0b);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.vs-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.vs-score {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent-yellow);
}

.vs-badge-center {
  background: linear-gradient(135deg, #dc2626, #f59e0b);
  color: white;
  font-weight: 900;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  letter-spacing: 1px;
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.5);
  animation: pulseVS 1.5s infinite alternate;
}

@keyframes pulseVS {
  0% { transform: scale(1); }
  100% { transform: scale(1.1); }
}

.radar-ping {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.35);
  animation: radarRipple 1.4s cubic-bezier(0, 0.2, 0.8, 1) infinite;
  z-index: 1;
}

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


/* Settings Group & Categorized Cards */
.settings-group {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-group-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-blue);
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border-color);
}
.setting-item:last-child {
  border-bottom: none;
}
.setting-item.vertical {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.pill-segmented-group {
  display: flex;
  width: 100%;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}

.pill-opt-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.pill-opt-btn:hover {
  color: var(--text-primary);
}

.pill-opt-btn.active {
  background: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 170, 255, 0.35);
}

.custom-select {
  background-color: var(--bg-color);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.custom-select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(0, 170, 255, 0.2);
}

.setting-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.setting-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--border-color);
  transition: .2s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-green);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* ==========================================================================
   TELEGRAM WEBAPP GUARD MODAL
   ========================================================================== */
.telegram-guard-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #0f172a;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: #ffffff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

.telegram-guard-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 24px;
  padding: 32px 24px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.telegram-guard-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

.telegram-guard-title {
  font-size: 20px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.3;
}

.telegram-guard-desc {
  font-size: 14px;
  color: #94a3b8;
  line-height: 1.5;
}

.telegram-guard-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #0088cc, #00aaff);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 24px;
  border-radius: 50px;
  text-decoration: none;
  width: 100%;
  box-shadow: 0 8px 20px rgba(0, 136, 204, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.telegram-guard-btn:hover, .telegram-guard-btn:active {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 136, 204, 0.6);
}

/* Quiz Bottom Navigation Bar */
.quiz-bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.quiz-nav-btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.quiz-nav-btn.primary {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #ffffff;
}

.btn-learn-inline {
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  background: rgba(255, 184, 0, 0.15);
  border: 1px solid rgba(255, 184, 0, 0.3);
  color: var(--accent-yellow);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* -------------------------------------------------------------
 * New Interactive Features: Emotes, Progress Bars, Panic Timer
 * ------------------------------------------------------------- */

/* Button active scale micro-interaction */
button, .ticket-card, .option-pill {
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease, border-color 0.2s ease;
}
button:active, .ticket-card:active, .option-pill:active {
  transform: scale(0.96);
}

/* Ticket Progress Bar */
.ticket-progress-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}
.ticket-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #00aaff, #3ecf29);
  transition: width 0.3s ease;
}

/* 1v1 Live Emote Bar & Floating Emotes */
.oktagon-emote-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  margin: 10px auto 0 auto;
  width: fit-content;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.emote-btn {
  background: transparent;
  border: none;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  transition: transform 0.15s ease;
}
.emote-btn:active {
  transform: scale(1.3);
}

.floating-emote-bubble {
  position: fixed;
  bottom: 120px;
  z-index: 99999;
  font-size: 48px;
  pointer-events: none;
  animation: floatEmote 2.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.4));
}
.floating-emote-bubble.user-side {
  right: 24px;
}
.floating-emote-bubble.opp-side {
  left: 24px;
}

@keyframes floatEmote {
  0% { transform: translateY(0) scale(0.4); opacity: 0; }
  20% { transform: translateY(-40px) scale(1.2); opacity: 1; }
  80% { transform: translateY(-140px) scale(1); opacity: 0.9; }
  100% { transform: translateY(-200px) scale(0.8); opacity: 0; }
}

/* Panic Countdown Timer Pulse & Red Ambient Vignette */
.timer-badge.panic-pulse {
  animation: heartbeatPulse 0.8s ease-in-out infinite !important;
  color: #ef4444 !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.6) !important;
}

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

.panic-vignette {
  box-shadow: inset 0 0 40px rgba(239, 68, 68, 0.35) !important;
}

