/* ===========================
   SEO Guide Pages
   (lyrics-typing, typing-guide, kids-typing-guide)
   =========================== */

.guide-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem 4rem;
}

/* Hero */
.guide-hero {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
}

.guide-hero-image {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  max-height: 300px;
  object-fit: cover;
  width: 100%;
}

.guide-hero-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.guide-hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Date */
.guide-date {
  font-size: 0.8rem;
  color: var(--text-muted, #888);
  text-align: center;
  margin-bottom: 0.5rem;
}

/* Table of Contents */
.guide-toc {
  background: var(--card-bg, #2a2a3a);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.5rem;
}

.guide-toc-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-color, #e0e0e0);
  margin-bottom: 0.75rem;
}

.guide-toc ol {
  margin: 0;
  padding-left: 1.25rem;
}

.guide-toc li {
  margin-bottom: 0.375rem;
}

.guide-toc a {
  font-size: 0.85rem;
  color: var(--text-muted, #aaa);
  text-decoration: none;
  transition: color 0.2s;
}

.guide-toc a:hover {
  color: var(--accent, #4a9eff);
}

/* Sections */
.guide-section {
  margin-bottom: 2.5rem;
}

.guide-section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.375rem;
  border-bottom: 2px solid var(--accent, #4a9eff);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.guide-section-title i {
  color: var(--accent, #4a9eff);
  font-size: 1.1rem;
}

/* Subsections */
.guide-subsection {
  margin-bottom: 1.5rem;
}

.guide-subsection-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.guide-subsection-title i {
  color: var(--accent, #4a9eff);
  font-size: 0.95rem;
}

.guide-text {
  font-size: 0.925rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

/* Steps */
.guide-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.guide-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--card-bg, #2a2a3a);
  border-radius: 12px;
  padding: 1.25rem;
}

.guide-step-number {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent, #4a9eff);
  color: #fff;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1.1rem;
}

.guide-step-content h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.guide-step-content p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0;
}

/* Feature cards */
.guide-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.guide-feature-card {
  background: var(--card-bg, #2a2a3a);
  border-radius: 12px;
  padding: 1.25rem;
}

.guide-feature-card i {
  font-size: 1.5rem;
  color: var(--accent, #4a9eff);
  margin-bottom: 0.5rem;
  display: block;
}

.guide-feature-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

.guide-feature-card p {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

/* CTA */
.guide-cta {
  text-align: center;
  padding: 2rem;
  background: var(--card-bg, #2a2a3a);
  border-radius: 12px;
  margin-bottom: 2.5rem;
}

.guide-cta h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.guide-cta p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.guide-cta-button {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--accent, #4a9eff);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: opacity 0.2s;
}

.guide-cta-button:hover {
  opacity: 0.85;
  color: #fff;
  text-decoration: none;
}

/* FAQ */
.guide-faq {
  margin-bottom: 2rem;
}

.guide-faq-item {
  border-bottom: 1px solid var(--border-color, #333);
  padding: 1rem 0;
}

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

.guide-faq-question {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

.guide-faq-question::before {
  content: "Q. ";
  color: var(--accent, #4a9eff);
  font-weight: 700;
}

.guide-faq-answer {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.guide-faq-answer::before {
  content: "A. ";
  color: var(--accent, #4a9eff);
  font-weight: 600;
}

/* Related links */
.guide-related {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color, #333);
}

.guide-related-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--border-color, #333);
  background: var(--card-bg, #2a2a3a);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.guide-related-link:hover {
  border-color: var(--accent, #4a9eff);
  color: var(--accent, #4a9eff);
  text-decoration: none;
}

/* Inline CTA (mid-article) */
.guide-inline-cta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--card-bg, #2a2a3a);
  border-radius: 8px;
  border-left: 3px solid var(--accent, #4a9eff);
  margin: 1rem 0;
}

.guide-inline-cta i {
  color: var(--accent, #4a9eff);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.guide-inline-cta a {
  color: var(--accent, #4a9eff);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.guide-inline-cta a:hover {
  text-decoration: underline;
}

/* Romaji comparison table */
.guide-romaji-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.guide-romaji-table th {
  background: var(--card-bg, #2a2a3a);
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-color, #333);
}

.guide-romaji-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-color, #333);
  color: var(--text-secondary);
}

.guide-romaji-table s {
  color: var(--text-tertiary, #888);
}

.guide-romaji-table strong {
  color: var(--accent, #4a9eff);
}

/* ===========================
   Guide Practice (Mini Typing Drill)
   =========================== */

.gp-skip-hint {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: #666;
}

.gp-skip-hint kbd {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border: 1px solid #555;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.7rem;
  color: #aaa;
  background: #222;
  margin: 0 0.15rem;
}

.gp-container {
  margin: 2rem 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color, #333);
}

.gp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--card-bg, #2a2a3a);
  border-bottom: 1px solid var(--border-color, #333);
}

.gp-stage-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.gp-stage-selector {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.gp-stage-btn {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border-color, #333);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.gp-stage-btn:hover,
.gp-stage-btn.active {
  border-color: var(--accent, #4a9eff);
  color: var(--accent, #4a9eff);
}

/* Play area */
.gp-play-area {
  background: #111;
  padding: 2rem 1.5rem;
  min-height: 200px;
  position: relative;
  display: none;
}

.gp-countdown {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0,0,0,0.8);
  z-index: 10;
}

.gp-miss-flash {
  position: absolute;
  inset: 0;
  background: rgba(239,68,68,0.15);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
  z-index: 5;
}

.gp-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: #aaa;
}

.gp-timer {
  font-family: monospace;
  font-size: 1.1rem;
  color: #ffc107;
  font-weight: 600;
}

.gp-main-text {
  font-size: 1.5rem;
  font-family: monospace, system-ui;
  letter-spacing: 0.05em;
  line-height: 2;
  text-align: center;
  margin-bottom: 0.75rem;
  min-height: 2.5rem;
  word-break: break-all;
}

.gp-typed { color: var(--typing-typed, #0099CC); }
.gp-current {
  color: #fff;
  background: rgba(var(--typing-typed-rgb, 0,153,204), 0.3);
  border-bottom: 2px solid var(--typing-typed, #0099CC);
}
.gp-untyped { color: #555; }

.gp-sub-text {
  text-align: center;
  font-size: 1rem;
  color: #888;
  margin-bottom: 1.5rem;
  min-height: 1.5rem;
}

.gp-progress-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gp-progress-wrap {
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}

.gp-progress-phrase {
  height: 100%;
  background: var(--progress-phrase, #17a2b8);
  border-radius: 2px;
  transition: width 0.1s;
  width: 0%;
}

.gp-progress-song {
  height: 100%;
  background: var(--progress-song, #ffc107);
  border-radius: 2px;
  transition: width 0.1s;
  width: 0%;
}

/* Keyboard Guide (finger hint below play area) */
.gp-keyboard-guide {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* 左右の手ラベル */
.gp-kb-hand-labels {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 2px;
  /* ラベル幅をキーボード幅に合わせる: 10キー * 42px + 9gap * 4px + 手境界8px = 464px */
  width: 464px;
}

.gp-kb-hand-label {
  flex: 1;
  text-align: center;
  font-size: 0.7rem;
  color: #666;
  font-weight: 600;
}

.gp-kb-hand-label:first-child {
  padding-right: 4px;
}

.gp-kb-hand-label:last-child {
  padding-left: 4px;
}

.gp-kb-row {
  display: flex;
  gap: 4px;
  justify-content: center;
}

/* 左右の手の境界（T-Y / G-H / B-N 間に隙間） */
.gp-kb-row .gp-kb-key:nth-child(5) {
  margin-right: 8px;
}

.gp-kb-row-home {
  padding-left: 20px;
}

.gp-kb-row-bottom {
  padding-left: 36px;
}

/* 未使用キー（グレーアウト） */
.gp-kb-key {
  position: relative;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: #1e1e1e;
  color: #333;
  font-size: 14px;
  font-weight: 700;
  font-family: system-ui, -apple-system, sans-serif;
  border: 1px solid #2a2a2a;
  transition: background 0.12s, transform 0.12s, box-shadow 0.12s, border-color 0.12s, color 0.12s;
  user-select: none;
}

/* ホームポジションキー（指を置く場所の目印 = キーボードの突起再現） */
.gp-kb-key.gp-kb-home {
  border-bottom: 3px solid #888;
}

.gp-kb-key.gp-kb-home::after {
  content: "";
  position: absolute;
  bottom: 4px;
  width: 8px;
  height: 2px;
  border-radius: 1px;
  background: #888;
}

/* ステージで使うキー（指の色で常時着色） */
.gp-kb-key.gp-kb-zone {
  background: var(--finger-color, #2a2a2a);
  color: #ddd;
  border-color: rgba(255,255,255,0.08);
}

.gp-kb-key.gp-kb-zone.gp-kb-home {
  border-bottom: 3px solid rgba(255,255,255,0.45);
}

.gp-kb-key.gp-kb-zone.gp-kb-home::after {
  background: rgba(255,255,255,0.45);
}

/* 次に押すべきキー（白ハイライト） */
.gp-kb-key.gp-kb-next {
  background: #fff !important;
  color: #111 !important;
  transform: scale(1.18);
  box-shadow: 0 0 16px 4px rgba(255,255,255,0.45);
  border-color: transparent !important;
  z-index: 1;
}

/* 代替入力キー（白枠線） */
.gp-kb-key.gp-kb-alt {
  border: 2px solid rgba(255,255,255,0.6) !important;
  color: #ddd;
}

/* 正解フラッシュ（緑） */
.gp-kb-key.gp-kb-correct {
  background: #22c55e !important;
  color: #fff !important;
  transform: scale(1.1);
  box-shadow: 0 0 10px 2px rgba(34,197,94,0.5);
  border-color: transparent !important;
}

/* ミスフラッシュ（赤） */
.gp-kb-key.gp-kb-miss {
  background: #ef4444 !important;
  color: #fff !important;
  transform: scale(1.08);
  box-shadow: 0 0 8px 1px rgba(239,68,68,0.5);
  border-color: transparent !important;
}

.gp-finger-name {
  margin-top: 0.6rem;
  font-size: 0.95rem;
  color: var(--finger-color, #aaa);
  font-weight: 600;
  min-height: 1.4em;
  text-align: center;
}

/* Start button area */
.gp-start-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  background: #111;
}

.gp-start-btn {
  padding: 0.75rem 2.5rem;
  background: var(--accent, #4a9eff);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.gp-start-btn:hover { opacity: 0.85; }

.gp-start-hint {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: #888;
}

/* Result area */
.gp-result-area {
  display: none;
  background: #111;
  padding: 2rem 1.5rem;
}

.gp-rank-display {
  text-align: center;
  margin-bottom: 1.5rem;
}

.gp-rank-text {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--result-gradient-1, #ff6b9d), var(--result-gradient-2, #c46dff));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 本番と同じ: 全ランク統一グラデーション */

.gp-scores-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.gp-score-item label {
  display: block;
  font-size: 0.75rem;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.gp-score-item .value {
  font-size: 1.3rem;
  font-weight: 700;
}

.gp-label-hint {
  font-size: 0.65rem;
  color: #777;
  margin-top: -0.125rem;
  margin-bottom: 0.25rem;
}

.gp-score-color { color: var(--result-score, #e5456f); }
.gp-miss-color { color: var(--result-miss, #7840f4); }
.gp-acc-color { color: var(--result-accuracy, #01a89d); }

.gp-extra-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.gp-extra-stats label {
  display: block;
  font-size: 0.7rem;
  color: #888;
  text-transform: uppercase;
}

.gp-extra-stats .value {
  font-size: 1rem;
  font-weight: 600;
  color: #ccc;
}

/* Score explanation */
.gp-explain {
  border-top: 1px solid #333;
  padding-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.gp-explain-title {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 1rem;
}

.gp-explain-item {
  margin-bottom: 1rem;
}

.gp-explain-item strong {
  display: block;
  font-size: 0.9rem;
  color: #e0e0e0;
  margin-bottom: 0.25rem;
}

.gp-explain-item p {
  font-size: 0.8rem;
  line-height: 1.6;
  color: #999;
  margin: 0;
}

/* Result actions */
.gp-result-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.gp-action-btn {
  padding: 0.625rem 1.5rem;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s;
}

.gp-action-btn:hover { opacity: 0.85; }

.gp-action-primary {
  background: var(--accent, #4a9eff);
  color: #fff;
}

.gp-action-secondary {
  background: #333;
  color: #ccc;
}

/* Responsive */
@media (max-width: 768px) {
  .guide-hero {
    padding: 1.5rem 0.5rem 1rem;
  }

  .guide-hero-title {
    font-size: 1.35rem;
  }

  .guide-features {
    grid-template-columns: 1fr;
  }

  .guide-step {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .gp-main-text {
    font-size: 1.15rem;
  }

  .gp-scores-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .gp-extra-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .gp-stage-selector {
    display: none;
  }

  .gp-desktop-only {
    display: none;
  }

  .gp-mobile-message {
    display: block;
  }
}

/* スキップ通知 */
.gp-skip-notice {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 193, 7, 0.9);
  color: #111;
  padding: 0.5rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 8;
  pointer-events: none;
}

/* IMEガイドオーバーレイ */
.gp-ime-guide {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.gp-ime-guide-content {
  max-width: 400px;
  text-align: center;
}

.gp-ime-guide-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffc107;
  margin-bottom: 1rem;
}

.gp-ime-guide-title i {
  margin-right: 0.375rem;
}

.gp-ime-guide-text {
  font-size: 0.9rem;
  color: #ccc;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.gp-ime-guide-steps {
  text-align: left;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.gp-ime-guide-steps p {
  font-size: 0.85rem;
  color: #ddd;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.gp-ime-guide-steps p:last-child {
  margin-bottom: 0;
}

.gp-ime-guide-steps kbd {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border: 1px solid #666;
  border-radius: 4px;
  font-family: system-ui, sans-serif;
  font-size: 0.8rem;
  color: #fff;
  background: #333;
}

/* 正解時フラッシュ */
.gp-correct-flash .gp-typed {
  text-shadow: 0 0 8px rgba(var(--typing-typed-rgb, 0,153,204), 0.6);
}

/* モバイル向けメッセージ（デスクトップでは非表示） */
.gp-mobile-message {
  display: none;
  text-align: center;
  padding: 1.5rem;
  background: var(--card-bg, #2a2a3a);
  border-radius: 12px;
  margin: 2rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.gp-mobile-message i {
  margin-right: 0.375rem;
}

/* sr-only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
