/* Codex Artificialis — Responsive Breakpoints */

/* Tablet */
@media (max-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
  }

  .top-bar__stats {
    gap: var(--space-sm);
  }

  .stat {
    font-size: 0.7rem;
  }

  .content {
    grid-template-columns: 220px 1fr;
  }

  .modal__panel {
    width: 95vw;
    gap: var(--space-lg);
    padding: var(--space-lg);
  }

  .section-hero__poem span {
    font-size: 0.72rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --header-h: 56px;
    --nav-h: 44px;
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
    padding: 0 var(--space-sm);
  }

  .top-bar {
    padding: 0 var(--space-md);
  }

  .top-bar__title {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
  }

  .top-bar__left {
    flex-shrink: 1;
    min-width: 0;
    max-width: 55%;
  }

  .top-bar__subtitle {
    font-size: 0.5rem;
  }

  .top-bar__subtitle-full {
    display: none;
  }

  .top-bar__subtitle-short {
    display: inline;
  }

  .top-bar__back {
    display: none;
  }

  .top-bar__stats {
    gap: var(--space-xs);
  }

  .stat {
    font-size: 0.65rem;
  }

  .stat--progress .stat__label {
    display: none;
  }

  .stat--essence,
  .stat--packs {
    cursor: pointer;
    border-bottom: 1px dotted rgba(212, 175, 55, 0.3);
    padding-bottom: 1px;
  }

  .code-btn {
    display: none;
  }

  .section-tab {
    padding: var(--space-xs) var(--space-sm);
  }

  .section-tab__full-name {
    display: none;
  }

  .section-tab__name {
    font-size: 0.65rem;
  }

  .section-hero {
    height: 220px;
  }

  .section-hero__poem {
    display: none;
  }

  /* Modal: stacked layout */
  .modal__panel {
    grid-template-columns: 1fr;
    width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    padding: var(--space-md);
  }

  .modal__art-container {
    max-width: 280px;
  }

  .modal__tier-row {
    max-width: 280px;
  }

  /* Sidebar: collapse to bottom on mobile */
  .content {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    order: 2;
    max-height: none;
    flex-direction: column;
    margin-top: var(--space-xl);
  }

  .content__main {
    order: 1;
  }

  /* Reveal cards */
  .reveal-area {
    flex-wrap: wrap;
    gap: var(--space-sm);
    padding: var(--space-md);
  }

  .reveal-card {
    width: 120px;
  }

  .sealed-pack {
    width: 220px;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .top-bar__stats {
    gap: var(--space-xs);
  }

  .card-slot__name {
    font-size: 0.55rem;
  }

  .card-slot__rarity {
    font-size: 0.5rem;
  }
}
