.rg-module {
  max-width: 520px;
  margin: 0 auto;
  padding: 8px 0 24px;
}

.rg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.rg-header h2 { margin: 0; font-size: 1.35rem; color: var(--primary); }

.rg-back {
  font-family: inherit; font-size: 0.88rem; font-weight: 600;
  color: var(--primary); background: var(--primary-light);
  border: none; border-radius: 999px; padding: 8px 16px; cursor: pointer;
}

.rg-back:hover { background: #e8e0ff; }

.rg-intro {
  font-size: 0.88rem; color: var(--text-light);
  margin-bottom: 12px; line-height: 1.5;
}

.rg-practice-toggle {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.85rem; color: var(--text);
  margin-bottom: 14px; padding: 10px 14px;
  background: #f8f5ff; border-radius: 12px;
  cursor: pointer; line-height: 1.45;
}

.rg-practice-toggle input {
  margin-top: 3px; accent-color: var(--primary);
  width: 16px; height: 16px; flex-shrink: 0;
}

.rg-level-list { display: flex; flex-direction: column; gap: 12px; }

.rg-level-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 16px;
  background: #fff; border: 2px solid #f0ebff;
  cursor: pointer; text-align: left; font-family: inherit;
  transition: border-color 0.15s, transform 0.15s;
}

.rg-level-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.rg-level-emoji { font-size: 2rem; flex-shrink: 0; }

.rg-level-info { flex: 1; min-width: 0; }

.rg-level-info h3 { margin: 0 0 4px; font-size: 1.05rem; color: var(--text); }

.rg-level-info p { margin: 0; font-size: 0.82rem; color: var(--text-light); }

.rg-level-grade {
  font-size: 1.1rem; font-weight: 800; color: var(--accent);
  min-width: 28px; text-align: center;
}

.rg-play {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.rg-play.active { display: flex; }

.rg-menu.hidden { display: none; }

.rg-bpm {
  font-size: 0.85rem; color: var(--text-light); font-weight: 600;
}

.rg-beat-bar {
  display: flex; gap: 6px; justify-content: center;
  flex-wrap: wrap; max-width: 320px; min-height: 28px;
}

.rg-beat-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #e0daf0; transition: background 0.15s, transform 0.15s;
}

.rg-beat-dot.upcoming { background: var(--primary-light); }
.rg-beat-dot.perfect { background: #4cd964; transform: scale(1.2); }
.rg-beat-dot.good { background: #ffb347; }
.rg-beat-dot.miss { background: #ff6b6b; }

.rg-stage {
  position: relative;
  width: min(100%, 280px);
  aspect-ratio: 1;
  border-radius: 24px;
  background: linear-gradient(160deg, #fff5e6 0%, #f0ebff 100%);
  border: 3px solid #f0ebff;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: manipulation;
}

.rg-mascot {
  font-size: 4.5rem;
  transition: transform 0.08s ease-out;
  pointer-events: none;
}

.rg-stage.pulse {
  border-color: var(--primary);
  box-shadow: 0 0 0 6px rgba(124, 92, 255, 0.25);
}

.rg-beat-dot.next {
  background: var(--primary);
  transform: scale(1.35);
  box-shadow: 0 0 8px rgba(124, 92, 255, 0.5);
}
.rg-mascot.hit { transform: scale(1.15); }
.rg-mascot.miss { transform: scale(0.9) rotate(-8deg); }

.rg-countdown {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem; font-weight: 800; color: var(--primary);
  background: rgba(255,255,255,0.75);
  border-radius: 21px;
}

.rg-countdown.hidden { display: none; }

.rg-judge {
  font-size: 1.25rem; font-weight: 800; min-height: 1.6em;
  color: var(--primary);
}

.rg-judge.perfect { color: #e89420; }
.rg-judge.good { color: #4cd964; }
.rg-judge.miss { color: #ff6b6b; }

.rg-hud {
  display: flex; gap: 20px; font-size: 0.9rem; font-weight: 700;
  color: var(--text-light);
}

.rg-tap-hint {
  font-size: 0.82rem; color: var(--text-light);
  text-align: center;
}

.rg-result {
  text-align: center; padding: 16px 0;
}

.rg-result .emoji { font-size: 3rem; display: block; margin-bottom: 8px; }

.rg-result h3 { margin: 0 0 8px; color: var(--primary); font-size: 1.3rem; }

.rg-result p { color: var(--text-light); margin: 0 0 16px; line-height: 1.6; }

.rg-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.rg-btn {
  font-family: inherit; font-size: 0.92rem; font-weight: 700;
  padding: 12px 22px; border: none; border-radius: 999px; cursor: pointer;
}

.rg-btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
}

.rg-btn-secondary {
  background: var(--primary-light); color: var(--primary);
}

.rg-btn-share {
  background: linear-gradient(135deg, #ffb347, #e89420);
  color: #fff;
}
