/* Mobile layout — Guild Chronicle + Slain registry */

@media (max-width: 768px) {
  html {
    -webkit-text-size-adjust: 100%;
  }

  body {
    overflow-x: hidden;
  }

  .back-hub {
    top: max(0.75rem, env(safe-area-inset-top));
    left: max(0.75rem, env(safe-area-inset-left));
    max-width: calc(100vw - 1.5rem);
    font-size: 0.68rem;
    padding: 0.45rem 0.75rem;
  }

  /* ── Hero ── */

  .hero {
    min-height: 100svh;
  }

  .hero-inner {
    padding: 2.5rem 1.25rem 3rem;
  }

  .hero h1 {
    font-size: clamp(2rem, 11vw, 3rem);
    letter-spacing: 0.04em;
  }

  .eyebrow {
    font-size: 0.62rem;
    letter-spacing: 0.18em;
  }

  .tagline {
    font-size: 1rem;
    padding: 0 0.5rem;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem 1rem;
    width: 100%;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-stats strong {
    font-size: 1.75rem;
  }

  .hero-stats span {
    font-size: 0.62rem;
  }

  .scroll-cta {
    width: 100%;
    max-width: 280px;
    text-align: center;
    padding: 0.85rem 1.25rem;
  }

  /* ── Panels ── */

  .scroll-body {
    margin-top: -2rem;
    padding: 0 0.85rem 2.5rem;
    padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
  }

  .panel {
    padding: 1.75rem 1rem;
    margin-bottom: 1.5rem;
  }

  .panel h2 {
    font-size: 1.15rem;
    letter-spacing: 0.08em;
  }

  .section-note {
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    padding: 0 0.25rem;
  }

  .conquest-frame img {
    height: 200px;
  }

  .conquest-details dl div {
    font-size: 0.95rem;
  }

  .slain-cta {
    display: block;
    width: 100%;
    text-align: center;
  }

  .knight-card {
    padding: 1.25rem 0.85rem;
  }

  .site-footer {
    padding: 1.25rem 1rem max(1.25rem, env(safe-area-inset-bottom));
    font-size: 0.85rem;
  }

  /* ── Slain page ── */

  .slain-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    margin-bottom: 1rem;
  }

  .slain-toolbar h2 {
    font-size: 1.15rem;
    text-align: center;
  }

  .slain-toolbar .section-note {
    margin-bottom: 0;
    text-align: center;
  }

  .add-entry-btn {
    width: 100%;
    max-width: none;
    padding: 0.75rem 1rem;
  }

  .category-head {
    padding: 0.85rem 1rem;
  }

  .category-title {
    font-size: 0.85rem;
    letter-spacing: 0.08em;
  }

  .slain-row-btn {
    grid-template-columns: auto 1fr auto;
    gap: 0.55rem 0.65rem;
    padding: 0.75rem 0.85rem;
  }

  .slain-avatar-wrap {
    width: 44px;
    height: 44px;
  }

  .slain-head {
    width: 36px;
    height: 36px;
  }

  .player-name {
    font-size: 0.88rem;
  }

  .slain-indicators {
    gap: 0.25rem;
  }

  .ind {
    font-size: 0.58rem;
    padding: 0.15rem 0.42rem;
  }

  .slain-expand {
    padding: 0 0.65rem 0.85rem;
  }

  .profile-banner {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 1rem;
    gap: 1rem;
  }

  .profile-skin-frame {
    margin: 0 auto;
    width: 100px;
    min-height: 130px;
  }

  .profile-body {
    max-height: 120px;
  }

  .profile-username {
    font-size: 1.1rem;
  }

  .profile-tags {
    justify-content: center;
  }

  .profile-edit-btn {
    top: 0.45rem;
    right: 0.45rem;
    width: 2rem;
    height: 2rem;
  }

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

  .profile-panel {
    padding: 0.85rem 1rem;
    border-right: none;
    border-bottom: 1px solid rgba(139, 105, 20, 0.12);
  }

  .profile-panel:last-child {
    border-bottom: none;
  }

  .shot-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* ── Modal (full-screen sheet on phone) ── */

  .slain-modal {
    padding: 0;
    align-items: stretch;
  }

  .modal-panel {
    max-width: none;
    max-height: none;
    min-height: 100svh;
    border: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }

  .modal-layout {
    grid-template-columns: 1fr;
    flex: 1;
    overflow-y: auto;
  }

  .modal-preview {
    border-right: none;
    border-bottom: 1px solid rgba(139, 105, 20, 0.2);
    padding: 1rem;
  }

  .preview-skin-frame {
    min-height: 140px;
  }

  .modal-body {
    padding: 1rem;
  }

  .modal-foot {
    padding: 0.85rem 1rem max(0.85rem, env(safe-area-inset-bottom));
    position: sticky;
    bottom: 0;
    background: var(--parchment-deep);
    display: flex;
    gap: 0.65rem;
  }

  .modal-foot .scroll-cta,
  .modal-foot .btn-secondary {
    flex: 1;
    text-align: center;
    min-height: 44px;
  }

  .modal-foot .btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 400px) {
  .hero-stats {
    max-width: 100%;
  }

  .slain-row-btn {
    grid-template-columns: auto 1fr;
  }

  .expand-chevron {
    grid-column: 2;
    justify-self: end;
  }
}
