@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;800;900&family=Rajdhani:wght@500;600;700&family=Share+Tech+Mono&display=swap');

/* カラーパレット */
:root {
  --bg-color: #09090b;
  --panel-bg: rgba(17, 18, 25, 0.75);
  --border-color: rgba(255, 255, 255, 0.07);
  --text-primary: #f4f4f5;
  --text-muted: #a1a1aa;
  
  /* ネオンカラー */
  --neon-green: #10b981;
  --neon-green-glow: rgba(16, 185, 129, 0.45);
  --neon-orange: #f97316;
  --neon-orange-glow: rgba(249, 115, 22, 0.45);
  --neon-purple: #c084fc;
  --neon-purple-glow: rgba(192, 132, 252, 0.45);
  --neon-red: #ef4444;
  --neon-red-glow: rgba(239, 68, 68, 0.45);
  --neon-cyan: #06b6d4;
  --neon-cyan-glow: rgba(6, 182, 212, 0.45);
  
  --font-title: 'Orbitron', sans-serif;
  --font-data: 'Rajdhani', sans-serif;
  --font-mono: 'Share Tech Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-data);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: 30px;
  
  /* レトロサイバーな背景グリッドと走査線 */
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(20, 10, 40, 0.5) 0%, transparent 80%),
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
    linear-gradient(90deg, transparent 49%, rgba(192, 132, 252, 0.05) 50%, transparent 51%),
    linear-gradient(transparent 49%, rgba(192, 132, 252, 0.05) 50%, transparent 51%);
  background-size: 100% 100%, 100% 4px, 40px 40px, 40px 40px;
  position: relative;
}

/* CRT画面の曲面と走査線エフェクト（擬似） */
body::after {
  content: " ";
  display: block;
  position: fixed;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.15) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
  background-size: 100% 3px, 3px 100%;
  z-index: 9999;
  pointer-events: none;
}

/* スクロールバーのカスタマイズ */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
  background: var(--neon-purple);
  border-radius: 3px;
  box-shadow: 0 0 5px var(--neon-purple-glow);
}

/* アプリ容器（Androidスマホ風幅制限、デスクトップ表示時に綺麗に見せるため） */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

/* ヘッダー */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 2px solid rgba(192, 132, 252, 0.2);
  margin-bottom: 8px;
}

header h1 {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(to right, #e879f9, #a855f7, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--neon-green);
  text-shadow: 0 0 8px var(--neon-green-glow);
  background: rgba(16, 185, 129, 0.1);
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--neon-green);
  box-shadow: 0 0 6px var(--neon-green);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.4; }
  100% { transform: scale(1); opacity: 1; }
}

/* メインダッシュボード */
.dashboard {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ゲームカード (グラスモルフィズム) */
.game-card {
  background: var(--panel-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 12px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
}

/* ゲームカード状態によるネオン境界線 */
.game-card.state-ready {
  border-left: 4px solid var(--neon-green);
}
.game-card.state-running {
  border-left: 4px solid var(--neon-orange);
  box-shadow: 0 0 15px rgba(249, 115, 22, 0.1);
}
.game-card.state-completed {
  border-left: 4px solid var(--neon-red);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.25);
  animation: alarm-pulse 1s infinite alternate;
}
.game-card.state-paused {
  border-left: 4px solid var(--neon-cyan);
}

@keyframes alarm-pulse {
  from { border-color: rgba(239, 68, 68, 0.2); }
  to { border-color: rgba(239, 68, 68, 0.8); }
}

/* 円形タイマー（左側） */
.timer-visual-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 56px;
  height: 56px;
}

.circular-progress {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.circular-progress circle {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
}

.circular-progress .bg-circle {
  stroke: rgba(255, 255, 255, 0.05);
}

.circular-progress .progress-circle {
  stroke-dasharray: 201; /* 2 * PI * r (r=32 => 201) */
  stroke-dashoffset: 201;
  transition: stroke-dashoffset 0.1s linear;
}

.state-ready .progress-circle { stroke: var(--neon-green); }
.state-running .progress-circle { stroke: var(--neon-orange); }
.state-completed .progress-circle { stroke: var(--neon-red); }
.state-paused .progress-circle { stroke: var(--neon-cyan); }

/* 円の真ん中のアイコン/進捗 */
.timer-icon {
  position: absolute;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 詳細情報（右側） */
.game-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.game-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-title {
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  word-break: break-all;
}

.game-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-muted);
}

.state-ready .game-tag { background: rgba(16, 185, 129, 0.15); color: var(--neon-green); }
.state-running .game-tag { background: rgba(249, 115, 22, 0.15); color: var(--neon-orange); }
.state-completed .game-tag { background: rgba(239, 68, 68, 0.15); color: var(--neon-red); }
.state-paused .game-tag { background: rgba(6, 182, 212, 0.15); color: var(--neon-cyan); }

.card-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 1.1rem;
  border-radius: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
}

.icon-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* タイマーのデジタル数値 */
.timer-digital {
  font-family: var(--font-mono);
  font-size: 1.65rem;
  font-weight: bold;
  letter-spacing: 1px;
  margin: 1px 0;
  line-height: 1;
}

.state-ready .timer-digital { color: var(--text-muted); text-shadow: none; }
.state-running .timer-digital { color: var(--neon-orange); text-shadow: 0 0 10px var(--neon-orange-glow); }
.state-completed .timer-digital { color: var(--neon-red); text-shadow: 0 0 15px var(--neon-red-glow); animation: text-blink 0.5s infinite alternate; }
.state-paused .timer-digital { color: var(--neon-cyan); text-shadow: 0 0 10px var(--neon-cyan-glow); }

@keyframes text-blink {
  from { opacity: 1; }
  to { opacity: 0.3; }
}

.timer-target-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* クイックコントロールパネル */
.quick-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 3px;
}

.btn-preset {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.68rem;
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 3px;
}

.btn-preset:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

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

/* 主要なタイマー制御ボタン */
.main-actions {
  display: flex;
  gap: 5px;
  margin-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 6px;
}

.btn {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.72rem;
  padding: 6px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  flex: 1;
}

.btn-primary {
  background: var(--neon-orange);
  color: #000;
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.3);
}
.btn-primary:hover {
  background: #ffa15c;
  box-shadow: 0 0 15px rgba(249, 115, 22, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-launch {
  background: var(--neon-cyan);
  color: #000;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}
.btn-launch:hover {
  background: #67e8f9;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.6);
}

.btn-reset-timer {
  background: rgba(239, 68, 68, 0.15);
  color: var(--neon-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-reset-timer:hover {
  background: rgba(239, 68, 68, 0.25);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

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

/* 空白時のプレースホルダー */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  background: var(--panel-bg);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-icon {
  font-size: 3rem;
  color: var(--neon-purple);
  opacity: 0.5;
  animation: float 3s ease-in-out infinite alternate;
}

@keyframes float {
  from { transform: translateY(0px); }
  to { transform: translateY(-8px); }
}

/* アクションボタン（最下部の追加・設定） */
.bottom-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

.btn-add-game {
  grid-column: span 2;
  padding: 14px;
  background: linear-gradient(135deg, #a855f7, #6366f1);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
  border: none;
  border-radius: 12px;
}
.btn-add-game:hover {
  background: linear-gradient(135deg, #c084fc, #818cf8);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.7);
}

/* サイバーパンク風インフォカード（設定・遅延対策説明） */
.info-panel {
  background: rgba(168, 85, 247, 0.05);
  border: 1px solid rgba(168, 85, 247, 0.15);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-title {
  font-family: var(--font-title);
  color: var(--neon-purple);
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-content {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
  line-height: 1.4;
}

.info-content strong {
  color: var(--text-primary);
}

.settings-list {
  padding-left: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ポップアップモーダル（ゲーム追加・編集用） */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: #12131a;
  border: 1px solid rgba(168, 85, 247, 0.4);
  box-shadow: 0 0 30px rgba(168, 85, 247, 0.2);
  border-radius: 20px;
  width: 100%;
  max-width: 400px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: scale(0.9);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  /* スマホ縦持ちで下のボタンが切れないようにスクロール可能にする */
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal.active .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--neon-purple);
  text-shadow: 0 0 10px var(--neon-purple-glow);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-family: var(--font-data);
  font-size: 1rem;
  padding: 10px 14px;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: var(--neon-purple);
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.3);
}

/* カスタム時間の入力エリア */
.time-input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.time-unit-box {
  position: relative;
  display: flex;
  align-items: center;
}

.time-unit-box input {
  width: 100%;
  text-align: center;
  padding-right: 24px;
}

.time-unit-label {
  position: absolute;
  right: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  pointer-events: none;
}

/* アイコン選択と色選択のリスト */
.color-picker {
  display: flex;
  gap: 8px;
}

.color-option {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s;
}

.color-option:hover {
  transform: scale(1.15);
}

.color-option.selected {
  border-color: #fff;
  box-shadow: 0 0 10px var(--glow-color);
}

/* 登録用のサウンドセレクター */
.sound-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-sound-opt {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-family: var(--font-data);
  font-weight: 600;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.8rem;
}

.btn-sound-opt:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.btn-sound-opt.selected {
  background: rgba(168, 85, 247, 0.15);
  border-color: var(--neon-purple);
  color: var(--neon-purple);
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.35);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

/* インストール促進バナー */
.install-banner {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(99, 102, 241, 0.15));
  border: 1px solid rgba(6, 182, 212, 0.3);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.1);
  border-radius: 16px;
  padding: 16px;
  display: none; /* JSでインストール可能な場合のみ表示 */
  flex-direction: column;
  gap: 10px;
}

.install-header {
  font-family: var(--font-title);
  color: var(--neon-cyan);
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.install-btn {
  background: var(--neon-cyan);
  color: #000;
  font-weight: 800;
  padding: 10px;
  font-size: 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  text-align: center;
}

.install-btn:hover {
  background: #67e8f9;
}

/* ==========================================
   メモリちゃん アシスタントパネルのスタイル
   ========================================== */
.assistant-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  margin-bottom: 8px;
  border-left: 4px solid var(--neon-purple);
}

.character-container {
  position: relative;
  width: 128px;
  height: 128px;
  flex-shrink: 0;
}

.char-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--neon-purple);
  box-shadow: 0 0 10px var(--neon-purple-glow);
  background: #12131a;
  transition: all 0.3s ease;
}


/* 音声ミュート切り替えボタン */
.voice-toggle-btn {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
  align-self: center;
  margin-left: auto;
  align-items: center;
  justify-content: center;
}

.voice-toggle-btn:hover {
  color: var(--neon-purple);
  text-shadow: 0 0 5px var(--neon-purple-glow);
  background: rgba(255, 255, 255, 0.05);
}

.voice-toggle-btn:active {
  transform: scale(0.9);
}

/* ==========================================
   トーク画面 (LINE風チャット) のスタイル
   ========================================== */
.talk-modal-content {
  display: flex;
  flex-direction: column;
  height: 85vh; /* 画面を広く使う */
  max-height: 800px;
  padding: 0; /* paddingを外してヘッダーとアクションエリアを画面端まで広げる */
  background: #111217;
  overflow: hidden;
}

.talk-header {
  padding: 16px 20px;
  background: rgba(16, 185, 129, 0.1);
  border-bottom: 1px solid rgba(16, 185, 129, 0.2);
  margin-bottom: 0;
}

.talk-log-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #161821; /* 少し暗めの背景 */
}

/* メッセージ共通 */
.talk-msg-wrapper {
  display: flex;
  width: 100%;
}

.talk-msg-wrapper.sender-user {
  justify-content: flex-end;
}

.talk-msg-wrapper.sender-memori {
  justify-content: flex-start;
  gap: 12px;
}

/* 吹き出しスタイル */
.talk-bubble {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.4;
  word-wrap: break-word;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sender-user .talk-bubble {
  background: var(--neon-green);
  color: #000;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

.sender-memori .talk-bubble {
  background: #2a2d3d;
  color: #fff;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* メモリちゃんアイコン (ズーム対応) */
.talk-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--neon-purple);
  box-shadow: 0 0 5px var(--neon-purple-glow);
  align-self: flex-end;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.talk-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  transform: scale(1.6); /* 顔がアップになるようにズーム */
}

/* チャット内画像 */
.talk-image {
  max-width: 100%;
  border-radius: 8px;
  margin-top: 8px;
  display: block;
}

/* タイムスタンプ */
.talk-time {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
  align-self: flex-end;
  margin: 0 8px;
  margin-bottom: 2px;
}

.sender-user .talk-time {
  order: -1; /* 時間を吹き出しの左側に配置 */
}

/* 定型文アクションボタンエリア */
.talk-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  background: #111217;
  border-top: 1px solid var(--border-color);
  max-height: 200px;
  overflow-y: auto;
}

.btn-talk-opt {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-talk-opt:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.5);
  color: var(--neon-green);
}
.btn-talk-opt:active {
  transform: scale(0.95);
}

/* カスタムパッケージ入力グループ */
.custom-package-group {
  display: none;
  animation: fadeIn 0.25s ease;
  margin-top: 4px;
}

.custom-package-group.active {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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


/* Zzz 睡眠エフェクト */
.zzz-container {
  position: absolute;
  top: -12px;
  right: -6px;
  font-family: var(--font-title);
  font-size: 0.9rem;
  color: var(--neon-purple);
  font-weight: bold;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.state-sleeping .zzz-container {
  opacity: 1;
}

.zzz-container span {
  position: absolute;
  opacity: 0;
  animation: zzz-float 2.5s infinite linear;
}

.zzz-container .z2 {
  animation-delay: 0.8s;
}

.zzz-container .z3 {
  animation-delay: 1.6s;
}

@keyframes zzz-float {
  0% {
    transform: translate(0, 0) scale(0.6);
    opacity: 0;
  }
  20% {
    opacity: 0.8;
  }
  80% {
    opacity: 0.8;
  }
  100% {
    transform: translate(15px, -25px) scale(1.2);
    opacity: 0;
  }
}

/* 吹き出し（セリフ） */
.speech-bubble {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 14px;
  border-radius: 12px;
  position: relative;
  flex-grow: 1;
  min-height: 48px;
  display: flex;
  align-items: center;
}

.speech-bubble-tail {
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: #12131a;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.speech-text {
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.4;
  font-weight: 500;
}

/* カスタムアプリの入力タイプ選択（Android ID vs URL） */
.app-type-selector {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.btn-type-opt {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-family: var(--font-data);
  font-weight: 600;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.8rem;
  text-align: center;
}

.btn-type-opt:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.btn-type-opt.selected {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.35);
}

