:root {
  --bg-dark: #07090e;
  --bg-card: rgba(14, 18, 28, 0.75);
  --bg-card-hover: rgba(20, 26, 40, 0.85);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-focus: #00f0ff;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-cyan: #00f0ff;
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-amber: #f59e0b;

  --glow-cyan: rgba(0, 240, 255, 0.35);
  --glow-purple: rgba(139, 92, 246, 0.35);

  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.mono-time {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}

/* Background Animated Gradient Mesh */
.background-mesh {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.mesh-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.22;
  animation: floatMesh 20s infinite alternate ease-in-out;
}

.mesh-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-cyan), transparent);
  top: -100px;
  left: -100px;
}

.mesh-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-purple), transparent);
  bottom: -150px;
  right: -100px;
  animation-duration: 25s;
}

.mesh-3 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, var(--accent-pink), transparent);
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.12;
}

@keyframes floatMesh {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.1); }
  100% { transform: translate(-40px, 80px) scale(0.95); }
}

/* Layout Container */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px 20px;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  gap: 24px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-card);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  font-size: 32px;
  filter: drop-shadow(0 0 12px var(--glow-cyan));
  animation: pulseRotate 12s infinite linear;
}

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

.brand-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, #ffffff 30%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--text-dim);
  display: block;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  backdrop-filter: blur(8px);
}

.badge-quality {
  color: var(--text-muted);
}

.dot-green {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

.badge-live {
  position: relative;
  color: #fff;
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.12);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-red);
  box-shadow: 0 0 10px var(--accent-red);
}

.pulse-ring {
  position: absolute;
  left: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-red);
  animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
  opacity: 0.75;
}

@keyframes ping {
  75%, 100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

.btn-secondary {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 12px var(--glow-cyan);
}

/* Main Grid */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  flex: 1;
}

@media (max-width: 980px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

/* Player Column */
.player-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Visualizer Card */
.visualizer-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 280px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.visualizer-overlay {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
  pointer-events: auto;
}

.session-mode-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-card);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--accent-cyan);
}

.session-mode-pill.live-session {
  color: #ff3366;
  border-color: rgba(255, 51, 102, 0.4);
  background: rgba(255, 51, 102, 0.15);
  box-shadow: 0 0 12px rgba(255, 51, 102, 0.3);
}

.visualizer-presets {
  display: flex;
  gap: 6px;
}

.viz-mode-btn {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
}

.viz-mode-btn:hover, .viz-mode-btn.active {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.12);
}

#visualizerCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.visualizer-floating-reactions {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 3;
}

.floating-emoji {
  position: absolute;
  bottom: 10px;
  font-size: 28px;
  animation: floatUp 2.5s forwards ease-out;
  opacity: 0.95;
}

@keyframes floatUp {
  0% {
    transform: translateY(0) scale(0.6) rotate(0deg);
    opacity: 1;
  }
  70% {
    opacity: 0.9;
  }
  100% {
    transform: translateY(-240px) scale(1.3) rotate(20deg);
    opacity: 0;
  }
}

/* Now Playing Card */
.now-playing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.badge-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border-card);
}

.tag-genre {
  background: rgba(139, 92, 246, 0.12);
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.3);
}

.tag-vault {
  background: rgba(0, 240, 255, 0.1);
  color: var(--accent-cyan);
  border-color: rgba(0, 240, 255, 0.25);
}

.track-event {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
  color: #ffffff;
  margin-bottom: 6px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.track-artist {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 6px;
}

.verified-icon {
  background: var(--accent-cyan);
  color: #000;
  border-radius: 50%;
  width: 15px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
}

/* Progress Section */
.progress-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-cyan));
  border-radius: 999px;
  transition: width 0.5s ease-linear;
  box-shadow: 0 0 10px var(--glow-cyan);
}

.time-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-dim);
}

.live-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent-cyan);
}

/* Controls */
.player-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-top: 4px;
}

.btn-play {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), #00a8ff);
  border: none;
  color: #050811;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 20px var(--glow-cyan);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-play:hover {
  transform: scale(1.06);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.6);
}

.btn-play:active {
  transform: scale(0.95);
}

.ctrl-icon {
  width: 24px;
  height: 24px;
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-card);
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.btn-icon:hover {
  color: var(--accent-cyan);
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 90px;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  cursor: pointer;
}

.stream-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.status-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
}

/* Up Next Card */
.up-next-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.up-next-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-dim);
}

.queue-count {
  color: var(--accent-purple);
}

.up-next-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.up-next-icon {
  font-size: 24px;
  background: rgba(255, 255, 255, 0.04);
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-card);
}

.up-next-info {
  overflow: hidden;
}

.up-next-event {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.up-next-artist {
  font-size: 12px;
  color: var(--text-muted);
}

/* Chat Column */
.chat-column {
  display: flex;
  flex-direction: column;
}

.chat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: 640px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.chat-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-icon {
  font-size: 20px;
}

.chat-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  display: block;
}

.chat-sub {
  font-size: 10px;
  color: var(--accent-green);
  font-weight: 600;
}

.btn-nick {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-nick:hover {
  border-color: var(--accent-cyan);
  color: var(--text-main);
}

/* Messages Area */
.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.chat-messages::-webkit-scrollbar {
  width: 5px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.chat-msg {
  display: flex;
  gap: 10px;
  font-size: 13px;
  line-height: 1.4;
  animation: fadeInMsg 0.25s ease-out;
}

@keyframes fadeInMsg {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-avatar {
  font-size: 18px;
  line-height: 1;
}

.msg-body {
  flex: 1;
  overflow-wrap: anywhere;
}

.msg-author {
  font-weight: 700;
  font-size: 12px;
  margin-right: 6px;
}

.msg-time {
  font-size: 10px;
  color: var(--text-dim);
}

.msg-text {
  color: var(--text-main);
  margin-top: 2px;
}

/* Reactions */
.reactions-bar {
  display: flex;
  justify-content: space-around;
  padding: 8px 12px;
  border-top: 1px solid var(--border-card);
  background: rgba(0, 0, 0, 0.2);
}

.reaction-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: transform 0.15s, background 0.15s;
}

.reaction-btn:hover {
  transform: scale(1.3);
  background: rgba(255, 255, 255, 0.08);
}

.reaction-btn:active {
  transform: scale(0.9);
}

/* Input Area */
.chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--border-card);
  display: flex;
  gap: 10px;
  background: rgba(0, 0, 0, 0.35);
}

#chatInput {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  border-radius: 999px;
  padding: 10px 16px;
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

#chatInput:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px var(--glow-cyan);
}

.btn-send {
  background: var(--accent-cyan);
  border: none;
  color: #000;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-send:hover {
  transform: scale(1.08);
  box-shadow: 0 0 12px var(--glow-cyan);
}

/* Footer */
.footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--accent-cyan);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  background: #0f1422;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 400px;
  padding: 24px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}

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

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 22px;
  cursor: pointer;
}

.input-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  margin-top: 14px;
}

.modal-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: #fff;
  font-size: 14px;
  outline: none;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.avatar-opt {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 22px;
  cursor: pointer;
  transition: all 0.15s;
}

.avatar-opt:hover, .avatar-opt.selected {
  border-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.15);
}

.modal-footer {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
}

.btn-primary {
  background: var(--accent-cyan);
  border: none;
  color: #000;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 16px var(--glow-cyan);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(14, 20, 32, 0.95);
  border: 1px solid var(--accent-cyan);
  box-shadow: 0 0 20px var(--glow-cyan);
  color: #fff;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  display: none;
  z-index: 200;
  animation: popToast 0.25s ease-out;
}

@keyframes popToast {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.hidden {
  display: none !important;
}
