/* ====== 3D scene for the button cube ====== */
.mc-loader-btn { 
  /* optional: makes perspective consistent */
  perspective: 900px;
}

.mc-btn-cube{
  width: 60px; height: 60px;
  position: relative;
  transform-style: preserve-3d;
  /* "camera" */
  perspective: 900px;
  perspective-origin: 50% 50%;
  pointer-events: auto !important;
  cursor: pointer;
}

/* The cube object itself (your faces live directly inside) */
.mc-btn-cube{
  /* base pose */
  transform: rotateX(-24deg) rotateY(28deg);
  will-change: transform, filter;
  filter: drop-shadow(0 0 10px rgba(255,122,24,.30))
          drop-shadow(0 0 14px rgba(0,229,255,.20));
  animation: mcCubeSpin 1100ms linear infinite, mcCubePrecess 2600ms ease-in-out infinite;
}

/* IMPORTANT: treat your 6 existing faces as real cube faces */
.mc-cube-face{
  position: absolute;
  inset: 0;
  border-radius: 12px;
  backface-visibility: hidden;
  transform-style: preserve-3d;

  /* material */
  background: linear-gradient(135deg, rgba(255,122,24,.10), rgba(0,229,255,.08));
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: inset 0 0 18px rgba(0,0,0,.35);
}

/* Depth: half of 60px */
:root{ --mcDepth: 30px; }

/* Map the six faces by DOM order (your 6 .mc-cube-face elements) */
.mc-btn-cube > .mc-cube-face:nth-of-type(1){ transform: rotateY(  0deg) translateZ(var(--mcDepth)); filter: brightness(1.20); } /* front */
.mc-btn-cube > .mc-cube-face:nth-of-type(2){ transform: rotateY(180deg) translateZ(var(--mcDepth)); filter: brightness(.65); }  /* back  */
.mc-btn-cube > .mc-cube-face:nth-of-type(3){ transform: rotateY( 90deg) translateZ(var(--mcDepth)); filter: brightness(.95); }  /* right */
.mc-btn-cube > .mc-cube-face:nth-of-type(4){ transform: rotateY(-90deg) translateZ(var(--mcDepth)); filter: brightness(.88); }  /* left  */
.mc-btn-cube > .mc-cube-face:nth-of-type(5){ transform: rotateX( 90deg) translateZ(var(--mcDepth)); filter: brightness(1.08);}  /* top   */
.mc-btn-cube > .mc-cube-face:nth-of-type(6){ transform: rotateX(-90deg) translateZ(var(--mcDepth)); filter: brightness(.62); }  /* bottom*/

/* keep your visualizer content visible but not flat-looking */
.mc-visualizer, .mc-viz-wave, .mc-viz-core{
  transform: translateY(90deg);
}

/* 4D/5D-ish extras: render hypercube wires in 3D space too */
.mc-cube-hypercube{
  position:absolute;
  inset:-10px;
  transform-style: preserve-3d;
  transform: translateZ(0);
  pointer-events:none;
  mix-blend-mode: screen;
  opacity:.75;
  animation: mcHyperDrift 1500ms ease-in-out infinite;
}
.mc-hypercube-wire{
  position:absolute;
  inset: 0;
  border-radius: 14px;
  border: 1px solid rgba(0,229,255,.35);
  box-shadow: 0 0 10px rgba(0,229,255,.18), inset 0 0 10px rgba(255,122,24,.10);
  transform-style: preserve-3d;
}
.mc-cube-hypercube .mc-hypercube-wire:nth-child(1){ transform: translateZ(10px) rotateY(20deg); }
.mc-cube-hypercube .mc-hypercube-wire:nth-child(2){ transform: translateZ(-10px) rotateX(20deg); opacity:.65; }
.mc-cube-hypercube .mc-hypercube-wire:nth-child(3){ transform: translateZ(18px) rotateX(-25deg); opacity:.45; }
.mc-cube-hypercube .mc-hypercube-wire:nth-child(4){ transform: translateZ(-18px) rotateY(-25deg); opacity:.35; }

/* push your "paper edge compatibility" layers in front so they behave like overlays */
.mc-btn-edge,
.mc-btn-edge-2,
.mc-btn-edge-3,
.mc-btn-edge-4,
.mc-btn-edge-5,
.mc-btn-edge-6,
.mc-btn-ring{
  position:absolute;
  inset:0;
  transform: translateZ(calc(var(--mcDepth) + 12px));
  pointer-events:none;
}

/* animations */
@keyframes mcCubeSpin{
  0%   { transform: rotateX(-24deg) rotateY( 28deg) rotateZ(0deg); }
  50%  { transform: rotateX(-24deg) rotateY(208deg) rotateZ(8deg); }
  100% { transform: rotateX(-24deg) rotateY(388deg) rotateZ(0deg); }
}
@keyframes mcCubePrecess{
  0%,100% { transform: rotateX(-24deg) rotateY(28deg) rotateZ(0deg); }
  25%     { transform: rotateX(-32deg) rotateY(44deg) rotateZ(6deg); }
  50%     { transform: rotateX(-18deg) rotateY(30deg) rotateZ(-5deg); }
  75%     { transform: rotateX(-28deg) rotateY(18deg) rotateZ(4deg); }
}
@keyframes mcHyperDrift{
  0%,100% { transform: translateZ(0) rotateX(0deg) rotateY(0deg); }
  50%     { transform: translateZ(0) rotateX(8deg) rotateY(-10deg); }
}

/* ================================
   TRUE 3D SCENE FOR SIDEBAR CUBE
================================ */
.sidebar-cube-wrap{
  perspective: 700px;
  perspective-origin: 50% 50%;
  transform-style: preserve-3d;
}

/* Turn .sidebar-cube into a 3D object */
.sidebar-cube{
  transform-style: preserve-3d;
  border-radius: 12px;
  animation: sbCubeSpin 1100ms linear infinite, sbCubePrecess 2600ms ease-in-out infinite;
  background: transparent; /* we'll render "faces" via pseudo elements */
}

/* Depth */
:root{ --sbDepth: 30px; }

/* Two pseudo elements = we fake multiple faces with layered gradients */
.sidebar-cube::before,
.sidebar-cube::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius: 12px;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  border: 1px solid rgba(255,255,255,.10);
}

/* Front face */
.sidebar-cube::before{
  transform: rotateY(0deg) translateZ(var(--sbDepth));
  background:
    linear-gradient(135deg, rgba(255,122,24,.10), rgba(0,229,255,.08)),
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.10), transparent 55%),
    radial-gradient(circle at 70% 70%, rgba(0,229,255,.10), transparent 60%);
  box-shadow: inset 0 0 18px rgba(0,0,0,.35);
  filter: brightness(1.10);
}

/* Back face (gives depth read even with only 2 pseudos) */
.sidebar-cube::after{
  transform: rotateY(180deg) translateZ(var(--sbDepth));
  background:
    linear-gradient(135deg, rgba(255,122,24,.06), rgba(0,229,255,.05));
  box-shadow: inset 0 0 22px rgba(0,0,0,.45);
  filter: brightness(.72);
  opacity: .9;
}

/* Keep your overlays in front */
.sidebar-streak{ transform: translateZ(calc(var(--sbDepth) + 6px)); }
.sidebar-edge  { transform: translateZ(calc(var(--sbDepth) + 10px)); }
.sidebar-ring  { transform: translateZ(calc(var(--sbDepth) + 12px)); }
.sidebar-scan  { transform: translateZ(calc(var(--sbDepth) + 14px)); }

/* Animations (match "hyper" feel) */
@keyframes sbCubeSpin{
  0%   { transform: rotateX(-22deg) rotateY( 28deg) rotateZ(0deg); }
  50%  { transform: rotateX(-22deg) rotateY(208deg) rotateZ(8deg); }
  100% { transform: rotateX(-22deg) rotateY(388deg) rotateZ(0deg); }
}
@keyframes sbCubePrecess{
  0%,100% { transform: rotateX(-22deg) rotateY(28deg) rotateZ(0deg); }
  25%     { transform: rotateX(-30deg) rotateY(44deg) rotateZ(6deg); }
  50%     { transform: rotateX(-18deg) rotateY(30deg) rotateZ(-5deg); }
  75%     { transform: rotateX(-26deg) rotateY(18deg) rotateZ(4deg); }
}

/* keep cube inside 40x40 button */
#mc-loader-btn .mc-btn-cube{
  transform-origin: center;
}

#mc-loader-btn{
  overflow: visible; /* or hidden if you want crop */
}

/* State-based animation speeds */
#mc-loader-btn[data-state="loading"] .mc-btn-cube{ 
  animation-duration: 900ms, 2200ms;
}
#mc-loader-btn[data-state="ready"] .mc-btn-cube{
  animation: mcCubePrecess 3600ms ease-in-out infinite; /* calmer */
}

/* ===== Magic Loader Button ===== */
.mc-loader-btn {
  position: fixed;
  top: 575px;
  left: 20px;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, rgba(15,15,15,0.9), rgba(25,25,25,0.9));
  border: 1px solid rgba(255,122,24,0.3);
  border-radius: 8px;
  cursor: pointer;
  z-index: 9995;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto !important;
  user-select: none;
}

.mc-loader-btn:hover {
    position: fixed;
  top: 575px;
  left: 20px;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, rgba(255,122,24,0.2), rgba(0,229,255,0.2));
  box-shadow: 0 4px 12px rgba(255,122,24,0.3);
  border-color: rgba(255,122,24,0.5);
}

.mc-loader-btn:focus {
    position: fixed;
  top: 575px;
  left: 20px;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, rgba(255,122,24,0.2), rgba(0,229,255,0.2));
  box-shadow: 0 4px 12px rgba(255,122,24,0.3);
  border-color: rgba(255,122,24,0.5);
}

/* Visualizer elements */
.mc-visualizer {
  position: absolute;
  inset: 2px;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 1px;
  pointer-events: none;
  z-index: 10;
}

.mc-viz-bar {
  width: 2px;
  background: linear-gradient(to top, 
    rgba(255,122,24,0.8), 
    rgba(0,229,255,0.9), 
    rgba(255,255,255,0.6));
  border-radius: 1px;
  animation: mcVizPulse 0.5s ease-in-out infinite alternate;
  transform-origin: bottom;
  box-shadow: 0 0 4px rgba(0,229,255,0.6);
}

.mc-viz-bar:nth-child(1) { animation-delay: 0s; height: 40%; }
.mc-viz-bar:nth-child(2) { animation-delay: 0.1s; height: 60%; }
.mc-viz-bar:nth-child(3) { animation-delay: 0.2s; height: 35%; }
.mc-viz-bar:nth-child(4) { animation-delay: 0.3s; height: 80%; }
.mc-viz-bar:nth-child(5) { animation-delay: 0.4s; height: 45%; }
.mc-viz-bar:nth-child(6) { animation-delay: 0.5s; height: 70%; }
.mc-viz-bar:nth-child(7) { animation-delay: 0.6s; height: 30%; }

.mc-viz-wave {
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background: radial-gradient(circle at center, 
    transparent 30%, 
    rgba(0,229,255,0.1) 50%, 
    transparent 70%);
  animation: mcVizWave 2s ease-in-out infinite;
}
/*
.mc-viz-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, 
    rgba(255,255,255,1) 0%, 
    rgba(0,229,255,0.8) 40%, 
    transparent 70%);
  border-radius: 50%;
  animation: mcVizCore 1s ease-in-out infinite alternate;
  box-shadow: 0 0 8px rgba(0,229,255,0.8);
}
*/
@keyframes mcVizPulse {
  0% { 
    transform: scaleY(0.5); 
    opacity: 0.6; 
  }
  100% { 
    transform: scaleY(1.2); 
    opacity: 1; 
  }
}

@keyframes mcVizWave {
  0% { 
    transform: scale(0.8); 
    opacity: 0.3; 
  }
  50% { 
    transform: scale(1.2); 
    opacity: 0.8; 
  }
  100% { 
    transform: scale(0.8); 
    opacity: 0.3; 
  }
}

@keyframes mcVizCore {
  0% { 
    transform: translate(-50%, -50%) scale(0.8); 
    box-shadow: 0 0 4px rgba(0,229,255,0.4); 
  }
  100% { 
    transform: translate(-50%, -50%) scale(1.5); 
    box-shadow: 0 0 12px rgba(255,122,24,0.8); 
  }
}

/* ===== KAI Chat Interface ===== */
.kai-chat-interface {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 350px;
  height: 450px;
  background: linear-gradient(135deg, rgba(15,15,15,0.95), rgba(25,25,25,0.95));
  border: 1px solid rgba(255,122,24,0.3);
  border-radius: 16px;
  backdrop-filter: blur(20px);
  z-index: 9999;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.kai-chat-interface.visible {
  opacity: 1;
  transform: translateY(0);
}

.kai-chat-header {
  background: linear-gradient(135deg, rgba(255,122,24,0.2), rgba(0,229,255,0.2));
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kai-chat-title {
  color: rgba(255,255,255,0.9);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kai-chat-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.kai-chat-close:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
}

.kai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kai-message {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
  word-wrap: break-word;
}

.kai-message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(255,122,24,0.2), rgba(255,122,24,0.1));
  border: 1px solid rgba(255,122,24,0.3);
  color: rgba(255,255,255,0.9);
}

.kai-message.assistant {
  align-self: flex-start;
  background: linear-gradient(135deg, rgba(0,229,255,0.2), rgba(0,229,255,0.1));
  border: 1px solid rgba(0,229,255,0.3);
  color: rgba(255,255,255,0.9);
}

.kai-chat-input-container {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.2);
}

.kai-chat-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 10px 12px;
  color: rgba(255,255,255,0.9);
  font-size: 13px;
  resize: none;
  outline: none;
  transition: all 0.2s ease;
}

.kai-chat-input:focus {
  border-color: rgba(0,229,255,0.5);
  background: rgba(255,255,255,0.08);
}

.kai-chat-send {
  margin-top: 8px;
  width: 100%;
  background: linear-gradient(135deg, rgba(255,122,24,0.8), rgba(0,229,255,0.8));
  border: none;
  border-radius: 8px;
  padding: 10px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.kai-chat-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255,122,24,0.3);
}

/* Sidebar Magic Loader */
.sidebar-magic-loader {
  position: fixed;
  top: 50%;
  left: 20px;
  transform: translateY(-50%);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-magic-loader.active {
  opacity: 1;
}

.sidebar-cube-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.sidebar-cube-wrap {
  perspective: 700px;
  perspective-origin: 50% 50%;
  transform-style: preserve-3d;
}

/* Turn .sidebar-cube into a 3D object */
.sidebar-cube {
  transform-style: preserve-3d;
  border-radius: 12px;
  animation: sbCubeSpin 1100ms linear infinite, sbCubePrecess 2600ms ease-in-out infinite;
  background: transparent; /* we'll render "faces" via pseudo elements */
}

/* Depth */
:root{ --sbDepth: 30px; }

/* Two pseudo elements = we fake multiple faces with layered gradients */
.sidebar-cube::before,
.sidebar-cube::after {
  content:"";
  position:absolute;
  inset:0;
  border-radius: 12px;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  border: 1px solid rgba(255,255,255,.10);
}

/* Front face */
.sidebar-cube::before {
  transform: rotateY(0deg) translateZ(var(--sbDepth));
  background:
    linear-gradient(135deg, rgba(255,122,24,.10), rgba(0,229,255,.08)),
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.10), transparent 55%),
    radial-gradient(circle at 70% 70%, rgba(0,229,255,.10), transparent 60%);
  box-shadow: inset 0 0 18px rgba(0,0,0,.35);
  filter: brightness(1.10);
}

/* Back face (gives depth read even with only 2 pseudos) */
.sidebar-cube::after {
  transform: rotateY(180deg) translateZ(var(--sbDepth));
  background:
    linear-gradient(135deg, rgba(255,122,24,.06), rgba(0,229,255,.05));
  box-shadow: inset 0 0 22px rgba(0,0,0,.45);
  filter: brightness(.72);
  opacity: .9;
}

/* Keep your overlays in front */
.sidebar-streak { transform: translateZ(calc(var(--sbDepth) + 6px)); }
.sidebar-edge  { transform: translateZ(calc(var(--sbDepth) + 10px)); }
.sidebar-ring  { transform: translateZ(calc(var(--sbDepth) + 12px)); }
.sidebar-scan  { transform: translateZ(calc(var(--sbDepth) + 14px)); }

/* Animations (match the "hyper" feel) */
@keyframes sbCubeSpin {
  0%   { transform: rotateX(-22deg) rotateY( 28deg) rotateZ(0deg); }
  50%  { transform: rotateX(-22deg) rotateY(208deg) rotateZ(8deg); }
  100% { transform: rotateX(-22deg) rotateY(388deg) rotateZ(0deg); }
}
@keyframes sbCubePrecess {
  0%,100% { transform: rotateX(-22deg) rotateY( 28deg) rotateZ(0deg); }
  25%     { transform: rotateX(-30deg) rotateY( 44deg) rotateZ(6deg); }
  50%     { transform: rotateX(-18deg) rotateY( 30deg) rotateZ(-5deg); }
  75%     { transform: rotateX(-26deg) rotateY( 18deg) rotateZ(4deg); }
}

.sidebar-edge {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  pointer-events: none;
}

.sidebar-edge::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  border: 2px solid transparent;
  background:
    linear-gradient(#070707, #070707) padding-box,
    linear-gradient(90deg, #ff7a18, #ffb24a, #00e5ff) border-box;
  border: 2px solid transparent;
  clip-path: polygon(0 0, 0 0, 0 0, 0 0);
  animation: sidebarDrawBorder 800ms cubic-bezier(.2,.9,.2,1) infinite;
}

.sidebar-ring {
  position: absolute;
  inset: 12px;
  border-radius: 999px;
  background:
    conic-gradient(
      from 0deg,
      rgba(255,122,24,.0) 0deg,
      rgba(255,122,24,.85) 20deg,
      rgba(255,255,255,.9) 35deg,
      rgba(0,229,255,.9) 55deg,
      rgba(0,229,255,.0) 75deg,
      rgba(255,122,24,.75) 95deg,
      rgba(255,122,24,.0) 120deg,
      rgba(0,229,255,.8) 150deg,
      rgba(255,255,255,.8) 165deg,
      rgba(0,229,255,.0) 190deg,
      rgba(255,122,24,.8) 230deg,
      rgba(0,229,255,.8) 270deg,
      rgba(255,122,24,.0) 360deg
    );
  mask: radial-gradient(circle, transparent 56%, #000 58%);
  animation: sidebarSpin 900ms linear infinite;
  filter: blur(.1px);
}

.sidebar-streak {
  position: absolute;
  inset: -20px;
  background:
    radial-gradient(closest-side at 15% 55%, rgba(255,122,24,.35), transparent 60%),
    radial-gradient(closest-side at 85% 50%, rgba(0,229,255,.25), transparent 60%);
  opacity: .75;
  animation: sidebarBreathe 1000ms cubic-bezier(.2,.9,.2,1) infinite;
}

.sidebar-scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    rgba(255,255,255,.04) 0px,
    rgba(255,255,255,.04) 1px,
    transparent 3px,
    transparent 6px
  );
  opacity: .10;
  mix-blend-mode: overlay;
}

.sidebar-loading-text {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,.8);
  text-align: center;
  letter-spacing: 0.5px;
  animation: sidebarTextPulse 800ms ease-in-out infinite;
}

/* Animations */
@keyframes sidebarDrawBorder {
  0%   { clip-path: polygon(0 0, 0 0, 0 0, 0 0); }
  25%  { clip-path: polygon(0 0, 100% 0, 100% 0, 0 0); }
  50%  { clip-path: polygon(0 0, 100% 0, 100% 100%, 100% 100%); }
  75%  { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
  100% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
}

@keyframes sidebarSpin {
  to { transform: rotate(360deg); }
}

@keyframes sidebarBreathe {
  0%, 100% { opacity: .75; }
  50% { opacity: 1; }
}

@keyframes sidebarTextPulse {
  0%, 100% { opacity: .8; }
  50% { opacity: 1; }
}

/* Track playing animation */
.sidebar-magic-loader.track-playing {
  animation: sidebarTrackMove 3s ease-in-out infinite;
}

@keyframes sidebarTrackMove {
  0%, 100% { transform: translateY(-50%) translateX(0); }
  50% { transform: translateY(-50%) translateX(5px); }
}
/* Base 
#mc-nowplaying{
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9997;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(8, 8, 8, .65);
  border: 1px solid rgba(255, 255, 255, .10);
  backdrop-filter: blur(10px);

  width: 275px;
  height: 95vh;
  max-height: 95vh;

  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
  
  /* DEBUG: Lime outline to see actual dimensions 
  outline: 2px solid rgb(41, 42, 41) !important;
}
*/
/* DEBUG: Outline all children */
#mc-nowplaying * {
  box-sizing: border-box !important;
}

/* DEBUG: Universal selector to force styles
[id="mc-nowplaying"] {
  position: fixed !important;
  right: 18px !important;
  bottom: 18px !important;
  z-index: 9997 !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 10px 12px !important;
  border-radius: 16px !important;
  background: rgba(8, 8, 8, .65) !important;
  border: 1px solid rgba(255, 255, 255, .10) !important;
  backdrop-filter: blur(10px) !important;
  width: 275px !important;
  height: 95vh !important;
  max-height: 95vh !important;
  opacity: 1 !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
  outline: 3px solid red !important;
}

/* Force dimensions on all child elements 
[id="mc-nowplaying"] * {
  box-sizing: border-box !important;
  max-width: 100% !important;
  max-height: 100% !important;
}

/* Force cube dimensions - override inline styles 
[id="mc-nowplaying"] .mc-btn-cube,
[id="mc-nowplaying"] .mc-nowplaying-cube,
[id="mc-nowplaying"] .mc-btn-cube[style],
[id="mc-nowplaying"] .mc-nowplaying-cube[style] {
  width: 800px !important;
  height: 500px !important;
  flex-shrink: 0 !important;
  min-width: 800px !important;
  min-height: 500px !important;
  max-width: 800px !important;
  max-height: 500px !important;
  /* Right flip animation 
  transform: rotateX(0deg) rotateY(0deg) rotateZ(-90deg) !important;
  width: 130% !important;
  height: 250% !important;
  animation: mcCubeSpin 1100ms linear infinite, mcCubePrecess 2600ms ease-in-out infinite !important;
  transition: transform 0.2s ease !important;
}

/* Override ALL inline styles on nowplaying cube only 
[id="mc-nowplaying"] div[style*="mcTiltX"],
[id="mc-nowplaying"] div[style*="mcTiltY"] {
  width: 72px !important;
  height: 72px !important;
  min-width: 72px !important;
  min-height: 72px !important;
  max-width: 72px !important;
  max-height: 72px !important;
}

/* Force container to override inline width/height 
[id="mc-nowplaying"][width],
[id="mc-nowplaying"][height],
[id="mc-nowplaying"][style*="width"],
[id="mc-nowplaying"][style*="height"] {
  width: 275px !important;
  height: 95vh !important;
  max-width: 275px !important;
  max-height: 95vh !important;
  min-width: 275px !important;
  min-height: 95vh !important;
}

/* Specific box-sizing fix for magic cube elements only 
.mc-loader-btn *,
.mc-nowplaying *,
.mc-viz-overlay *,
.mc-cube-face *,
.mc-btn-edge *,
.mc-btn-edge-2 *,
.mc-btn-edge-3 *,
.mc-btn-edge-4 *,
.mc-btn-edge-5 *,
.mc-btn-edge-6 * {
  box-sizing: border-box !important;
}

[id="mc-nowplaying"] {
  width: 275px !important;
  height: 95vh !important;
  max-width: 275px !important;
  max-height: 95vh !important;
  min-width: 275px !important;
  min-height: 95vh !important;
  position: fixed !important;
  right: 18px !important;
  bottom: 18px !important;
  z-index: 9997 !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 10px 12px !important;
  border-radius: 16px !important;
  background: rgba(8, 8, 8, .65) !important;
  border: 1px solid rgba(255, 255, 255, .10) !important;
  backdrop-filter: blur(10px) !important;
  opacity: 1 !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
  outline: 5px solid red !important;
}
*/
/* Override magic cube button styles only 
#mc-loader-btn[width="275px"],
#mc-loader-btn[height="95%"],
.mc-loader-btn.mc-loader-btn {
  width: 72px !important;
  height: 72px !important;
  max-width: 72px !important;
  max-height: 72px !important;
  min-width: 72px !important;
  min-height: 72px !important;
  /* DISABLE 3D EFFECTS TEMPORARILY 
  transform: none !important;
  animation: none !important;
  transition: none !important;
}

/* Override magic cube elements only 
[id="mc-nowplaying"] .mc-btn-cube,
[id="mc-nowplaying"] .mc-nowplaying-cube,
[id="mc-nowplaying"] .mc-btn-cube[style],
[id="mc-nowplaying"] .mc-nowplaying-cube[style],
div[style*="mcTiltX"],
div[style*="mcTiltY"] {
  width: 72px !important;
  height: 72px !important;
  max-width: 72px !important;
  max-height: 72px !important;
  min-width: 72px !important;
  min-height: 72px !important;
  box-sizing: border-box !important;
  display: block !important;
  position: relative !important;
}

/* Force meta container to fill remaining space 
[id="mc-nowplaying"] .mc-nowplaying-meta {
  flex: 1 !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

/* Visible 
#mc-nowplaying.visible{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* DEBUG: Force visible for testing 
#mc-nowplaying.debug-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}

.mc-nowplaying-cube{
  width: 300%;
  height: 46vh;
  /* Updated to match main cube style 
  transform: rotateX(calc(-22deg + var(--mcTiltX, 0deg)))
             rotateY(calc( 30deg + var(--mcTiltY, 0deg)));
  cursor: pointer;
  transition: transform 0.2s ease;
  /* Remove animations from clone 
  animation: none !important;
}

.mc-nowplaying-cube:hover{
  transform: rotateX(calc(-22deg + var(--mcTiltX, 0deg) - 5deg))
             rotateY(calc( 30deg + var(--mcTiltY, 0deg) + 5deg))
             scale(1.05);
}

/* Separate clone elements - independent from main cube 
# .mc-cube-face{
  width: 300% !important;
  height: 500vh !important;
  transform-style: preserve-3d;
}

# .mc-btn-edge,
# .mc-btn-edge-2,
# .mc-btn-edge-3,
# .mc-btn-edge-4,
# .mc-btn-edge-5,
# .mc-btn-edge-6,
# .mc-btn-ring{
  width: 300% !important;
  height: 500vh !important;
  transform: translateZ(calc(var(--mcDepth) + 12px));
  pointer-events:none;
}
*/
/* Force all clone elements to large size 
# * {
  width: 300% !important;
  height: 500vh !important;
}
*/
.mc-np-title{ 
  font-size: 12px; 
  font-weight: 700; 
  color: rgba(255,255,255,.92);
  margin-bottom: 2px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mc-np-artist{ 
  font-size: 11px; 
  color: rgba(255,255,255,.70);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Drive glow/energy by volume */


/* When paused, freeze */
.mc-nowplaying.is-paused .mc-btn-cube,
.mc-nowplaying.is-paused .mc-nowplaying-cube{
  animation-play-state: paused;
}

/* ===== VISUALIZER SIDEBAR (not overlay) ===== */
.mc-viz-overlay{
  position: fixed;
  top: 0;
  right: 0;
  width: min(300px, 85vw);
  height: 273vh;  
  z-index: 10;
  display: flex !important;
  align-items: stretch;
  justify-content: flex-end;
  opacity: 1;
  visibility: visible;
  background: rgba(6,6,6,.95);
  border-left: 1px solid rgba(255,122,24,.3);
  box-shadow: -18px 0 50px rgba(0,0,0,.55);
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
.mc-viz-overlay.is-open{ 
  transform: translateX(0);
}
.mc-viz-panel.side-left{
  right: auto;
  left: 0;
  border-right: 1px solid rgba(255,122,24,.3);
  border-left: none;
  box-shadow: 18px 0 50px rgba(0,0,0,.55);
  transform: translateX(-100%);
}
.mc-viz-overlay.is-open .mc-viz-panel.side-left{
  transform: translateX(0);
}

.mc-viz-header{
  padding: 14px 14px 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.mc-viz-title-main{
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .3px;
  color: rgba(255,255,255,.92);
}

/* Playtime Resources Display Styling */
#playtime-resources-display {
  position: fixed;
  top: 50%;
  right: 400px;
  transform: translateY(-50%);
  background: linear-gradient(135deg, rgba(15,15,15,0.95), rgba(25,25,25,0.95));
  border: 1px solid rgba(255,122,24,0.3);
  border-radius: 12px;
  padding: 20px;
  color: white;
  font-family: Arial, sans-serif;
  z-index: 10000;
  min-width: 300px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.mc-viz-title-sub{
  font-size: 11px;
  color: rgba(255,255,255,.65);
  margin-top: 2px;
}

.mc-viz-close{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.85);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.mc-viz-close:hover{
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,1);
}

.mc-viz-body{
  position: relative;
  flex: 1;
  padding: 0;
  overflow: hidden;
  width: 300px;
  height: 32%;
}

.mc-viz-split{
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 12px;
  height: 100%;
  width: 100%;
}

.mc-viz-center{
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  padding: 0;
  margin: 0;
}

.mc-viz-left{
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.mc-viz-right{
  min-width: 0;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(10,10,10,.55);
  box-shadow: inset 0 0 40px rgba(0,0,0,.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.mc-rel-head{
  padding: 12px 12px 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.mc-rel-title{
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .3px;
  color: rgba(255,255,255,.9);
}
.mc-rel-sub{
  margin-top: 3px;
  font-size: 11px;
  color: rgba(255,255,255,.65);
}

.mc-rel-summary{
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  font-size: 11px;
  color: rgba(255,255,255,.75);
  display: grid;
  gap: 6px;
}

.mc-rel-list{
  padding: 10px 10px 12px 10px;
  overflow: auto;
  display: grid;
  gap: 10px;
}

/* relation card */
.mc-rel-card{
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.mc-rel-card:hover{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,122,24,.3);
  transform: translateY(-1px);
}

.mc-rel-row1{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.mc-rel-name{
  font-size: 12px;
  font-weight: 850;
  color: rgba(255,255,255,.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mc-rel-tag{
  font-size: 10px;
  font-weight: 800;
  color: rgba(255,255,255,.75);
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.25);
  padding: 3px 8px;
  border-radius: 999px;
}

.mc-rel-row2{
  margin-top: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  font-size: 11px;
  color: rgba(255,255,255,.70);
}
.mc-rel-metric b{ color: rgba(255,255,255,.92); }

.mc-rel-why{
  margin-top: 8px;
  font-size: 10px;
  color: rgba(255,255,255,.60);
  line-height: 1.25;
}

#mc-viz-canvas{
  width: 300px;
  height: 260% !important;
  max-height: 501vh;
  display: block;
  border-radius: 0;
  border: none;
  background:
    radial-gradient(closest-side at 25% 25%, rgba(255, 140, 0, 0.043), transparent 60%),
    radial-gradient(closest-side at 75% 75%, rgba(0, 229, 255, 0.133), transparent 65%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.072), rgba(255,255,255,.00));
  box-shadow: inset 0 0 40px rgba(0,0,0,.55);
}

.mc-viz-footer{
  padding: 10px 12px 14px 12px;
  display: flex;
  gap: 10px;
  border-top: 1px solid rgba(255,255,255,.10);
}
.mc-viz-btn{
  flex: 1;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.85);
  font-weight: 700;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.mc-viz-btn:hover{
  background: rgba(255,122,24,.2);
  border-color: rgba(255,122,24,.4);
  color: rgba(255,255,255,1);
  transform: translateY(-1px);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .kai-chat-interface {
    width: calc(100vw - 40px);
    right: 20px;
    left: 20px;
    height: 60vh;
  }
  
  .sidebar-magic-loader {
    left: 10px;
  }
  
  .mc-loader-btn {
    left: 10px;
    width: 35px;
    height: 35px;
  }
  
  .mc-nowplaying{
    right: 10px;
    bottom: 10px;
    padding: 8px 10px;
    gap: 8px;
  }
  
  .mc-nowplaying-cube{
    width: 60px;
    height: 60px;
  }
  
  .mc-viz-panel{
    width: min(100px, 30vw);
  }
}

/* ====== Third Domino Toggle ====== */
.third-domino-toggle {
  position: fixed;
  top: calc(50% + 120px); /* Below visualizer */
  left: 10px;
  width: 40px;
  height: 40px;
  background: rgba(0, 100, 200, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  cursor: pointer;
  z-index: 1001;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.third-domino-toggle:hover {
  background: rgba(0, 150, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}

.third-domino-toggle img {
  width: 24px;
  height: 24px;
  filter: brightness(0.8);
  transition: filter 0.3s ease;
}

.third-domino-toggle:hover img {
  filter: brightness(1.2);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .third-domino-toggle {
    top: calc(50% + 100px);
    left: 5px;
    width: 35px;
    height: 35px;
  }
  
  .third-domino-toggle img {
    width: 20px;
    height: 20px;
  }
}

#resource-tracker {
  position: fixed;
  top: 79%;
  overflow: visible;
  transform: translateY(-50%);
  z-index: 9998;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  width: 45px;
  height: 45px;
  border-radius: 8px;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.3s ease;
  border: 2px solid #333;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
  font-weight: bold;
}

#resource-tracker:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  border-color: #667eea;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.R-Tracker {
  padding: 8px;
}

/* Resource Tracker Button */
#rt-btn {
  position: fixed;
  top: 74%;
  overflow: visible;
  transform: translateY(-50%);
  z-index: 9998;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  width: 45px;
  height: 45px;
  border-radius: 8px;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.3s ease;
  border: 2px solid #333;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
  font-weight: bold;
}

#rt-btn:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  border-color: #667eea;
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

#rt-btn:active {
  transform: translateY(-50%) scale(0.98);
}

/* Library Sidebar Resource Tracker */
.library-sidebar-resource-tracker {
  width: 35%;
  height: 35vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 2px solid #667eea;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.library-sidebar-resource-tracker::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.library-sidebar-resource-tracker h3 {
  color: #667eea;
  margin: 0 0 20px 0;
  font-size: 18px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: bold;
}

.resource-item-sidebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  margin: 8px 0;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border-left: 4px solid #667eea;
  transition: all 0.3s ease;
}

.resource-item-sidebar:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

.resource-item-sidebar.low {
  border-left-color: #ef4444;
}

.resource-item-sidebar.medium {
  border-left-color: #f59e0b;
}

.resource-item-sidebar.high {
  border-left-color: #10b981;
}

.resource-label-sidebar {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 500;
}

.resource-value-sidebar {
  color: white;
  font-size: 14px;
  font-weight: bold;
  font-family: 'Courier New', monospace;
}

.resource-status-sidebar {
  margin-top: 20px;
  padding: 16px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 8px;
  text-align: center;
}

.status-text-sidebar {
  color: #667eea;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: bold;
}

.resource-actions-sidebar {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.resource-btn-sidebar {
  flex: 1;
  padding: 8px 12px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.resource-btn-sidebar:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Resource Tracker Right Sidebar */
.resource-tracker-sidebar {
  position: fixed;
  top: 51px;
  right: -331px;
  left: auto;
  width: 331px;
  height: 46vh;
  background: linear-gradient(135deg, #0a0e27 31%, #1a1f3a 50%, #0f172a 100%);
  border-left: 4.25px solid rgba(0, 255, 255, 1.0);
  border-radius: 12px;
  z-index: 9999;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  overflow-y: auto;
  backdrop-filter: blur(10px);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.6);
  color: white;
  font-family: Arial, sans-serif;
  opacity: 0.867;
}

.resource-tracker-sidebar.show {
  right: -25px;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.resource-tracker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 16px 20px;
  border-bottom: 1px solid rgba(102, 126, 234, 0.3);
  background: rgba(102, 126, 234, 0.1);
}

.resource-tracker-header h3 {
  color: #667eea;
  margin: 0;
  font-size: 18px;
  font-weight: bold;
}

.resource-tracker-close-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 20px;
  cursor: pointer;
  padding: 5px;
  border-radius: 4px;
  transition: all 0.3s ease;
  position: relative;
  right: 13px;
}

.resource-tracker-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: white;
}

.resource-tracker-content {
  padding: 20px;
}

.resource-item {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.resource-icon {
  font-size: 20px;
  margin-right: 12px;
  width: 24px;
  text-align: center;
}

.resource-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.resource-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 4px;
}

.resource-value {
  font-size: 16px;
  font-weight: bold;
  color: white;
}

.resource-flow {
  font-size: 12px;
  font-weight: bold;
  margin-left: 8px;
  animation: none;
  transition: all 0.3s ease;
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

.resource-status {
  margin: 20px 0;
  padding: 12px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 8px;
  text-align: center;
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.status-text {
  font-size: 14px;
  font-weight: bold;
}

.resource-actions {
  margin: 20px 0;
}

.resource-action-btn {
  display: block;
  width: 100%;
  padding: 12px;
  margin: 8px 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.3s ease;
}

.resource-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.resource-stats {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 12px;
}

.stat-label {
  color: rgba(255, 255, 255, 0.7);
}

.stat-value {
  color: white;
  font-weight: bold;
}

.resource-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  margin: 12px 0;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border-left: 4px solid #667eea;
  transition: all 0.3s ease;
}

.resource-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(8px);
}

.resource-item.low {
  border-left-color: #ef4444;
}

.resource-item.medium {
  border-left-color: #f59e0b;
}

.resource-item.high {
  border-left-color: #10b981;
}

.resource-icon {
  font-size: 24px;
  margin-right: 16px;
  min-width: 30px;
}

.resource-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.resource-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.resource-value {
  color: white;
  font-size: 16px;
  font-weight: bold;
  font-family: 'Courier New', monospace;
}

.resource-status {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  margin: 16px 0;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 12px;
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f59e0b;
  margin-right: 12px;
  animation: pulse-status 2s infinite;
}

.status-indicator.high {
  background: #10b981;
}

.status-indicator.medium {
  background: #f59e0b;
}

.status-indicator.low {
  background: #ef4444;
}

.status-text {
  color: #667eea;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: bold;
}

@keyframes pulse-status {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.resource-actions {
  display: flex;
  gap: 12px;
  margin: 20px 0;
}

.resource-action-btn {
  flex: 1;
  padding: 12px 16px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  text-align: center;
}

.resource-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.resource-action-btn.fuel-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.resource-action-btn.gas-btn {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.resource-action-btn.mccc-btn {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.resource-stats {
  margin-top: 24px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border-top: 1px solid rgba(102, 126, 234, 0.2);
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.stat-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
}

.stat-value {
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  font-family: 'Courier New', monospace;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .resource-tracker-sidebar {
    width: 100%;
    left: -100%;
    height: 100vh;
  }
  
  .resource-tracker-sidebar.show {
    left: 0;
  }
  
  .resource-actions {
    flex-direction: column;
    gap: 8px;
  }
}
.library-layout {
  display: flex;
  gap: 20px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  position: relative;
}

.library-sidebar {
  width: 35%;
  min-width: 280px;
  max-width: 400px;
  flex-shrink: 0;
}

.library-main-content {
  flex: 1;
  min-width: 0;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .library-layout {
    flex-direction: column;
  }
  
  .library-sidebar {
    width: 100%;
    max-width: 100%;
    margin-bottom: 20px;
  }
  
  .library-sidebar-resource-tracker {
    height: auto;
    max-height: 300px;
  }
}

@media (max-width: 768px) {
  .library-layout {
    gap: 10px;
  }
  
  .library-sidebar-resource-tracker {
    height: auto;
    max-height: 250px;
    padding: 15px;
  }
  
  .resource-actions-sidebar {
    flex-direction: column;
    gap: 6px;
  }
}

#playtime-resource-display {
  right: 0px;
  top: 31px;
  max-width: 350px;
  max-height: 70vh;
  overflow-y: auto;
}

#today-scoreboard-display {
  right: 0px;
  top: 31px;
  max-width: 400px;
  max-height: 75vh;
  overflow-y: auto;
}

/* Resource tooltip */
#resource-tooltip {
  position: fixed;
  top: 31px;
  right: 0px;
  background: linear-gradient(135deg, rgba(15,15,15,0.95), rgba(25,25,25,0.95));
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 8px;
  padding: 15px;
  color: white;
  font-family: 'Courier New', monospace;
  z-index: 10002;
  min-width: 280px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

#resource-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

#resource-tooltip::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 15px;
  right: 15px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #00d4ff, transparent);
  animation: tooltip-scan 2s linear infinite;
}

@keyframes tooltip-scan {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

#resource-tooltip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

#resource-tooltip-title {
  color: #00d4ff;
  font-size: 12px;
  font-weight: bold;
  margin: 0;
}

#resource-tooltip-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.3);
  color: #00d4ff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  cursor: pointer;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

#resource-tooltip-close:hover {
  background: rgba(0, 212, 255, 0.2);
  transform: rotate(90deg);
}

#resource-tooltip-content {
  display: grid;
  gap: 8px;
  font-size: 11px;
}

.resource-tooltip-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid rgba(0, 212, 255, 0.1);
}

.resource-tooltip-item:last-child {
  border-bottom: none;
}

.resource-tooltip-label {
  color: rgba(0, 212, 255, 0.8);
  font-size: 10px;
  text-transform: uppercase;
}

.resource-tooltip-value {
  color: #ffffff;
  font-weight: bold;
  font-family: 'Courier New', monospace;
}

.resource-tooltip-rate {
  color: rgba(0, 212, 255, 0.6);
  font-size: 9px;
  font-family: 'Courier New', monospace;
}

/* Real-time calculation indicator */
.calculating-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #00d4ff;
  border-radius: 50%;
  margin-left: 8px;
  animation: calculate-pulse 1s ease-in-out infinite;
}

@keyframes calculate-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Resource display improvements */
.playtime-resources-btn:hover,
.today-scoreboard-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

/* Negative resource indicators */
.resource-value.negative {
  color: #ff6b6b;
  font-weight: bold;
}

.resource-flow.negative::after {
  content: ' ⬇️';
  color: #ff6b6b;
}

/* Positive resource indicators */
.resource-value.positive {
  color: #4CAF50;
  font-weight: bold;
}

.resource-flow.positive::after {
  content: ' ⬆️';
  color: #4CAF50;
}