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

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Avant Garde", "Futura", sans-serif;
}

/* ローディング画面 */
#loading-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10vw;
  font-weight: bold;
  z-index: 1000;
  overflow: hidden;
}

#loading-text {
  white-space: nowrap;
  transform: translateX(0);
  transition: transform 2s ease-in-out;
}

/* メインコンテンツ */
#main {
  position: relative;
  width: 100%;
  height: 100%;
  background: #fff;
  overflow: hidden;
}

.feed-wrapper {
  position: absolute;
  cursor: grab;
}

.feed-wrapper:active {
  cursor: grabbing;
}

.feed-image {
  display: block;
  object-fit: cover;
  transition: opacity 1s ease-in-out;
  pointer-events: auto;
}

/* リロードボタン */
#reload-btn, #caption-btn {
  position: fixed;
  bottom: 20px;
  width: 60px;
  height: 60px;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

#reload-btn:hover, #caption-btn:hover {
  background: #333;
}

#reload-btn {
  left: 50%;
  transform: translateX(-50%);
}

#caption-btn {
  right: 20px;
  left: auto;
  transform: none;
}

/* キャプションパネル */
#caption-panel {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.95);
  display: none;
  flex-direction: column;
  z-index: 3000;
}

#caption-header {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  padding: 20px;
}

#caption-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 40px; /* PC向け余白 */
  max-width: 900px; /* PCで本文幅を制限 */
  margin: 0 auto; /* 中央寄せ */
}

#caption-content h2,
#caption-content p {
  margin-bottom: 20px; /* 各ブロックの間隔 */
}

#caption-close {
  position: fixed; /* 固定表示 */
  top: 20px;
  right: 20px;
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 3100;
  color: #000; /* テキスト色を黒に固定 */
  -webkit-tap-highlight-color: transparent; /* iOS/Androidの青ハイライトを消す */
  outline: none; /* フォーカス枠を消す */
}

#caption-close:focus,
#caption-close:active {
  color: #000;
  background: none;
}

#sns-links {
  margin-top: 20px;
}

#sns-links img {
  width: 32px;
  height: 32px;
  margin-right: 10px;
}

/* スマホ対応 */
@media (max-width: 768px) {
  #loading-screen {
    font-size: 14vw;
  }
  #reload-btn, #caption-btn {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }
  #caption-content {
    padding: 20px 10px 40px; /* スマホでは余白を狭める */
    max-width: 100%;
    margin: 0;
  }
}
