@charset "UTF-8";

/* ===================================================
   Song & Letter Bottle - スタイルシート
   レトロ・温かみ・セピア・星降る夜の海の世界観
   =================================================== */

:root {
  --font-serif: "Yu Mincho", "Hiragino Mincho ProN", "MS PMincho", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  
  --color-parchment-bg: #f5eedc;
  --color-parchment-border: #d2be99;
  --color-parchment-dark: #3a2e26;
  --color-ink: #2b221a;
  --color-ink-light: #5f5144;
  --color-accent-amber: #d49a42;
  --color-accent-glow: rgba(235, 185, 110, 0.4);
  
  --color-ocean-night: #0c1527;
  --color-ocean-wave: #2a4c6f;
  
  --shadow-paper: 0 12px 36px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-glass: 0 10px 25px rgba(0, 0, 0, 0.35), inset 0 0 15px rgba(255, 255, 255, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-serif);
  background-color: var(--color-ocean-night);
  background-image: linear-gradient(180deg, rgba(8, 14, 26, 0.45) 0%, rgba(8, 14, 26, 0.25) 50%, rgba(8, 14, 26, 0.8) 100%), url('../assets/sea_bg.jpg');
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  color: #f0ede6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  /* ボタン以外の文章を自由に選択・コピー可能にする */
  user-select: auto;
  -webkit-user-select: auto;
}

/* ボタンやアイコンなどUI部品のみ誤選択防止 */
button, .btn-paper, .action-bottle, .nav-btn, .music-preset-btn, .avatar-icon, .bottle-seal {
  user-select: none;
  -webkit-user-select: none;
}

/* 手紙本文、スレッドのやりとり、モーダル文章は明示的にコピー許可 */
.letter-paper, 
.letter-content, 
.thread-bubble, 
.thread-message-body, 
.thread-dialogue-container, 
.read-content, 
.modal-body, 
.modal-content p, 
.epilogue-card, 
.epilogue-stream-bubble {
  user-select: text !important;
  -webkit-user-select: text !important;
}

/* 背景Canvas（写真の上に星のきらめき効果のみ透過オーバーレイ） */
#sea-bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: screen;
}

/* アプリ全体レイアウト */
.app-container {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ヘッダーエリア */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background: linear-gradient(180deg, rgba(12, 21, 39, 0.85) 0%, rgba(12, 21, 39, 0) 100%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 8px var(--color-accent-glow));
}

.brand-title {
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: #fff7eb;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.brand-subtitle {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: #b8af9f;
  margin-top: -2px;
}

/* ヘッダー右側のアクション */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ヘッダーボタン（文字ラベル付きで誰でも直感的にわかるデザイン） */
.btn-header-action {
  background: rgba(22, 38, 62, 0.65);
  border: 1px solid rgba(255, 235, 190, 0.3);
  color: #f2ede4;
  border-radius: 20px;
  height: 38px;
  padding: 0 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
  position: relative;
  font-family: var(--font-serif);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.btn-header-action .action-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.btn-header-action:hover {
  background: rgba(35, 58, 92, 0.85);
  border-color: var(--color-accent-amber);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(223, 165, 77, 0.35);
}

.btn-icon {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e8e3d9;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  flex-shrink: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(6px);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--color-accent-amber);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 154, 66, 0.3);
}

/* 通知バッジ */
.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #e74c3c;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: bold;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  border-radius: 9px;
  text-align: center;
  padding: 0 4px;
  border: 2px solid #0f1c2e;
  box-shadow: 0 2px 5px rgba(0,0,0,0.5);
  animation: badge-pulse 2s infinite ease-in-out;
}

@keyframes badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.sea-status-badge {
  font-size: 0.85rem;
  color: #d1c7b7;
  background: rgba(25, 40, 65, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  letter-spacing: 0.05em;
  backdrop-filter: blur(4px);
}

/* メインステージ（海と砂浜の中央） */
.main-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
  text-align: center;
}

.stage-poem {
  max-width: 520px;
  margin-bottom: 3rem;
  color: #e5dec9;
  line-height: 2;
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}

.stage-poem span {
  display: block;
}

/* ボトルビジュアル（写真調ボトルアート） */
.main-bottle-wrapper {
  position: relative;
  width: 170px;
  height: 170px;
  min-width: 170px;
  min-height: 170px;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  margin: 0 auto 3rem;
  cursor: pointer;
  border-radius: 50%;
  padding: 6px;
  background: linear-gradient(135deg, rgba(235, 185, 110, 0.7) 0%, rgba(180, 225, 235, 0.25) 50%, rgba(20, 35, 55, 0.8) 100%);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.75), 0 0 25px rgba(212, 154, 66, 0.4);
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.main-bottle-photo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-image: url('../assets/bottle_sand.jpg');
  background-size: cover;
  background-position: center center;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.65);
}

.bottle-shine-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, transparent 60%);
  pointer-events: none;
}

.main-bottle-wrapper:hover {
  transform: translateY(-8px) scale(1.06);
  box-shadow: 0 22px 45px rgba(0, 0, 0, 0.85), 0 0 35px rgba(223, 165, 77, 0.65);
}

/* メインアクションボタン */
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  z-index: 10;
}

.btn-primary, .btn-secondary {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  padding: 0.9rem 2.2rem;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-primary {
  background: linear-gradient(135deg, #dfa54d 0%, #b87b28 100%);
  color: #1a1208;
  border: 1px solid rgba(255, 235, 190, 0.6);
  box-shadow: 0 6px 20px rgba(223, 165, 77, 0.35), 0 2px 4px rgba(0, 0, 0, 0.3);
  font-weight: 600;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 28px rgba(223, 165, 77, 0.5);
  background: linear-gradient(135deg, #ebb55e 0%, #c88934 100%);
}

.btn-secondary {
  background: rgba(22, 38, 62, 0.7);
  color: #f2ede4;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background: rgba(30, 52, 85, 0.85);
  border-color: var(--color-accent-amber);
  transform: translateY(-3px) scale(1.02);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

/* フッター */
.app-footer {
  padding: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  color: #8c8275;
  background: linear-gradient(0deg, rgba(15, 12, 10, 0.95) 0%, rgba(15, 12, 10, 0) 100%);
}

/* ===================================================
   モーダル & 羊皮紙（手紙を読む / 手紙を書く）
   =================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(6, 12, 22, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.modal-backdrop:not(.active) * {
  pointer-events: none !important;
}

/* 羊皮紙ペーパーコンテナ（リアルなヴィンテージ手紙テクスチャ） */
.parchment-letter {
  background-color: #f7eedc;
  background-image: linear-gradient(rgba(247, 238, 220, 0.9), rgba(247, 238, 220, 0.9)), url('../assets/parchment_bg.jpg');
  background-size: cover;
  background-position: center center;
  color: var(--color-ink);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 12px;
  padding: 3rem 2.6rem;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.75), 0 4px 15px rgba(0, 0, 0, 0.4);
  border: 1px solid #caa97b;
  transform: translateY(20px) scale(0.96);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active .parchment-letter {
  transform: translateY(0) scale(1);
}

/* 羊皮紙の装飾的な縁取り線 */
.parchment-border-inner {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  bottom: 14px;
  border: 1px solid rgba(168, 140, 98, 0.4);
  pointer-events: none;
  border-radius: 4px;
}

.modal-close-btn:not(.btn-paper),
.modal-corner-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--color-ink-light);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 5;
}

.modal-close-btn:not(.btn-paper):hover,
.modal-corner-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--color-ink);
}

/* 手紙ヘッダー */
.letter-header {
  border-bottom: 1px dashed rgba(160, 130, 90, 0.45);
  padding-bottom: 1.2rem;
  margin-bottom: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.letter-sender {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sender-avatar {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.sender-info h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-ink);
  letter-spacing: 0.08em;
}

.sender-info span {
  font-size: 0.8rem;
  color: var(--color-ink-light);
  letter-spacing: 0.05em;
}

.letter-date {
  font-size: 0.8rem;
  color: var(--color-ink-light);
  letter-spacing: 0.05em;
}

/* 手紙本文 */
.letter-body {
  font-size: 1.05rem;
  line-height: 2.1;
  letter-spacing: 0.08em;
  color: var(--color-ink);
  white-space: pre-wrap;
  margin-bottom: 2rem;
  min-height: 120px;
}

/* 音楽カード（YouTube / 曲情報） */
.music-attachment {
  background: rgba(235, 222, 198, 0.75);
  border: 1px solid rgba(190, 165, 125, 0.6);
  border-radius: 8px;
  padding: 1.2rem;
  margin-bottom: 2rem;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.music-attachment-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-ink-light);
  margin-bottom: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.music-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #7d261b;
  margin-bottom: 0.8rem;
  letter-spacing: 0.05em;
}

.music-embed-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  background: #000;
}

.music-embed-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* 洗練されたYouTube音楽カード */
.music-card {
  display: flex;
  gap: 1.2rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(180, 150, 110, 0.5);
  border-radius: 10px;
  padding: 1rem;
  align-items: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(4px);
}

.music-card-thumb {
  width: 110px;
  height: 75px;
  border-radius: 6px;
  background-color: #2c221b;
  background-image: radial-gradient(circle at center, #4d3826 0%, #1e150f 100%);
  background-size: cover;
  background-position: center;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  cursor: pointer;
}

.music-card-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.4rem;
  transition: all 0.25s ease;
}

.music-card-thumb:hover .music-card-play-overlay {
  background: rgba(180, 80, 20, 0.65);
  transform: scale(1.05);
}

.music-card-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.music-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #2b2016;
  line-height: 1.4;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-card-sub {
  font-size: 0.75rem;
  color: #7d6b5b;
}

.music-card-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.45rem;
  flex-wrap: wrap;
}

/* メイン優先ボタン: この場で再生 */
.btn-play-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, #d97724 0%, #b35917 100%);
  color: #ffffff;
  border: none;
  padding: 0.45rem 1.05rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 9px rgba(179, 89, 23, 0.35);
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
}

.btn-play-primary:hover {
  background: linear-gradient(135deg, #ea852d 0%, #c4641d 100%);
  box-shadow: 0 5px 14px rgba(179, 89, 23, 0.48);
  transform: translateY(-1.5px);
}

.btn-play-primary.playing {
  background: linear-gradient(135deg, #5c4738 0%, #3e2e22 100%);
  box-shadow: 0 2px 7px rgba(60, 40, 25, 0.3);
}

.btn-play-primary .play-icon-text {
  font-size: 0.9rem;
}

/* 控えめなサブボタン: YouTubeで開く */
.btn-yt-sub,
.btn-yt-direct {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.85);
  color: #554433;
  border: 1px solid rgba(170, 145, 120, 0.45);
  padding: 0.4rem 0.75rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
}

.btn-yt-sub:hover,
.btn-yt-direct:hover {
  background: #ffffff;
  border-color: #cc0000;
  color: #cc0000;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(200, 0, 0, 0.12);
}

.btn-yt-embed-toggle {
  /* 互換用 */
  display: none;
}

.music-link-fallback {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #8c3220;
  text-decoration: underline;
  font-size: 0.95rem;
  font-weight: 500;
}

/* 手紙フッター・アクション */
.letter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  border-top: 1px dashed rgba(160, 130, 90, 0.45);
  padding-top: 1.5rem;
}

.btn-paper {
  background: #e7dac2;
  border: 1px solid #baa887;
  color: var(--color-ink);
  font-family: var(--font-serif);
  padding: 0.65rem 1.4rem;
  border-radius: 20px;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-paper:hover {
  background: #dfcfb2;
  border-color: #8c7350;
  transform: translateY(-1px);
}

.btn-paper-primary {
  background: #8b3c2d;
  color: #fff9ee;
  border-color: #6d281c;
}

.btn-paper-primary:hover {
  background: #a34735;
  color: #ffffff;
}

.btn-paper-highlight {
  background: #c98836;
  color: #1a1208;
  border-color: #9c631e;
  font-weight: 600;
}

.btn-paper-highlight:hover {
  background: #df9a43;
  color: #000;
  box-shadow: 0 2px 8px rgba(201, 136, 54, 0.35);
}

/* 旅の足跡：寄せ書きスタイル */
.replies-section {
  margin-top: 2rem;
  margin-bottom: 2rem;
  padding-top: 1.5rem;
  border-top: 2px dashed rgba(160, 130, 90, 0.45);
}

.replies-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #6d3324;
  margin-bottom: 1.2rem;
  letter-spacing: 0.08em;
}

.replies-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.reply-item {
  background: rgba(255, 255, 255, 0.4);
  border-left: 3px solid #b87b28;
  border-radius: 0 6px 6px 0;
  padding: 0.9rem 1.1rem;
  font-size: 0.95rem;
  line-height: 1.8;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.reply-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
  color: var(--color-ink-light);
}

.reply-item-sender {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--color-ink);
}

.reply-item-content {
  color: var(--color-ink);
  white-space: pre-wrap;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.reply-item-music {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #8c3220;
}

.reply-item-music a {
  color: #8c3220;
  text-decoration: underline;
}

/* 寄せ書き内の音楽プレーヤーボックス */
.reply-music-box {
  margin-top: 0.65rem;
  padding: 0.55rem 0.85rem;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(190, 160, 120, 0.45);
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.reply-music-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.reply-music-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #2b221a;
}

.reply-music-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.btn-reply-play {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: linear-gradient(135deg, #d97724, #b35917);
  color: #ffffff;
  border: none;
  padding: 0.25rem 0.65rem;
  border-radius: 14px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(179, 89, 23, 0.25);
  transition: all 0.2s;
}

.btn-reply-play:hover {
  background: linear-gradient(135deg, #ea852d, #c4641d);
  transform: translateY(-1px);
}

.btn-reply-play.playing {
  background: #5c4738;
}

.btn-reply-yt {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(170, 145, 120, 0.4);
  border-radius: 12px;
  color: #6d5b4b;
  font-size: 0.72rem;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-reply-yt:hover {
  color: #cc0000;
  border-color: #cc0000;
  background: #fff;
}

.reply-player-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 0.6rem;
  background: #000;
}

.reply-player-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* 返信フォームコンテナ */
.reply-form-container {
  margin-top: 1.8rem;
  padding: 1.4rem;
  background: rgba(240, 227, 203, 0.7);
  border: 1px solid rgba(190, 165, 125, 0.7);
  border-radius: 8px;
  animation: fadeIn 0.3s ease;
}

.reply-textarea {
  min-height: 100px !important;
  font-size: 0.95rem !important;
}

/* 手紙作成フォーム */
.letter-form-group {
  margin-bottom: 1.5rem;
}

.letter-form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: 0.5rem;
  letter-spacing: 0.08em;
}

.letter-textarea {
  width: 100%;
  min-height: 180px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--color-parchment-border);
  border-radius: 6px;
  padding: 1rem;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 2;
  color: var(--color-ink);
  resize: vertical;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.letter-textarea:focus {
  background: rgba(255, 255, 255, 0.7);
  border-color: #8f6c40;
}

.letter-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--color-parchment-border);
  border-radius: 6px;
  padding: 0.65rem 0.9rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--color-ink);
  outline: none;
  transition: all 0.2s ease;
}

.letter-input:focus {
  background: rgba(255, 255, 255, 0.7);
  border-color: #8f6c40;
}

.form-tip {
  font-size: 0.8rem;
  color: var(--color-ink-light);
  margin-top: 0.35rem;
  line-height: 1.4;
}

/* アニメーション用オーバーレイ演出 */
.animation-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 200;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.animation-overlay.active {
  opacity: 1;
  pointer-events: auto;
  background: rgba(8, 14, 25, 0.6);
}

.animating-bottle {
  position: absolute;
  transition: all 2s cubic-bezier(0.25, 1, 0.5, 1);
}

.toast-message {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(50px);
  background: rgba(20, 32, 50, 0.92);
  border: 1px solid var(--color-accent-amber);
  color: #f7eedc;
  padding: 0.9rem 1.8rem;
  border-radius: 30px;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  z-index: 300;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-message.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===================================================
   レスポンシブ対応（タブレット・スマートフォン）
   =================================================== */

/* タブレット対応（iPad、M70、Androidタブレットなど 幅900px以下） */
@media (max-width: 900px) {
  .app-header {
    padding: 1.1rem 1.2rem;
    flex-direction: column;
    gap: 0.9rem;
    align-items: center;
  }
  .brand {
    justify-content: center;
  }
  .brand-title {
    font-size: 1.3rem;
  }
  .header-actions {
    width: 100%;
    justify-content: center;
    gap: 0.65rem;
    flex-wrap: wrap;
  }
  .sea-status-badge {
    order: 10;
    font-size: 0.8rem;
    padding: 0.35rem 0.8rem;
    margin-top: 0.2rem;
  }
  .btn-header-action {
    height: 36px;
    padding: 0 0.75rem;
    font-size: 0.82rem;
  }
  .stage-poem {
    font-size: 0.98rem;
    margin-bottom: 2.2rem;
    padding: 0 1rem;
    line-height: 1.9;
  }
  .main-bottle-wrapper {
    width: 150px;
    height: 150px;
    min-width: 150px;
    min-height: 150px;
    margin-bottom: 2.4rem;
  }
  .parchment-letter {
    padding: 2.4rem 1.8rem;
    max-width: 92vw;
  }
}

/* スマートフォン対応（幅680px以下） */
@media (max-width: 680px) {
  .app-header {
    padding: 0.9rem 0.6rem;
    gap: 0.7rem;
  }
  .brand-icon {
    font-size: 1.5rem;
  }
  .brand-title {
    font-size: 1.15rem;
  }
  .brand-subtitle {
    font-size: 0.7rem;
  }
  .header-actions {
    gap: 0.45rem;
  }
  .btn-header-action {
    height: 34px;
    padding: 0 0.6rem;
    font-size: 0.78rem;
    gap: 0.3rem;
  }
  .btn-header-action .action-icon {
    font-size: 0.95rem;
  }
  .btn-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    font-size: 0.95rem;
  }
  .sea-status-badge {
    width: 100%;
    text-align: center;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }
  .stage-poem {
    font-size: 0.9rem;
    margin-bottom: 1.6rem;
    line-height: 1.8;
  }
  .main-bottle-wrapper {
    width: 125px;
    height: 125px;
    min-width: 125px;
    min-height: 125px;
    aspect-ratio: 1 / 1;
    margin-bottom: 1.8rem;
    border-radius: 50%;
  }
  .action-buttons {
    gap: 0.9rem;
    width: 100%;
  }
  .btn-primary, .btn-secondary {
    width: 100%;
    max-width: 270px;
    justify-content: center;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
  }
  .parchment-letter {
    padding: 2rem 1.2rem;
    max-width: 95vw;
  }
}

/* ===================================================
   お返事ボトル到着通知（You've Got Bottle Mail!）＆マイボトル小箱
   =================================================== */

/* ヘッダー小箱ボタン＆通知バッジ */
.btn-my-box {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}



/* お返事到着通知カード */
.reply-alert-card {
  max-width: 520px;
  text-align: center;
  background: linear-gradient(135deg, #fdf8eb 0%, #f4e8cf 100%);
  border: 2px solid #dfc28d;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.5), 0 0 25px rgba(220, 180, 100, 0.35);
  animation: alertFloat 3s ease-in-out infinite alternate;
}

@keyframes alertFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}

.glowing-bottle-icon {
  font-size: 3rem;
  margin-bottom: 0.4rem;
  filter: drop-shadow(0 0 12px rgba(240, 200, 100, 0.8));
  animation: bottleGlow 2s ease-in-out infinite;
}

@keyframes bottleGlow {
  0%, 100% { transform: rotate(-5deg) scale(1); filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6)); }
  50% { transform: rotate(5deg) scale(1.08); filter: drop-shadow(0 0 20px rgba(255, 230, 120, 0.9)); }
}

.reply-alert-title {
  font-size: 1.35rem;
  color: #3b2818;
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
  font-family: var(--font-serif);
}

.reply-alert-sub {
  font-size: 0.85rem;
  color: #7d634d;
  margin-bottom: 1.2rem;
  line-height: 1.5;
}

.reply-alert-preview-item {
  background: #ffffff;
  border: 1px dashed #d5be9b;
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  text-align: left;
  margin-bottom: 0.8rem;
  box-shadow: 0 3px 10px rgba(100, 80, 50, 0.05);
}

.reply-alert-preview-sender {
  font-weight: bold;
  color: #633e1c;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.reply-alert-preview-text {
  font-size: 0.9rem;
  color: #4a3c2c;
  line-height: 1.6;
  font-family: var(--font-serif);
}

.reply-alert-parent-tag {
  font-size: 0.76rem;
  color: #8c7355;
  background: #fbf5e8;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  display: inline-block;
  margin-top: 0.5rem;
}

.letter-reply-context {
  background: #fdf5e2;
  border-left: 3px solid #c9933e;
  border-radius: 4px;
  padding: 0.5rem 0.8rem;
  margin-bottom: 1.2rem;
  font-size: 0.86rem;
  color: #724c25;
  font-family: var(--font-serif);
}

/* マイボトル小箱モーダル */
.my-box-container {
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.my-box-list {
  overflow-y: auto;
  padding-right: 0.5rem;
  max-height: 55vh;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.my-bottle-card {
  background: #ffffff;
  border: 1px solid #dfcfb2;
  border-radius: 10px;
  padding: 1.1rem 1.3rem;
  box-shadow: 0 4px 12px rgba(80, 60, 40, 0.06);
  transition: all 0.2s ease;
}

.my-bottle-card:hover {
  box-shadow: 0 6px 16px rgba(80, 60, 40, 0.12);
  border-color: #c9af88;
}

.my-bottle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  border-bottom: 1px dashed #ede2cf;
  padding-bottom: 0.5rem;
}

.my-bottle-date {
  font-size: 0.8rem;
  color: #8c7355;
}

.my-bottle-status {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  background: #eef8ff;
  color: #1976d2;
  border: 1px solid #bbdefb;
}

.my-bottle-content {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: #3b2a1a;
  line-height: 1.6;
  white-space: pre-wrap;
  margin-bottom: 0.8rem;
}

.my-bottle-replies-wrap {
  background: #faf6ed;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin-top: 0.8rem;
  border-left: 3px solid #c9933e;
}

.my-bottle-replies-title {
  font-size: 0.85rem;
  font-weight: bold;
  color: #7a4f1e;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.my-reply-item {
  padding: 0.6rem 0;
  border-bottom: 1px dotted #e3d3ba;
}

.my-reply-item:last-child {
  border-bottom: none;
}

.my-reply-author {
  font-weight: 600;
  font-size: 0.88rem;
  color: #4a341e;
  margin-bottom: 0.25rem;
}

.my-reply-body {
  font-size: 0.88rem;
  color: #33271a;
  line-height: 1.55;
  font-family: var(--font-serif);
}

/* チェックボックス設定（文通・返信選択） */
.letter-checkbox-group {
  margin: 1rem 0 1.2rem 0;
  padding: 0.8rem 1rem;
  background: rgba(212, 175, 55, 0.08);
  border: 1px dashed rgba(160, 110, 40, 0.35);
  border-radius: 8px;
}

.letter-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-weight: 600;
  color: #4a341e;
  font-size: 0.95rem;
  user-select: none;
}

.letter-checkbox-label input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: #8c531b;
  cursor: pointer;
}

.letter-checkbox-group .form-tip {
  margin-top: 0.35rem;
  margin-left: 1.75rem;
  font-size: 0.8rem;
  color: #7a634e;
  line-height: 1.4;
}

/* 気分で選ぶおすすめ音楽パレット */
.music-preset-tip {
  font-size: 0.8rem;
  color: #7a634e;
  margin-bottom: 0.5rem;
}

.music-preset-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.music-preset-btn {
  background: #fdfaf3;
  border: 1px solid #d4c2a8;
  color: #4a341e;
  border-radius: 18px;
  padding: 0.38rem 0.8rem;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  user-select: none;
}

.music-preset-btn:hover {
  background: #f3e9d8;
  border-color: #ba9a76;
  transform: translateY(-1px);
}

.music-preset-btn.active {
  background: linear-gradient(135deg, #a65825 0%, #873f15 100%);
  color: #ffffff;
  border-color: #6e2e0b;
  font-weight: 600;
  box-shadow: 0 2px 7px rgba(135, 63, 21, 0.35);
  transform: translateY(-1px);
}

.music-preset-btn.btn-music-clear {
  background: #f0ebe1;
  border-color: #d1c5b4;
  color: #8c735d;
}

.music-preset-btn.btn-music-clear:hover {
  background: #e3dbce;
  color: #5c4430;
}

.music-preset-btn.btn-music-clear.active {
  background: #7a6a5d;
  color: #fff;
  border-color: #594c41;
}

/* ==========================================================================
   Ver 2.0: 写真添付・ポラロイド演出スタイル
   ========================================================================== */

.photo-upload-wrapper {
  margin-top: 0.4rem;
}

.btn-paper-photo {
  background: #fdfaf3;
  border: 1px dashed #b08d57;
  color: #724e2c;
  font-size: 0.9rem;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-paper-photo:hover {
  background: #f6ecdc;
  border-color: #8c5b23;
  transform: translateY(-1px);
}

.photo-preview-container {
  margin-top: 0.8rem;
}

.polaroid-preview {
  position: relative;
  display: inline-block;
  background: #ffffff;
  padding: 8px 8px 18px 8px;
  border-radius: 4px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1);
  transform: rotate(-2deg);
  border: 1px solid #e0d8c8;
}

.polaroid-preview img {
  display: block;
  max-width: 140px;
  max-height: 140px;
  object-fit: cover;
  border-radius: 2px;
}

.btn-remove-photo {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #c94a29;
  color: #ffffff;
  border: 2px solid #ffffff;
  font-size: 0.75rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s;
}

.btn-remove-photo:hover {
  transform: scale(1.15);
  background: #b03617;
}

.photo-preview-tip {
  font-size: 0.75rem;
  color: #8a735c;
  margin-top: 0.5rem;
}

/* 閲覧モーダル内のポラロイド写真表示 */
.letter-photo-section {
  display: flex;
  justify-content: center;
  margin: 1.2rem 0;
}

.polaroid-card {
  position: relative;
  background: #ffffff;
  padding: 10px 10px 22px 10px;
  border-radius: 3px;
  box-shadow: 0 6px 20px rgba(70, 50, 30, 0.22), 0 2px 6px rgba(0, 0, 0, 0.08);
  transform: rotate(-1.5deg);
  border: 1px solid #e5dcce;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s ease;
  max-width: 280px;
}

.polaroid-card:hover {
  transform: rotate(0deg) scale(1.03);
  box-shadow: 0 10px 28px rgba(70, 50, 30, 0.3);
}

.polaroid-photo-inner {
  overflow: hidden;
  background: #f7f3ec;
  border-radius: 2px;
}

.polaroid-photo-inner img {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.polaroid-caption {
  font-family: var(--font-serif);
  font-size: 0.8rem;
  color: #634d3b;
  text-align: center;
  margin-top: 10px;
}

.polaroid-zoom-hint {
  font-size: 0.72rem;
  color: #a88d74;
}

/* マスキングテープ風の装飾 */
.tape-decor {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 20px;
  background: rgba(235, 220, 185, 0.85);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-left: 2px dashed rgba(180, 150, 100, 0.4);
  border-right: 2px dashed rgba(180, 150, 100, 0.4);
}

/* 写真拡大ライトボックス */
.photo-lightbox-backdrop {
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 18, 30, 0.85);
  backdrop-filter: blur(8px);
}

.photo-lightbox-backdrop.active {
  display: flex;
}

.lightbox-wrapper {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  border: 4px solid #ffffff;
}

.lightbox-close-btn {
  position: absolute;
  top: -18px;
  right: -18px;
  width: 40px;
  height: 40px;
  background: #ffffff;
  color: #333333;
  border-radius: 50%;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10001;
}

.lightbox-close-btn:hover {
  background: #f0f0f0;
  transform: scale(1.1);
}

/* ===================================================
   映画『メッセージ・イン・ア・ボトル』体験スタイル
   =================================================== */

/* 海辺の手がかりバッジ */
.origin-clue-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(184, 123, 40, 0.12);
  border: 1px dashed rgba(184, 123, 40, 0.45);
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  font-size: 0.82rem;
  color: #6a4012;
  margin-top: 0.5rem;
  margin-bottom: 0.6rem;
  font-style: italic;
}

/* 映画体験用 特別なボタン */
.btn-paper-special {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%) !important;
  color: #ffffff !important;
  border: 1px solid #6366f1 !important;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35) !important;
  font-weight: 600 !important;
}

.btn-paper-special:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5) !important;
  filter: brightness(1.08);
}

/* 小箱タブ切り替え */
.my-box-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
  border-bottom: 2px solid rgba(180, 140, 90, 0.25);
  padding-bottom: 0.5rem;
}

.my-box-tab-btn {
  background: none;
  border: none;
  padding: 0.6rem 1rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: #7a634e;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.my-box-tab-btn:hover {
  background: rgba(180, 140, 90, 0.1);
  color: #4a341e;
}

.my-box-tab-btn.active {
  background: rgba(184, 123, 40, 0.18);
  color: #5c350c;
  border-bottom: 3px solid #b87b28;
}

/* 往復書簡スレッドリストアイテム */
.private-thread-card {
  background: #fffcf7;
  border: 1px solid #e2d2ba;
  border-left: 4px solid #7c3aed;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(70, 50, 30, 0.06);
}

.private-thread-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(70, 50, 30, 0.12);
}

.private-thread-card.has-unread {
  border-left-color: #f59e0b;
  background: #fffef2;
}

.private-thread-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.private-thread-title {
  font-weight: bold;
  font-size: 0.96rem;
  color: #3d2314;
}

.private-thread-clue {
  font-size: 0.78rem;
  color: #8c6a46;
  margin-top: 0.2rem;
}

.private-thread-badge-unread {
  background: #f59e0b;
  color: #ffffff;
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-weight: bold;
}

.private-thread-latest-msg {
  font-size: 0.88rem;
  color: #554433;
  line-height: 1.5;
  background: rgba(235, 220, 195, 0.3);
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  margin-top: 0.6rem;
}

/* 往復書簡 タイムライン表示 */
.thread-dialogue-container {
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.5rem;
  margin-bottom: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.thread-original-letter-quote {
  background: rgba(212, 175, 55, 0.1);
  border: 1px dashed #c49a45;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-size: 0.88rem;
  color: #5c3b12;
  font-family: var(--font-serif);
}

.thread-original-letter-quote:empty {
  display: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.thread-msg-bubble {
  max-width: 85%;
  padding: 1rem 1.2rem;
  border-radius: 12px;
  position: relative;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}

.thread-msg-bubble.mine {
  align-self: flex-end;
  background: #f1f8e9;
  border: 1px solid #c5e1a5;
  color: #2e4a1a;
  border-bottom-right-radius: 2px;
}

.thread-msg-bubble.theirs {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid #e0d0bc;
  color: #3d2314;
  border-bottom-left-radius: 2px;
}

.thread-waiting-bubble {
  align-self: flex-start;
  background: rgba(254, 243, 199, 0.85);
  border: 1px dashed #f59e0b;
  border-radius: 12px;
  padding: 0.75rem 1.1rem;
  font-size: 0.85rem;
  color: #92400e;
  font-family: var(--font-serif);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
  animation: waitingPulse 2s ease-in-out infinite alternate;
}

@keyframes waitingPulse {
  0% { opacity: 0.7; transform: translateY(0); }
  100% { opacity: 1; transform: translateY(-3px); }
}

.thread-msg-sender {
  font-size: 0.8rem;
  font-weight: bold;
  color: #7a5833;
  margin-bottom: 0.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.thread-msg-body {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.thread-msg-date {
  font-size: 0.72rem;
  color: #9e8874;
  margin-top: 0.4rem;
  text-align: right;
}

/* 奇跡のボトル到着通知（ゴールド） */
.private-alert-card {
  border: 3px solid #f59e0b !important;
  box-shadow: 0 10px 40px rgba(245, 158, 11, 0.35) !important;
}

.glowing-gold-bottle {
  font-size: 2.8rem;
  animation: floatAndGlowGold 2.2s infinite ease-in-out;
  display: inline-block;
  filter: drop-shadow(0 0 16px rgba(245, 158, 11, 0.7));
}

@keyframes floatAndGlowGold {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.08); }
}

/* ===================================================
   映画『メッセージ・イン・ア・ボトル』差出人調査デスク
   =================================================== */

.investigation-desk {
  max-width: 640px !important;
  border: 2px solid #8c6843 !important;
  background: #fdfaf3 !important;
  box-shadow: 0 12px 48px rgba(35, 20, 8, 0.35) !important;
}

.investigation-letter-preview {
  background: rgba(245, 237, 224, 0.85);
  border: 1px dashed #b89a74;
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1.2rem;
}

.investigation-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  margin-bottom: 0.35rem;
}

.preview-tag {
  background: #8c531b;
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-weight: bold;
  letter-spacing: 0.04em;
}

.preview-target-sender {
  color: #634327;
  font-weight: 600;
}

.investigation-preview-body {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  color: #4a341e;
  line-height: 1.5;
  white-space: pre-wrap;
  max-height: 60px;
  overflow-y: auto;
}

/* 調査カードグリッド */
.investigation-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.2rem;
}

.investigation-card {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  background: #ffffff;
  border: 1.5px solid #d9c8b2;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.investigation-card:hover {
  border-color: #8c531b;
  background: #faf6ee;
  transform: translateY(-2px);
  box-shadow: 0 5px 14px rgba(140, 83, 27, 0.12);
}

.investigation-card.investigating {
  border-color: #3b82f6;
  background: #eff6ff;
  pointer-events: none;
}

.investigation-card.completed {
  border-color: #10b981;
  background: #f0fdf4;
  cursor: default;
}

.card-icon-wrap {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  background: #f5ede0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  position: relative;
}

.investigation-card.investigating .card-icon-wrap {
  background: #dbeafe;
  animation: pulseCard 1s infinite alternate;
}

.investigation-card.completed .card-icon-wrap {
  background: #d1fae5;
}

@keyframes pulseCard {
  0% { transform: scale(1); }
  100% { transform: scale(1.12); }
}

.card-content-wrap {
  flex: 1;
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.card-title {
  font-weight: bold;
  font-size: 0.95rem;
  color: #3b2816;
}

.card-status-badge {
  font-size: 0.72rem;
  padding: 0.18rem 0.55rem;
  border-radius: 12px;
  font-weight: 600;
}

.badge-pending {
  background: #f3efe6;
  color: #85705a;
  border: 1px solid #d9cdbd;
}

.badge-investigating {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
  animation: badgeBlink 1s infinite alternate;
}

.badge-done {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

@keyframes badgeBlink {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

.card-desc {
  font-size: 0.8rem;
  color: #786350;
  line-height: 1.4;
}

.card-result {
  margin-top: 0.5rem;
  background: rgba(255, 255, 255, 0.9);
  border-left: 3px solid #10b981;
  padding: 0.45rem 0.75rem;
  border-radius: 0 6px 6px 0;
  font-family: var(--font-serif);
  font-size: 0.86rem;
  color: #1e3a29;
  line-height: 1.5;
  animation: fadeInResult 0.4s ease-out forwards;
}

@keyframes fadeInResult {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 進捗バー & クイック調査 */
.investigation-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.2rem;
  font-size: 0.88rem;
  color: #5c432b;
}

.investigation-progress-info strong {
  color: #8c531b;
  font-size: 1.05rem;
  margin-left: 0.3rem;
}

.btn-investigate-quick {
  background: #fdf8ee;
  border: 1px solid #c9b193;
  color: #70471b;
  padding: 0.35rem 0.75rem;
  border-radius: 16px;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-investigate-quick:hover {
  background: #faeed7;
  border-color: #a4733e;
  transform: translateY(-1px);
}

/* 特定完了スタンプ & 結果ボックス */
.investigation-completed-box {
  margin-top: 1rem;
  background: #fdfbf7;
  border: 2px solid #b45309;
  border-radius: 12px;
  padding: 1.2rem;
  position: relative;
  overflow: hidden;
  animation: zoomInBox 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  box-shadow: 0 8px 24px rgba(180, 83, 9, 0.12);
}

@keyframes zoomInBox {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

.stamp-wrapper {
  position: absolute;
  top: 10px;
  right: 15px;
  pointer-events: none;
  z-index: 2;
}

.stamp-identified {
  display: inline-block;
  color: #dc2626;
  border: 3px double #dc2626;
  border-radius: 8px;
  padding: 0.25rem 0.8rem;
  font-family: 'Georgia', serif;
  font-weight: 900;
  font-size: 1.15rem;
  text-align: center;
  line-height: 1.1;
  text-transform: uppercase;
  transform: rotate(-12deg) scale(1);
  opacity: 0.9;
  animation: stampSlam 0.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  filter: drop-shadow(0 2px 4px rgba(220, 38, 38, 0.2));
}

@keyframes stampSlam {
  0% { transform: rotate(-25deg) scale(2.2); opacity: 0; }
  70% { transform: rotate(-10deg) scale(0.95); opacity: 1; }
  100% { transform: rotate(-12deg) scale(1); opacity: 0.92; }
}

.identified-location-box {
  padding-right: 110px;
}

.location-header {
  font-size: 0.82rem;
  font-weight: bold;
  color: #92400e;
  margin-bottom: 0.35rem;
  letter-spacing: 0.04em;
}

.location-text {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: bold;
  color: #451a03;
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.location-sub {
  font-size: 0.78rem;
  color: #78350f;
  line-height: 1.4;
}

.btn-start-letter {
  background: linear-gradient(135deg, #b45309 0%, #78350f 100%) !important;
  color: #fff !important;
  border: none !important;
  font-weight: bold !important;
  box-shadow: 0 4px 15px rgba(120, 53, 15, 0.3) !important;
  transition: all 0.25s ease !important;
}

.btn-start-letter:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 7px 20px rgba(120, 53, 15, 0.45) !important;
}

/* ===================================================
   映画再現 推理探索フェーズ（居場所特定クイズ）
   =================================================== */

.investigation-deduction-area {
  margin-top: 1.2rem;
  background: #fbf8f1;
  border: 2px dashed #b89a74;
  border-radius: 12px;
  padding: 1.1rem;
  animation: fadeInDeduction 0.45s ease-out forwards;
}

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

.deduction-header {
  margin-bottom: 0.85rem;
}

.deduction-tag {
  display: inline-block;
  background: #78350f;
  color: #fff;
  font-size: 0.72rem;
  padding: 0.15rem 0.6rem;
  border-radius: 12px;
  font-weight: bold;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.deduction-title {
  font-size: 1.1rem;
  color: #451a03;
  margin: 0.1rem 0 0.3rem 0;
  font-weight: bold;
}

.deduction-instruction {
  font-size: 0.82rem;
  color: #78350f;
  margin: 0;
  line-height: 1.45;
}

.deduction-feedback {
  margin-bottom: 0.8rem;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  font-size: 0.84rem;
  line-height: 1.4;
  animation: fadeInResult 0.3s ease-out;
}

.feedback-wrong {
  background: #fee2e2;
  color: #991b1b;
  border-left: 4px solid #ef4444;
}

.feedback-correct {
  background: #d1fae5;
  color: #065f46;
  border-left: 4px solid #10b981;
}

/* 候補地選択ボタングリッド */
.deduction-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.deduction-option-btn {
  background: #ffffff;
  border: 1.5px solid #d4c2a8;
  border-radius: 10px;
  padding: 0.8rem 0.9rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: #3b2816;
  text-align: left;
  cursor: pointer;
  transition: all 0.22s ease;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  line-height: 1.4;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.deduction-option-btn:hover {
  background: #fdfaf3;
  border-color: #8c531b;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(140, 83, 27, 0.12);
}

.deduction-option-btn.wrong {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
  color: #991b1b !important;
  animation: shakeCard 0.4s ease-in-out;
}

.deduction-option-btn.correct {
  border-color: #10b981 !important;
  background: #ecfdf5 !important;
  color: #065f46 !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.4) !important;
  transform: scale(1.02);
  pointer-events: none;
}

@keyframes shakeCard {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

@media (max-width: 640px) {
  .deduction-options-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .deduction-option-btn {
    padding: 0.75rem 0.85rem;
    font-size: 0.84rem;
  }
}

/* ===================================================
   ボトルの航海日誌（漂流ログ）スタイル
   =================================================== */

.btn-paper-voyage {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%) !important;
  color: #ffffff !important;
  border: 1px solid #1e3a8a !important;
  box-shadow: 0 2px 6px rgba(30, 58, 138, 0.25) !important;
}

.btn-paper-voyage:hover {
  background: linear-gradient(135deg, #172554 0%, #1e3a8a 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(30, 58, 138, 0.35) !important;
}

.voyage-modal-card {
  max-width: 620px !important;
  max-height: 90vh;
  overflow-y: auto;
  background: #fdfaf3 !important;
  border: 2px solid #8c6843 !important;
}

/* 航海ステータスバー */
.voyage-stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(245, 237, 224, 0.9);
  border: 1px solid #d4c2a8;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.4rem;
  gap: 0.6rem;
}

.voyage-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  text-align: center;
}

.voyage-stat-item .stat-label {
  font-size: 0.74rem;
  color: #7a634e;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.voyage-stat-item .stat-value {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: bold;
  color: #3b2816;
}

.voyage-stat-item .origin-text {
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.voyage-stat-divider {
  width: 1px;
  height: 28px;
  background: #d4c2a8;
}

/* タイムライン */
.voyage-timeline {
  position: relative;
  padding-left: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.voyage-timeline::before {
  content: '';
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 24px;
  width: 2px;
  background: repeating-linear-gradient(
    to bottom,
    #8c6843,
    #8c6843 6px,
    transparent 6px,
    transparent 12px
  );
}

.voyage-node {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.voyage-node-icon-wrap {
  position: absolute;
  left: -2rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #8c6843;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  z-index: 2;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.voyage-node.departure .voyage-node-icon-wrap {
  border-color: #1e3a8a;
  background: #eff6ff;
}

.voyage-node.arrival .voyage-node-icon-wrap {
  border-color: #b45309;
  background: #fef3c7;
  animation: pulseArrival 1.8s infinite alternate;
}

@keyframes pulseArrival {
  0% { transform: scale(1); box-shadow: 0 0 4px rgba(180, 83, 9, 0.2); }
  100% { transform: scale(1.1); box-shadow: 0 0 12px rgba(180, 83, 9, 0.45); }
}

.voyage-node-body {
  flex: 1;
  background: #ffffff;
  border: 1px solid #d9c8b2;
  border-radius: 8px;
  padding: 0.75rem 0.95rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  position: relative;
}

.voyage-node.arrival .voyage-node-body {
  border-color: #d97706;
  background: #fffbeb;
}

.voyage-node-date {
  font-size: 0.74rem;
  color: #8c735d;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.voyage-node-title {
  font-size: 0.92rem;
  font-weight: bold;
  color: #3b2816;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.voyage-node-desc {
  font-family: var(--font-serif);
  font-size: 0.86rem;
  color: #4a341e;
  line-height: 1.55;
}

@media (max-width: 640px) {
  .voyage-stats-bar {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
  }

  .voyage-stat-divider {
    width: 80%;
    height: 1px;
  }

  .voyage-stat-item .origin-text {
    max-width: 100%;
  }

  .voyage-timeline {
    padding-left: 1.6rem;
    gap: 1.1rem;
  }

  .voyage-timeline::before {
    left: 18px;
  }

  .voyage-node-icon-wrap {
    left: -1.6rem;
    width: 28px;
    height: 28px;
    font-size: 0.95rem;
  }
}

/* ===================================================
   海辺の情景（時間帯）切替ドロップダウン
   =================================================== */

.time-mode-container {
  position: relative;
  display: inline-block;
}

.dropdown-arrow {
  font-size: 0.75rem;
  margin-left: 3px;
  opacity: 0.75;
  transition: transform 0.2s ease;
}

.time-mode-container.open .dropdown-arrow {
  transform: rotate(180deg);
}

.time-mode-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: rgba(18, 25, 38, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 0.6rem;
  z-index: 1000;
  display: none;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.time-mode-dropdown.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.time-dropdown-title {
  font-size: 0.78rem;
  color: #92a4ba;
  padding: 0.35rem 0.5rem 0.5rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.4rem;
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0.35rem 0;
}

.time-option-btn {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  color: #dbe4ee;
  text-align: left;
  transition: all 0.15s ease;
}

.time-option-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.time-option-btn.active {
  background: rgba(80, 140, 220, 0.18);
  border-color: rgba(130, 185, 245, 0.4);
  color: #ffffff;
}

.time-option-btn .option-icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.time-option-btn .option-info {
  flex: 1;
  min-width: 0;
}

.time-option-btn .option-name {
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.3;
}

.time-option-btn .option-desc {
  font-size: 0.72rem;
  color: #8c9eb3;
  line-height: 1.25;
  margin-top: 1px;
}

.time-option-btn.active .option-desc {
  color: #a8caea;
}

/* テーマ連動によるUI微調整 */
body.theme-day .brand-title {
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

body.theme-day .stage-poem {
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

body.theme-morning .time-mode-dropdown,
body.theme-day .time-mode-dropdown,
body.theme-sunset .time-mode-dropdown {
  background: rgba(20, 30, 48, 0.96);
}

/* ===================================================
   古い海辺のラジオ（潮騒のジュークボックス）スタイル
   =================================================== */

.antique-radio-card {
  position: relative;
  width: 94%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(145deg, #3d2518 0%, #29170e 45%, #1c0f09 100%);
  border: 3px solid #b8860b;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 215, 0, 0.25), inset 0 2px 10px rgba(255, 255, 255, 0.15), inset 0 -4px 15px rgba(0, 0, 0, 0.6);
  border-radius: 20px;
  padding: 1.4rem;
  color: #f7eedb;
  font-family: var(--font-serif);
  animation: modalParchmentOpen 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ラジオ専用の閉じる×ボタン（視認性向上・真鍮ゴールド） */
.antique-radio-card .modal-close-btn {
  color: #ffd700;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 215, 0, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.antique-radio-card .modal-close-btn:hover {
  background: rgba(184, 134, 11, 0.4);
  color: #ffffff;
  border-color: #ffd700;
  transform: scale(1.08);
}

/* 上部キャビネット */
.radio-cabinet-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.8rem;
  border-bottom: 2px groove #5a3a22;
  margin-bottom: 1rem;
}

.radio-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(180deg, #d4af37 0%, #aa8214 50%, #856108 100%);
  color: #2b1805;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  font-weight: bold;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.6), 0 2px 5px rgba(0, 0, 0, 0.4);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.radio-status-light {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ffaa33;
  box-shadow: 0 0 10px #ffaa33, 0 0 20px #ff8800;
  border: 2px solid #5a3818;
  animation: radioBulbGlow 2.5s infinite ease-in-out;
}

.radio-status-light.paused {
  background: #553311;
  box-shadow: none;
  animation: none;
}

@keyframes radioBulbGlow {
  0%, 100% { opacity: 0.85; filter: brightness(1); }
  50% { opacity: 1; filter: brightness(1.35); }
}

/* 中央パネル（スピーカー ＆ チューナー） */
.radio-display-panel {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  background: #140b07;
  padding: 0.9rem;
  border-radius: 12px;
  border: 2px solid #4a2e1c;
  box-shadow: inset 0 3px 12px rgba(0, 0, 0, 0.8);
  margin-bottom: 1rem;
}

/* スピーカーグリル */
.radio-speaker-grille {
  background: #24140b;
  border: 2px solid #6b4528;
  border-radius: 8px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
}

.speaker-mesh-dots {
  width: 100%;
  height: 100%;
  background-image: radial-gradient(#b8860b 1.2px, transparent 1.2px);
  background-size: 6px 6px;
  opacity: 0.65;
}

/* チューナー周波数スケール */
.radio-tuner-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tuner-glass {
  position: relative;
  height: 60px;
  background: linear-gradient(180deg, #1b120c 0%, #301f14 50%, #150d08 100%);
  border: 2px solid #754c2a;
  border-radius: 6px;
  box-shadow: inset 0 0 15px rgba(255, 170, 50, 0.25), 0 1px 3px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 0 0.8rem;
}

.tuner-scale {
  display: flex;
  justify-content: space-between;
  width: 100%;
  color: #e6b87d;
  font-size: 0.72rem;
  font-family: monospace;
  font-weight: bold;
  letter-spacing: 0.05em;
  opacity: 0.85;
}

.scale-mark {
  position: relative;
}

.scale-mark::after {
  content: '';
  position: absolute;
  top: 15px;
  left: 50%;
  width: 1px;
  height: 8px;
  background: #b8860b;
}

.tuner-needle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20%;
  width: 2.5px;
  background: #ff4500;
  box-shadow: 0 0 8px #ff4500, 0 0 2px #fff;
  transition: left 0.45s cubic-bezier(0.2, 0.9, 0.3, 1);
  z-index: 2;
}

.tuner-needle::before {
  content: '';
  position: absolute;
  top: 0;
  left: -3px;
  width: 8px;
  height: 4px;
  background: #ffd700;
  border-radius: 2px;
}

.tuner-sub-label {
  text-align: center;
  font-size: 0.68rem;
  color: #a88358;
  margin-top: 0.4rem;
  letter-spacing: 0.08em;
}

/* 楽曲情報カード */
.radio-track-info-card {
  background: rgba(250, 243, 230, 0.94);
  color: #3b2818;
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  border: 1px solid #d4c3a7;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
  margin-bottom: 1rem;
}

.track-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.track-playing-badge {
  font-size: 0.68rem;
  font-weight: bold;
  background: #dc2626;
  color: #ffffff;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  letter-spacing: 0.06em;
  animation: radioBulbGlow 1.8s infinite;
}

.track-source {
  font-size: 0.8rem;
  color: #7a5530;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: bold;
}

.radio-track-title {
  font-size: 1.05rem;
  font-weight: bold;
  color: #2b180a;
  margin: 0.2rem 0 0.4rem;
  line-height: 1.35;
}

.radio-letter-snippet {
  font-size: 0.84rem;
  color: #5c4129;
  font-style: italic;
  line-height: 1.5;
  background: rgba(0, 0, 0, 0.03);
  padding: 0.4rem 0.6rem;
  border-left: 3px solid #b8860b;
  border-radius: 0 4px 4px 0;
  margin-bottom: 0.6rem;
}

.radio-letter-action {
  text-align: right;
}

/* YouTube IFrame（スマホでの不可視停止防止のため、レトロモニター画面として表示） */
.radio-youtube-wrapper {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 16 / 9;
  margin: 0.8rem auto 1rem auto;
  border-radius: 10px;
  overflow: hidden;
  background: #0f0a05;
  border: 2px solid #8c6d48;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.9), 0 4px 12px rgba(0, 0, 0, 0.5);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.radio-youtube-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  pointer-events: auto;
}

/* レトロモニター用ポスター（スマホでの確実な再生用） */
.radio-screen-poster {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radio-screen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: background 0.3s ease;
}

.radio-screen-poster:hover .radio-screen-overlay,
.radio-screen-poster:active .radio-screen-overlay {
  background: rgba(0, 0, 0, 0.25);
}

.radio-screen-play-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d32f2f 0%, #9a0007 100%);
  color: #fff;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 3px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), 0 0 12px rgba(255, 69, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.6);
  transition: transform 0.2s ease;
}

.radio-screen-poster:hover .radio-screen-play-btn {
  transform: scale(1.08);
}

.radio-screen-hint {
  color: #f7eedb;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  font-family: var(--font-serif);
}

/* ラジオ操作パネル */
.radio-controls-panel {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 215, 0, 0.15);
}

.radio-knob-group {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.2rem;
}

.radio-btn-ctrl {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(145deg, #4d3322 0%, #2b1c12 100%);
  border: 2px solid #8f653b;
  color: #e8d0b5;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.radio-btn-ctrl:hover {
  transform: translateY(-1px);
  color: #fff;
  border-color: #b8860b;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.6);
}

.radio-btn-ctrl:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.radio-btn-play {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(145deg, #c9933b 0%, #996817 100%);
  border: 2px solid #ffd700;
  color: #2b1704;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.radio-btn-play:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
  box-shadow: 0 8px 22px rgba(255, 170, 0, 0.35);
}

.radio-btn-play:active {
  transform: scale(0.96);
}

.radio-extra-controls {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
}

.radio-btn-sub {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #c9b397;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.76rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.radio-btn-sub:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.radio-btn-sub.active {
  background: rgba(184, 134, 11, 0.28);
  border-color: #ffd700;
  color: #ffd700;
  font-weight: bold;
}

/* プレイリスト一覧トグル */
.radio-playlist-section {
  margin-top: 0.8rem;
  border-top: 1px solid rgba(255, 215, 0, 0.15);
  padding-top: 0.6rem;
}

.radio-playlist-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 0.8rem;
  color: #c4a47c;
  padding: 0.3rem 0.2rem;
  transition: color 0.15s;
}

.radio-playlist-toggle:hover {
  color: #ffd700;
}

.radio-playlist-list {
  max-height: 180px;
  overflow-y: auto;
  margin-top: 0.4rem;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  padding: 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.radio-playlist-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  color: #d1bba2;
  transition: all 0.15s;
}

.radio-playlist-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.radio-playlist-item.active {
  background: rgba(184, 134, 11, 0.32);
  color: #ffd700;
  font-weight: bold;
}

.radio-playlist-item .track-index {
  font-family: monospace;
  color: #8c7355;
  width: 20px;
}

.radio-playlist-item.active .track-index {
  color: #ffd700;
}

.radio-playlist-item .track-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.radio-playlist-item .track-from {
  font-size: 0.7rem;
  color: #8c7355;
}

/* ラジオ下部のアクションボタングループ */
.radio-footer-actions {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px dashed rgba(255, 215, 0, 0.2);
}

.radio-btn-footer {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.radio-btn-footer-poweroff {
  background: rgba(40, 20, 15, 0.8);
  color: #d1bba2;
  border: 1px solid rgba(255, 100, 100, 0.35);
}

.radio-btn-footer-poweroff:hover {
  background: rgba(70, 25, 20, 0.9);
  color: #ff9999;
  border-color: rgba(255, 120, 120, 0.6);
  transform: translateY(-1px);
}

.radio-btn-footer-keep {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.25) 0%, rgba(133, 97, 8, 0.35) 100%);
  color: #ffd700;
  border: 1px solid rgba(255, 215, 0, 0.45);
}

.radio-btn-footer-keep:hover {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.4) 0%, rgba(133, 97, 8, 0.5) 100%);
  color: #ffffff;
  border-color: #ffd700;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.25);
}

@media (max-width: 600px) {
  .radio-display-panel {
    grid-template-columns: 1fr;
  }
  .radio-speaker-grille {
    height: 70px;
  }
  .radio-footer-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  .radio-btn-footer {
    width: 100%;
    justify-content: center;
  }
}

/* ===================================================
   【映画のクライマックス】海辺のエピローグ（再会演出）
   =================================================== */

/* 往復書簡内のエピローグ招待カード */
.epilogue-invite-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.2rem 0;
  padding: 1.1rem 1.3rem;
  background: linear-gradient(135deg, rgba(255, 237, 213, 0.92) 0%, rgba(254, 215, 170, 0.85) 50%, rgba(253, 186, 116, 0.9) 100%);
  border: 1.5px solid rgba(249, 115, 22, 0.45);
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(234, 88, 12, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  position: relative;
  overflow: hidden;
  animation: epilogueGlowPulse 3s ease-in-out infinite;
}

@keyframes epilogueGlowPulse {
  0%, 100% {
    box-shadow: 0 4px 18px rgba(234, 88, 12, 0.18), 0 0 0 0 rgba(249, 115, 22, 0.2);
  }
  50% {
    box-shadow: 0 6px 24px rgba(234, 88, 12, 0.32), 0 0 12px rgba(249, 115, 22, 0.4);
  }
}

.epilogue-invite-icon {
  font-size: 2.2rem;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(194, 65, 12, 0.3));
  flex-shrink: 0;
  animation: inviteFloat 2.5s ease-in-out infinite;
}

@keyframes inviteFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.epilogue-invite-text {
  flex: 1;
}

.epilogue-invite-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: #9a3412;
  margin-bottom: 0.25rem;
  letter-spacing: 0.03em;
}

.epilogue-invite-desc {
  font-size: 0.82rem;
  color: #7c2d12;
  line-height: 1.5;
}

/* フルスクリーン・シネマティック舞台 */
.epilogue-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 18, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2800;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.epilogue-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.epilogue-cinematic-stage {
  position: relative;
  width: 92%;
  max-width: 820px;
  min-height: 540px;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(251, 146, 60, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: background 1s ease;
}

/* シネマスコープ・ブラックバー */
.cinematic-letterbox {
  position: absolute;
  left: 0;
  right: 0;
  height: 42px;
  background: #000000;
  z-index: 10;
}

.letterbox-top {
  top: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.letterbox-bottom {
  bottom: 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
}

.epilogue-close-btn {
  position: absolute;
  top: 8px;
  right: 14px;
  z-index: 20;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.epilogue-close-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.1);
}

/* 背景の光彩・波の気配 */
.epilogue-ambient-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(255, 200, 120, 0.18) 0%, transparent 70%);
  pointer-events: none;
  animation: glowBreathe 6s ease-in-out infinite alternate;
}

@keyframes glowBreathe {
  0% { opacity: 0.5; transform: scale(0.95); }
  100% { opacity: 0.9; transform: scale(1.05); }
}

.epilogue-wave-silhouette {
  position: absolute;
  bottom: 42px;
  left: 0;
  right: 0;
  height: 90px;
  background: linear-gradient(180deg, transparent 0%, rgba(10, 20, 35, 0.4) 60%, rgba(5, 10, 20, 0.7) 100%);
  pointer-events: none;
}

/* 本編コンテンツ */
.epilogue-inner-content {
  position: relative;
  z-index: 5;
  padding: 60px 32px 55px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
}

/* ペルソナのアバターと情景タイトル */
.epilogue-persona-halo {
  margin-bottom: 1.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: personaEnter 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes personaEnter {
  0% { opacity: 0; transform: translateY(-20px) scale(0.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.epilogue-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.45), inset 0 0 15px rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin-bottom: 0.6rem;
}

.epilogue-name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.epilogue-scene-title {
  font-size: 0.8rem;
  color: #fed7aa;
  letter-spacing: 0.12em;
  margin-top: 0.25rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
  opacity: 0.9;
}

/* 映画字幕風ダイアログカード */
.epilogue-dialogue-card {
  width: 100%;
  max-width: 620px;
  min-height: 180px;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 1.6rem 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.epilogue-lines-stream {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100px;
  width: 100%;
}

.epilogue-line-bubble {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.95;
  color: #f8fafc;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
  letter-spacing: 0.06em;
  margin: 0;
  opacity: 0;
  transform: translateY(12px);
  animation: dialogueFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dialogueFadeIn {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

.epilogue-control-row {
  margin-top: 1.2rem;
}

.btn-epilogue-next {
  background: rgba(255, 255, 255, 0.16);
  color: #fed7aa;
  border: 1px solid rgba(254, 215, 170, 0.4);
  padding: 0.55rem 1.4rem;
  border-radius: 20px;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.25s ease;
  animation: promptPulse 2s ease-in-out infinite;
}

@keyframes promptPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 rgba(254, 215, 170, 0); }
  50% { transform: scale(1.04); box-shadow: 0 0 14px rgba(254, 215, 170, 0.4); }
}

.btn-epilogue-next:hover {
  background: rgba(254, 215, 170, 0.3);
  color: #ffffff;
  border-color: #fed7aa;
}

/* 記念品贈呈カード */
.epilogue-gift-card {
  position: relative;
  width: 100%;
  max-width: 500px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1.5px solid rgba(255, 215, 0, 0.6);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.35), inset 0 0 20px rgba(255, 215, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: giftReveal 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes giftReveal {
  0% { opacity: 0; transform: scale(0.85) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.gift-glow-fx {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.35) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: giftGlowSpin 6s linear infinite;
}

@keyframes giftGlowSpin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.gift-icon {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 0.8rem;
  filter: drop-shadow(0 4px 12px rgba(255, 215, 0, 0.6));
  animation: giftBounce 3s ease-in-out infinite;
}

@keyframes giftBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.gift-name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffd700;
  letter-spacing: 0.06em;
  margin: 0 0 0.6rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.gift-desc {
  font-size: 0.88rem;
  color: #e2e8f0;
  line-height: 1.65;
  margin: 0 0 1.5rem;
  padding: 0 1rem;
}

/* 「あなたの小箱」記念品一覧リスト */
.my-gifts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.1rem;
  padding: 0.4rem 0.2rem;
}

.my-gift-card {
  background: linear-gradient(135deg, rgba(255, 252, 245, 0.95) 0%, rgba(254, 243, 199, 0.85) 100%);
  border: 1.5px solid rgba(217, 119, 6, 0.35);
  border-radius: 12px;
  padding: 1.2rem;
  box-shadow: 0 4px 12px rgba(180, 83, 9, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.my-gift-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(180, 83, 9, 0.18);
  border-color: rgba(217, 119, 6, 0.6);
}

.my-gift-top {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
}

.my-gift-icon-bubble {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.my-gift-title-wrap {
  flex: 1;
  min-width: 0;
}

.my-gift-name {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: #78350f;
  margin: 0 0 0.2rem;
  line-height: 1.35;
}

.my-gift-giver {
  font-size: 0.75rem;
  color: #92400e;
  opacity: 0.85;
}

.my-gift-desc {
  font-size: 0.82rem;
  color: #451a03;
  line-height: 1.6;
  flex: 1;
  margin-bottom: 0.8rem;
}

.my-gift-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.6rem;
  border-top: 1px dashed rgba(180, 83, 9, 0.25);
  font-size: 0.72rem;
  color: #a16207;
}

.my-gifts-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: #8c6a45;
}

.my-gifts-empty-icon {
  font-size: 3rem;
  margin-bottom: 0.8rem;
  opacity: 0.7;
}

@media (max-width: 640px) {
  .epilogue-cinematic-stage {
    width: 96%;
    min-height: 460px;
    border-radius: 12px;
  }
  .epilogue-inner-content {
    padding: 50px 16px 45px;
  }
  .epilogue-avatar {
    width: 60px;
    height: 60px;
    font-size: 2rem;
  }
  .epilogue-dialogue-card {
    padding: 1.2rem 1.2rem;
    min-height: 160px;
  }
  .epilogue-line-bubble {
    font-size: 1rem;
    line-height: 1.8;
  }
  .epilogue-gift-card {
    padding: 1.4rem;
  }
  .gift-icon {
    font-size: 2.8rem;
  }
  .gift-name {
    font-size: 1.1rem;
  }
}

/* =================================================== */
/* 想い出の一冊（海辺の往復書簡録）スタイル */
/* =================================================== */

/* スレッド内の招待カード */
.memory-book-invite-card {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  background: linear-gradient(135deg, rgba(254, 252, 246, 0.98) 0%, rgba(245, 237, 224, 0.98) 100%);
  border: 2px solid #c59b27;
  border-radius: 12px;
  padding: 1.1rem 1.4rem;
  margin: 1.2rem 0;
  box-shadow: 0 4px 18px rgba(197, 155, 39, 0.22), inset 0 0 10px rgba(197, 155, 39, 0.1);
  position: relative;
  overflow: hidden;
}

.memory-book-invite-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(180deg, #c59b27 0%, #78350f 100%);
}

.book-invite-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
  animation: bookIconBob 3s ease-in-out infinite;
}

@keyframes bookIconBob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(-2deg); }
}

.book-invite-text {
  flex: 1;
}

.book-invite-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: bold;
  color: #78350f;
  margin-bottom: 0.25rem;
}

.book-invite-desc {
  font-size: 0.86rem;
  color: #854d0e;
  line-height: 1.5;
}

.btn-book-open {
  background: linear-gradient(135deg, #8a3a14 0%, #5a240b 100%) !important;
  color: #fff9ed !important;
  border: 1px solid #c59b27 !important;
  box-shadow: 0 3px 10px rgba(90, 36, 11, 0.35) !important;
  font-weight: bold !important;
  white-space: nowrap;
  padding: 0.65rem 1.1rem !important;
  transition: all 0.25s ease !important;
}

.btn-book-open:hover {
  background: linear-gradient(135deg, #a64718 0%, #6e2b0e 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(90, 36, 11, 0.45) !important;
}

/* スレッド内のテラスデート招待カード */
.terrace-invite-card {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  background: linear-gradient(135deg, rgba(254, 250, 240, 0.98) 0%, rgba(240, 247, 255, 0.98) 100%);
  border: 2px solid #b8860b;
  border-radius: 12px;
  padding: 1.1rem 1.4rem;
  margin: 1.2rem 0;
  box-shadow: 0 4px 18px rgba(184, 134, 11, 0.2), inset 0 0 10px rgba(59, 130, 246, 0.08);
  position: relative;
  overflow: hidden;
  flex-wrap: wrap;
}

.terrace-invite-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(180deg, #ba8c46 0%, #1e3a8a 100%);
}

.terrace-invite-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
  animation: bookIconBob 3s ease-in-out infinite 0.5s;
}

.terrace-invite-text {
  flex: 1;
  min-width: 220px;
}

.terrace-invite-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: bold;
  color: #1e3a8a;
  margin-bottom: 0.25rem;
}

.terrace-invite-desc {
  font-size: 0.86rem;
  color: #334155;
  line-height: 1.5;
}

.btn-paper-terrace {
  background: linear-gradient(135deg, #1e40af 0%, #172554 100%) !important;
  color: #eff6ff !important;
  border: 1px solid #60a5fa !important;
  box-shadow: 0 3px 10px rgba(30, 64, 175, 0.35) !important;
  font-weight: bold !important;
  white-space: nowrap;
  padding: 0.65rem 1.2rem !important;
  transition: all 0.25s ease !important;
}

.btn-paper-terrace:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1e3a8a 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(37, 99, 235, 0.45) !important;
}

/* 本モーダル全体 */
.book-modal-backdrop {
  background: rgba(8, 14, 26, 0.92);
  backdrop-filter: blur(8px);
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.book-modal-backdrop.active {
  opacity: 1 !important;
  pointer-events: auto !important;
  display: flex !important;
}

.memory-book-container {
  position: relative;
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.book-close-btn {
  position: absolute;
  top: -14px;
  right: -14px;
  z-index: 10;
  background: #2b170c;
  color: #fdfaf3;
  border: 2px solid #c59b27;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}

.book-close-btn:hover {
  background: #a64718;
  transform: scale(1.1);
}

/* 革表紙バインダー */
.book-leather-cover {
  background: linear-gradient(135deg, #3d1c0e 0%, #241108 50%, #150a04 100%);
  border: 4px solid #78481e;
  outline: 2px solid #c59b27;
  outline-offset: -8px;
  border-radius: 16px;
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.6),
    inset 0 0 25px rgba(0, 0, 0, 0.7),
    inset 0 0 6px rgba(197, 155, 39, 0.4);
  padding: 1.5rem;
  height: 82vh;
  min-height: 560px;
  max-height: 85vh;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* カバービュー（表紙） */
.book-cover-surface {
  margin: auto;
  width: 100%;
  max-width: 580px;
  text-align: center;
  padding: 2.5rem 2rem;
  background: radial-gradient(circle at center, rgba(65, 30, 16, 0.4) 0%, rgba(26, 12, 6, 0.8) 100%);
  border-radius: 12px;
  position: relative;
  overflow-y: auto;
}

.book-cover-emboss-border {
  border: 1px solid rgba(197, 155, 39, 0.5);
  padding: 2.5rem 1.8rem;
  border-radius: 8px;
  position: relative;
}

.book-cover-corner-tl, .book-cover-corner-tr, .book-cover-corner-bl, .book-cover-corner-br {
  position: absolute;
  color: #c59b27;
  font-size: 1.2rem;
  opacity: 0.8;
}
.book-cover-corner-tl { top: 6px; left: 8px; }
.book-cover-corner-tr { top: 6px; right: 8px; }
.book-cover-corner-bl { bottom: 6px; left: 8px; }
.book-cover-corner-br { bottom: 6px; right: 8px; }

.book-cover-emblem {
  font-size: 2.6rem;
  margin-bottom: 1rem;
  letter-spacing: 0.4rem;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.book-cover-main-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: #f7e7ce;
  letter-spacing: 0.15rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), 0 0 12px rgba(197, 155, 39, 0.4);
  margin-bottom: 0.6rem;
}

.book-cover-sub-title {
  font-size: 0.95rem;
  color: #d1b48c;
  letter-spacing: 0.1rem;
  margin-bottom: 1.8rem;
}

.book-cover-names-box {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  background: rgba(18, 9, 4, 0.6);
  border: 1px solid rgba(197, 155, 39, 0.4);
  padding: 0.6rem 1.6rem;
  border-radius: 30px;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: #fff4e0;
  margin-bottom: 2rem;
}

.names-connector {
  color: #c59b27;
  font-size: 0.9rem;
}

.book-cover-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  margin-bottom: 2.2rem;
}

.book-meta-item {
  background: rgba(25, 12, 6, 0.5);
  border: 1px solid rgba(197, 155, 39, 0.25);
  border-radius: 8px;
  padding: 0.65rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.book-meta-item .meta-label {
  font-size: 0.72rem;
  color: #b59877;
}

.book-meta-item .meta-val {
  font-size: 1rem;
  font-weight: bold;
  color: #fcecd2;
  font-family: var(--font-serif);
}

.btn-book-start-reading {
  background: linear-gradient(135deg, #c59b27 0%, #8a6510 100%);
  color: #1a0c04;
  border: none;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: bold;
  padding: 0.85rem 2.5rem;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(197, 155, 39, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.5);
  transition: all 0.25s ease;
}

.btn-book-start-reading:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 22px rgba(197, 155, 39, 0.6);
  background: linear-gradient(135deg, #deb53c 0%, #a47814 100%);
}

/* 開いた本（羊皮紙ページビュー） - 常に高さを固定してボタン位置を安定化 */
.book-pages-surface {
  position: relative;
  background: #fdf9f0;
  border-radius: 10px;
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.5),
    inset 0 0 40px rgba(168, 128, 76, 0.15);
  border: 1px solid #d8c3a5;
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  padding: 1.8rem 2rem 1.2rem;
  color: #2b1f1d;
  user-select: text !important;
  overflow: hidden;
}

/* 栞リボン */
.book-silk-bookmark {
  position: absolute;
  top: -6px;
  right: 40px;
  width: 22px;
  height: 48px;
  background: #b91c1c;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  border-radius: 0 0 4px 4px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%);
  z-index: 5;
}

/* ページ本文シート - スクロールはここだけで発生 */
.book-page-sheet {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.5rem;
  margin-bottom: 0.8rem;
  min-height: 0; /* flex item shrink 対応 */
}

.book-chapter-header {
  border-bottom: 1px solid rgba(180, 140, 90, 0.4);
  padding-bottom: 0.8rem;
  margin-bottom: 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.book-chapter-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: bold;
  color: #6b3410;
}

.book-chapter-date {
  font-size: 0.82rem;
  color: #8c6d48;
}

.book-letter-card-single {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid #e8dbcb;
  border-radius: 8px;
  padding: 1.4rem;
  margin-bottom: 1rem;
  line-height: 1.85;
  font-size: 1rem;
  color: #3b2818;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.book-letter-sender {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: bold;
  color: #78350f;
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px dashed rgba(197, 155, 39, 0.4);
}

.book-letter-body {
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text !important;
}

.book-music-capsule {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 1rem;
  background: #f4ecdc;
  border: 1px solid #cfbfa8;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.88rem;
}

.book-music-disc {
  font-size: 1.4rem;
  animation: discSpin 8s linear infinite;
}

@keyframes discSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.book-music-title {
  font-weight: bold;
  color: #4a341e;
  flex: 1;
}

.btn-book-play-song {
  background: #8c531b;
  color: #fff;
  border: none;
  border-radius: 16px;
  padding: 0.35rem 0.8rem;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-book-play-song:hover {
  background: #ad6722;
}

/* ナビゲーションバー */
.book-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-top: 1px solid #e0d0bd;
  margin-top: auto;
}

.btn-book-nav {
  background: #eedfc9;
  border: 1px solid #c4b097;
  color: #59391a;
  border-radius: 6px;
  padding: 0.45rem 1.1rem;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-book-nav:hover:not(:disabled) {
  background: #e2ceb2;
  transform: translateY(-1px);
}

.btn-book-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.book-page-counter {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  color: #7a5c3e;
  font-weight: 500;
}

/* 本の下部ツールバー */
.book-footer-tools {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding-top: 0.8rem;
  border-top: 1px dashed #e0d0bd;
  margin-top: 0.5rem;
}

.btn-book-tool {
  background: #f5ece0;
  border: 1px solid #d4c2a8;
  color: #614022;
  border-radius: 20px;
  padding: 0.45rem 1rem;
  font-size: 0.84rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-book-tool:hover {
  background: #e8dbca;
  color: #3b2818;
}

.btn-book-terrace {
  background: linear-gradient(135deg, #ba7a28 0%, #874e0d 100%) !important;
  color: #fff9ed !important;
  border: 1px solid #e3a953 !important;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(135, 78, 13, 0.25);
}

.btn-book-terrace:hover {
  background: linear-gradient(135deg, #d48c30 0%, #9e5b0f 100%) !important;
  transform: translateY(-1px);
}

/* 巻末ページ特有の演出 */
.book-epilogue-sheet {
  text-align: center;
  padding: 2.2rem 1.4rem;
}

.book-epilogue-seal {
  width: 90px;
  height: 90px;
  margin: 0 auto 1.4rem;
  border: 2px dashed #c59b27;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #92540e;
  background: rgba(254, 249, 237, 0.8);
  box-shadow: inset 0 0 10px rgba(197, 155, 39, 0.2);
}

.seal-icon {
  font-size: 2rem;
  margin-bottom: 0.1rem;
}

.seal-text {
  font-size: 0.65rem;
  font-weight: bold;
  letter-spacing: 0.1rem;
}

@media (max-width: 640px) {
  .memory-book-container {
    max-height: 95vh;
  }
  .book-leather-cover {
    padding: 1rem 0.8rem;
    min-height: 480px;
  }
  .book-cover-surface {
    padding: 1.5rem 0.8rem;
  }
  .book-cover-emboss-border {
    padding: 1.8rem 1rem;
  }
  .book-cover-main-title {
    font-size: 1.55rem;
  }
  .book-cover-meta-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .book-pages-surface {
    padding: 1.2rem 0.9rem 0.9rem;
  }
  .book-silk-bookmark {
    right: 15px;
  }
  .book-letter-card-single {
    padding: 1rem;
    font-size: 0.92rem;
  }
  .btn-book-tool {
    font-size: 0.78rem;
    padding: 0.4rem 0.75rem;
  }
}

/* =================================================== */
/* 海辺のテラスデート（二人きりのカフェ逢瀬）スタイル */
/* =================================================== */

.terrace-modal-backdrop {
  background: rgba(10, 16, 28, 0.92);
  backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.terrace-modal-backdrop.active {
  opacity: 1 !important;
  pointer-events: auto !important;
  display: flex !important;
}

.terrace-date-container {
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  background: linear-gradient(180deg, #162438 0%, #1c2b3e 40%, #2a1f18 100%);
  border: 2px solid #ba8c46;
  border-radius: 18px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7), inset 0 0 30px rgba(186, 140, 70, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* ヘッダー */
.terrace-header {
  padding: 1.1rem 1.5rem;
  background: rgba(15, 23, 36, 0.85);
  border-bottom: 1px solid rgba(186, 140, 70, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.terrace-badge {
  background: linear-gradient(135deg, #ba8c46 0%, #875a1d 100%);
  color: #fff9ed;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 0.25rem;
}

.terrace-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: bold;
  color: #faeed7;
  margin: 0;
}

.terrace-sub {
  font-size: 0.82rem;
  color: #c9b49b;
}

.terrace-btn-leave {
  background: rgba(40, 25, 18, 0.8);
  border: 1px solid #ba8c46;
  color: #f7eedc;
  padding: 0.45rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.terrace-btn-leave:hover {
  background: #a64718;
  border-color: #e59d43;
}

/* デッキステージ（二人の席 ＆ テーブル） */
.terrace-deck-stage {
  padding: 2.2rem 1.5rem 1.4rem;
  background: 
    radial-gradient(ellipse at 50% 120%, rgba(220, 150, 70, 0.25) 0%, transparent 70%),
    linear-gradient(180deg, rgba(20, 32, 50, 0.6) 0%, rgba(45, 30, 20, 0.85) 100%),
    url('../assets/wood_pattern.png');
  background-size: cover;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  position: relative;
  min-height: 260px;
  border-bottom: 1px solid rgba(186, 140, 70, 0.25);
}

/* 座席 */
.terrace-seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 140px;
  position: relative;
  z-index: 2;
}

.seat-avatar-wrap {
  position: relative;
  margin-bottom: 0.5rem;
}

.seat-avatar-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fffbf0 0%, #e2ceb2 100%);
  border: 3px solid #ba8c46;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), 0 0 12px rgba(220, 160, 70, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  animation: seatBob 4s ease-in-out infinite;
}

.terrace-seat-partner .seat-avatar-icon {
  animation-delay: 1.5s;
}

@keyframes seatBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.seat-lantern {
  position: absolute;
  top: -8px;
  font-size: 1.3rem;
  filter: drop-shadow(0 0 8px rgba(255, 180, 50, 0.8));
  animation: lanternGlow 2.5s ease-in-out infinite alternate;
}
.lantern-left { right: -12px; }
.lantern-right { left: -12px; }

@keyframes lanternGlow {
  from { filter: drop-shadow(0 0 4px rgba(255, 180, 50, 0.5)); transform: scale(0.95); }
  to { filter: drop-shadow(0 0 12px rgba(255, 200, 70, 0.9)); transform: scale(1.05); }
}

.seat-name-tag {
  font-family: var(--font-serif);
  font-size: 0.98rem;
  font-weight: bold;
  color: #faeed7;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  margin-bottom: 0.2rem;
}

.seat-status-pill {
  font-size: 0.72rem;
  background: rgba(186, 140, 70, 0.25);
  border: 1px solid rgba(186, 140, 70, 0.5);
  color: #eed6b6;
  padding: 0.15rem 0.55rem;
  border-radius: 12px;
}

/* 頭上の吹き出し */
.seat-speech-bubble {
  position: absolute;
  bottom: 110px;
  background: rgba(254, 250, 240, 0.96);
  border: 2px solid #ba8c46;
  border-radius: 14px;
  padding: 0.75rem 1rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #3d2411;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  width: 200px;
  text-align: center;
  animation: bubblePop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 5;
}

.terrace-seat-me .seat-speech-bubble {
  left: -20px;
}
.terrace-seat-partner .seat-speech-bubble {
  right: -20px;
}

.seat-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 10px 8px 0;
  border-style: solid;
  border-color: rgba(254, 250, 240, 0.96) transparent transparent;
}

@keyframes bubblePop {
  0% { transform: scale(0.6) translateY(15px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* テーブル中央 */
.terrace-table-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  padding: 0 1rem;
  margin-bottom: 0.6rem;
}

.terrace-table-surface {
  background: radial-gradient(circle at center, #6b4122 0%, #3d2210 100%);
  border: 3px solid #ba8c46;
  border-radius: 40px;
  padding: 0.6rem 1.8rem;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), inset 0 2px 6px rgba(255, 255, 255, 0.2);
  margin-bottom: 1rem;
}

.table-candle {
  font-size: 1.6rem;
  animation: candleFlicker 2s infinite alternate;
}

@keyframes candleFlicker {
  0% { transform: scale(1) rotate(-2deg); }
  50% { transform: scale(1.08) rotate(1deg); }
  100% { transform: scale(0.96) rotate(-1deg); }
}

.table-drink {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1.4rem;
  position: relative;
}

.drink-steam {
  font-size: 0.9rem;
  color: #faeed7;
  opacity: 0.8;
  animation: steamRise 2s infinite ease-out;
}

@keyframes steamRise {
  0% { transform: translateY(0); opacity: 0.9; }
  100% { transform: translateY(-10px); opacity: 0; }
}

.table-action-strip {
  display: flex;
  gap: 0.6rem;
}

.btn-terrace-action {
  background: rgba(30, 20, 14, 0.85);
  border: 1px solid #ba8c46;
  color: #fff6e5;
  border-radius: 16px;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-terrace-action:hover {
  background: #ba8c46;
  color: #1a0f08;
  transform: translateY(-1px);
}

/* 会話ログボックス */
.terrace-conversation-box {
  background: rgba(12, 18, 28, 0.7);
  padding: 0.8rem 1.2rem;
  max-height: 130px;
  overflow-y: auto;
  border-bottom: 1px solid rgba(186, 140, 70, 0.2);
}

.terrace-conversation-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.terrace-chat-line {
  font-size: 0.86rem;
  line-height: 1.4;
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}

.terrace-chat-line.me {
  color: #d1e8ff;
}

.terrace-chat-line.partner {
  color: #ffe6bf;
}

.terrace-chat-line .chat-sender {
  font-weight: bold;
  font-size: 0.82rem;
}

.terrace-chat-line .chat-text {
  flex: 1;
}

/* クイック一言パレット */
.terrace-quick-palette {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 1.2rem;
  background: rgba(18, 26, 38, 0.6);
  overflow-x: auto;
  white-space: nowrap;
}

.quick-word-btn {
  background: rgba(45, 32, 22, 0.75);
  border: 1px solid rgba(186, 140, 70, 0.5);
  color: #faeed7;
  border-radius: 14px;
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-word-btn:hover {
  background: #ba8c46;
  color: #1a0f08;
}

/* 入力バー */
.terrace-input-bar {
  display: flex;
  gap: 0.6rem;
  padding: 0.8rem 1.2rem;
  background: rgba(14, 20, 32, 0.95);
  border-top: 1px solid rgba(186, 140, 70, 0.3);
}

.terrace-text-input {
  flex: 1;
  background: rgba(254, 250, 240, 0.95);
  border: 1px solid #ba8c46;
  border-radius: 20px;
  padding: 0.6rem 1.2rem;
  font-size: 0.92rem;
  color: #2b170c;
  outline: none;
}

.terrace-text-input:focus {
  border-color: #ffd27d;
  box-shadow: 0 0 8px rgba(255, 210, 125, 0.4);
}

.btn-terrace-send {
  background: linear-gradient(135deg, #ba8c46 0%, #875a1d 100%);
  color: #fff9ed;
  border: none;
  border-radius: 20px;
  padding: 0.6rem 1.4rem;
  font-size: 0.92rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.btn-terrace-send:hover {
  background: linear-gradient(135deg, #d49f50 0%, #9e6922 100%);
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .terrace-date-container {
    max-height: 95vh;
  }
  .terrace-deck-stage {
    padding: 1.5rem 0.6rem 1rem;
    min-height: 220px;
  }
  .seat-avatar-icon {
    width: 58px;
    height: 58px;
    font-size: 1.9rem;
  }
  .seat-speech-bubble {
    width: 140px;
    font-size: 0.8rem;
    padding: 0.5rem 0.6rem;
    bottom: 95px;
  }
  .terrace-table-surface {
    padding: 0.4rem 1rem;
    gap: 0.8rem;
  }
  .btn-terrace-send {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }
}
