/* ── MATCH GAME MODULE ────────────────────────────────────── */
  #page-matchgame.active { display: flex; flex-direction: column; align-items: center; }
  #page-matchgame .mg-header { width: 100%; max-width: 900px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
  #page-matchgame h1 { font-size: 1.4rem; font-weight: 700; color: #f8fafc; letter-spacing: -0.02em; }
  #page-matchgame h1 span { color: #6366f1; }
  #page-matchgame .mg-stats { display: flex; gap: 20px; align-items: center; font-size: 0.9rem; }
  #page-matchgame .mg-stat { text-align: center; }
  #page-matchgame .mg-stat-val { font-size: 1.5rem; font-weight: 800; }
  #page-matchgame .mg-stat-val.green { color: #4ade80; }
  #page-matchgame .mg-stat-val.red   { color: #f87171; }
  #page-matchgame .mg-stat-val.blue  { color: #818cf8; }
  #page-matchgame .mg-stat-label { font-size: 0.72rem; color: #64748b; margin-top: 2px; }
  #page-matchgame .mg-round-badge { background: #1e293b; border: 1.5px solid #334155; border-radius: 20px; padding: 5px 14px; font-size: 0.82rem; color: #94a3b8; }
  #page-matchgame .mg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; max-width: 900px; margin-bottom: 28px; }
  #page-matchgame .mg-tile { min-height: 110px; border-radius: 12px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; justify-content: space-between; transition: transform 0.12s, border-color 0.12s, opacity 0.4s, scale 0.4s; position: relative; user-select: none; border: 2px solid transparent; }
  #page-matchgame .mg-tile.term { background: #1e293b; border-color: #334155; justify-content: center !important; align-items: center; text-align: center; }
  #page-matchgame .mg-tile.term:hover { border-color: #6366f1; transform: translateY(-2px); }
  #page-matchgame .mg-tile.term.selected { border-color: #6366f1; background: #1e1b4b; box-shadow: 0 0 0 3px #6366f133; }
  #page-matchgame .mg-tile.def { background: #172033; border-color: #1e3a5f; }
  #page-matchgame .mg-tile.def:hover { border-color: #38bdf8; transform: translateY(-2px); }
  #page-matchgame .mg-tile.def.selected { border-color: #38bdf8; background: #0c2235; box-shadow: 0 0 0 3px #38bdf833; }
  #page-matchgame .mg-tile.matched { opacity: 0 !important; pointer-events: none !important; transform: scale(0.75) !important; transition: opacity 0.45s ease, transform 0.45s ease !important; }
  #page-matchgame .mg-tile.wrong { border-color: #f87171 !important; background: #2d0a0a !important; animation: mgshake 0.35s ease; }
  @keyframes mgshake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
  #page-matchgame .mg-tile-type { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px; }
  #page-matchgame .mg-tile.term .mg-tile-type { color: #818cf8; margin-bottom: 8px; }
  #page-matchgame .mg-tile.def  .mg-tile-type { color: #38bdf8; }
  #page-matchgame .mg-tile-text { font-size: 0.82rem; line-height: 1.45; color: #e2e8f0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; }
  #page-matchgame .mg-tile.term .mg-tile-text { font-size: 0.95rem; font-weight: 700; color: #f1f5f9; -webkit-line-clamp: 3; }
  .mg-tooltip { display: none; position: fixed; z-index: 9999; background: #1e293b; border: 1.5px solid #6366f1; border-radius: 10px; padding: 10px 14px; max-width: 320px; font-size: 0.78rem; color: #cbd5e1; line-height: 1.55; box-shadow: 0 8px 32px #0008; pointer-events: none; }
  .mg-tooltip.visible { display: block; }
  #page-matchgame .mg-btn-new { display: none; padding: 12px 32px; background: #6366f1; color: #fff; border: none; border-radius: 10px; font-size: 1rem; font-weight: 700; cursor: pointer; margin: 0 auto 28px; transition: background 0.15s; }
  #page-matchgame .mg-btn-new:hover { background: #4f46e5; }
  #page-matchgame .mg-btn-new.show { display: block; }
  #page-matchgame .mg-btn-reset { padding: 6px 16px; background: transparent; color: #f87171; border: 1.5px solid #f8717155; border-radius: 8px; font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
  #page-matchgame .mg-btn-reset:hover { background: #2d0a0a; border-color: #f87171; }
  #page-matchgame .mg-btn-load { padding: 6px 16px; background: transparent; color: #94a3b8; border: 1.5px solid #334155; border-radius: 8px; font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s; }
  #page-matchgame .mg-btn-load:hover { background: #1e293b; border-color: #94a3b8; color: #f1f5f9; }
  #page-matchgame .mg-toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px); background: #1e293b; border: 1.5px solid #4ade80; border-radius: 10px; padding: 10px 20px; font-size: 0.82rem; color: #4ade80; opacity: 0; transition: opacity 0.3s, transform 0.3s; pointer-events: none; white-space: nowrap; z-index: 9999; }
  #page-matchgame .mg-toast.error { border-color: #f87171; color: #f87171; }
  #page-matchgame .mg-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
  #page-matchgame .mg-history-wrap { width: 100%; max-width: 900px; }
  #page-matchgame .mg-history-wrap h2 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: #64748b; margin-bottom: 12px; }
  #page-matchgame table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
  #page-matchgame thead th { text-align: left; padding: 8px 12px; background: #1e293b; color: #64748b; font-weight: 600; border-bottom: 1px solid #334155; }
  #page-matchgame thead th:first-child { border-radius: 8px 0 0 0; }
  #page-matchgame thead th:last-child  { border-radius: 0 8px 0 0; }
  #page-matchgame tbody tr { border-bottom: 1px solid #1e293b; }
  #page-matchgame tbody tr:hover { background: #1a2235; }
  #page-matchgame td { padding: 8px 12px; vertical-align: top; color: #94a3b8; }
  #page-matchgame td:first-child { color: #64748b; width: 36px; text-align: center; }
  #page-matchgame td.term-col { font-weight: 700; color: #c7d2fe; width: 20%; }
  #page-matchgame td.def-col  { color: #94a3b8; width: 50%; }
  #page-matchgame td.result-col { width: 14%; font-weight: 700; text-align: center; }
  #page-matchgame td.result-ok  { color: #4ade80; }
  #page-matchgame td.result-bad { color: #f87171; }
  #page-matchgame td.round-col  { color: #475569; width: 8%; text-align: center; }
  #page-matchgame .mg-empty-history { text-align: center; color: #334155; padding: 24px; font-size: 0.85rem; }
  #page-matchgame .mg-terms-wrap { width: 100%; max-width: 900px; margin-top: 36px; }
  #page-matchgame .mg-terms-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
  #page-matchgame .mg-terms-header h2 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: #64748b; }
  #page-matchgame .mg-terms-counter { font-size: 0.82rem; color: #94a3b8; }
  #page-matchgame .mg-terms-counter span { color: #4ade80; font-weight: 700; }
  #page-matchgame .mg-terms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
  #page-matchgame .mg-term-chip { padding: 6px 10px; border-radius: 8px; background: #1e293b; border: 1px solid #334155; font-size: 0.75rem; color: #64748b; display: flex; align-items: center; gap: 6px; transition: border-color 0.2s, color 0.2s; }
  #page-matchgame .mg-term-chip.seen { border-color: #4ade8044; color: #4ade80; background: #0f2a1a; }
  #page-matchgame .mg-term-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: #334155; flex-shrink: 0; }
  #page-matchgame .mg-term-chip.seen .dot { background: #4ade80; }

  /* LIST QUESTIONS PAGE */
  .lq-filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
  .lq-filters select { width: auto; min-width: 180px; }
  .lq-count { font-size: 13px; color: var(--muted); }
  .lq-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
  .lq-table { width: 100%; border-collapse: collapse; }
  .lq-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
  .lq-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
  .lq-table tbody tr:last-child td { border-bottom: none; }
  .lq-table tbody tr:hover td { background: var(--surface2); }
  .lq-empty { color: var(--muted); text-align: center; padding: 48px; font-size: 14px; }
  .lq-ans-correct { color: var(--accent2); font-weight: 600; }
  .lq-ans-wrong { color: var(--red); font-weight: 600; }
  .lq-preview-btn { background: none; border: 1px solid var(--border); color: var(--muted); padding: 4px 10px; border-radius: 6px; font-size: 12px; cursor: pointer; transition: all .15s; white-space: nowrap; }
  .lq-preview-btn:hover { border-color: var(--accent); color: var(--text); }

  /* PREVIEW MODAL */
  .preview-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 600; display: flex; align-items: center; justify-content: center; animation: fadeInUp .18s ease; padding: 16px; }
  .preview-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; width: 700px; max-width: 96vw; max-height: 88vh; overflow-y: auto; }
  .preview-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
  .preview-header h3 { font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: .3px; }
  .preview-your-ans { font-size: 12px; margin-bottom: 16px; padding: 8px 12px; border-radius: 8px; background: var(--surface2); }

  /* ─── MOBILE: Match Game grid responsive ──────────────────────────────
     UWAGA: globalne layouty (nav/main/kpi-grid/charts) są w components.css
     Tier A. Tutaj tylko mg-grid bo to Match Game-specific. */
  @media (max-width: 1024px) {
    #page-matchgame .mg-grid { grid-template-columns: repeat(2, 1fr); }
    #page-matchgame .mg-header { flex-direction: column; align-items: stretch; }
    #page-matchgame .mg-stats { justify-content: center; }
  }
  @media (max-width: 480px) {
    #page-matchgame .mg-grid { grid-template-columns: 1fr; }
  }
