/* --- Audio Player (Flat Industrial: Walkman x DAW) --- */
.sekai-audio-player {
  --player-bg: #1e1e24;       /* Deep matte chassis */
  --screen-bg: #0a0a0c;       /* Pitch black screen */
  --accent-on: #ff5500;       /* Walkman Orange / Rec Red */
  --accent-dim: #552b11;
  --text-main: #d0d0d0;
  --text-dim: #96969a;
  --border-color: #333333;

  display: flex;
  gap: 0; /* Seamless modular design */
  background-color: var(--player-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden; /* Contain inner borders */
  margin: 12px 0;
  width: fit-content;
  min-width: 400px;
  min-height: 120px;
  font-family: 'JetBrains Mono', 'Consolas', monospace; /* Monospaced for tech feel */
  user-select: none;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Common Borders */
.sekai-audio-player > div {
  border-right: 1px solid var(--border-color);
}
.sekai-audio-player > div:last-child {
  border-right: none;
}

/* 1. Console Fader Module */
.sekai-console-module {
  width: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #232329;
  position: relative;
  padding: 8px 0;
}

/* Fader Scale Markings */
.sekai-fader-scale {
  position: absolute;
  top: 13px; bottom: 13px;
  left: 8px;
  width: 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}
.sekai-fader-tick {
  width: 100%; height: 1px; background: #444;
}
.sekai-fader-tick.major { width: 200%; background: #666; }

.sekai-fader-track {
  width: 4px;
  height: 70px;
  background: #111;
  border-radius: 2px;
  position: relative;
}

:is(.sekai-fader-track, .sekai-tape-scrubber, .sekai-audio-progress-bar):focus-visible {
  outline: 2px solid #d1c1f2;
  outline-offset: 4px;
}

.sekai-fader-cap {
  position: absolute;
  left: 50%;
  /* top set by JS */
  transform: translateX(-50%) translateY(-50%);
  width: 24px;
  height: 12px;
  background: #888;
  border-radius: 1px;
  cursor: grab;
  /* Flat Indent line */
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
}
.sekai-fader-cap::after {
  content: ''; width: 100%; height: 1px; background: #222;
}
.sekai-fader-cap:active {
  background: #ccc;
  cursor: grabbing;
}


/* 2. Main Screen Module (Tape + DAW) */
.sekai-audio-content {
  flex: 1;
  background: var(--screen-bg);
  display: flex;
  flex-direction: column;
  position: relative;
  min-width: 240px;
}

/* Top Bar: Status + Track Info + Time */
.sekai-screen-meta {
  height: 20px;
  border-bottom: 1px solid #222;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  font-size: 10px;
  color: var(--text-dim);
  gap: 8px;
  overflow: hidden;
}

/* Status Indicator (LED + STEREO) */
.sekai-status-indicator {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.sekai-status-text {
  font-size: 9px;
  letter-spacing: 1px;
}

.sekai-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #333;
  flex-shrink: 0;
}

.sekai-led.active {
  background: var(--accent-on);
  box-shadow: 0 0 4px var(--accent-on);
}

/* Track Info (Title - Artist) */
.sekai-track-info {
  display: flex;
  gap: 6px;
  align-items: center;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.sekai-track-title {
  font-size: 11px;
  font-weight: 600;
  color: #eee;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}

.sekai-track-artist {
  font-size: 9px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.7;
  flex-shrink: 2;
}

.sekai-track-artist::before {
  content: '- ';
}

/* Center: Visualizer & Tape Overlay */
.sekai-viz-area {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Tape Reels (Background) */
.sekai-tape-mechanism {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  opacity: 0.2; /* Subtle background mechanism */
  pointer-events: none;
}
.sekai-reel {
  width: 48px; height: 48px;
  border: 4px solid #444;
  border-radius: 50%;
  position: relative;
}
.sekai-reel::before, .sekai-reel::after {
  content: ''; position: absolute; background: #444;
  top: 50%; left: 0; right: 0; height: 2px;
}
.sekai-reel::after { transform: rotate(90deg); }
.sekai-audio-player.playing .sekai-reel {
  animation: reel-spin 4s linear infinite;
}
@keyframes reel-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Waveform Bars (Foreground) */
.sekai-audio-visualizer-bars {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end; /* DAW style: ground up */
  gap: 2px;
  height: 30px;
}
.sekai-viz-bar {
  width: 3px;
  background: #333;
  height: 100%;
  transform: scaleY(0.1);
  transition: transform 0.1s;
  transform-origin: bottom;
}
.sekai-audio-player.playing .sekai-viz-bar {
  background: var(--text-main); /* White bars */
}

/* Bottom: Progress/Scrubber */
.sekai-tape-scrubber {
  height: 16px;
  background: #151515;
  border-top: 1px solid #222;
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: height 0.1s ease;
}

.sekai-tape-scrubber:hover {
  height: 18px;
}

.sekai-tape-scrubber:active {
  cursor: grabbing;
}

/* Buffered Progress (background layer) */
.sekai-scrub-buffered {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.08);
  width: 0%;
  z-index: 1;
  transition: width 0.3s ease, opacity 0.5s ease;
}

.sekai-scrub-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.05);
  width: 0%;
  border-right: 1px solid var(--accent-on);
  z-index: 2;
  transition: background 0.1s ease;
}

.sekai-tape-scrubber:hover .sekai-scrub-progress {
  background: rgba(255, 255, 255, 0.08);
}

/* Playhead triangle */
.sekai-scrub-progress::after {
  content: ''; position: absolute;
  right: -3px; top: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 4px solid var(--accent-on);
  transition: border-top-width 0.1s ease;
}

.sekai-tape-scrubber:hover .sekai-scrub-progress::after {
  border-top-width: 6px;
}

.sekai-scrub-time {
  position: absolute;
  right: 6px;
  font-size: 10px;
  color: var(--text-main);
  pointer-events: none;
  z-index: 3;
}


/* 3. Transport Module (Walkman Keys) */
.sekai-walkman-transport {
  width: 50px;
  background: #232329;
  display: flex;
  flex-direction: column;
  padding: 6px;
  gap: 4px;
}

.sekai-transport-btn {
  flex: 1;
  min-height: 24px;
  background: #333;
  border: none;
  border-radius: 2px;
  color: #888;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s, box-shadow 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sekai-transport-btn:hover {
  background: #444;
  color: #fff;
} /* Hover brightness */
.sekai-transport-btn.active {
  background: var(--accent-on); /* Physical latch down look */
  color: #000;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}
.sekai-transport-btn svg {
  width: 14px; height: 14px; fill: currentColor;
}

/* Removed sekai-mech-icon styles */
