/* DoyaLore - 毎日5問チャレンジ & ごほうび・お叱り & 神速タイムアタック & 実績図鑑 UI スタイル */
:root {
  --bg-primary: #0f111a;
  --bg-secondary: #1a1d2e;
  --bg-tertiary: #252945;
  --accent-cyan: #00f0ff;
  --accent-magenta: #ff007f;
  --accent-gold: #ffd700;
  --accent-green: #00e676;
  --accent-red: #ff5252;
  --text-primary: #f0f4fc;
  --text-secondary: #9aa5ce;
  --text-muted: #565f89;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(0, 240, 255, 0.5);
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", Meiryo, sans-serif;
  --shadow-glow: 0 0 20px rgba(0, 240, 255, 0.2);
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* 実績解除トースト通知 */
.achievement-toast {
  position: fixed;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(26, 29, 46, 0.95), rgba(15, 17, 26, 0.95));
  border: 2px solid var(--accent-gold);
  border-radius: 30px;
  padding: 12px 24px;
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  z-index: 9999;
  box-shadow: 0 8px 30px rgba(255, 215, 0, 0.4);
  backdrop-filter: blur(8px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  white-space: nowrap;
}

.achievement-toast.show {
  top: 20px;
}

/* ヘッダー */
.app-header {
  height: 64px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(15, 17, 26, 0.9);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 680px;
  margin: 0 auto;
  height: 100%;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* モード切替タブ */
.mode-tabs {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 3px;
  gap: 4px;
}

.mode-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-tab.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(255, 0, 127, 0.2));
  color: #fff;
  border: 1px solid var(--accent-cyan);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-icon {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

.btn-lang {
  width: auto;
  padding: 0 8px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-cyan);
  border-color: rgba(0, 240, 255, 0.35);
  letter-spacing: 0.5px;
}

/* メインコンテナ（1画面収容・スクロール防止） */
.main-container {
  max-width: 620px;
  width: 100%;
  margin: 0 auto;
  padding: 8px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* HUDダッシュボード */
.hud-dashboard {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hud-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 4px;
}

.badge-tag {
  color: var(--accent-cyan);
  font-weight: 700;
  font-size: 0.8rem;
}

.diff-badge {
  background: rgba(255, 0, 127, 0.15);
  border: 1px solid var(--accent-magenta);
  color: var(--accent-magenta);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
}

.shield-tag {
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 800;
  font-size: 0.75rem;
  padding: 1px 5px;
  border-radius: 4px;
}

.streak-tag {
  color: var(--accent-gold);
  font-weight: 800;
  font-size: 0.8rem;
}

.hud-bottom-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
  gap: 4px;
}

.hud-stat-box {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hud-stat-lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.hud-stat-val {
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--text-primary);
}

.score-glow {
  color: var(--accent-cyan);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

/* ★スリム象徴絵文字ストリップ（スクロール防止・HUD直下） */
.hud-emoji-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 0, 128, 0.08);
  border: 1px dashed rgba(255, 0, 128, 0.35);
  border-radius: 6px;
  padding: 3px 8px;
  margin-top: 2px;
}

.strip-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: #ff79c6;
}

.strip-emojis {
  display: flex;
  gap: 6px;
  font-size: 1.25rem;
  user-select: none;
}

/* ヒントカード群（スマート・アコーディオン） */
.hints-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hint-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

/* 最新の主役ヒント */
.hint-card.open.active-hint {
  border-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.05);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.15);
  padding: 10px 14px;
}

/* 過去に解放したヒント（折り畳みスリム） */
.hint-card.open.past-hint {
  padding: 5px 10px;
  background: rgba(26, 29, 46, 0.4);
  opacity: 0.85;
  cursor: pointer;
}

.hint-card.open.past-hint .hint-content {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* 未解放ヒント（超コンパクト1行ロックバー） */
.hint-card.locked {
  padding: 4px 10px;
  opacity: 0.45;
  background: rgba(26, 29, 46, 0.25);
}

.hint-card.locked .hint-content {
  display: none;
}

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

.hint-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-cyan);
}

.hint-card.locked .hint-tag {
  color: var(--text-muted);
}

.hint-status {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.hint-card.open .hint-status {
  color: var(--accent-green);
}

.hint-content {
  font-size: 0.95rem;
  line-height: 1.4;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
  margin-top: 4px;
}

.hint-card.locked .hint-content {
  color: var(--text-muted);
  filter: blur(4px);
  user-select: none;
}

/* 回答履歴 */
.history-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.guess-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  animation: slideIn 0.25s ease-out;
}

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

.guess-item.correct {
  background: rgba(0, 230, 118, 0.15);
  border: 1px solid var(--accent-green);
  color: var(--accent-green);
}

.guess-item.wrong {
  background: rgba(255, 82, 82, 0.12);
  border: 1px solid var(--accent-red);
  color: #ff8a80;
}

.guess-num {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* 回答セクション */
.answer-section {
  position: relative;
  margin-top: auto;
  padding-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.btn-link {
  background: transparent;
  border: none;
  color: var(--accent-cyan);
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: underline;
}

/* 4択選択肢ボタン */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.choice-btn {
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 8px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.choice-btn:hover:not(:disabled) {
  border-color: var(--accent-cyan);
  background: var(--bg-tertiary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.choice-btn:active:not(:disabled) {
  transform: scale(0.98);
}

/* キーボードショートカット数字バッジ */
.kb-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--accent-cyan);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
}

/* 50:50で除外された選択肢 */
.choice-btn.fifty-disabled {
  opacity: 0.25;
  filter: grayscale(1);
  cursor: not-allowed;
  border-style: dashed;
}

.choice-btn.wrong-choice {
  opacity: 0.35;
  background: rgba(255, 82, 82, 0.1);
  border-color: var(--accent-red);
  cursor: not-allowed;
  text-decoration: line-through;
}

/* サブアクション */
.action-buttons {
  display: flex;
  gap: 6px;
}

.btn-action-sub {
  flex: 1;
  height: 38px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action-sub:hover:not(:disabled) {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--accent-cyan);
}

.btn-fifty {
  color: #ffaa00;
  border-color: rgba(255, 170, 0, 0.4);
}

.btn-fifty:hover:not(:disabled) {
  border-color: #ffaa00;
  background: rgba(255, 170, 0, 0.15);
}

.btn-fifty.used {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: var(--border-color);
  color: var(--text-muted);
}

.btn-giveup {
  color: var(--accent-red);
}

/* ==========================================================================
   ★ 今日の体感難易度投票（Community Difficulty Poll）
   ========================================================================== */
.poll-section {
  background: rgba(10, 20, 38, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  text-align: left;
}

.poll-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.poll-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-primary);
}

.poll-badge {
  font-size: 0.65rem;
  background: rgba(0, 230, 118, 0.15);
  color: var(--accent-green);
  border: 1px solid var(--accent-green);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.poll-btn-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.btn-poll {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 6px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.btn-poll:hover {
  border-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.1);
  transform: translateY(-1px);
}

.poll-results-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.poll-result-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
}

.poll-res-lbl {
  width: 90px;
  flex-shrink: 0;
  color: var(--text-secondary);
  font-weight: 700;
}

.poll-res-bar-track {
  flex-grow: 1;
  height: 8px;
  background: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
}

.poll-res-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-hard { background: #ff007f; }
.bar-normal { background: #00f0ff; }
.bar-easy { background: #00e676; }

.poll-res-pct {
  width: 40px;
  text-align: right;
  font-weight: 800;
  color: var(--text-primary);
}

/* 直接テキスト入力 */
.text-input-wrapper {
  position: relative;
}

.input-box-wrapper {
  position: relative;
  display: flex;
  gap: 8px;
}

.guess-input {
  flex: 1;
  height: 50px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 0 16px;
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.guess-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-glow);
}

.btn-submit {
  height: 50px;
  padding: 0 20px;
  background: linear-gradient(135deg, var(--accent-cyan), #0099ff);
  border: none;
  border-radius: 12px;
  color: #050b14;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.suggestions-dropdown {
  position: absolute;
  bottom: 58px;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--accent-cyan);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 50;
  display: none;
}

.suggestions-dropdown.active {
  display: block;
}

.suggestion-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  transition: background 0.15s ease;
}

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

.suggestion-item:hover {
  background: var(--bg-tertiary);
  color: var(--accent-cyan);
}

/* サブアクション */
.action-buttons {
  display: flex;
  gap: 10px;
}

.btn-action-sub {
  flex: 1;
  height: 42px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action-sub:hover:not(:disabled) {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--accent-cyan);
}

.btn-giveup {
  color: var(--accent-red);
}

/* フッター */
.app-footer {
  text-align: center;
  padding: 14px;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.footer-link {
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 600;
}

/* モーダル */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 18, 0.85);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  cursor: pointer;
}

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

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 20px;
  max-width: 480px;
  width: 100%;
  padding: 24px;
  position: relative;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
  cursor: default;
}

.modal-card-lg {
  max-width: 520px;
}

@keyframes modalPop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  color: var(--text-secondary);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--bg-tertiary);
  color: #fff;
  border-color: var(--accent-cyan);
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 12px;
  text-align: center;
}

.round-score-badge {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--accent-gold);
  margin-bottom: 14px;
}

.result-target-box {
  text-align: center;
  margin-bottom: 16px;
}

.target-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.target-name {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--accent-cyan);
  margin: 4px 0 8px;
}

.target-exp {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
  border-radius: 8px;
  text-align: left;
}

.btn-primary-action {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent-cyan), #0099ff);
  border: none;
  border-radius: 12px;
  color: #050b14;
  font-weight: 900;
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.3);
}

.btn-primary-action:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

/* グランドリザルト特化スタイル */
.grand-score-box {
  background: var(--bg-primary);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  margin-bottom: 14px;
  border: 1px solid var(--border-color);
}

.grand-score-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  font-weight: 800;
}

.grand-score-val {
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent-cyan);
  margin: 4px 0;
  text-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

.grand-rank-title {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--accent-gold);
}

.grand-badge-pill {
  display: inline-block;
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 12px;
  margin-top: 6px;
}

.grand-time-text {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent-green);
  margin-top: 6px;
}

/* ごほうび・お叱りカード */
.feedback-card {
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
  animation: feedbackGlow 0.4s ease-out;
}

@keyframes feedbackGlow {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.feedback-reward {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(0, 240, 255, 0.1));
  border: 2px solid var(--accent-gold);
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.25);
}

.feedback-reward .feedback-title {
  color: var(--accent-gold);
}

.feedback-scold, .feedback-harsh {
  background: linear-gradient(135deg, rgba(255, 82, 82, 0.18), rgba(255, 0, 127, 0.1));
  border: 2px solid var(--accent-red);
  box-shadow: 0 0 25px rgba(255, 82, 82, 0.25);
}

.feedback-scold .feedback-title, .feedback-harsh .feedback-title {
  color: var(--accent-red);
}

.feedback-mild {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--text-secondary);
}

.feedback-mild .feedback-title {
  color: var(--text-primary);
}

.feedback-title {
  font-size: 1rem;
  font-weight: 900;
  margin-bottom: 6px;
}

.feedback-text {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.feedback-quote {
  font-size: 0.85rem;
  font-style: italic;
  font-weight: 700;
  color: var(--accent-cyan);
  border-left: 3px solid var(--accent-cyan);
  padding-left: 10px;
}

/* 5問サマリー一覧 */
.grand-section-label {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.grand-rounds-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.grand-summary-row {
  background: var(--bg-primary);
  padding: 8px 12px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.gsr-round {
  color: var(--accent-cyan);
  font-weight: 800;
  margin-right: 8px;
}

.gsr-target {
  font-weight: 700;
  color: var(--text-primary);
}

.gsr-status {
  font-weight: 800;
  color: var(--accent-gold);
}

/* カウントダウンタイマー */
.countdown-box {
  background: rgba(0, 240, 255, 0.08);
  border: 1px dashed var(--accent-cyan);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.countdown-lbl {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.countdown-val {
  font-size: 1.15rem;
  font-weight: 900;
  font-family: monospace;
  color: var(--accent-cyan);
  letter-spacing: 1px;
}

/* 絵文字マトリクス */
.share-code-box {
  background: rgba(0, 0, 0, 0.4);
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 14px;
}

.share-code-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-align: center;
}

.emoji-matrix-display {
  font-family: monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-primary);
  text-align: center;
  white-space: pre-wrap;
  word-break: break-all;
}

/* バイラルアクション群 */
.viral-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.btn-viral {
  padding: 12px 8px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-viral-cert {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.05));
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
}

.btn-viral-cert:hover {
  background: var(--accent-gold);
  color: #050b14;
}

.btn-viral-vs {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(0, 240, 255, 0.05));
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-viral-vs:hover {
  background: var(--accent-cyan);
  color: #050b14;
}

/* エンドレス誘導ボタン */
.btn-go-endless {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #ff007f, #7928ca);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(255, 0, 127, 0.3);
}

.btn-go-endless:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.share-buttons {
  display: flex;
  gap: 10px;
}

.btn-share {
  flex: 1;
  height: 48px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-share-x {
  background: #000;
  color: #fff;
  border: 1px solid #333;
}

.btn-share-copy {
  background: linear-gradient(135deg, var(--accent-cyan), #0099ff);
  color: #050b14;
}

.btn-close-footer {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 8px 20px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-close-footer:hover {
  color: #fff;
  border-color: var(--text-secondary);
}

/* ★実績トロフィー図鑑モーダル */
.trophy-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
}

.trophy-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s ease;
}

.trophy-card.unlocked {
  border-color: var(--accent-gold);
  background: rgba(255, 215, 0, 0.05);
}

.trophy-card.locked {
  opacity: 0.45;
  filter: grayscale(0.8);
}

.trophy-icon {
  font-size: 1.6rem;
}

.trophy-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-primary);
}

.trophy-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

.trophy-status {
  font-size: 0.7rem;
  font-weight: 700;
  margin-top: 4px;
  color: var(--accent-gold);
}

.trophy-card.locked .trophy-status {
  color: var(--text-muted);
}

/* 統計モーダル */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
}

.stat-box {
  background: var(--bg-primary);
  padding: 12px 6px;
  border-radius: 10px;
}

.stat-val {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--accent-cyan);
}

.stat-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* アーカイブ */
.archive-list {
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.archive-item {
  background: var(--bg-primary);
  padding: 10px 14px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.archive-info {
  display: flex;
  flex-direction: column;
}

.archive-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.archive-work {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.archive-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.archive-status {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.btn-sm {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--accent-cyan);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-sm:hover {
  background: var(--accent-cyan);
  color: #050b14;
}

/* ==========================================================================
   ★ 絵文字暗号モード（Emoji Clue Mode）専用スタイル
   ========================================================================== */
.emoji-clue-card {
  background: linear-gradient(135deg, rgba(255, 0, 128, 0.15) 0%, rgba(121, 40, 202, 0.25) 100%);
  border: 2px solid #ff0080;
  box-shadow: 0 0 25px rgba(255, 0, 128, 0.3);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  margin-bottom: 16px;
  animation: glowPulse 2s infinite ease-in-out;
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 15px rgba(255, 0, 128, 0.25); }
  50% { box-shadow: 0 0 30px rgba(255, 0, 128, 0.5); }
}

.emoji-clue-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #ff79c6;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.emoji-sequence-display {
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: 2.8rem;
  margin: 12px 0;
  user-select: none;
}

.emoji-bounce {
  display: inline-block;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.emoji-bounce:hover {
  transform: scale(1.3) rotate(8deg);
}

.emoji-clue-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   ★ オタク考察・みんなの感想掲示板（Spoiler-Free Community Board）
   ========================================================================== */
.community-board-section {
  background: rgba(10, 20, 38, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px;
  margin: 16px 0;
  text-align: left;
}

.community-board-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.community-board-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.community-board-badge {
  font-size: 0.65rem;
  background: rgba(255, 215, 0, 0.15);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.community-board-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.community-comments-list {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  padding-right: 4px;
}

.community-comment-bubble {
  background: var(--bg-primary);
  border-left: 3px solid var(--accent-cyan);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.8rem;
  line-height: 1.4;
}

.comment-top-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 0.7rem;
}

.comment-author {
  font-weight: 800;
  color: var(--accent-cyan);
}

.comment-badge {
  background: rgba(0, 240, 255, 0.1);
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 0.65rem;
  margin-left: 6px;
}

.comment-time {
  color: var(--text-muted);
}

.comment-body {
  color: var(--text-primary);
  word-break: break-word;
}

/* ネタバレ伏字タップ解除 */
.spoiler-blur {
  background: #333;
  color: transparent;
  user-select: none;
  cursor: pointer;
  padding: 1px 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: inline-block;
}

.spoiler-blur.revealed {
  background: rgba(0, 240, 255, 0.15);
  color: var(--accent-cyan);
  user-select: auto;
}

.community-form-row {
  display: flex;
  gap: 6px;
}

.community-input {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
}

.community-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.name-input {
  width: 90px;
  flex-shrink: 0;
}

.text-input {
  flex-grow: 1;
}

.btn-community-post {
  background: var(--accent-cyan);
  color: #050b14;
  border: none;
  border-radius: 6px;
  padding: 0 14px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.btn-community-post:hover {
  opacity: 0.9;
}

/* ==========================================================================
   ★ 過去問カレンダー（Archive Grid）
   ========================================================================== */
.archive-calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.archive-day-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.archive-day-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 240, 255, 0.15);
}

.archive-day-card.completed {
  border-color: var(--accent-gold);
  background: rgba(255, 215, 0, 0.05);
}

.adc-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.adc-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.adc-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}

.adc-badge.cleared {
  background: rgba(0, 240, 255, 0.2);
  color: var(--accent-cyan);
}

.adc-badge.unplayed {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

/* 管理者プレビューバー */
.admin-preview-bar {
  background: linear-gradient(90deg, #7c2d12, #991b1b);
  border: 1px solid #f87171;
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
  animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
  0%, 100% { border-color: #f87171; }
  50% { border-color: #fca5a5; }
}

.apb-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.apb-tag {
  background: #fff;
  color: #991b1b;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
}

.apb-info {
  font-size: 0.85rem;
  color: #fee2e2;
  font-weight: 600;
}

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

.btn-apb {
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-apb:hover {
  background: rgba(0, 0, 0, 0.7);
  border-color: #fff;
}

.btn-apb-exit {
  background: #1e293b;
  border-color: #475569;
}

/* デイリークリア完了カード（スマートホーム表示） */
.daily-completed-card {
  background: linear-gradient(135deg, rgba(26, 29, 46, 0.95), rgba(15, 17, 26, 0.95));
  border: 2px solid var(--accent-gold);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(255, 215, 0, 0.15);
  text-align: center;
}

.dcc-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
}

.dcc-icon {
  font-size: 2.2rem;
}

.dcc-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-gold);
  margin-bottom: 2px;
}

.dcc-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.dcc-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.dcc-stat-lbl {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dcc-stat-val {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.dcc-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.dcc-btn {
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
}

/* ★★★ ヒロインカードドロップ ＆ コレクションアルバム スタイル ★★★ */

/* レアリティバッジ */
.card-rarity-badge {
  font-size: 0.75rem;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  display: inline-block;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.rarity-sss {
  background: linear-gradient(135deg, #ff007f, #ffd700, #00f0ff);
  color: #fff;
  border: 1px solid #fff;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.8);
  animation: holo-shine 2s infinite linear;
}

.rarity-ssr {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #1a1100;
  border: 1px solid #ffe880;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

.rarity-sr {
  background: linear-gradient(135deg, #a855f7, #6366f1);
  color: #fff;
  border: 1px solid #c084fc;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.5);
}

.rarity-r {
  background: #334155;
  color: #cbd5e1;
  border: 1px solid #64748b;
}

@keyframes holo-shine {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

/* リザルト画面でのカードドロップ枠 */
.card-showcase-container {
  margin: 12px 0 14px;
  display: flex;
  justify-content: center;
}

.heroine-card {
  width: 220px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: #1e2238;
  border: 2px solid var(--accent-gold);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 18px rgba(255, 215, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.heroine-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.8), 0 0 25px rgba(255, 215, 0, 0.6);
}

.heroine-card.card-rarity-sss {
  border-color: #ffd700;
  box-shadow: 0 0 25px rgba(255, 0, 127, 0.5), 0 0 20px rgba(255, 215, 0, 0.5);
}

.heroine-card-img-wrap {
  width: 100%;
  height: 250px;
  position: relative;
  background: #0f111a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.heroine-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 12%;
  display: block;
}

.heroine-card-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
}

.heroine-card-body {
  padding: 8px 12px 10px;
  background: linear-gradient(180deg, rgba(26, 29, 46, 0.95), rgba(15, 17, 26, 0.98));
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.heroine-card-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.heroine-card-type {
  font-size: 0.7rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

/* アルバムフィルタータブ */
.album-filter-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.album-filter-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.album-filter-btn.active, .album-filter-btn:hover {
  background: var(--accent-cyan);
  color: #0f111a;
  border-color: var(--accent-cyan);
}

/* アルバムグリッド */
.album-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 12px;
  max-height: 55vh;
  overflow-y: auto;
  padding: 4px;
}

.album-card-item {
  border-radius: 10px;
  overflow: hidden;
  background: #161a29;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  transition: all 0.2s;
  cursor: pointer;
}

.album-card-item.unlocked:hover {
  transform: translateY(-2px);
  border-color: var(--accent-gold);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.album-card-item.locked {
  filter: grayscale(1);
  opacity: 0.5;
  cursor: not-allowed;
}

.aci-thumb-wrap {
  width: 100%;
  aspect-ratio: 3 / 4;
  position: relative;
  background: #0d1117;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.aci-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 12%;
  display: block;
}

.aci-locked-icon {
  font-size: 2rem;
  color: var(--text-muted);
}

.aci-info {
  padding: 6px 8px;
  background: rgba(15, 17, 26, 0.9);
}

.aci-name {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aci-rarity {
  font-size: 0.65rem;
  font-weight: 800;
}

/* スマホセーフエリア対応 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .hud-dashboard, .choice-grid {
    padding-bottom: calc(env(safe-area-inset-bottom) / 2);
  }
}

/* カード詳細インスペクター ＆ PC拡大表示 */
.inspect-media-container {
  width: 100%;
  max-height: 480px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: #090b10;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.inspect-media-container img,
.inspect-media-container video {
  width: 100%;
  max-height: 480px;
  object-fit: contain;
  display: block;
}

.btn-zoom-toggle {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: all 0.2s;
}

.btn-zoom-toggle:hover {
  background: rgba(0, 0, 0, 0.9);
  border-color: var(--accent-gold);
}

.inspect-media-container.zoomed {
  position: fixed;
  inset: 20px;
  max-height: calc(100vh - 40px);
  z-index: 1000;
  background: rgba(0, 0, 0, 0.95);
  border-color: var(--accent-gold);
}

.inspect-media-container.zoomed img,
.inspect-media-container.zoomed video {
  max-height: calc(100vh - 60px);
  object-fit: contain;
}

