body {
      background-color: #0b1e3d;
      color: #dfeaff;
      font-family: Arial, sans-serif;
      margin: 0;
      padding: 20px;
    }

    h1, h2, h5 {
      color: #9bc9ff;
    }

    body, h1, h2, h3, h4, h5, h6, p, span, button, input, table, td, th {
      font-family: "Trebuchet MS", Arial, sans-serif !important;
    }

    .btn-back {
      background: linear-gradient(135deg, #1a3c6e, #274c8e);
      color: #e0efff;
      font-weight: bold;
      border: 2px solid #3a5c88;
      border-radius: 10px;
      padding: 8px 18px;
      transition: all 0.2s ease;
      box-shadow: 0 0 8px rgba(100, 160, 255, 0.3);
    }

    .btn-back:hover {
      background: linear-gradient(135deg, #274c8e, #3560b0);
      color: #ffffff;
      transform: translateY(-2px);
      box-shadow: 0 0 12px rgba(150,200,255,0.5);
    }

    /* === Stat Table Improvements === */
    .stat-table {
      width: 100%;
      border-collapse: separate;
      border-spacing: 0;
      border-radius: 12px;
      overflow: hidden;
      margin-bottom: 20px;
    }
    .stat-table td {
      padding: 12px 16px;
      border: none !important;
      background-color: #11284a;
      color: #e8f1ff;
      vertical-align: middle;
    }

    .stat-table tr:nth-child(even) td {
      background-color: #0e1f3c;
    }

    .stat-table td strong {
      color: #82c4ff;
      font-weight: 600;
    }

    .box {
      background-color: #132b50;
      border: 2px solid #3a5c88;
      border-radius: 10px;
      padding: 15px;
      margin-bottom: 20px;
      box-shadow: 0 0 10px rgba(100, 160, 255, 0.2);
    }

    .highlight-number { color: #33c5ff; font-weight: bold; }
    .fragment-entry { border-top: 1px solid #3a5c88; padding-top: 10px; margin-top: 10px; }
    .description { white-space: pre-wrap; }

    /* === Character List Grid === */
    .char-list {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
      gap: 15px;
      margin-top: 20px;
    }

    .char-item {
      border: 1px solid rgba(0,0,0,0.08);
      border-radius: 12px;
      overflow: hidden;
      background: rgba(255,255,255,0.02);
      width: 100%;
      transition: transform 0.18s ease;
      cursor: pointer;
    }
    .char-item .char-row { display:flex; align-items:center; justify-content:space-between; padding:14px 16px; gap:12px; }
    .char-item .char-name { font-weight:700; font-size:1.05rem; color: #e8f1ff; }
    .char-item .version-badge { background: rgba(0,0,0,0.12); padding:6px 10px; border-radius:12px; font-weight:700; font-size:0.85rem; border:1px solid rgba(255,255,255,0.04); }

    /* Released / Unreleased color themes for cards */
    .char-item.released { background: linear-gradient(145deg, #0b5f4d, #0f6f5b); color: #e0fff5; border: none; }
    .char-item.released .version-badge { background: rgba(0,0,0,0.16); }
    .char-item.unreleased { background: linear-gradient(145deg, #4e0a15, #6d1b26); color: #ffe0e0; border: none; }
    .char-item.unreleased .version-badge { background: rgba(0,0,0,0.12); }

    .gameplay-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      cursor: pointer;
      padding: 10px 12px;
      gap: 12px;
    }

    .gameplay-list { display: block; margin-top: 8px; }
    .gameplay-list .gameplay-item { margin-bottom: 10px; }

    .gameplay-item.open .arrow svg { transform: rotate(180deg); }

    .char-item:hover {
      transform: translateY(-3px);
      box-shadow: 0 0 12px rgba(150,200,255,0.4);
    }

    .released {
      background: linear-gradient(145deg, #004d40, #00695c);
      color: #e0fff5;
    }

    .unreleased {
      background: linear-gradient(145deg, #4e0a15, #6d1b26);
      color: #ffe0e0;
    }

    .container {
      max-width: 1100px;
      margin: auto;
      padding: 0 15px;
    }

    /* Force the same font everywhere and stop mobile auto-scaling */
    :root { --app-font: "Inter", Arial, sans-serif; }
      * { font-family: var(--app-font) !important; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
    
    /* Mobile friendliness */
    .container { max-width: 1100px; margin: auto; padding: 0 15px; }
    #searchBar { max-width: 520px; width: 100%; }
    @media (max-width: 576px) {
      body { padding: 12px; }
      .char-list { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
      .char-item { padding: 12px 14px; }
      h1 { font-size: 1.6rem; }
    }

    .forge-ui {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 12px;
      margin-top: 6px;
      justify-content: flex-start;
    }

    .forge-btn {
      background: linear-gradient(135deg, #1a3c6e, #274c8e);
      color: #e0efff;
      border: 2px solid #3a5c88;
      border-radius: 8px;
      padding: 2px 14px;
      font-size: 1.2rem;
      font-weight: bold;
      cursor: pointer;
      transition: all 0.2s;
      box-shadow: 0 0 6px rgba(100, 160, 255, 0.2);
    }

    .forge-btn:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    .forge-indicator {
      background: #11284a;
      color: #82c4ff;
      border-radius: 8px;
      padding: 2px 18px;
      font-size: 1.1rem;
      font-weight: bold;
      border: 2px solid #3a5c88;
      box-shadow: 0 0 6px rgba(100, 160, 255, 0.1);
    }

    /* Back button tap feedback (keeps your hover) */
    .btn-back:active { transform: scale(0.96); box-shadow: 0 0 6px rgba(150,200,255,0.6); }

    .forge-ui-small { gap: 6px; align-items: center; }
    .forge-btn-small { padding: 1px 8px; font-size: 0.95rem; border-radius: 6px; }
    .forge-indicator-small { padding: 1px 8px; font-size: 0.95rem; border-radius: 6px; }

    #relicLoader .d-flex { position: relative; z-index: 50; }
    #relicTypeFilter, #relicSearchBar { position: relative; z-index: 60; pointer-events: auto; }

    /* === Description highlights (unchanged from you) === */
    .description .Physical-ATK { color: yellow; font-weight: bold; }
    .description .Magic-PWR { color: magenta; font-weight: bold; }
    .description .Physical-DEF { color: orange; font-weight: bold; }
    .description .Magic-DEF { color: #66ccff; font-weight: bold; }
    .description .Physical-DMG { color: yellow; font-weight: bold; }
    .description .Magic-DMG { color: magenta; font-weight: bold; }
    .description .Quantum-DMG { color: #c792ea; font-weight: bold; }
    .description .Fusion-DMG { color: #ff6b81; font-weight: bold; }
    .description .Destruction-DMG { color: white; font-weight: bold; }
    .description .Artificial-DMG { color: #66faff; font-weight: bold; }
    .description .Sharp-DMG { color: darkred; font-weight: bold; }
    .description .Flame-DMG { color: red; font-weight: bold; }
    .description .Frost-DMG { color: #66ccff; font-weight: bold; }
    .description .Volte-DMG { color: #ffee66; font-weight: bold; }
    .description .Tide-DMG { color: #3366cc; font-weight: bold; }
    .description .Gale-DMG { color: #66fadd; font-weight: bold; }
    .description .Special-Active-Skill {color: #9bc9ff; font-weight: bold; }

/* === Trial Chamber Level Buttons === */
#currentSessionTitle {
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}

#trialBuffsDisplay {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  min-height: 50px;
  transition: background 0.3s ease, border 0.3s ease, color 0.3s ease;
  margin-bottom: 16px; /* gap between buff display and main layout */
}

.level-btn {
  background: linear-gradient(135deg, #1a3c6e, #274c8e);
  border: 2px solid #3a5c88;
  border-radius: 12px;
  padding: 10px 14px;
  color: #e0efff;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 0 6px rgba(100, 160, 255, 0.2);
  text-align: center;
  user-select: none;
}

.level-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 12px rgba(150, 200, 255, 0.4);
}

.level-btn:active {
  transform: scale(0.96);
  box-shadow: 0 0 6px rgba(150, 200, 255, 0.6);
}

.level-btn.active {
  background: linear-gradient(135deg, #3560b0, #4b7bd1);
  border-color: #82c4ff;
}

/* ============ Muted Fire Seasonal Theme (Dark + Subtle) ============ */

.level-btn.seasonal {
  background: linear-gradient(135deg, #3a1610, #592016);
  border: 2px solid #7a2f1f;
  color: #f3d6c3;
  box-shadow: 0 0 8px rgba(255, 120, 60, 0.25);
}

.level-btn.seasonal:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 0 12px rgba(255, 120, 60, 0.35);
}

.level-btn.seasonal:active {
  transform: scale(0.96);
  box-shadow: 0 0 8px rgba(255, 120, 60, 0.45);
}

.level-btn.active.seasonal {
  background: linear-gradient(135deg, #5c1f14, #7a2a1b);
  border-color: #b85a3a;
  box-shadow:
    0 0 14px rgba(255, 120, 60, 0.45),
    inset 0 0 6px rgba(255, 180, 120, 0.12);
}

/* Remove type-based coloring */
.level-btn.basic,
.level-btn.advanced {
  border-left: none;
}

.trial-chamber {
  margin-bottom: 24px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
}

.level-badge {
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
}

.sector-card {
  margin-top: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
}

.level-buff-box {
  white-space: pre-line;
  background: rgba(19, 43, 80, 0.7); /* semi-transparent deep blue */
  border: 2px solid #3a5c88;         /* same as .box border */
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #82c4ff;                     /* matches highlight color */
  box-shadow: 0 2px 8px rgba(100, 160, 255, 0.2);
  transition: all 0.2s ease;
}

.opponent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 8px;
  transition: all 0.3s ease;
}

.opponent-card {
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  transition: all 0.3s ease; /* smooth expansion */
}

/* Allow card to span more columns on hover */
.opponent-card:hover {
  grid-column: span 2; /* expand width 2x */
  z-index: 10; /* overlap neighbors */
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
}

/* Card summary */
/* Summary (name + level) */
.opponent-card .summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap; /* prevent wrapping */
  gap: 6px;
  overflow: hidden;
}

/* Opponent Name */
.opponent-card .opponent-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap; /* stay on one line */
  max-width: calc(100% - 50px); /* leave space for level badge */
}

/* Level Badge */
.opponent-card .opponent-level {
  background: rgba(255,255,255,0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0; /* never shrink */
  white-space: nowrap;
}

/* Card styling */
.opponent-card {
  align-self: start;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  position: relative; /* for hover z-index */
  transition: box-shadow 0.2s ease, z-index 0.2s ease;
}

/* Hover effect - only shadow & z-index, no scale */
.opponent-card:hover {
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  z-index: 10;
}

/* Gameplay list styles */
.gameplay-item {
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255,255,255,0.02);
}
.gameplay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
.gameplay-desc {
  background: transparent;
}
.gameplay-item .arrow {
  transition: transform 0.18s ease;
  margin-left: 10px;
}
.gameplay-item.open .arrow {
  transform: rotate(180deg);
}

/* Hidden details by default */
.opponent-card .details {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.35s ease, margin-top 0.35s ease;
  margin-top: 0;
  font-size: 0.85rem;
  pointer-events: none;
}

/* Show details on hover */
.opponent-card:hover .details {
  max-height: 300px; /* adjust for content */
  opacity: 1;
  margin-top: 6px;
  pointer-events: auto;
}

/* Description styling */
.opponent-desc {
  margin-top: 6px;
  font-style: italic;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
  border-left: 2px solid rgba(255,255,255,0.2);
  padding-left: 6px;
  word-break: break-word; /* wrap long text */
}

/* Rewards grid */
.reward-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.reward-card {
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.reward-card:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 12px rgba(0,0,0,0.2);
}

.reward-name {
  font-weight: 600;
  word-break: break-word;
  flex: 1;
}

.reward-qty {
  background: rgba(255,255,255,0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 4px;
}

/* Chamber Buff */
.chamber-buff {
  margin-bottom: 8px;
  padding: 4px 8px;
  background: rgba(0,255,150,0.1);
  border-radius: 6px;
  font-size: 0.9rem;
}

/* Challenges */
.challenge-list {
  margin-top: 8px;
  font-size: 0.85rem;
}

/* ================= Gameplay boxes & animation ================ */
.gameplay-list { display: block; margin-top: 12px; }
.gameplay-item { 
  width: 100%;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(19,43,80,0.35), rgba(13,30,58,0.25));
  box-shadow: 0 4px 14px rgba(5,25,60,0.35);
}
.gameplay-item:hover {
  border-color: rgba(130, 196, 255, 0.35);
  box-shadow: 0 8px 18px rgba(5,25,60,0.45);
}
.gameplay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 12px 14px;
  gap: 12px;
}
.gameplay-header:focus-visible {
  outline: 2px solid rgba(130, 196, 255, 0.65);
  outline-offset: -2px;
}
.gameplay-title { color: #dfeaff; font-size: 1rem; }
.gameplay-title .fw-bold { font-weight: 700; }
.gameplay-item .arrow { color: #82c4ff; display: inline-flex; align-items: center; }
.gameplay-item .arrow svg { transition: transform 0.28s ease; width: 18px; height: 18px; }
.gameplay-desc {
  max-height: 0;
  overflow: hidden;
  padding: 0 14px;
  opacity: 0;
  transition: max-height 0.32s ease, opacity 0.28s ease, padding 0.28s ease;
  color: #e8f1ff;
  background: rgba(0,0,0,0.02);
}
.gameplay-item.open .gameplay-desc {
  max-height: 800px;
  opacity: 1;
  padding: 10px 14px 14px 14px;
}
.gameplay-item.open .arrow svg { transform: rotate(180deg); }
.gameplay-section {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(9, 24, 50, 0.45);
  border: 1px solid rgba(130, 196, 255, 0.12);
}
.gameplay-section + .gameplay-section {
  margin-top: 10px;
}
.gameplay-label {
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: rgba(130, 196, 255, 0.9);
  font-weight: 700;
  margin-bottom: 6px;
}
.gameplay-summary .gameplay-body {
  color: #eaf3ff;
}
.gameplay-full {
  background: linear-gradient(165deg, rgba(26, 60, 110, 0.45), rgba(14, 32, 61, 0.55));
  border-color: rgba(130, 196, 255, 0.2);
}
.gameplay-body {
  line-height: 1.55;
}

@media (max-width: 576px) {
  .gameplay-header { padding: 10px 12px; }
  .gameplay-desc { padding: 8px 12px; }
}

/* ================= Mobile improvements ================= */
@media (max-width: 768px) {
  /* Force utilities that used fixed 50% to be full width on small screens */
  .w-50 { width: 100% !important; max-width: none !important; }
  #searchBar, #gameplaySearchBar, #relicSearchBar { max-width: none; width: 100% !important; }

  .container { padding: 0 12px; }

  /* tighter grid for small screens */
  .char-list { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .char-item .char-row { padding: 10px 12px; gap: 8px; }

  /* Larger tap targets */
  .btn-back { padding: 10px 12px; border-radius: 8px; }
  .box { padding: 12px; }

  /* Trial chambers: stack left/right columns and allow level list to scroll horizontally */
  #trialChambers .d-flex.gap-3 { flex-direction: column; }
  #levelList { min-width: 0; display: flex; gap: 8px; overflow-x: auto; }
  #levelList .level-btn { flex: 0 0 auto; }

  /* Prevent heavy hover expands on small devices */
  .opponent-card:hover { grid-column: span 1; }
}

@media (max-width: 420px) {
  h1 { font-size: 1.4rem; }
  .char-list { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .stat-table td { padding: 10px 12px; }
  .level-btn { padding: 8px 10px; font-size: 0.95rem; }
}

/* ================= Custom Navigation ================= */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 1200;
  backdrop-filter: blur(8px);
  background: rgba(7, 19, 41, 0.92);
  border-bottom: 1px solid rgba(130, 196, 255, 0.22);
  margin: -20px -20px 18px -20px;
  padding: 10px 20px;
}

.top-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  color: #e8f1ff;
  font-weight: 700;
  letter-spacing: 0.4px;
  font-size: 1.1rem;
}

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

.nav-link-item {
  text-decoration: none;
  color: #c7dcff;
  font-weight: 600;
  border: 1px solid rgba(130, 196, 255, 0.2);
  border-radius: 999px;
  padding: 8px 12px;
  transition: all 0.18s ease;
  background: rgba(16, 40, 76, 0.45);
}

.nav-link-item:hover {
  color: #f3f8ff;
  border-color: rgba(130, 196, 255, 0.5);
  background: rgba(30, 69, 123, 0.55);
}

.nav-link-item.active {
  color: #08182f;
  background: linear-gradient(135deg, #8ed6ff, #68b5ff);
  border-color: #9dd7ff;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(130, 196, 255, 0.4);
  border-radius: 8px;
  width: 42px;
  height: 38px;
  padding: 6px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: #c7dcff;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.nav-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ================= Rifted Matters ================= */
.matters-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.matters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 10px;
  align-items: start;
}

.matter-card {
  border: 1px solid rgba(130, 196, 255, 0.28);
  border-radius: 12px;
  padding: 14px;
  background: linear-gradient(165deg, rgba(19, 43, 80, 0.76), rgba(12, 28, 54, 0.88));
  box-shadow: 0 4px 14px rgba(5, 25, 60, 0.3);
  align-self: start;
}

.matter-card.fusion {
  border-color: rgba(255, 174, 107, 0.48);
  background: linear-gradient(165deg, rgba(73, 42, 17, 0.72), rgba(32, 22, 13, 0.9));
}

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

.matter-title {
  margin: 0;
  font-size: 1.05rem;
  color: #eaf3ff;
}

.matter-type-badge {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(130, 196, 255, 0.18);
  color: #aeddff;
}

.matter-card.fusion .matter-type-badge {
  background: rgba(255, 174, 107, 0.2);
  color: #ffd6ab;
}

.matter-preview {
  font-size: 0.84rem;
  color: #a9c8ef;
  margin: 2px 0 8px;
}

.matter-actions {
  display: flex;
  justify-content: flex-start;
}

.matter-expand-btn {
  border: 1px solid rgba(130, 196, 255, 0.35);
  background: rgba(18, 48, 89, 0.6);
  color: #d9ebff;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.83rem;
  font-weight: 600;
}

.matter-card.is-open .matter-expand-btn {
  opacity: 0.6;
}

.matter-body {
  position: relative;
  margin-top: 10px;
  padding-top: 6px;
  animation: matterExpand 0.18s ease;
}

.matter-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px;
}

.matter-chip {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.78rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.matter-set-block {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.matter-set-block h5 {
  margin: 0 0 4px;
  font-size: 0.83rem;
  color: #9bc9ff;
}

.matter-set-block p {
  margin: 0;
  line-height: 1.45;
  color: #dfeaff;
}

@keyframes matterExpand {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  body { padding: 12px; }

  .top-nav {
    margin: -12px -12px 12px -12px;
    padding: 10px 12px;
  }

  .nav-toggle {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    width: min(280px, 82vw);
    background: linear-gradient(180deg, rgba(8, 21, 44, 0.98), rgba(8, 23, 47, 0.98));
    border-right: 1px solid rgba(130, 196, 255, 0.2);
    box-shadow: 6px 0 20px rgba(0, 0, 0, 0.45);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    padding: 72px 12px 14px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    z-index: 1201;
  }

  .main-nav.open {
    transform: translateX(0);
  }

  .nav-link-item {
    border-radius: 10px;
    padding: 10px 12px;
  }

  .matters-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .matters-grid {
    grid-template-columns: 1fr;
  }
}
