/* ── Shared help modals (tutorial + glossary) ── */
.rakuen-tutorial-overlay,
.glossary-overlay,
body.machine-game-body .tutorial-overlay.mg-help-overlay,
body.machine-game-body .glossary-overlay.mg-help-overlay {
  position: fixed;
  inset: 0;
  z-index: 21060;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.rakuen-tutorial-overlay.active,
.glossary-overlay.active,
body.machine-game-body .tutorial-overlay.mg-help-overlay.active,
body.machine-game-body .glossary-overlay.mg-help-overlay.active {
  display: flex;
}

.rakuen-tutorial-card,
.rakuen-help-card,
body.machine-game-body .tutorial-overlay .tutorial-card,
body.machine-game-body .glossary-overlay .rakuen-help-card {
  width: min(480px, 100%);
  max-height: min(88vh, 640px);
  overflow-y: auto;
  padding: 28px 24px 22px;
  border-radius: var(--radius-lg, 18px);
  background: linear-gradient(180deg, rgba(30, 22, 38, 0.98) 0%, rgba(18, 12, 28, 0.98) 100%);
  border: 1px solid var(--line-gold, #d4af37);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 24px rgba(212, 175, 55, 0.15);
  color: #fff8f0;
}

.rakuen-tutorial-card h2,
.rakuen-help-card h2,
.rakuen-help-card h3,
body.machine-game-body .tutorial-card h2,
body.machine-game-body .rakuen-help-card h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
  color: var(--gold, #fbbf24);
  line-height: 1.3;
}

.rakuen-tutorial-card .sub,
.rakuen-help-card .sub,
body.machine-game-body .tutorial-card .sub {
  margin: 0 0 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.5;
}

.rakuen-help-step,
.rakuen-tutorial-step,
body.machine-game-body .tutorial-step {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  animation: rakuen-help-fade-in 0.35s ease;
}

.rakuen-help-step:last-of-type,
.rakuen-tutorial-step:last-of-type,
body.machine-game-body .tutorial-step:last-of-type {
  border-bottom: 0;
}

@keyframes rakuen-help-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rakuen-help-step .num,
.rakuen-tutorial-step .num,
body.machine-game-body .tutorial-step .num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  background: rgba(251, 191, 36, 0.2);
  color: var(--gold, #fbbf24);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.rakuen-help-step .title,
.rakuen-tutorial-step .title,
.rakuen-tutorial-step .content .title,
body.machine-game-body .tutorial-step .content .title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  color: #fff8f0;
}

.rakuen-help-step .desc,
.rakuen-tutorial-step .desc,
.rakuen-tutorial-step .content .desc,
body.machine-game-body .tutorial-step .content .desc {
  font-size: 12px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
}

.rakuen-help-progress {
  margin: 8px 0 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(251, 191, 36, 0.85);
  text-align: center;
}

.rakuen-help-step-host {
  min-height: 72px;
}

.rakuen-tutorial-actions,
.rakuen-help-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.rakuen-tutorial-skip,
body.machine-game-body .rakuen-tutorial-skip {
  flex: 1;
  min-width: 100px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 600;
  cursor: pointer;
}

.rakuen-tutorial-close,
.rakuen-help-close,
body.machine-game-body .tutorial-close {
  flex: 2;
  min-width: 140px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, #ffb627, #ff8c00);
  color: #2a1038;
  font-weight: 800;
  cursor: pointer;
}

.rakuen-tutorial-close:hover,
.rakuen-help-close:hover,
body.machine-game-body .tutorial-close:hover {
  filter: brightness(1.05);
}

.rakuen-topbar-tutorial-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-right: 8px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}

.rakuen-topbar-tutorial-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* ── Glossary list (tutorial-style rows) ── */
.rakuen-help-card__body {
  overflow-y: auto;
  max-height: min(50vh, 360px);
  margin: 0 -4px;
  padding: 0 4px;
}

.rakuen-help-glossary-row {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.rakuen-help-glossary-row:last-child {
  border-bottom: 0;
}

.rakuen-help-glossary-row .num {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(251, 191, 36, 0.9);
  padding-top: 2px;
}

.rakuen-help-glossary-row .jp {
  font-size: 15px;
  font-weight: 700;
  color: #fff8f0;
}

.rakuen-help-glossary-row .yomi {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  margin: 2px 0 4px;
}

.rakuen-help-glossary-row .mean {
  font-size: 13px;
  color: var(--gold, #fbbf24);
  font-weight: 600;
}

.rakuen-help-empty,
.glossary-empty {
  padding: 24px 12px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
}

/* ── Glossary search page (light theme) ── */
.rakuen-glossary-page {
  position: relative;
  z-index: 1;
}

.rakuen-glossary-hero {
  text-align: center;
  margin-bottom: 24px;
}

.rakuen-glossary-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  margin-bottom: 8px;
}

.rakuen-glossary-sub {
  color: var(--rakuen-ink-muted, #8b4a6b);
  margin: 0;
}

.rakuen-glossary-search {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 640px;
  margin: 0 auto 28px;
}

.rakuen-glossary-search input[type="search"] {
  flex: 1 1 200px;
  min-width: 0;
  padding: 12px 16px;
  border-radius: 999px;
  border: 2px solid var(--rakuen-border-pink, #ffc6dd);
  background: rgba(255, 255, 255, 0.92);
}

.rakuen-glossary-count {
  font-size: 13px;
  color: var(--rakuen-ink-muted);
  margin-bottom: 12px;
}

.rakuen-glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.rakuen-glossary-card {
  padding: 16px;
  border-radius: var(--rakuen-radius-md, 14px);
  background: var(--rakuen-card, rgba(255, 255, 255, 0.92));
  border: 1px solid var(--rakuen-border, rgba(255, 117, 171, 0.28));
  box-shadow: var(--rakuen-shadow-soft);
}

.rakuen-glossary-card__cat {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--rakuen-pink-deep, #c41e6a);
  margin-bottom: 6px;
}

.rakuen-glossary-card__jp {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 4px;
}

.rakuen-glossary-card__yomi {
  font-size: 12px;
  color: var(--ink-2, #8b4a6b);
  margin: 0 0 8px;
}

.rakuen-glossary-card__kr {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.rakuen-glossary-card__key {
  display: block;
  margin-top: 8px;
  font-size: 10px;
  opacity: 0.5;
}

.rakuen-glossary-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--rakuen-ink-muted);
}
