:root {
  --bg-color: #0b0e14;
  --card-bg: #141820;
  --panel-bg: #0e1117;
  --card-border: #232936;
  --text-main: #f1f5f9;
  --text-muted: #8e9bb0;
  --cyan-glow: #38ef7d;
  --blue-accent: #00b4d8;
  --bar-grad: linear-gradient(90deg, #11998e, #38ef7d);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 14px;
}

.player-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  width: 100%;
  max-width: 430px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Header */
.card-header {
  padding: 16px 20px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sub-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.header-icon {
  font-size: 16px;
  color: var(--text-muted);
}

/* Visualizer / Artwork */
.media-preview {
  padding: 8px 20px;
}

.media-box {
  width: 100%;
  height: 170px;
  background: radial-gradient(circle at center, #1b2838 0%, #0d131a 100%);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.center-artwork {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: linear-gradient(135deg, #11998e, #38ef7d);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 32px;
  box-shadow: 0 0 24px rgba(56, 239, 125, 0.35);
  animation: spin 10s linear infinite;
  animation-play-state: paused;
}

.center-artwork.playing {
  animation-play-state: running;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* Visualizer Bars */
.visualizer {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 28px;
  margin-top: 14px;
}

.v-bar {
  width: 4px;
  height: 4px;
  background-color: var(--cyan-glow);
  border-radius: 2px;
  transition: height 0.1s ease;
}

/* Track Info */
.track-info {
  padding: 10px 20px 4px;
}

.track-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Seekbar */
.seekbar-container {
  padding: 8px 20px 0;
}

.seekbar {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: #2a3140;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.seekbar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.time-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Main Controls */
.controls-row {
  padding: 6px 20px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.control-btn {
  background: none;
  border: none;
  color: #cbd5e1;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s;
}

.control-btn:hover {
  color: #ffffff;
}

.btn-play {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #ffffff;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100px;
}

.vol-slider {
  width: 100%;
  -webkit-appearance: none;
  height: 3px;
  background: #2a3140;
  border-radius: 2px;
  outline: none;
}

.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #94a3b8;
  cursor: pointer;
}

/* WebSocket Telemetry Console (Persis Screenshot 3) */
.telemetry-card {
  background: var(--panel-bg);
  border-top: 1px solid var(--card-border);
  padding: 16px 20px;
}

.telemetry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.telemetry-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #cbd5e1;
}

.badge-status {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(56, 239, 125, 0.15);
  color: #38ef7d;
  border: 1px solid rgba(56, 239, 125, 0.3);
}

.badge-status.streaming {
  background: rgba(0, 180, 216, 0.15);
  color: #00b4d8;
  border-color: rgba(0, 180, 216, 0.3);
}

/* Telemetry Grid */
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.t-cell {
  background: #151a22;
  border: 1px solid #202734;
  border-radius: 8px;
  padding: 6px 10px;
}

.t-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.t-val {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
  margin-top: 2px;
}

/* Progress Bar */
.progress-bar-wrapper {
  width: 100%;
  height: 5px;
  background: #1f2735;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--bar-grad);
  border-radius: 3px;
  transition: width 0.15s ease;
}

/* Terminal Log */
.terminal-box {
  background: #090b0e;
  border: 1px solid #1a202c;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 11px;
  color: #94a3b8;
  height: 100px;
  overflow-y: auto;
  line-height: 1.5;
}

.terminal-box div {
  white-space: nowrap;
}

.terminal-box .green {
  color: #38ef7d;
}

.terminal-box .cyan {
  color: #00b4d8;
}

/* Footer Action */
.card-actions {
  display: flex;
  gap: 10px;
  padding: 12px 20px 16px;
  background: var(--panel-bg);
  border-top: 1px solid #1c222e;
}

.btn {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: #1e2430;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s;
}

.btn:hover {
  background: #2a3344;
}

.btn-green {
  background: linear-gradient(135deg, #11998e, #38ef7d);
  color: #0b0e14;
  font-weight: 700;
  border: none;
}
