/* ==========================================================
   リセット
========================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

/* ==========================================================
   アニメーション
========================================================== */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================
   PC 固定横並びメニュー
   スマホへの拡張は mobile CSS 側で行う
========================================================== */
@media (min-width: 601px) {
  .top-right-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    padding: 8px 0;
    display: flex;
    flex-direction: row;
    justify-content: center;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(6px);
    overflow: visible;
    z-index: 10000;
  }

  .toggle-nav-btn {
    display: none;
  }

  .nav-items {
    max-height: none;
    overflow: visible;
    flex-direction: row;
  }
  .nav-items.closed {
    max-height: none;
  }

  header {
    margin-top: 60px;
  }
}

/* ==========================================================
   基本スタイル
========================================================== */
body {
  font-family: "Segoe UI", sans-serif;
  line-height: 1.7;
  padding: 20px;
  background: #f5f5f5;
  color: #333;
}

header,
footer {
  text-align: center;
  margin-bottom: 25px;
  background: #fff;
  padding: 18px;
}

h1 {
  font-size: 2rem;
  margin-bottom: 10px;
}

h2 {
  font-size: 1.3rem;
  margin-bottom: 12px;
  padding-left: 10px;
  border-left: 5px solid #0078ff;
}

header {
  margin-top: 80px;
}

/* ==========================================================
   ローディング画面
========================================================== */
#loading {
  position: fixed;
  inset: 0;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  transition: opacity 0.6s ease;
}

#loading.hide {
  opacity: 0;
  pointer-events: none;
}

.loading-icon {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 18px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: fadeIn 0.8s ease;
}

.loader {
  width: 50px;
  height: 50px;
  border: 6px solid #ddd;
  border-top-color: #4a90e2;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 12px;
}

#loading p {
  font-size: 1rem;
  color: #4a90e2;
  font-weight: bold;
  animation: fadeIn 1s ease;
}

/* ハンバーガーボタン ホバー（PC/スマホ共通） */
.toggle-nav-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

.toggle-nav-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* ==========================================================
   メニュー項目（PC：横並び）
========================================================== */
.nav-items {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;

  overflow: hidden;
  max-height: 500px;
  transition: max-height 0.3s ease;
}

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

/* プロフィール */
.nav-profile {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-size: 14px;
}

.nav-profile img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

/* 共通ボタン */
.nav-btn {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  transition: 0.2s ease;
  border: none;
  cursor: pointer;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

#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: 90px;
  height: 20px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* フレンド一覧 */
.friend-list {
  display: grid;
  /* 3列レイアウト（幅が狭くなったら折り返す） */
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 30px;
}

.friend-card {
  display: flex;
  gap: 14px;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  align-items: center;
}

.friend-card img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(0,0,0,0.1);
}

.friend-info h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.friend-info a {
  color: #0078ff;
  text-decoration: none;
  font-weight: bold;
}

.friend-info a:hover {
  text-decoration: underline;
}