/* ============================================
   Base Pages - 共通スタイルシート
   ============================================
   ベースページ、プロファイル画面、VTuber一覧画面
   で共有するスタイル定義
   ============================================ */

:root {
  --primary: #c084fc;
  --primary-glow: #d8b4fe;
  --secondary: #f0abfc;
  --accent: #67e8f9;
  --ui-bg: rgba(15, 5, 25, 0.65);
  --ui-bg-solid: rgba(20, 10, 35, 0.85);
  --ui-border: rgba(192, 132, 252, 0.25);
  --text-primary: #faf5ff;
  --text-secondary: rgba(250, 245, 255, 0.7);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --glow-purple: 0 0 20px rgba(192, 132, 252, 0.3);
}

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

html, body {
  width: 100%;
  min-height: 100%;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  background: #0a0015;
  color: var(--text-primary);
  -webkit-user-select: none;
  user-select: none;
}

a {
  color: var(--primary);
  text-decoration: none;
}

/* ===== Page Container ===== */
.page-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 20px 40px;
  max-width: 480px;
  margin: 0 auto;
}

/* ===== ベースページ: Hero ===== */
.hero {
  text-align: center;
  padding: 60px 0 40px;
}

.hero-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.hero-title {
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* ===== メニューカード ===== */
.menu-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.menu-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--ui-bg-solid);
  border: 1px solid var(--ui-border);
  border-radius: 16px;
  padding: 20px;
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 0.2s, box-shadow 0.2s;
}

.menu-card:active {
  transform: scale(0.97);
}

.menu-card:hover {
  box-shadow: var(--glow-purple);
}

.card-icon {
  font-size: 36px;
  flex-shrink: 0;
}

.card-body {
  flex: 1;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.card-arrow {
  font-size: 24px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* ===== ページフッター ===== */
.page-footer {
  text-align: center;
  padding-top: 32px;
  color: var(--text-secondary);
  font-size: 12px;
}

/* ===== ページヘッダー (サブページ) ===== */
.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--ui-border);
  margin-bottom: 24px;
}

.back-btn {
  color: var(--primary);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.back-btn:active {
  background: rgba(192, 132, 252, 0.15);
}

.page-title {
  font-size: 20px;
  font-weight: 700;
}

/* ===== プロファイル画面 ===== */
.profile-content {
  text-align: center;
}

.profile-icon {
  font-size: 56px;
  margin-bottom: 16px;
}

.profile-desc {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 24px;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 32px;
  border: none;
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--glow-purple);
}

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

.btn-icon {
  font-size: 18px;
}

/* ステップガイド */
.steps {
  margin: 32px 0 24px;
  text-align: left;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--ui-bg-solid);
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.step-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  padding-top: 3px;
}

.step-text b {
  color: var(--text-primary);
}

.step-text a {
  color: var(--primary);
  text-decoration: underline;
}

.profile-note {
  color: var(--text-secondary);
  font-size: 11px;
  opacity: 0.7;
}

/* ===== VTuber一覧画面 ===== */
.section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

/* シリアルコード入力 */
.serial-section {
  margin-bottom: 32px;
}

.serial-form {
  display: flex;
  gap: 8px;
}

.serial-input {
  flex: 1;
  background: var(--ui-bg-solid);
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

.serial-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

.serial-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(192, 132, 252, 0.2);
}

.serial-btn {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.serial-btn:active {
  transform: scale(0.95);
}

.serial-error {
  color: #f87171;
  font-size: 13px;
  margin-top: 8px;
}

/* VTuberリスト */
.vtuber-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vtuber-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--ui-bg-solid);
  border: 1px solid var(--ui-border);
  border-radius: 14px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 0.2s, box-shadow 0.2s;
}

.vtuber-item:active {
  transform: scale(0.97);
}

.vtuber-item:hover {
  box-shadow: var(--glow-purple);
}

.vtuber-thumb {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--ui-border);
  background: rgba(192, 132, 252, 0.1);
  flex-shrink: 0;
}

.vtuber-info {
  flex: 1;
  min-width: 0;
}

.vtuber-name {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vtuber-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vtuber-arrow {
  font-size: 20px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.vtuber-empty {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  padding: 32px 0;
}

/* ===== ページ遷移アニメーション ===== */
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.page-container {
  animation: fadeSlideIn 0.4s ease-out;
}

.menu-card,
.vtuber-item,
.step {
  animation: fadeSlideIn 0.4s ease-out both;
}

/* 一覧アイテムの段階的表示 */
.menu-card:nth-child(1),
.vtuber-item:nth-child(1),
.step:nth-child(1) { animation-delay: 0.05s; }
.menu-card:nth-child(2),
.vtuber-item:nth-child(2),
.step:nth-child(2) { animation-delay: 0.1s; }
.vtuber-item:nth-child(3),
.step:nth-child(3) { animation-delay: 0.15s; }
.vtuber-item:nth-child(4),
.step:nth-child(4) { animation-delay: 0.2s; }
.vtuber-item:nth-child(5),
.step:nth-child(5) { animation-delay: 0.25s; }
.vtuber-item:nth-child(6) { animation-delay: 0.3s; }
.vtuber-item:nth-child(7) { animation-delay: 0.35s; }
.vtuber-item:nth-child(8) { animation-delay: 0.4s; }

/* ===== ユーティリティ ===== */
.hidden {
  display: none !important;
}
