/* ==========================================================================
   Astral Moods Design System & Core Styles
   ========================================================================== */

   :root {
    /* Mood Color Palette (HSL optimized for glowing aesthetics) */
    --color-happy: hsl(48, 100%, 60%);      /* Radiant Golden Yellow */
    --color-sad: hsl(197, 100%, 62%);       /* Ethereal Sky Blue */
    --color-excited: hsl(330, 100%, 65%);   /* Electric Pink */
    --color-tired: hsl(271, 91%, 74%);     /* Mystical Lavender */
    --color-focused: hsl(146, 85%, 58%);    /* Mint Aurora Green */
  
    /* Glow definitions */
    --glow-happy: 0 0 20px hsla(48, 100%, 60%, 0.7), 0 0 8px hsla(48, 100%, 60%, 0.4);
    --glow-sad: 0 0 20px hsla(197, 100%, 62%, 0.7), 0 0 8px hsla(197, 100%, 62%, 0.4);
    --glow-excited: 0 0 20px hsla(330, 100%, 65%, 0.7), 0 0 8px hsla(330, 100%, 65%, 0.4);
    --glow-tired: 0 0 20px hsla(271, 91%, 74%, 0.7), 0 0 8px hsla(271, 91%, 74%, 0.4);
    --glow-focused: 0 0 20px hsla(146, 85%, 58%, 0.7), 0 0 8px hsla(146, 85%, 58%, 0.4);
  
    /* Space Theme Neutrals */
    --bg-space: #03030d;
    --panel-bg: rgba(10, 10, 26, 0.5);
    --panel-bg-hover: rgba(15, 15, 38, 0.65);
    --panel-border: rgba(255, 255, 255, 0.07);
    --panel-border-focus: rgba(255, 255, 255, 0.15);
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --glass-blur: blur(16px);
  
    /* Font definitions */
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Animation Timings */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-spring: 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  
  /* Reset & Box Sizing */
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  
  body {
    font-family: var(--font-body);
    background-color: var(--bg-space);
    color: var(--text-primary);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    position: relative;
    user-select: none;
  }
  
  /* ==========================================================================
     Canvas Layers
     ========================================================================== */
  
  #bg-canvas,
  #constellation-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
  }
  
  #constellation-canvas {
    z-index: 2;
  }
  
  #stars-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: auto; /* Let stars intercept clicks */
  }
  
  #ui-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    pointer-events: none; /* Let clicks pass through to stars/canvas unless on panel */
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
  }
  
  /* ==========================================================================
     Glassmorphic Layout & Panels
     ========================================================================== */
  
  .glass-panel {
    background: var(--panel-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    color: var(--text-primary);
    pointer-events: auto; /* Re-enable clicks inside the panels */
    transition: var(--transition-smooth);
  }
  
  .glass-panel:hover {
    border-color: var(--panel-border-focus);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
  }
  
  /* Left Control Panel */
  #control-panel {
    width: 380px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 24px;
  }
  
  /* Hide scrollbar for panel */
  #control-panel::-webkit-scrollbar {
    width: 4px;
  }
  #control-panel::-webkit-scrollbar-track {
    background: transparent;
  }
  #control-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
  }
  
  .panel-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  
  .panel-header .logo {
    font-size: 2.5rem;
    animation: float 4s ease-in-out infinite;
    width: fit-content;
  }
  
  h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
  }
  
  #panel-title {
    font-size: 1.8rem;
    background: linear-gradient(135deg, #ffffff 30%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  
  .subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    opacity: 0.8;
  }
  
  /* Form Elements */
  #mood-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  
  .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  
  .form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }
  
  /* Mood Grid */
  .mood-selector-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
  }
  
  .mood-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 10px 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
  }
  
  .mood-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
  }
  
  .mood-btn .mood-emoji {
    font-size: 1.5rem;
    transition: var(--transition-spring);
  }
  
  .mood-btn .mood-name {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-secondary);
  }
  
  /* Mood Selected States */
  .mood-btn[data-mood="happy"].active {
    border-color: var(--color-happy);
    background: rgba(255, 215, 0, 0.12);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
  }
  .mood-btn[data-mood="happy"].active .mood-emoji { transform: scale(1.2); }
  
  .mood-btn[data-mood="sad"].active {
    border-color: var(--color-sad);
    background: rgba(51, 181, 229, 0.12);
    box-shadow: 0 0 10px rgba(51, 181, 229, 0.2);
  }
  .mood-btn[data-mood="sad"].active .mood-emoji { transform: scale(1.2); }
  
  .mood-btn[data-mood="excited"].active {
    border-color: var(--color-excited);
    background: rgba(255, 51, 102, 0.12);
    box-shadow: 0 0 10px rgba(255, 51, 102, 0.2);
  }
  .mood-btn[data-mood="excited"].active .mood-emoji { transform: scale(1.2); }
  
  .mood-btn[data-mood="tired"].active {
    border-color: var(--color-tired);
    background: rgba(179, 136, 255, 0.12);
    box-shadow: 0 0 10px rgba(179, 136, 255, 0.2);
  }
  .mood-btn[data-mood="tired"].active .mood-emoji { transform: scale(1.2); }
  
  .mood-btn[data-mood="focused"].active {
    border-color: var(--color-focused);
    background: rgba(0, 230, 118, 0.12);
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.2);
  }
  .mood-btn[data-mood="focused"].active .mood-emoji { transform: scale(1.2); }
  
  /* Textarea Notes */
  textarea {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 12px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    resize: none;
    outline: none;
    transition: var(--transition-fast);
  }
  
  textarea:focus {
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.35);
  }
  
  .char-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
  }
  
  /* Cast Button */
  .glowing-btn {
    position: relative;
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    color: white;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition-fast);
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .glowing-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.4);
  }
  
  .glowing-btn:active {
    transform: translateY(0);
  }
  
  .glowing-btn .btn-text {
    position: relative;
    z-index: 2;
  }
  
  .glowing-btn .btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(
      120deg,
      transparent,
      rgba(255, 255, 255, 0.2),
      transparent
    );
    transition: 0.6s;
    z-index: 1;
  }
  
  .glowing-btn:hover .btn-glow {
    left: 100%;
  }
  
  /* ==========================================================================
     Right Panel (Stats Panel / Expandable Drawer)
     ========================================================================== */
  
  #stats-panel {
    position: relative;
    width: 320px;
    padding: 24px;
    max-height: calc(100vh - 48px);
    overflow: visible;
  }
  
  /* Drawer Toggle Tab */
  .toggle-drawer-btn {
    position: absolute;
    left: -40px;
    top: 24px;
    width: 40px;
    height: 40px;
    background: var(--panel-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--panel-border);
    border-right: none;
    border-radius: 12px 0 0 12px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    transition: var(--transition-smooth);
    pointer-events: auto;
  }
  
  .toggle-drawer-btn:hover {
    background: var(--panel-bg-hover);
    color: white;
  }
  
  /* Collapsed Panel state */
  #stats-panel.collapsed {
    transform: translateX(calc(100% + 24px)); /* Push panel completely off-screen, keeping margin */
  }
  
  #stats-panel.collapsed .toggle-drawer-btn {
    box-shadow: -8px 0 16px rgba(0, 0, 0, 0.2);
  }
  
  .panel-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  
  #stats-title {
    font-size: 1.3rem;
  }
  
  /* Stats Cards Grid */
  .stats-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  
  .stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }
  
  .stat-number {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
  }
  
  .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  
  /* Mood Chart List */
  .chart-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  
  .chart-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  
  .bar-chart {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  
  .chart-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
  }
  
  .chart-row-label {
    width: 60px;
    font-weight: 500;
    color: var(--text-secondary);
  }
  
  .chart-bar-outer {
    flex-grow: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
  }
  
  .chart-bar-inner {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
  }
  
  /* Chart inner colors matching moods */
  .chart-bar-inner.happy { background: var(--color-happy); box-shadow: 0 0 8px hsla(48, 100%, 60%, 0.4); }
  .chart-bar-inner.sad { background: var(--color-sad); box-shadow: 0 0 8px hsla(197, 100%, 62%, 0.4); }
  .chart-bar-inner.excited { background: var(--color-excited); box-shadow: 0 0 8px hsla(330, 100%, 65%, 0.4); }
  .chart-bar-inner.tired { background: var(--color-tired); box-shadow: 0 0 8px hsla(271, 91%, 74%, 0.4); }
  .chart-bar-inner.focused { background: var(--color-focused); box-shadow: 0 0 8px hsla(146, 85%, 58%, 0.4); }
  
  .chart-row-value {
    width: 35px;
    text-align: right;
    font-weight: 600;
    color: var(--text-muted);
  }
  
  /* Utility Buttons */
  .danger-btn {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    padding: 10px 16px;
    color: #ef4444;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    width: 100%;
    transition: var(--transition-fast);
  }
  
  .danger-btn:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
  }
  
  .danger-btn:active {
    transform: translateY(0);
  }
  
  /* Audio Control Floating Button */
  .audio-control {
    position: absolute;
    top: 24px;
    left: 428px;
    z-index: 10;
    background: var(--panel-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 8px 14px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    pointer-events: auto;
    transition: var(--transition-fast);
  }
  
  .audio-control:hover {
    background: var(--panel-bg-hover);
    border-color: var(--panel-border-focus);
    transform: translateY(-1px);
  }
  
  /* ==========================================================================
     Interactive Star Nodes
     ========================================================================== */
  
  .star-node {
    position: absolute;
    width: 20px;
    height: 20px;
    margin-left: -10px; /* Center alignment offset */
    margin-top: -10px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  
  /* Flare animations and structure */
  .star-node::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 10px white;
    z-index: 2;
  }
  
  .star-node::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    z-index: 1;
    animation: starPulse 2.5s ease-in-out infinite alternate;
  }
  
  /* Flare light rays */
  .star-flare {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
  }
  
  .star-flare::before,
  .star-flare::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0) 70%);
    transform: translate(-50%, -50%);
    border-radius: 50%;
  }
  
  .star-flare::before {
    width: 2px;
    height: 36px;
  }
  .star-flare::after {
    width: 36px;
    height: 2px;
  }
  
  /* Hover effects */
  .star-node:hover {
    transform: scale(1.4);
    z-index: 105;
  }
  
  .star-node:hover::after {
    animation: starPulseHover 1s ease-in-out infinite alternate;
  }
  
  /* Color themes for stars */
  .star-node.happy::after { background: var(--color-happy); box-shadow: var(--glow-happy); }
  .star-node.happy .star-flare::before, .star-node.happy .star-flare::after { background: radial-gradient(circle, var(--color-happy) 0%, transparent 80%); }
  
  .star-node.sad::after { background: var(--color-sad); box-shadow: var(--glow-sad); }
  .star-node.sad .star-flare::before, .star-node.sad .star-flare::after { background: radial-gradient(circle, var(--color-sad) 0%, transparent 80%); }
  
  .star-node.excited::after { background: var(--color-excited); box-shadow: var(--glow-excited); }
  .star-node.excited .star-flare::before, .star-node.excited .star-flare::after { background: radial-gradient(circle, var(--color-excited) 0%, transparent 80%); }
  
  .star-node.tired::after { background: var(--color-tired); box-shadow: var(--glow-tired); }
  .star-node.tired .star-flare::before, .star-node.tired .star-flare::after { background: radial-gradient(circle, var(--color-tired) 0%, transparent 80%); }
  
  .star-node.focused::after { background: var(--color-focused); box-shadow: var(--glow-focused); }
  .star-node.focused .star-flare::before, .star-node.focused .star-flare::after { background: radial-gradient(circle, var(--color-focused) 0%, transparent 80%); }
  
  /* Star Tooltip */
  .star-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    background: rgba(8, 8, 20, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 110;
  }
  
  .star-node:hover .star-tooltip {
    opacity: 1;
    transform: translateY(0);
  }
  
  /* Spawn animation */
  .star-spawn-flash {
    position: absolute;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    background: radial-gradient(circle, #ffffff 10%, rgba(255,255,255,0.8) 30%, transparent 70%);
    z-index: 99;
    animation: flashOut 0.8s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
  }
  
  /* ==========================================================================
     Detail Modal
     ========================================================================== */
  
  .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 3, 10, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
  }
  
  .modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
  }
  
  .modal-card {
    position: relative;
    width: 440px;
    max-width: 90vw;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    pointer-events: auto;
  }
  
  .modal-overlay.hidden .modal-card {
    transform: scale(0.9);
  }
  
  .close-modal-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-fast);
    line-height: 1;
  }
  
  .close-modal-btn:hover {
    color: white;
    transform: scale(1.1);
  }
  
  .modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
  }
  
  .modal-mood-badge {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--panel-border);
  }
  
  /* Mood badge glows in modal */
  .modal-card.happy .modal-mood-badge { background: rgba(255, 215, 0, 0.15); border-color: var(--color-happy); box-shadow: 0 0 15px rgba(255, 215, 0, 0.2); }
  .modal-card.sad .modal-mood-badge { background: rgba(51, 181, 229, 0.15); border-color: var(--color-sad); box-shadow: 0 0 15px rgba(51, 181, 229, 0.2); }
  .modal-card.excited .modal-mood-badge { background: rgba(255, 51, 102, 0.15); border-color: var(--color-excited); box-shadow: 0 0 15px rgba(255, 51, 102, 0.2); }
  .modal-card.tired .modal-mood-badge { background: rgba(179, 136, 255, 0.15); border-color: var(--color-tired); box-shadow: 0 0 15px rgba(179, 136, 255, 0.2); }
  .modal-card.focused .modal-mood-badge { background: rgba(0, 230, 118, 0.15); border-color: var(--color-focused); box-shadow: 0 0 15px rgba(0, 230, 118, 0.2); }
  
  .modal-emoji {
    font-size: 2rem;
  }
  
  .modal-mood-name {
    font-size: 1.4rem;
    font-family: var(--font-heading);
    margin-bottom: 2px;
  }
  
  .modal-time {
    font-size: 0.75rem;
    color: var(--text-muted);
  }
  
  .modal-body {
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
  }
  
  .modal-note-quote {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-primary);
    font-style: italic;
  }
  
  .modal-footer {
    display: flex;
    justify-content: flex-end;
  }
  
  .text-danger-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
  }
  
  .text-danger-btn:hover {
    color: #ef4444;
  }
  
  /* ==========================================================================
     Keyframe Animations
     ========================================================================== */
  
  @keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(3deg); }
  }
  
  @keyframes starPulse {
    0% { transform: scale(0.85); opacity: 0.5; }
    100% { transform: scale(1.15); opacity: 1; }
  }
  
  @keyframes starPulseHover {
    0% { transform: scale(1); filter: brightness(1); }
    100% { transform: scale(1.35); filter: brightness(1.3); }
  }
  
  @keyframes flashOut {
    0% { width: 0px; height: 0px; opacity: 1; box-shadow: 0 0 0px 0px rgba(255,255,255,0.9); }
    40% { width: 100px; height: 100px; opacity: 0.8; box-shadow: 0 0 30px 10px rgba(255,255,255,0.7); }
    100% { width: 250px; height: 250px; opacity: 0; box-shadow: 0 0 100px 30px rgba(255,255,255,0); }
  }
  
  .animate-scale {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  
  /* ==========================================================================
     Media Queries (Responsive Layouts)
     ========================================================================== */
  
  @media (max-width: 1024px) {
    #ui-container {
      padding: 16px;
    }
    .audio-control {
      left: 16px;
      top: unset;
      bottom: 16px;
    }
  }
  
  @media (max-width: 768px) {
    body {
      overflow-y: auto;
      height: auto;
      min-height: 100vh;
    }
    
    #bg-canvas,
    #constellation-canvas,
    #stars-container {
      position: fixed;
    }
    
    #ui-container {
      flex-direction: column;
      gap: 20px;
      padding: 12px;
      position: relative;
      height: auto;
      overflow-y: auto;
      pointer-events: auto; /* Allow scrolling */
    }
    
    #control-panel {
      width: 100%;
      max-height: none;
      padding: 20px;
    }
    
    #stats-panel {
      width: 100%;
      max-height: none;
      padding: 20px;
      transform: none !important; /* Force visual visible state */
    }
    
    .toggle-drawer-btn {
      display: none; /* Hide drawer toggler on mobile since they stack */
    }
    
    .audio-control {
      position: relative;
      left: 0;
      bottom: 0;
      top: 0;
      width: fit-content;
      order: -1; /* Place above everything */
    }
  }
