#main {
  padding-top: 90px;
  padding-bottom: 40px;
}

#rnbo-root {
  width: 100%;
  max-width: 520px;
  margin: 0.5rem auto;
  padding: 0 1rem;
}

#rnbo-root .lab-header {
  text-align: center;
  border-bottom: 1px solid var(--color-border, #e5e5e5);
  margin-bottom: 0.75rem;
  padding-bottom: 0.6rem;
}

#rnbo-root .section-title {
  font-size: 1rem;
  margin: 0 0 0.1rem 0;
}

#rnbo-root .lab-meta {
  font-size: 0.7rem;
  margin: 0;
  letter-spacing: 0.1em;
  font-weight: 400;
  color: var(--color-text-muted, #666666);
}

#rnbo-root .icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

#rnbo-root .main-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 0.75rem 0;
}

#rnbo-root select {
  font-family: inherit;
  font-size: 0.75rem;
  background: transparent;
  border: 1px solid var(--color-border, #e5e5e5);
  border-radius: 999px;
  padding: 0.35em 0.7em;
  outline: none;
}

#rnbo-root .pill-btn {
  border-radius: 999px;
  padding: 0.35em 0.85em;
  font-size: 0.75rem;
}

#rnbo-root .circle-play-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  line-height: 1;
}

#rnbo-root button {
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-name, #000);
  background: transparent;
  border: 1px solid var(--color-name, #000);
  cursor: pointer;
  transition: all 0.2s ease;
}

#rnbo-root button:hover {
  background: var(--color-name, #000);
  color: #fff;
}

#rnbo-root button:active {
  opacity: 0.7;
}

#key-display-container {
  text-align: center;
  margin: 0.4rem auto;
}

#key-display-container span {
  font-size: 0.65rem;
  color: var(--color-text-muted, #666666);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 1px;
}

#current-key-display {
  font-family: var(--font-name, inherit);
  font-size: 1.4rem;
  margin: 0;
  font-weight: 400;
}

#result-status {
  text-align: center;
  margin: 0.2rem 0;
  font-size: 0.75rem;
  color: var(--color-text, #1a1a1a);
  min-height: 16px;
}

#rnbo-output-display {
  margin-top: 6px;
  padding: 6px 10px;
  border-top: 1px solid var(--color-border, #e5e5e5);
  display: flex;
  justify-content: space-around;
  font-size: 0.75rem;
  color: var(--color-text-muted, #666666);
}

#rnbo-output-display p {
  margin: 0;
}

#rnbo-root #out5-value, #rnbo-root #out6-value, #rnbo-root #out8-value {
  font-weight: 600;
  color: inherit;
}

#rnbo-root .hidden {
  display: none !important;
}

.keyboard-section-label {
  font-size: 0.65rem;
  color: var(--color-text-muted, #666);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 3px;
  display: block;
}

/* =========================================================
  Interactive Solfege Piano Keyboard (상대음)
  ========================================================= */
#rnbo-root #solfege-container {
  margin-top: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#rnbo-root .solfege-piano-keyboard {
  position: relative;
  display: flex;
  height: 85px;
  width: 240px;
  user-select: none;
}

#rnbo-root .solfege-btn.key {
  border: 1px solid var(--color-name, #000);
  border-radius: 0 0 3px 3px;
  cursor: pointer;
  outline: none;
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 4px;
  font-size: 8px;
  line-height: 1.1;
  transition: opacity 0.2s ease, background 0.2s ease;
}

#rnbo-root .solfege-btn.key.inactive {
  opacity: 0.25;
}

#rnbo-root .solfege-btn.key.white {
  width: 34.28px;
  height: 100%;
  background: transparent;
  color: var(--color-text-muted, #666);
  z-index: 1;
}

#rnbo-root .solfege-btn.key.white:active, #rnbo-root .solfege-btn.key.white.active {
  background: var(--color-border, #e5e5e5);
}

#rnbo-root .solfege-btn.key.black {
  width: 18px;
  height: 55%;
  background: var(--color-name, #000);
  color: #fff;
  position: absolute;
  z-index: 2;
  padding-bottom: 2px;
}

#rnbo-root .solfege-btn.key.black:active, #rnbo-root .solfege-btn.key.black.active {
  background: var(--color-text-muted, #666);
}

#rnbo-root .solfege-btn.c_sharp { left: 24px; }
#rnbo-root .solfege-btn.d_sharp { left: 58px; }
#rnbo-root .solfege-btn.f_sharp { left: 126px; }
#rnbo-root .solfege-btn.g_sharp { left: 160px; }
#rnbo-root .solfege-btn.a_sharp { left: 194px; }

/* =========================================================
  Absolute Piano Keyboard
  ========================================================= */
#rnbo-root #absolute-piano-container {
  margin-top: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#rnbo-root .absolute-piano-keyboard {
  position: relative;
  display: flex;
  height: 75px;
  width: 240px;
  user-select: none;
}

#rnbo-root .absolute-key.key {
  border: 1px solid var(--color-name, #000);
  border-radius: 0 0 3px 3px;
  cursor: pointer;
  outline: none;
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 3px;
  font-size: 8px;
}

#rnbo-root .absolute-key.key.white {
  width: 34.28px;
  height: 100%;
  background: #ffffff;
  color: var(--color-text-muted, #666);
  z-index: 1;
}

#rnbo-root .absolute-key.key.white:active {
  background: var(--color-border, #e5e5e5);
}

#rnbo-root .absolute-key.key.black {
  width: 18px;
  height: 55%;
  background: var(--color-name, #000);
  color: #fff;
  position: absolute;
  z-index: 2;
  padding-bottom: 2px;
}

#rnbo-root .absolute-key.key.black:active {
  background: var(--color-text-muted, #666);
}

#rnbo-root .absolute-key.c_sharp { left: 24px; }
#rnbo-root .absolute-key.d_sharp { left: 58px; }
#rnbo-root .absolute-key.f_sharp { left: 126px; }
#rnbo-root .absolute-key.g_sharp { left: 160px; }
#rnbo-root .absolute-key.a_sharp { left: 194px; }

/* =========================================================
  Settings & Settings Toggle
  ========================================================= */
#rnbo-root .settings-group {
  display: flex;
  justify-content: center;
  margin: 0.75rem 0;
  border-top: 1px solid var(--color-border, #e5e5e5);
  padding-top: 0.75rem;
}

#rnbo-root .toggle-label {
  display: flex;
  align-items: center;
  gap: 0.3em;
  font-size: 0.75rem;
  cursor: pointer;
}

#rnbo-root .toggle-label input[type="checkbox"] {
  accent-color: var(--color-name, #000);
  width: 12px;
  height: 12px;
}

/* =========================================================
  Volume Controls (완전 은닉형 서랍식 세로 패널)
  ========================================================= */
#rnbo-root #volume-controls {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%) translateX(0);
  padding: 0.8rem 0.6rem 0.8rem 0.8rem;
  border: 1px solid var(--color-border, #e5e5e5);
  border-right: none;
  border-radius: 8px 0 0 8px;
  background: #ffffff;
  box-shadow: -4px 0 12px rgba(0, 0, 0, 0.08);
  z-index: 999;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

#rnbo-root #volume-controls.collapsed {
  transform: translateY(-50%) translateX(100%);
}

#rnbo-root #volume-controls #volume-toggle-btn {
  position: absolute;
  left: -26px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 48px;
  padding: 0;
  border-radius: 6px 0 0 6px;
  border: 1px solid var(--color-border, #e5e5e5);
  border-right: none;
  background: #ffffff;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: -3px 0 6px rgba(0, 0, 0, 0.05);
}

#rnbo-root #volume-controls #volume-toggle-btn:hover {
  background: var(--color-border, #f5f5f5);
  color: #000;
}

#rnbo-root #volume-controls .volume-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

#rnbo-root #volume-controls h4 {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--color-text-muted, #666);
  margin: 0;
  text-transform: uppercase;
  text-align: center;
}

#rnbo-row-container {
  display: flex;
  gap: 8px;
}

#rnbo-root .volume-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
}

#rnbo-root .volume-row label {
  font-size: 0.65rem;
  color: var(--color-text-muted, #666);
  min-width: auto;
  text-align: center;
}

#rnbo-root .volume-row input[type="range"] {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 8px;
  height: 75px;
  accent-color: var(--color-name, #000);
  cursor: pointer;
}

#rnbo-root .volume-row span {
  font-size: 0.65rem;
  min-width: auto;
  text-align: center;
}

/* ==========================================================================
   Piano Reference Panel (볼륨 서랍식 패널 디자인 적용)
   ========================================================================== */
#piano-ref-panel {
  position: fixed;
  right: 0;
  top: 70%;
  transform: translateY(-50%) translateX(0);
  padding: 0.8rem 0.6rem 0.8rem 0.8rem;
  border: 1px solid var(--color-border, #e5e5e5);
  border-right: none;
  border-radius: 8px 0 0 8px;
  background: #ffffff;
  box-shadow: -4px 0 12px rgba(0, 0, 0, 0.08);
  z-index: 998;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  display: flex;
  align-items: center;
}

#piano-ref-panel.collapsed {
  transform: translateY(-50%) translateX(100%);
}

#piano-ref-toggle-btn {
  position: absolute;
  left: -26px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 48px;
  padding: 0;
  border-radius: 6px 0 0 6px;
  border: 1px solid var(--color-border, #e5e5e5);
  border-right: none;
  background: #ffffff;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: -3px 0 6px rgba(0, 0, 0, 0.05);
  color: var(--color-name, #000);
}

#piano-ref-toggle-btn:hover {
  background: var(--color-border, #f5f5f5);
  color: #000;
}

#piano-ref-panel #absolute-piano-container {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
}

/* ==========================================================================
   Fever/Speed Bonus (미니멀 인라인 스타일)
   ========================================================================== */
#speed-boost-flash,
#speed-boost-flash.speed-flash {
  display: none !important;
  margin: 0.4rem auto 0 auto;
  width: fit-content;
  text-align: center;
  opacity: 0;
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-name, #000);
  padding: 0.2em 0.7em;
  border-radius: 999px;
  border: 1px solid var(--color-border, #e5e5e5);
  background-color: transparent;
  box-shadow: none;
  pointer-events: none;
}

#speed-boost-flash.show:not(.hidden) {
  display: block !important;
  animation: simpleFadeIn 0.25s ease-out forwards;
}

@keyframes simpleFadeIn {
  0% {
    opacity: 0;
    transform: translateY(-2px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Rhythm Quiz Modal System (미니멀 톤앤매너 수정)
   ========================================================================== */
.modal-panel {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  display: flex; justify-content: center; align-items: center;
  z-index: 1000;
}

.modal-panel.hidden { display: none; }

.modal-content {
  background: #ffffff;
  color: var(--color-name, #000);
  border: 1px solid var(--color-border, #e5e5e5);
  padding: 20px 24px;
  border-radius: 12px;
  text-align: center;
  width: 320px;
  max-width: 90%;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.modal-content h3 {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0;
  margin-bottom: 12px;
  color: var(--color-name, #000);
}

.rhythm-input-wrapper {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
}

#rhythm-text-input {
  flex: 1;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--color-border, #e5e5e5);
  background: transparent;
  color: var(--color-name, #000);
  font-size: 0.85rem;
  text-align: center;
  outline: none;
}

#rhythm-replay-btn {
  padding: 0 14px;
  background: transparent;
  color: var(--color-name, #000);
  border: 1px solid var(--color-border, #e5e5e5);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

#rhythm-replay-btn:hover {
  background: var(--color-name, #000);
  color: #ffffff;
}

/* 퍼커션 라인 악보 UI */
.percussion-line-container {
  position: relative;
  width: 100%;
  height: 54px;
  background: #fafafa;
  border: 1px solid var(--color-border, #e5e5e5);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  overflow: hidden;
}

.percussion-line {
  position: absolute;
  width: 90%;
  height: 1px;
  background: var(--color-border, #ccc);
}

.percussion-notes {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 1.6rem;
  color: var(--color-name, #000);
}

.quiz-feedback {
  min-height: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  font-size: 0.75rem;
  color: var(--color-text-muted, #666);
  text-align: center;
}

.rhythm-actions {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.rhythm-actions button {
  flex: 1;
  padding: 6px 0;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--color-name, #000);
  background: transparent;
  color: var(--color-name, #000);
  cursor: pointer;
  transition: all 0.2s ease;
}

.rhythm-actions .primary-btn {
  background: var(--color-name, #000);
  color: #ffffff;
}

.rhythm-actions .primary-btn:hover {
  opacity: 0.85;
}

.rhythm-actions button:hover:not(.primary-btn) {
  background: var(--color-border, #e5e5e5);
}

/* 파일 맨 아래에 추가 */
.hidden-by-game {
  display: none !important;
}

/* 기존 .settings-group 규칙에 gap 한 줄 추가 (두 토글 사이 간격) */
#rnbo-root .settings-group {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 0.75rem 0;
  border-top: 1px solid var(--color-border, #e5e5e5);
  padding-top: 0.75rem;
}