/**
 * features/grammar/grammar-vocab-bridge.css
 * Styling for FIEZEL Grammar-Vocab Scaffolding & Pacing Leveling Engine
 * Enforces high contrast, cream/terracotta palette, zero voids, and clean responsive pill UI.
 */

/* ==========================================================================
   1. INTENSITY SELECTOR BAR (Grammar Hub & Settings)
   ========================================================================== */
.grammar-intensity-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #FFFFFF;
  border: 1px solid #EFE7DE;
  border-radius: 16px;
  padding: 12px 14px;
  margin: 10px 0 16px 0;
  box-shadow: 0 2px 6px rgba(46, 39, 36, 0.04);
}

.grammar-intensity-selector.is-compact {
  padding: 8px 10px;
  margin: 6px 0 10px 0;
  border-radius: 12px;
}

.intensity-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.intensity-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.intensity-eyebrow i,
.intensity-eyebrow svg {
  width: 14px;
  height: 14px;
  stroke: #0284C7;
}

.intensity-current-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  color: #0284C7;
  background: #E0F2FE;
  border: 1px solid #BAE6FD;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.intensity-pill-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: #F1F5F9;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid #E2E8F0;
}

@media (max-width: 480px) {
  .intensity-pill-group {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.intensity-pill {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #0F172A;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.2, 0.8, 0.3, 1);
  text-align: center;
  user-select: none;
  min-height: 48px;
}

.intensity-pill:hover {
  background: rgba(255, 255, 255, 0.7);
}

.intensity-pill.is-active {
  background: #FFFFFF !important;
  color: #047857 !important;
  border: 1.5px solid #10B981 !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.16);
  font-weight: 800;
}

.intensity-pill-dot {
  display: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10B981;
  margin-bottom: 2px;
}

.intensity-pill.is-active .intensity-pill-dot {
  display: inline-block;
}

.intensity-pill-name {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
}

.intensity-pill.is-active .intensity-pill-name {
  font-weight: 800;
  color: #047857;
}

.intensity-pill-meta {
  font-size: 0.68rem;
  color: #64748B;
  line-height: 1.1;
  white-space: nowrap;
}

.intensity-pill.is-active .intensity-pill-meta {
  color: #059669;
  font-weight: 700;
}

/* ==========================================================================
   2. VOCABULARY SCAFFOLDING WARMUP CARD (Inside Lesson View)
   ========================================================================== */
.grammar-vocab-scaffold-card {
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: 16px;
  padding: 14px 16px;
  margin: 12px 0 16px 0;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

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

.scaffold-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.scaffold-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0284C7;
}

.scaffold-eyebrow i,
.scaffold-eyebrow svg {
  width: 14px;
  height: 14px;
  stroke: #0284C7;
}

.scaffold-stats {
  font-size: 0.84rem;
  color: #0F172A;
}

.scaffold-stats b {
  color: #059669;
}

.scaffold-intensity-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 20px;
  padding: 5px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #0F172A;
  cursor: pointer;
  transition: all 0.15s ease;
}

.scaffold-intensity-toggle:hover {
  background: #E0F2FE;
  border-color: #38BDF8;
  color: #0284C7;
}

.scaffold-intensity-toggle i,
.scaffold-intensity-toggle svg {
  width: 12px;
  height: 12px;
}

.scaffold-pills-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 10px 0;
  flex-wrap: wrap;
}

.scaffold-intensity-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 99px;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  color: #64748B;
  cursor: pointer;
  transition: all 0.15s ease;
}

.scaffold-intensity-pill:hover {
  background: #F1F5F9;
  color: #0F172A;
}

.scaffold-intensity-pill.is-active {
  background: #ECFDF5;
  border-color: #6EE7B7;
  color: #047857;
  font-weight: 800;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.16);
}

.scaffold-progress-bar {
  width: 100%;
  height: 6px;
  background: #E2E8F0;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 12px;
}

.scaffold-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #34D399, #059669);
  border-radius: 99px;
  transition: width 0.3s ease;
}

.scaffold-vocab-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  max-height: 160px;
  overflow-y: auto;
  padding: 2px;
}

.scaffold-vocab-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.78rem;
  color: #0F172A;
  transition: transform 0.12s ease;
}

.scaffold-vocab-chip:hover {
  transform: translateY(-1px);
}

.scaffold-vocab-chip.is-mastered {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #065F46;
}

.scaffold-vocab-chip.is-mastered .chip-icon {
  stroke: #059669;
}

.scaffold-vocab-chip.is-learning {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #92400E;
}

.scaffold-vocab-chip.is-learning .chip-icon {
  stroke: #D97706;
}

.scaffold-vocab-chip .chip-icon {
  width: 11px;
  height: 11px;
  display: inline-block;
  align-self: center;
  stroke: #64748B;
}

.chip-word {
  font-weight: 700;
  color: inherit;
}

.chip-meaning {
  font-size: 0.72rem;
  color: #64748B;
}

.scaffold-vocab-chip.is-mastered .chip-meaning {
  color: #047857;
}

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

.scaffold-warmup-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
}

/* ==========================================================================
   3. MODAL INTENSITY SHEET
   ========================================================================== */
.modal-intensity-sheet {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-intensity-sheet h2 {
  color: #0F172A !important;
  font-size: 1.25rem !important;
  font-weight: 800 !important;
  margin: 0 !important;
  text-align: center !important;
}

.modal-intensity-sheet .modal-mark {
  color: #D97706 !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.12em !important;
  text-align: center !important;
}

.modal-intensity-sheet p.muted {
  color: #475569 !important;
  font-size: 0.88rem !important;
  text-align: center !important;
  line-height: 1.5 !important;
  margin: 0 0 4px 0 !important;
}

.modal-intensity-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 6px 0;
}

.intensity-option-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.intensity-option-card:hover {
  background: #FFFFFF;
  border-color: #10B981;
  transform: translateY(-1px);
}

.intensity-option-card.is-selected {
  background: #FFFFFF !important;
  border: 2px solid #10B981 !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.16);
}

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

.option-name {
  font-size: 0.95rem;
  color: #0F172A;
}

.intensity-option-card.is-selected .option-name {
  color: #059669;
}

.option-badge {
  font-size: 0.72rem;
  font-weight: 800;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  color: #B45309;
  padding: 2px 8px;
  border-radius: 16px;
}

.option-desc {
  font-size: 0.82rem;
  color: #475569;
  margin: 0;
  line-height: 1.35;
}

.option-specs {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #0284C7;
}

.option-specs span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.option-specs i,
.option-specs svg {
  width: 13px;
  height: 13px;
}

/* ==========================================================================
   4. LESSON GATEWAY SHEET (Misi Kosakata Kunci)
   ========================================================================== */
/* Modal Gateway Panel & Intensity Panel Styling */
#modalPanel:has(.lesson-prereq-gateway-sheet),
#modalPanel:has(.modal-intensity-sheet),
.modal-panel:has(.lesson-prereq-gateway-sheet),
.modal-panel:has(.modal-intensity-sheet) {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border-radius: 24px !important;
  border: 1px solid rgba(226, 232, 240, 0.9) !important;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2) !important;
  width: 92% !important;
  max-width: 480px !important;
  max-height: 90vh !important;
  max-height: 90dvh !important;
  padding: 24px 20px !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

#modalPanel:has(.lesson-prereq-gateway-sheet) h2,
#modalPanel:has(.modal-intensity-sheet) h2,
.modal-panel:has(.lesson-prereq-gateway-sheet) h2,
.modal-panel:has(.modal-intensity-sheet) h2 {
  color: #0F172A !important;
}

#modalPanel:has(.lesson-prereq-gateway-sheet) p,
#modalPanel:has(.modal-intensity-sheet) p,
.modal-panel:has(.lesson-prereq-gateway-sheet) p,
.modal-panel:has(.modal-intensity-sheet) p {
  color: #475569 !important;
}

.lesson-prereq-gateway-sheet {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0;
  background: #FFFFFF;
  height: 100%;
  box-sizing: border-box;
}

.gateway-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  align-items: center;
}

.gateway-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #0284C7;
  background: #E0F2FE;
  border: 1px solid #BAE6FD;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gateway-badge i {
  width: 14px;
  height: 14px;
  stroke: #0284C7;
}

.gateway-header h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0F172A;
  margin: 2px 0 0 0;
  line-height: 1.3;
}

.gateway-header p.muted {
  font-size: 0.85rem;
  color: #475569;
  margin: 0;
  line-height: 1.4;
  max-width: 440px;
}

.gateway-vocab-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
}

@media (max-width: 360px) {
  .gateway-vocab-grid {
    grid-template-columns: 1fr;
  }
}

.gateway-vocab-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease;
  min-height: 52px;
  box-sizing: border-box;
}

.gateway-vocab-card:hover {
  transform: translateY(-1px);
  border-color: #38BDF8;
}

.gw-word-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.gw-word {
  font-size: 0.95rem;
  color: #0F172A;
  font-weight: 800;
  line-height: 1.2;
}

.gw-audio-btn {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  color: #059669;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: all 0.12s ease;
}

.gw-audio-btn:active {
  transform: scale(0.92);
  background: #DCFCE7;
}

.gw-audio-btn i {
  width: 14px;
  height: 14px;
}

.gw-meaning {
  font-size: 0.8rem;
  color: #0284C7;
  font-weight: 600;
  white-space: normal;
  line-height: 1.3;
}

.gateway-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.gateway-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.gateway-btn.primary {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  border: none;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.28);
}

.gateway-btn.primary:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
}

.gateway-btn.secondary {
  background: #F1F5F9;
  color: #334155;
  border: 1px solid #E2E8F0;
}

.gateway-btn.secondary:hover {
  background: #E2E8F0;
}

/* ==========================================================================
   5. MICRO-INTERACTIVE MINI-GAME (Word Quest & Puzzle)
   Duolingo-grade Native App Experience:
   - Fullscreen viewport modal (immersive, zero-web leak)
   - Fixed header + sticky actions footer (no broken scroll)
   - Scrollable middle content area with smooth momentum
   - Body scroll lock & bottomnav hiding
   ========================================================================== */

/* Pastikan body tidak goyang saat mini-game / gateway aktif */
body:has(.modal-mini-game-sheet),
body:has(.lesson-prereq-gateway-sheet),
body:has(.modal-intensity-sheet) {
  overflow: hidden !important;
  touch-action: pan-y !important;
}

/* Sembunyikan bottomnav agar tidak menutupi atau memotong konten */
body:has(.modal-mini-game-sheet) .bottomnav,
body:has(.modal-mini-game-sheet) nav.bottomnav,
body:has(.lesson-prereq-gateway-sheet) .bottomnav,
body:has(.lesson-prereq-gateway-sheet) nav.bottomnav,
body:has(.modal-intensity-sheet) .bottomnav,
body:has(.modal-intensity-sheet) nav.bottomnav {
  display: none !important;
}

/* Modal Overlay Penuh & di Atas Segala Lapisan */
#modal:has(.modal-mini-game-sheet),
.modal:has(.modal-mini-game-sheet) {
  z-index: 2147483000 !important;
  padding: 0 !important;
  background: #FFFFFF !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  align-items: stretch !important;
  justify-content: stretch !important;
}

@media (min-width: 641px) {
  #modal:has(.modal-mini-game-sheet),
  .modal:has(.modal-mini-game-sheet) {
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
  }
}

/* Modal Panel: Menutupi Seluruh Layar (Zero Space Kosong / Full Screen) */
#modalPanel:has(.modal-mini-game-sheet),
#modal:has(.modal-mini-game-sheet) #modalPanel,
.modal-panel:has(.modal-mini-game-sheet) {
  background: #FFFFFF !important;
  color: #0F172A !important;
  box-shadow: none !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  border-radius: 0 !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  position: relative !important;
  overscroll-behavior: contain !important;
}

@media (min-width: 641px) {
  #modalPanel:has(.modal-mini-game-sheet),
  #modal:has(.modal-mini-game-sheet) #modalPanel,
  .modal-panel:has(.modal-mini-game-sheet) {
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    max-width: 540px !important;
    border-radius: 0 !important;
    border: none !important;
  }
}

#modalPanel:has(.modal-mini-game-sheet) p,
#modal:has(.modal-mini-game-sheet) #modalPanel p,
.modal-panel:has(.modal-mini-game-sheet) p,
.modal-mini-game-sheet p.game-instruction,
.modal-mini-game-sheet .game-instruction {
  color: #334155 !important;
  opacity: 1 !important;
  font-weight: 500 !important;
}

.modal-mini-game-sheet {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background: #FFFFFF;
  box-sizing: border-box;
  overflow: hidden;
}

/* Header Statis - Selalu Menempel di Atas dan Mengisi Notch/Safe-Area Penuh */
.mini-game-header-fixed {
  flex: 0 0 auto;
  padding: max(14px, env(safe-area-inset-top, 14px)) 18px 10px 18px;
  background: #FFFFFF;
  border-bottom: 1px solid #F1F5F9;
  z-index: 10;
}

.mini-game-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
}

/* Kontainer Scrollable yang Mulus di Tengah */
.mini-game-scroll-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px 18px max(24px, env(safe-area-inset-bottom)) 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-brand-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-brand {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #047857;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  padding: 3px 10px;
  border-radius: 99px;
}

.game-lesson-indicator {
  font-size: 0.74rem;
  color: #64748B;
  font-weight: 600;
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-close-corner {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #475569;
  transition: all 0.15s ease;
}

.modal-close-corner:hover {
  background: #F1F5F9;
  color: #0F172A;
}

.modal-close-corner i {
  width: 16px;
  height: 16px;
}

/* Stepper Bar */
.mini-game-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  margin-top: 2px;
}

.stepper-node {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #94A3B8;
  font-size: 0.74rem;
  font-weight: 700;
}

.stepper-node.is-active {
  color: #047857;
}

.stepper-node.is-done {
  color: #0F172A;
}

.stepper-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #E2E8F0;
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  transition: all 0.2s ease;
}

.stepper-node.is-active .stepper-dot {
  background: #10B981;
  color: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.stepper-node.is-done .stepper-dot {
  background: #047857;
  color: #FFFFFF;
}

.stepper-node.is-done .stepper-dot i {
  width: 12px;
  height: 12px;
}

.stepper-line {
  flex-grow: 1;
  height: 2px;
  background: #E2E8F0;
  margin: 0 8px;
}

.stepper-line.is-done {
  background: #10B981;
}

@media (max-width: 420px) {
  .stepper-label {
    display: none;
  }
}

/* Stage Hero Banner */
.stage-hero-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.stage-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stage-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #059669;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stage-tag i {
  width: 12px;
  height: 12px;
}

.stage-heading {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0F172A;
  margin: 0;
  letter-spacing: -0.01em;
}

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

.game-combo-pill {
  font-size: 0.78rem;
  font-weight: 800;
  color: #D97706;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  padding: 3px 8px;
  border-radius: 99px;
}

.game-counter-pill {
  font-size: 0.78rem;
  font-weight: 800;
  color: #0369A1;
  background: #E0F2FE;
  border: 1px solid #BAE6FD;
  padding: 3px 8px;
  border-radius: 99px;
}

.game-instruction {
  font-size: 0.88rem !important;
  color: #334155 !important;
  margin: 4px 0 10px 0;
  line-height: 1.45;
  font-weight: 500;
}

/* Stage 1: Matching Game Board (Duolingo 3D Match Cards) */
.match-game-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.match-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.col-header {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748B;
  padding: 0 4px;
}

.match-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #FFFFFF;
  border: 2px solid #E2E8F0;
  border-bottom: 4px solid #CBD5E1;
  border-radius: 14px;
  color: #0F172A;
  cursor: pointer;
  transition: all 0.12s cubic-bezier(0.2, 0.8, 0.3, 1);
  user-select: none;
  min-height: 52px;
  text-align: left;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.03);
}

.match-card .card-text {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.3;
}

.en-card .card-text {
  font-weight: 800;
  color: #0F172A;
}

.match-card:hover {
  border-color: #38BDF8;
  border-bottom-color: #0284C7;
  background: #F0F9FF;
  transform: translateY(-2px);
}

.match-card:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

.match-card.is-selected {
  border-color: #0284C7 !important;
  border-bottom-color: #0369A1 !important;
  background: #E0F2FE !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.22);
  transform: translateY(1px);
  border-bottom-width: 2px;
}

.match-card.is-matched {
  border-color: #A7F3D0 !important;
  border-bottom-color: #6EE7B7 !important;
  border-bottom-width: 2px;
  background: #ECFDF5 !important;
  color: #065F46 !important;
  opacity: 0.8;
  cursor: default;
  pointer-events: none;
  transform: none;
}

.match-sound-icon {
  width: 14px;
  height: 14px;
  color: #0284C7;
  opacity: 0.7;
}

.stage-bottom-status {
  text-align: center;
  padding: 6px 0;
  font-size: 0.78rem;
  color: #64748B;
  font-weight: 600;
}

/* Stage 2: Micro Sentence Puzzle */
.puzzle-context-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.context-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #334155;
}

.context-item i {
  width: 14px;
  height: 14px;
  color: #64748B;
  flex-shrink: 0;
}

.context-item.word-highlight {
  color: #065F46;
}

.context-item.word-highlight i {
  color: #059669;
}

.puzzle-sentence-stage {
  min-height: 68px;
  background: #F8FAFC;
  border: 2px dashed #94A3B8;
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
}

.puzzle-slot-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.puzzle-empty-hint {
  font-size: 0.85rem;
  color: #94A3B8;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Placed Tokens: Duolingo Blue Chunky Chip */
.puzzle-placed-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #0284C7;
  color: #FFFFFF;
  border: none;
  border-bottom: 3px solid #0369A1;
  padding: 8px 14px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(2, 132, 199, 0.28);
  transition: all 0.12s ease;
}

.puzzle-placed-chip:hover {
  background: #0369A1;
  transform: translateY(-1px);
}

.puzzle-placed-chip:active {
  transform: translateY(2px);
  border-bottom-width: 1.5px;
}

.chip-remove-icon {
  width: 12px;
  height: 12px;
  opacity: 0.8;
}

/* Pedagogical Feedback Banner */
.puzzle-pedagogical-feedback {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  margin-top: 6px;
  animation: fadeIn 0.2s ease;
}

.puzzle-pedagogical-feedback.is-success {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #065F46;
}

.puzzle-pedagogical-feedback.is-error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
}

.puzzle-pedagogical-feedback i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.feedback-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

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

.feedback-desc {
  font-size: 0.78rem;
  line-height: 1.35;
}

/* Token Bank */
.puzzle-bank-wrapper {
  margin-top: 10px;
}

.bank-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #64748B;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 8px;
}

.puzzle-bank-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 4px 0;
}

/* Duolingo-style 3D Chunky Word Tiles */
.puzzle-tile {
  background: #FFFFFF;
  border: 2px solid #E2E8F0;
  border-bottom: 4px solid #CBD5E1;
  color: #0F172A;
  padding: 10px 16px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  transition: all 0.12s ease;
  user-select: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.puzzle-tile:hover {
  border-color: #38BDF8;
  border-bottom-color: #0284C7;
  background: #F0F9FF;
  transform: translateY(-2px);
}

.puzzle-tile:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

.puzzle-tile.is-used {
  opacity: 0.28;
  background: #F1F5F9;
  border-color: #E2E8F0;
  border-bottom-width: 2px;
  cursor: default;
  pointer-events: none;
  transform: none;
}

/* Sticky Action Bar di Bawah Konten */
.puzzle-actions-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
  position: sticky;
  bottom: 0;
  background: #FFFFFF;
  border-top: 1px solid #F1F5F9;
  z-index: 5;
}

.puzzle-hint-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #FFFBEB;
  color: #B45309;
  border: 1.5px solid #FDE68A;
  border-bottom: 3px solid #F59E0B;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
}

.puzzle-hint-btn:active {
  transform: translateY(2px);
  border-bottom-width: 1.5px;
  background: #FEF3C7;
}

.puzzle-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  background: #10B981;
  color: #FFFFFF;
  border: none;
  border-bottom: 4px solid #047857;
  padding: 13px 20px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 0.96rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  transition: all 0.12s ease;
}

.puzzle-submit-btn:hover:not(:disabled) {
  background: #059669;
}

.puzzle-submit-btn:active:not(:disabled) {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

.puzzle-submit-btn:disabled {
  background: #E2E8F0;
  border-bottom-color: #CBD5E1;
  color: #94A3B8;
  cursor: not-allowed;
  box-shadow: none;
}

/* Stage 3: Victory & Mastery Scorecard */
.victory-card-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 6px;
}

.victory-icon-emblem {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #ECFDF5;
  border: 2px solid #A7F3D0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #059669;
  margin-bottom: 10px;
  animation: popSuccess 0.4s ease;
}

.victory-icon-emblem i {
  width: 30px;
  height: 30px;
}

.victory-headline {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0F172A;
  margin: 0 0 4px 0;
}

.victory-subtext {
  font-size: 0.84rem;
  color: #475569;
  margin: 0 0 14px 0;
  max-width: 320px;
  line-height: 1.4;
}

.mastery-summary-box {
  width: 100%;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 16px;
}

.summary-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-bottom: 10px;
  border-bottom: 1px solid #E2E8F0;
  margin-bottom: 10px;
}

.summary-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.metric-num {
  font-size: 1.15rem;
  font-weight: 800;
  color: #047857;
}

.metric-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748B;
  text-transform: uppercase;
}

.summary-metric-divider {
  width: 1px;
  height: 28px;
  background: #E2E8F0;
}

.mastered-vocab-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  max-height: 200px;
  overflow-y: auto;
}

.mastered-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #FFFFFF;
  border: 1px solid #BBF7D0;
  color: #065F46;
  font-size: 0.74rem;
  padding: 4px 8px;
  border-radius: 99px;
  font-weight: 600;
}

.mastered-pill i {
  width: 11px;
  height: 11px;
  color: #10B981;
}

.victory-cta-actions {
  width: 100%;
}

.enter-grammar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
  transition: transform 0.15s ease;
}

.enter-grammar-btn:hover {
  transform: translateY(-1px);
}

.enter-grammar-btn i {
  width: 16px;
  height: 16px;
}

/* Audit UX grammar U11 (2026-10-04): style.css memasang .modal-close-corner absolut di top/right
   -8px untuk modal biasa, sehingga di kepala FIEZEL QUEST tombol tutupnya terpotong di tepi
   layar. Di dalam lembar quest tombolnya ikut alur kepala dan cukup besar untuk jari. */
.modal-mini-game-sheet .modal-close-corner{position:static;flex:0 0 auto;width:40px;height:40px;top:auto;right:auto}
