/**
 * HKIIT Sound Mixing Simulator — Tab1 Mini Mixer styles
 * Original look (not Sound Desk Sim). Dark console aesthetic for classroom demos.
 */

.mm-root {
  --mm-bg: #1a1e24;
  --mm-panel: #242a33;
  --mm-border: #3a4350;
  --mm-text: #e8eef5;
  --mm-muted: #9aa5b5;
  --mm-accent: #3d9cf0;
  --mm-accent-safe: #3d9cf0;
  --mm-solo: #e6c84a;
  --mm-mute: #e05a5a;
  --mm-flash: #ffe566;
  --mm-fader: #4caf7a;
  font-family: "Segoe UI", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  background: var(--mm-bg);
  color: var(--mm-text);
  border: 1px solid var(--mm-border);
  border-radius: 10px;
  padding: 8px 10px 6px;
  box-sizing: border-box;
  user-select: none;
}

/* Hidden when create({ skipTransport: true }) — main app uses shell #slot-transport */
.mm-root--no-transport .mm-transport {
  display: none !important;
}

.mm-transport {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--mm-border);
}

.mm-btn {
  appearance: none;
  border: 1px solid var(--mm-border);
  background: var(--mm-panel);
  color: var(--mm-text);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}

.mm-btn:hover {
  border-color: #5a6a80;
  background: #2c3440;
}

.mm-btn:active {
  transform: translateY(1px);
}

.mm-btn:focus-visible {
  outline: 2px solid #3d9cf0;
  outline-offset: 2px;
}

.mm-root.is-playing .mm-btn-play {
  border-color: #4caf7a;
  box-shadow: 0 0 0 1px rgba(76, 175, 122, 0.35);
}

.mm-loop {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 13px;
  color: var(--mm-muted);
  cursor: pointer;
}

.mm-loop input {
  width: 16px;
  height: 16px;
  accent-color: #3d9cf0;
}

.mm-channels {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  justify-content: flex-start;
}

.mm-channel {
  flex: 0 0 90px;
  width: 90px;
  background: var(--mm-panel);
  border: 1px solid var(--mm-border);
  border-radius: 8px;
  padding: 6px 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: opacity 0.15s, border-color 0.15s;
}

.mm-channel.is-muted {
  opacity: 0.55;
}

.mm-channel.is-solo {
  border-color: var(--mm-solo);
}

.mm-channel[data-user-added="true"] {
  box-shadow: inset 0 3px 0 #3ddc97;
}

.mm-screen {
  width: 100%;
  min-height: 36px;
  border: 1px solid #2a3340;
  border-radius: 6px;
  background: linear-gradient(180deg, #0e141c 0%, #151c26 100%);
  color: #7dffb3;
  font-family: "Consolas", "Menlo", monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  transition: box-shadow 0.15s, background 0.15s, color 0.15s;
}

.mm-screen-en {
  line-height: 1.1;
}

.mm-screen-zh {
  font-size: 10px;
  font-weight: 500;
  color: #8fa0b5;
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  letter-spacing: 0;
}

.mm-screen:hover {
  border-color: #3d9cf0;
}

.mm-screen:focus-visible {
  outline: 2px solid #3d9cf0;
  outline-offset: 2px;
}

.mm-screen.is-flash {
  background: var(--mm-flash);
  color: #222;
  box-shadow: 0 0 12px rgba(255, 229, 102, 0.8);
  animation: mm-flash-pulse 0.6s ease;
}

.mm-screen.is-flash .mm-screen-zh {
  color: #444;
}

@keyframes mm-flash-pulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.25);
  }
}

.mm-label {
  display: block;
  width: 100%;
  font-size: 10px;
  color: var(--mm-muted);
  text-align: center;
  margin-bottom: 2px;
}

.mm-pan-block,
.mm-fader-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mm-pan {
  width: 100%;
  accent-color: #3d9cf0;
  cursor: pointer;
}

.mm-pan-val,
.mm-fader-val {
  font-size: 11px;
  color: var(--mm-muted);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

/* Vertical fader: modern browsers */
.mm-fader {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 24px;
  height: 72px;
  accent-color: var(--mm-fader);
  cursor: pointer;
  margin: 2px 0;
}

.mm-btn-row {
  display: flex;
  gap: 6px;
  width: 100%;
  justify-content: center;
}

.mm-solo,
.mm-mute {
  flex: 1;
  appearance: none;
  border: 1px solid var(--mm-border);
  background: #1c222b;
  color: var(--mm-muted);
  border-radius: 4px;
  padding: 5px 0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.mm-solo:focus-visible,
.mm-mute:focus-visible {
  outline: 2px solid #3d9cf0;
  outline-offset: 1px;
}

.mm-solo.is-lit {
  background: var(--mm-solo);
  color: #1a1a1a;
  border-color: #c4a82e;
}

.mm-mute.is-lit {
  background: var(--mm-mute);
  color: #fff;
  border-color: #c04444;
}

.mm-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--mm-muted);
  text-align: center;
  line-height: 1.35;
}

.mm-hint--stacked .mm-hint-en {
  display: block;
  color: var(--mm-text);
  font-weight: 600;
  font-size: 12px;
}

.mm-hint--stacked .mm-hint-zh {
  display: block;
  color: var(--mm-muted);
  font-size: 11px;
  margin-top: 2px;
}

@media (max-width: 720px) {
  .mm-channel {
    flex-basis: 84px;
    width: 84px;
  }
  .mm-fader {
    height: 64px;
  }
}
