/* ==========================================================
   レスポンシブ（PC→スマホ）
========================================================== */
@media (max-width: 768px) {
  .hobby-wrapper {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================
   スマホ最適化（600px以下）
========================================================== */
@media (max-width: 600px) {

  header {
    margin-top: 90px;
  }

  body {
    padding: 10px;
    font-size: 15px;
    line-height: 1.8;
  }

  /* スマホ：縦に伸びる、右上固定 */
  .top-right-nav {
    position: fixed;
    top: 10px;
    right: 10px;
    width: 130px;
    height: 46px;
    padding: 6px;
    background: rgba(0,0,0,0.7);
    border-radius: 40px;
    z-index: 10000;
  }

  .top-right-nav.open {
    top: 0;
    right: 0;
    width: 200px;
    height: 100%;
    padding: 60px 10px 10px;
    background: rgba(0,0,0,0.85);
    border-radius: 0;
    z-index: 10000;
  }

  .toggle-nav-btn {
    width: 115px;
    height: 30px;
    font-size: 20px;
  }

  .nav-btn {
    font-size: 25px;
    padding: 6px 8px;
  }

  #back-to-top {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: none;
    margin: 0 auto 12px;
    background: #ccc;
    color: #000;
    border: none;
    border-radius: 10px;
    padding: 10px 0;
    font-size: 1.1rem;
    text-align: center;
  }

  .small-btn {
    width: 120px;
    height: 40px;
  }

  /* スマホは縦並び */
  .nav-items {
    flex-direction: column;
    gap: 10px;
    max-height: 500px;
  }

  .nav-items.closed {
    max-height: 0;
  }

  /* スマホ調整 */
  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.1rem; padding-left: 8px; border-left-width: 4px; }

  section { padding: 12px; margin-bottom: 18px; }

  .profile-wrapper { flex-direction: column; gap: 15px; }
  .profile-list dt { width: 100px; font-size: 14px; }
  .profile-list dd { font-size: 14px; }

  .avatar-image img { width: 140px; height: 240px; }

  .hobby-wrapper {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .hobby-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
  }

  .photo-card { width: calc(50% - 8px); padding: 8px; }
  .photo-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
  }

  .friend-icon { width: 90px; height: 90px; }

  .btn-link { padding: 12px 0; font-size: 15px; }

  .timeline { padding-left: 15px; margin-left: 5px; }
  .timeline-item { margin-bottom: 16px; }
  .timeline-item::before { left: -20px; }

  .back-to-top {
    right: 10px;
    bottom: 10px;
    padding: 12px 16px;
    font-size: 10px;
  }
}

img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

header,
footer {
  background: #fff;
  padding: 18px;
}