/* ==============================
 共通
============================== */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Hiragino Sans", "Helvetica Neue", Arial, sans-serif;
}

.fadeIn { animation: fadeIn .6s ease; }
.fadeInUp { animation: fadeInUp .6s ease; }
@keyframes fadeIn { from {opacity:0;} to {opacity:1;} }
@keyframes fadeInUp { from {opacity:0; transform:translateY(20px);} to {opacity:1; transform:translateY(0);} }

/* ==============================
 index.html
============================== */
body.index-page {
  background: linear-gradient(135deg, #9be2ff, #c7f5d9);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.index-container {
  width: 92%;
  max-width: 420px;
  padding: 30px 20px;
  background: white;
  border-radius: 24px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
  text-align: center;
}

.index-container input[type="text"] {
  width: 100%;
  padding: 13px;
  margin-top: 14px;
  border: 2px solid #ddd;
  font-size: 17px;
  border-radius: 12px;
}

.start-btn {
  width: 100%;
  padding: 12px;
  margin-top: 20px;
  font-size: 18px;
  border-radius: 12px;
  border: none;
  color: white;
  background: #4ba3ff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ==============================
 map4.html
============================== */

body.map-page {
  background: linear-gradient(135deg, #d7efff, #e8ffef);
  padding: 20px;
}

.card {
  background: white;
  padding: 18px;
  border-radius: 18px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  margin-bottom: 20px;
}

.map-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 900px) {
  .map-body { flex-direction: row; }
  .member-area { width: 30%; }
  .map-area { width: 70%; }
}

#map {
  width: 100%;
  height: 500px;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.20);
}

/* メンバー一覧 */
#memberList {
  list-style: none;
  padding: 0;
  margin: 0;
}

#memberList li {
  background: #f2f6ff;
  padding: 12px;
  margin: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-left: 5px solid #4ba3ff;
  border-radius: 14px;
}

.member-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
}

/* オンラインバッジ */
.member-icon::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  bottom: -3px;
  right: -3px;
  border: 2px solid white;
}

.online .member-icon::after { background: #22dd77; }
.offline .member-icon::after { background: #ff5d5d; }

.status-text {
  font-size: 14px;
  opacity: 0.8;
}

/* ピン（ズレ防止・固定サイズ） */
.custom-pin {
  transform-origin: center bottom;
}

.pin-wrapper {
  position: relative;
  transform: translate(-16px, -32px); /* ピンの先端位置に合わせる */
}

.pin-img {
  width: 32px;
  height: 32px;
}

.pin-label {
  background: white;
  padding: 2px 6px;
  margin-top: 3px;
  display: inline-block;
  font-size: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  white-space: nowrap;
}

/* 可愛い退出ボタン */
.exit-btn.cute {
  padding: 10px 16px;
  border-radius: 30px;
  background: linear-gradient(135deg, #ff9bb5, #ff6b8c);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(255, 100, 140, 0.4);
  transition: 0.25s;
}
.exit-btn.cute:hover {
  transform: scale(1.08);
  background: linear-gradient(135deg, #ff6b8c, #ff3b6f);
}

/* ==============================
   スマホ時（900px 未満）は
   マップ → メンバー一覧 の順番にする
============================== */
@media (max-width: 899px) {
  .map-body {
    display: flex;
    flex-direction: column;
  }

  /* 順番を入れ替える */
  .map-area {
    order: 1;
  }
  .member-area {
    order: 2;
  }
}

.member-icon {
  position: relative;    /* ← これが必須！ */
  width: 26px;
  height: 26px;
  border-radius: 50%;
}

.member-icon::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  bottom: -3px;
  right: -3px;
  border: 2px solid white;
}

.online .member-icon::after { background: #22dd77; }
.offline .member-icon::after { background: #ff5d5d; }

/* 一番近い駅表示用ボックス */
.nearest-box {
  margin-top: 12px;
  padding: 10px 12px;
  background: #f5fbff;
  border-radius: 10px;
  font-size: 14px;
  color: #444;
  border-left: 4px solid #4ba3ff;
}

.input-box {
  width: 100%;
  padding: 13px;
  margin-top: 14px;
  border: 2px solid #ddd;
  font-size: 17px;
  border-radius: 12px;
}

/* メンバーがチカチカしないよう固定レイアウト化 */
#memberList li {
  display: flex;
  align-items: center;
  gap: 10px;

  background: #f5f7ff;
  transition: background 0.2s linear; /* ← ゆるい色の変化だけ */
}

#memberList li.online {
  background: #e9f8ff; /* 色のみ変える */
}

#memberList li.offline {
  background: #f0f0f0; /* 色のみ変える */
}

/* 位置が変わらないアイコン */
.member-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
}

#memberList li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #f8f9ff;
  transition: background 0.2s linear;
  border-radius: 10px;
}

#memberList li.online {
  background: #e9f8ff;
}

#memberList li.offline {
  background: #f0f0f0;
}

.member-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
}
