/**
 * xxyun 录音室四轨节奏游戏样式 (4-Track Studio Rhythm Console)
 * 遵循浅色音乐录音室主题，温润优雅，不含刺眼闪光
 */

.rhythm-console-wrap {
  background: #FFFFFF;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sleeve);
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* 顶部机架状态与控制栏 */
.rhythm-rack-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 12px;
  gap: 8px;
  flex-wrap: wrap;
}

.rack-title-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rack-led-light {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #9F93A5;
  transition: background-color 0.3s ease;
}

.rack-led-light.active {
  background-color: #2F7C48;
  box-shadow: 0 0 6px rgba(47, 124, 72, 0.4);
}

.rack-title-text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--color-text);
  font-family: var(--font-latin);
}

.rhythm-rack-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rhythm-btn-small {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border-soft);
  background: var(--bg-studio);
  color: var(--color-text);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.rhythm-btn-small:hover {
  background: var(--color-lilac);
  border-color: var(--color-lilac-dark);
}

.rhythm-btn-small.btn-active {
  background: var(--color-rose);
  border-color: var(--color-rose-dark);
}

.rhythm-btn-small:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* 数据看板 (HUD Display) */
.rhythm-hud-bar {
  background: rgba(250, 244, 250, 0.85);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.hud-item {
  display: flex;
  flex-direction: column;
}

.hud-label {
  font-size: 10px;
  font-family: var(--font-latin);
  color: var(--color-text-subtle);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.hud-value {
  font-family: var(--font-latin);
  font-size: 18px;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.2;
}

/* 进度条 */
.rhythm-timeline-bar {
  width: 100%;
  height: 4px;
  background: rgba(81, 70, 87, 0.1);
  border-radius: 2px;
  margin-bottom: 12px;
  overflow: hidden;
}

.timeline-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--color-blue), var(--color-lilac), var(--color-rose));
  transition: width 0.1s linear;
}

/* 四轨主视口 (4-Track Viewport) */
.rhythm-track-viewport {
  position: relative;
  width: 100%;
  height: 380px;
  background: linear-gradient(to bottom, #FAF7FB 0%, #FFFFFF 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  box-shadow: inset 0 2px 8px rgba(81, 70, 87, 0.06);
  touch-action: manipulation;
}

/* 四条音轨 */
.rhythm-lane {
  position: relative;
  flex: 1;
  height: 100%;
  border-right: 1px solid rgba(142, 118, 153, 0.15);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.rhythm-lane:last-child {
  border-right: none;
}

.lane-key-header {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-latin);
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-subtle);
  opacity: 0.6;
}

/* 各轨道的底色氛围 */
.rhythm-lane.lane-0 { background: linear-gradient(to bottom, transparent 60%, rgba(225, 202, 230, 0.12) 100%); }
.rhythm-lane.lane-1 { background: linear-gradient(to bottom, transparent 60%, rgba(206, 223, 240, 0.12) 100%); }
.rhythm-lane.lane-2 { background: linear-gradient(to bottom, transparent 60%, rgba(239, 203, 216, 0.12) 100%); }
.rhythm-lane.lane-3 { background: linear-gradient(to bottom, transparent 60%, rgba(245, 230, 188, 0.12) 100%); }

.rhythm-lane.lane-active {
  background: rgba(225, 202, 230, 0.3) !important;
}

/* 判定线 (Judgment Line) */
.rhythm-judgment-line {
  position: absolute;
  bottom: 60px;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-lilac-dark), var(--color-rose-dark));
  box-shadow: 0 0 8px rgba(222, 164, 184, 0.5);
  z-index: 5;
  pointer-events: none;
}

.judgment-line-label {
  position: absolute;
  right: 10px;
  top: -18px;
  font-family: var(--font-latin);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--color-text-subtle);
  text-transform: uppercase;
}

/* 下落音符 (Note) */
.rhythm-note {
  position: absolute;
  left: 8px;
  right: 8px;
  height: 18px;
  border-radius: 6px;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(81, 70, 87, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.7);
  z-index: 4;
  will-change: transform;
}

.note-lane-0 { background: linear-gradient(135deg, #DFBEDE, #C8A2C7); }
.note-lane-1 { background: linear-gradient(135deg, #B9D4EB, #9AC0DC); }
.note-lane-2 { background: linear-gradient(135deg, #EAB7C7, #DC9AAB); }
.note-lane-3 { background: linear-gradient(135deg, #ECDCA5, #DEC985); }

/* 判定提示文字 (Judgment Feedback Toast) */
.rhythm-toast-box {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 10;
}

.judgment-text {
  font-family: var(--font-latin);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 1px;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.judgment-perfect {
  color: #8C47A3;
  text-shadow: 0 2px 8px rgba(140, 71, 163, 0.25);
}

.judgment-good {
  color: #2F7C48;
  text-shadow: 0 2px 8px rgba(47, 124, 72, 0.25);
}

.judgment-miss {
  color: #B23B3B;
  text-shadow: 0 2px 8px rgba(178, 59, 59, 0.25);
}

.judgment-text.show {
  opacity: 1;
  transform: scale(1.08);
}

.combo-streak-text {
  font-family: var(--font-latin);
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-light);
  margin-top: 4px;
}

/* 轨道底部的触控 / 击键按键区 (Touch & Key Target Buttons) */
.rhythm-keys-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.rhythm-key-btn {
  flex: 1;
  height: 52px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-latin);
  font-size: 16px;
  font-weight: 800;
  color: var(--color-text);
  box-shadow: 0 2px 6px rgba(81, 70, 87, 0.08);
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.08s ease, transform 0.08s ease;
  -webkit-tap-highlight-color: transparent;
}

.rhythm-key-btn span.key-sub {
  font-size: 10px;
  color: var(--color-text-subtle);
  font-weight: 600;
}

.rhythm-key-btn:active, .rhythm-key-btn.key-pressed {
  background: var(--color-lilac);
  transform: translateY(2px);
  border-color: var(--color-lilac-dark);
}

/* 未开始遮罩层与开始面板 */
.rhythm-overlay-screen {
  position: absolute;
  inset: 0;
  background: rgba(250, 244, 250, 0.95);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  border-radius: var(--radius-md);
  transition: opacity 0.25s ease;
}

.rhythm-overlay-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-vinyl-icon {
  width: 70px;
  height: 70px;
  margin-bottom: 16px;
}

.overlay-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
}

.overlay-sub {
  font-size: 13px;
  color: var(--color-text-light);
  max-width: 280px;
  line-height: 1.6;
  margin-bottom: 20px;
}

/* 结算面板 (Settlement Card) */
.settlement-card {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.settlement-card.show {
  display: flex;
}

.grade-badge-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-rose), var(--color-cream));
  border: 2px solid var(--color-rose-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-latin);
  font-size: 32px;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(222, 164, 184, 0.4);
}

.settlement-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: 260px;
  margin-bottom: 20px;
}

.settle-stat-item {
  background: #FFFFFF;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 8px 10px;
  text-align: center;
}

.settle-stat-item .stat-lbl {
  font-size: 11px;
  color: var(--color-text-subtle);
  font-family: var(--font-latin);
}

.settle-stat-item .stat-num {
  font-size: 15px;
  font-weight: 800;
  color: var(--color-text);
  font-family: var(--font-latin);
}

/* 免责声明提示 */
.rhythm-disclaimer {
  font-size: 11px;
  color: var(--color-text-subtle);
  line-height: 1.5;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-soft);
  text-align: center;
}

/* 减少动画模式适配 */
@media (prefers-reduced-motion: reduce) {
  .judgment-text.show {
    transform: none !important;
  }
}
