:root {
  --bg-color: #ffffff;
  /* 45度角の4色グラデーション（白に近い淡い色調） */
  --bg-gradient: linear-gradient(45deg, #fffafa, #f0f7ff, #fff0f5, #f5f5ff);
  --bg-card: rgba(255, 255, 255, 0.82);
  --text-primary: #333333;
  --text-secondary: #666666;
  --accent-pink: #FF66A1;
  --accent-blue: #007BFF;
  --accent-gradient: linear-gradient(135deg, #FF66A1, #007BFF);
  --border-radius: 16px;
  --font-family: 'Inter', 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  --header-height: 60px;
  --footer-height: 65px;
  --glass-effect: backdrop-filter: blur(10px) saturate(180%);
}

@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background: var(--bg-gradient);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background-color: var(--bg-app);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
}

/* --- Header (Standard) --- */
header {
  position: fixed;
  /* stickyから変更して全体固定化 */
  top: 0;
  width: 100%;
  max-width: 480px;
  /* pcなどで見た場合にapp-containerに追随するよう */
  height: var(--header-height);
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(15px);
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

header.top-header {
  display: none;
}

/* ヘッダの裏にコンテンツが隠れないよう、mainの上部にパディングを設定 */
main {
  flex: 1;
  padding-top: var(--header-height);
  padding-bottom: calc(var(--footer-height) + 20px);
  /* フッタ被り防止 */
}

main.no-header {
  padding-top: 0;
}

main.no-footer {
  padding-bottom: 0;
}

/* --- Hamburger Menu Content --- */
.hamburger-menu-content {
  display: none;
  /* 初期非表示 */
}

.hamburger-menu-content.open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: var(--header-height);
  right: 0;
  width: 280px; /* 250pxから280pxへ拡張 */
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  padding: 16px 20px;
  border-bottom-left-radius: var(--border-radius);
  box-shadow: -5px 5px 20px rgba(0, 0, 0, 0.1);
  z-index: 2000;
  border-left: 1px solid rgba(255, 255, 255, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.hamburger-menu-content a {
  text-decoration: none;
  font-weight: bold;
  color: var(--text-primary);
  padding: 12px 0;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.1);
  white-space: nowrap; /* 折り返しを強制防止 */
}

.hamburger-menu-content a:last-child {
  border-bottom: none;
}

/* Typography */

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.header-logo {
  height: 24px;
}

.menu-icon {
  font-size: 1.6rem;
  color: var(--text-primary);
  cursor: pointer;
}

h2.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 20px;
  color: var(--text-primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: 40px;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: none;
  width: 100%;
  font-family: var(--font-family);
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 8px 20px rgba(255, 102, 161, 0.25);
}

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

.btn-secondary {
  background: white;
  color: var(--accent-blue);
  border: 1.5px solid var(--accent-blue);
}

.btn-secondary:active {
  background: rgba(0, 123, 255, 0.05);
}

.btn-support {
  background: var(--accent-gradient);
  color: white;
  font-size: 1.1rem;
  padding: 12px 24px;
  border-radius: 50px;
  box-shadow: 0 10px 25px rgba(255, 102, 161, 0.3);
  margin-bottom: 20px;
  flex-direction: column;
  line-height: 1.2;
}

.btn-support .sub-label {
  display: block;
  font-size: 0.75rem;
  font-weight: normal;
  margin-top: 2px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.03);
}

/* Bottom Nav (Fixed) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--footer-height);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(15px);
  display: flex;
  justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  z-index: 1000;
}

.nav-item {
  color: #a0a0a0;
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
}

.nav-item.active {
  color: var(--accent-pink);
}

.nav-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  margin-bottom: 2px;
}

/* LIVEボタンの強調 */
.nav-item.nav-live-highlight {
  position: relative;
  display: flex;
  justify-content: center;
}

.nav-item.nav-live-highlight .nav-icon-wrapper {
  width: 84px;
  height: 84px;
  background: #01255a;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: none; /* 影なし（フラット） */
  position: absolute;
  top: -8px; /* 突き出し具合の最終調整値 */
  left: 50%;
  transform: translateX(-50%);
  border: none; /* 枠線なし */
  padding-bottom: 6px; /* アイコンとテキストを3px上に（中心から） */
}

.nav-item.nav-live-highlight .nav-icon {
  width: 32px;
  height: 32px;
  margin-bottom: 2px;
  filter: brightness(0) invert(1);
}

.nav-item.nav-live-highlight span {
  color: #ffffff !important;
  font-size: 0.75rem;
  font-weight: bold;
}

/* Helpers */
/* キラキラ演出（パーティクル） */
.sparkle-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3000;
}

.sparkle-particle {
  position: absolute;
  font-size: 2rem;
  user-select: none;
  animation: sparkle-fly 1.2s ease-out forwards;
}

@keyframes sparkle-fly {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translate(var(--dx), var(--dy)) scale(0) rotate(var(--dr));
    opacity: 0;
  }
}

/* ボトムシート内の追加UI */
.sheet-back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  background: none;
  border: none;
  color: #666;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.purchase-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.purchase-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.purchase-item:hover {
  background: #f0f2f5;
}

.purchase-amount {
  font-weight: bold;
  font-size: 1.1rem;
}

.purchase-price {
  color: #007BFF;
  font-weight: bold;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
}

.sheet-footer-text {
  text-align: center;
  font-size: 0.85rem;
  color: #999;
  margin-top: 16px;
}

.sheet-footer-text span {
  color: #007BFF;
  cursor: pointer;
  text-decoration: underline;
}

.mt-2 {
  margin-top: 10px;
}

.mt-4 {
  margin-top: 20px;
}

.mb-2 {
  margin-bottom: 10px;
}

.mb-4 {
  margin-bottom: 20px;
}


/* --- Live Page Styles (Instagram Style) --- */
.live-stream-body {
  overflow: hidden;
  height: 100vh !important;
  background: black !important;
}

.live-stream-container {
  position: relative;
  height: 100vh;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background-image: url('images/artist_fujitayuya_02.jpg');
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
}

.live-overlay-gradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, transparent 20%, transparent 60%, rgba(0, 0, 0, 0.8) 100%);
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 1;
}

.live-content {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 80px 16px 0 !important;
  color: white;
  z-index: 2;
}

/* アイテムメニュー制御 */
.live-item-menu-overlay {
  display: none;
}

.live-item-menu-overlay.open {
  display: block;
}

.live-item-bubble {
  position: absolute;
  bottom: 140px;
  /* アイテム行(64px) + フッター(65px) + 余白 */
  right: 16px;
  background: white;
  color: #333;
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  z-index: 500;
  text-align: center;
  min-width: 220px;
}

.live-item-bubble::after {
  content: "";
  position: absolute;
  bottom: -10px;
  right: 20px;
  border-width: 10px 10px 0;
  border-style: solid;
  border-color: white transparent transparent;
}

.live-item-menu-title {
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 2px;
}

.live-item-menu-subtitle {
  font-size: 0.8rem;
  color: #007BFF;
  text-decoration: underline;
  cursor: pointer;
}

.live-items-row {
  position: absolute;
  bottom: 65px;
  /* フッターの上 */
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  padding: 0 16px;
  padding-right: 75px;
  /* 右側のトグルボタン用スペース */
  height: 64px;
  z-index: 400;
}

.live-items-grid {
  display: flex;
  flex: 1;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.live-items-grid::-webkit-scrollbar {
  display: none;
}

.live-item-icon-btn {
  font-size: 1.8rem;
  background: white;
  border: 1px solid #333;
  border-radius: 8px;
  min-width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* 入力エリア */
.live-input-area {
  position: absolute;
  bottom: 65px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  padding-right: 75px;
  /* 右側のギフトボタンと被らないようにスペース確保 */
  height: 64px;
  background: transparent;
  z-index: 100;
}

.live-message-input {
  flex: 1;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 25px;
  padding: 10px 18px;
  color: white;
}

.live-action-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.live-header-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.live-status {
  background: #e60012;
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 4px;
  align-self: flex-start;
}

.live-video-title {
  font-size: 1.1rem;
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.live-comments-container {
  margin-top: auto;
  margin-bottom: 130px;
  /* 入力欄(64px) + 余白 + 吹き出しのしっぽを考慮 */
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 250px;
  overflow: hidden;
}

.live-comment-item {
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideUpFade 0.5s ease-out;
}

.comment-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.comment-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-text {
  font-size: 0.95rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.icon-gift {
  font-size: 1.5rem;
}

/* Bottom Sheet (Slide Up Panel) */
.sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sheet-overlay.active {
  display: block;
  opacity: 1;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 100%);
  width: 100%;
  max-width: 480px;
  background: white;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 24px 20px 40px;
  z-index: 2001;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  color: #333;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
}

.bottom-sheet.active {
  transform: translate(-50%, 0);
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
  margin: 0 auto 20px;
}

.sheet-title {
  font-size: 1.25rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 24px;
}

.sheet-item-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.preview-icon {
  font-size: 3.5rem;
}

.preview-name {
  font-weight: bold;
  font-size: 1.2rem;
}

.point-info {
  background: #f8f9fa;
  padding: 16px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.point-label {
  color: #666;
  font-size: 0.95rem;
}

.point-value {
  font-weight: bold;
  color: #007BFF;
  font-size: 1.1rem;
}

.sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sheet-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 1.8rem;
  color: #999;
  cursor: pointer;
  border: none;
  background: none;
  line-height: 1;
}

.bottom-sheet .btn-primary {
  background: #007BFF;
  color: white;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-weight: bold;
  font-size: 1rem;
  width: 100%;
  cursor: pointer;
}

.bottom-sheet .btn-secondary {
  background: #eee;
  color: #666;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-weight: bold;
  font-size: 1rem;
  width: 100%;
  cursor: pointer;
}

.text-center {
  text-align: center;
}

/* バースト演出（弾ける） */
.sparkle-particle {
  position: absolute;
  font-size: 6rem;
  /* 従来の3倍 */
  user-select: none;
  animation: sparkle-burst-anim 1.5s ease-out forwards;
  z-index: 3000;
}

@keyframes sparkle-burst-anim {
  0% {
    transform: translate(0, 0) scale(0.5) rotate(0deg);
    opacity: 0;
  }

  20% {
    opacity: 1;
    transform: translate(0, 0) scale(1.2) rotate(0deg);
  }

  100% {
    transform: translate(var(--dx), var(--dy)) scale(0.8) rotate(var(--dr));
    opacity: 0;
  }
}

/* スペシャルメッセージ吹き出し */
.special-message-bubble {
  position: absolute;
  bottom: 160px;
  /* コメントエリアの上部付近 */
  left: 20px;
  right: 20px;
  background: white;
  color: #333;
  padding: 16px 20px;
  border-radius: 20px;
  font-size: 1.4rem;
  /* 1.5倍相当 */
  font-weight: bold;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 2500;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: bubble-pop-in 4s ease-out forwards;
  border: 2px solid #007BFF;
}

.special-message-bubble::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 30px;
  border-width: 15px 15px 0;
  border-style: solid;
  border-color: white transparent transparent;
}

@keyframes bubble-pop-in {
  0% {
    transform: scale(0.8) translateY(20px);
    opacity: 0;
  }

  10% {
    transform: scale(1.05) translateY(0);
    opacity: 1;
  }

  15% {
    transform: scale(1);
  }

  85% {
    transform: translateY(0);
    opacity: 1;
  }

  100% {
    transform: translateY(-40px);
    opacity: 0;
  }
}

.special-message-icon {
  font-size: 2rem;
}

/* メッセージ入力・カウンタ */
.message-input-container {
  position: relative;
  margin-bottom: 20px;
}

.sheet-message-input {
  width: 100%;
  padding: 12px 16px;
  padding-right: 60px;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-size: 1rem;
  background: #f8f9fa;
  color: #333;
}

/* Artist Page Custom Styles */
.artist-header-flex {
  display: flex;
  justify-content: space-around; /* アイコンを右端に寄せるためにSpace-between または space-around */
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
}

.artist-name-group {
  display: flex;
  flex-direction: column-reverse;
  line-height: 1.1; /* 行間の調整 */
}

.artist-name-group div {
  margin-bottom: 6px !important; /* ふりがなを1mm(約4px)程度上に上げる(元の2pxから+4px) */
}

.artist-hero-name {
  margin-bottom: 0; /* 下の余白を消してボタンと揃える */
}

.fav-btn {
  width: 44px;
  height: 44px;
  border: 2px solid #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.fav-btn.active {
  background: var(--accent-pink);
  border-color: var(--accent-pink);
}

.fav-btn svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
}

.fav-btn.active svg {
  fill: #fff;
  stroke: none;
}

.sheet-message-input:focus {
  outline: none;
  border-color: #007BFF;
  background: white;
}

.char-counter {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  color: #999;
  pointer-events: none;
}

.char-counter.error {
  color: #ff4d4f;
  font-weight: bold;
}

/* ボタンの無効化状態 */
.bottom-sheet button:disabled {
  background: #ccc !important;
  cursor: not-allowed !important;
  opacity: 0.8;
  color: #fff !important;
}
.coming-soon-bubble {
    position: absolute;
    background: #555;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    pointer-events: none;
    z-index: 10000;
    white-space: nowrap;
    animation: bubbleFade 1.5s forwards;
}
.coming-soon-bubble::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px 5px 0;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
}
@keyframes bubbleFade {
    0% { opacity: 0; transform: translateY(5px); }
    10% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-10px); }
}
