/* ═══════════════════════════════════════════════════
   HARMONIUM — CINEMATIC MOVIE DEFAULT THEME
   Psychology color palette: Deep Crimson (passion/energy),
   Molten Amber (warmth/focus), Midnight Indigo (depth/mystique)
   ═══════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;900&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  /* ── CINEMA DEFAULT PALETTE ── */
  --bg:           #060408;
  --bg2:          #0c080f;
  --glass:        rgba(18, 10, 24, 0.72);
  --glass-border: rgba(180, 120, 60, 0.12);
  --glass-inner:  rgba(255, 200, 100, 0.04);

  --gold:         #e8a830;      /* Molten amber — warmth, focus */
  --crimson:      #c0392b;      /* Deep crimson — passion, energy */
  --accent:       #7c3aed;      /* Violet — depth, mystique */
  --rose:         #f43f5e;      /* Rose — excitement */
  --text:         #f2e8d8;
  --muted:        #7a6a58;
  --glow:         rgba(232, 168, 48, 0.3);
  --glow2:        rgba(192, 57, 43, 0.25);
  --bg:           #140d0a;
  --bg2:          #080504;
  --glass:        rgba(20, 15, 12, 0.45);
  --glass-border: rgba(255, 200, 120, 0.15);
  --glass-inner:  rgba(0, 0, 0, 0.3);

  --gold:         #dfa85a;
  --crimson:      #8b2318;
  --accent:       #dfa85a;
  --text:         #f4efe6;
  --muted:        #a69888;
  --glow:         rgba(223, 168, 90, 0.3);

  /* ── KEYBOARD ── */
  --wkey:        linear-gradient(180deg, #fffff8 0%, #f4e8d4 80%, #d8c29d 100%);
  --bkey:        linear-gradient(180deg, #2a1f1a 0%, #110c0a 80%, #000000 100%);
  --pressed-w:   linear-gradient(180deg, #e8d0a8, #c6a46e);
  --pressed-b:   linear-gradient(180deg, #3d251c, #1a0f0b);
  --frame-bg:    linear-gradient(145deg, #321c10, #140804);
  --wkey-text:   #5a3818;
  --bkey-text:   rgba(255,200,100,0.6);
  --panel-w:     272px;
  --perspective: 1200px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%; overflow: hidden;
  font-family: var(--font-ui);
  font-size: 14px; color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ════════════════════════════════════════
   CINEMATIC AMBIENT BACKGROUND
   ════════════════════════════════════════ */
#ambient-bg {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: 1; pointer-events: none; overflow: hidden;
  background: radial-gradient(circle at 50% 30%, var(--bg2) 0%, var(--bg) 100%);
}
.blob {
  position: absolute; border-radius: 50%; filter: blur(120px) opacity(0.4);
  mix-blend-mode: soft-light; animation: float 60s ease-in-out infinite;
}
.blob.b1 { width: 80vw; height: 80vw; top: -40vw; left: 10vw; background: var(--gold); }
.blob.b2 { width: 60vw; height: 60vw; bottom: -30vw; right: -10vw; background: var(--crimson); animation-delay: -15s; }
.blob.b3 { width: 70vw; height: 70vw; bottom: 0; left: -20vw; background: var(--accent); animation-delay: -30s; }

@keyframes float {
  0%   { transform: translate(0,     0   ) scale(1   ); }
  50%  { transform: translate(5%,   -5%  ) scale(1.1); }
  100% { transform: translate(0,     0   ) scale(1   ); }
}

/* Film grain overlay */
.grain-overlay {
  position: fixed; inset: 0; z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.35; pointer-events: none; mix-blend-mode: overlay;
  animation: grainShift 0.5s steps(2) infinite;
}
@keyframes grainShift {
  0%  { transform: translate(0,0); }
  25% { transform: translate(-2px, 1px); }
  50% { transform: translate(1px, -2px); }
  75% { transform: translate(2px, 2px); }
}

/* Vignette */
.scanlines {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.75) 100%);
}

/* ════════════════════════════════════════
   CINEMATIC ENTRY OVERLAY
   ════════════════════════════════════════ */
.cinematic-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: radial-gradient(circle at center, var(--bg) 0%, var(--bg2) 100%);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 2s cubic-bezier(0.2,0.8,0.2,1), visibility 2s;
}

.cinematic-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  z-index: -1;
}

.ov-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  align-items: center; gap: 20px;
}

.ov-icon {
  width: 100px; height: 100px;
  background: var(--harmonium-img, radial-gradient(circle at 40% 30%, #e8a830, #5a1a04));
  border-radius: 20px;
  box-shadow: 0 0 80px rgba(232,168,48,0.4),
              0 0 160px rgba(192,57,43,0.2);
  font-size: 60px; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(232,168,48,0.3);
}

.ov-title {
  font-family: var(--font-display);
  font-size: 72px; font-weight: 900; letter-spacing: 0.15em;
  background: linear-gradient(135deg,
    #e8a830 0%, #fff5d0 40%, #e8a830 60%, #c0392b 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 40px rgba(232,168,48,0.5));
}

.ov-sub {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.5em; text-transform: uppercase;
  color: var(--muted); opacity: 0.7;
}

/* ════════════════════════════════════════
   APP SHELL
   ════════════════════════════════════════ */
#app {
  position: relative; z-index: 10;
  display: flex; flex-direction: column;
  height: 100vh;
}

/* UI visibility system */
.cinematic-ui {
  opacity: 0; visibility: hidden;
  transition: opacity 0.9s ease,
              transform 0.9s cubic-bezier(0.16,1,0.3,1),
              visibility 0.01s linear,
              filter 0.9s ease;
  will-change: opacity, transform;
}
body[data-experience-started="true"] .cinematic-ui {
  opacity: 1; visibility: visible;
}
body.idle .cinematic-ui {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(-16px) scale(0.985);
  filter: blur(8px);
}

/* ════════════════════════════════════════
   HEADER
   ════════════════════════════════════════ */
#header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 36px; min-height: 80px;
  background: linear-gradient(180deg, var(--bg) 0%, transparent 100%);
  flex-shrink: 0; z-index: 100;
  border-bottom: 1px solid var(--glass-border);
}

.app-title {
  font-family: var(--font-display);
  font-size: 30px; font-weight: 900; letter-spacing: 0.12em;
  background: linear-gradient(135deg, var(--gold) 0%, #fff8e0 50%, var(--gold) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 20px rgba(232,168,48,0.4));
}

.h-center { display: flex; flex-direction: column; align-items: center; gap: 3px; }
#current-swara {
  font-family: var(--font-display);
  font-size: 48px; font-weight: 900; letter-spacing: -0.02em;
  color: var(--gold);
  text-shadow: 0 0 30px rgba(232,168,48,0.5),
               0 0 60px rgba(232,168,48,0.2);
  min-width: 100px; text-align: center;
  transition: all 0.15s cubic-bezier(0.16,1,0.3,1);
}
#current-swara.note-flash {
  transform: scale(1.2);
}

.h-right { display: flex; align-items: center; gap: 12px; }
#perf-btn {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: 6px; color: var(--muted);
  padding: 9px 18px; cursor: pointer;
  font-family: var(--font-mono); font-size: 9px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.15em;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  backdrop-filter: blur(20px);
}

/* ════════════════════════════════════════
   MAIN LAYOUT & SIDE PANELS
   ════════════════════════════════════════ */
#main-body {
  display: flex; flex: 1; min-height: 0; padding-top: 10px;
  max-width: 1800px; margin: 0 auto; width: 100%; gap: 20px;
}

.side-panel {
  width: 280px;
  display: flex; flex-direction: column; gap: 14px;
  height: 100%;
  overflow-y: auto; overflow-x: hidden;
  padding-bottom: 24px;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(120%);
  -webkit-backdrop-filter: blur(24px) saturate(120%);
  box-shadow: 
    8px 8px 30px rgba(0,0,0,0.5),
    inset 1px 1px 2px rgba(255,255,255,0.05),
    inset -1px -1px 2px rgba(0,0,0,0.4);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.side-panel::-webkit-scrollbar { width: 6px; }
.side-panel::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 6px; }
#left-panel { padding-right: 12px; padding-left: 20px; }
#right-panel { padding-left: 12px; padding-right: 20px; }

.ps {
  flex-shrink: 0;
  background: var(--glass-inner);
  border-radius: 12px; padding: 18px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.4), 0 1px 1px rgba(255,255,255,0.03);
  position: relative;
  overflow: hidden;
}
.ps::before {
  content: ''; position: absolute; top:0; left:0; right:0; height:1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}

.ps-title {
  font-family: 'Playfair Display', serif;
  font-size: 15px; font-weight: 600; font-style: italic;
  color: var(--gold);
  margin-bottom: 12px; letter-spacing: 0.05em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  border-bottom: 1px solid rgba(255, 200, 120, 0.1);
  padding-bottom: 6px;
}

/* ════════════════════════════════════════
   INSTRUMENT SECTION
   ════════════════════════════════════════ */
.inst-btn {
  flex: 1; background: transparent; border: 1px solid var(--glass-border);
  color: var(--muted); border-radius: 6px; padding: 8px 4px;
  font-family: var(--font-ui); font-size: 11px; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
  box-shadow: inset 0 0 0 rgba(255,255,255,0);
}
.inst-btn:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.inst-btn.active {
  background: rgba(232,168,48,0.15); color: var(--gold);
  border-color: var(--gold);
  box-shadow: inset 0 0 10px rgba(232,168,48,0.2), 0 0 10px rgba(232,168,48,0.1);
}

/* ════════════════════════════════════════
   CENTER — KEYBOARD AREA
   ════════════════════════════════════════ */
#center-area {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  position: relative; z-index: 5;
}

#keyboard-housing {
  position: relative; display: flex; flex-direction: column;
  align-items: center; perspective: var(--perspective);
  width: 100%;
  z-index: 10;
}

.kbd-frame {
  background: var(--frame-bg);
  border: 4px solid #1a0a04;
  border-bottom: 8px solid #0f0502;
  border-radius: 12px;
  padding: 30px 40px 45px;
  box-shadow:
    0 40px 100px -10px rgba(0,0,0,1),
    0 20px 40px rgba(0,0,0,0.9),
    inset 0 4px 6px rgba(255,255,255,0.05),
    inset 0 -8px 25px rgba(0,0,0,0.9),
    0 0 60px rgba(139,35,24,0.15);
  transform-style: preserve-3d;
  position: relative;
  min-width: 600px; max-width: 95vw;
}

.kbd-frame::before {
  content: ''; position: absolute; inset: 20px 20px auto 20px; height: 35px; border-radius: 6px;
  background: linear-gradient(180deg, #3d0c0c 0%, #170303 100%);
  box-shadow: inset 0 3px 6px rgba(0,0,0,0.8), 0 4px 10px rgba(0,0,0,0.9);
  pointer-events: none;
}

.kbd-perspective {
  transform: rotateX(8deg) translateZ(10px);
  transform-origin: bottom center;
  transform-style: preserve-3d;
  position: relative;
  z-index: 2;
}

/* ════════════════════════════════════════
   3D PIANO KEYS
   ════════════════════════════════════════ */
.piano-key {
  position: absolute; border-radius: 0 0 8px 8px;
  cursor: pointer; display: flex;
  flex-direction: column; align-items: center; justify-content: space-between;
  padding: 10px 4px 8px;
  will-change: transform, box-shadow;
  transition: transform 0.08s cubic-bezier(0.1,0.7,0.1,1), box-shadow 0.08s;
  user-select: none; -webkit-user-select: none; touch-action: none;
}
.white-key {
  background: var(--wkey);
  border: 1px solid rgba(0,0,0,0.15); border-top: none;
  box-shadow:
    0 18px 35px rgba(0,0,0,0.7),
    inset 3px 0 4px rgba(255,255,255,0.8),
    inset -3px 0 4px rgba(0,0,0,0.25);
  z-index: 1; top: 0;
  transform: translateZ(15px);
}
.black-key {
  background: var(--bkey);
  border: 1px solid rgba(0,0,0,0.8); border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow:
    10px 22px 35px rgba(0,0,0,0.9),
    inset 0 1px 2px rgba(255,200,80,0.3),
    inset -3px 0 4px rgba(0,0,0,0.95);
  z-index: 2; top: 0;
  transform: translateZ(50px);
}

.white-key.pressed {
  background: var(--pressed-w);
  transform: translateZ(-18px) rotateX(4deg) translateY(6px);
  box-shadow:
    0 4px 8px rgba(0,0,0,0.95),
    0 0 40px rgba(232,168,48,0.5),
    0 0 80px rgba(192,57,43,0.2),
    inset 0 4px 12px rgba(0,0,0,0.6);
}
.black-key.pressed {
  background: var(--pressed-b);
  transform: translateZ(12px) rotateX(2deg) translateY(3px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.95), 0 0 30px rgba(192,57,43,0.5);
}

.key-hint {
  font-family: var(--font-ui); font-size: 11px; font-weight: 500;
  color: var(--wkey-text); opacity: 0.6; align-self: flex-end;
}
.key-swara {
  font-family: var(--font-ui); font-size: 12px; font-weight: 600;
  color: var(--wkey-text); pointer-events: none;
}
.black-key .key-hint { color: rgba(255,200,80,0.35); font-size: 8px; }
.black-key .key-swara { color: var(--bkey-text); font-size: 9px; }
.piano-key.dimmed { opacity: 0.12; filter: saturate(0); pointer-events: none; }

#keys-hint {
  margin-top: 20px; text-align: center; font-size: 10px;
  color: rgba(255,255,255,0.3); letter-spacing: 0.08em;
}

/* ════════════════════════════════════════
   GUITAR UI
   ════════════════════════════════════════ */
#guitar-housing {
  width: 100%; max-width: 960px;
  display: flex; flex-direction: column; align-items: center;
  perspective: 1200px; margin-top: 20px; position: relative;
}
.gt-frame {
  width: 100%; height: 260px;
  border-radius: 10px; position: relative; overflow: hidden;
  transform: rotateX(20deg) scale(0.95); transform-style: preserve-3d;
  transition: all 0.4s cubic-bezier(0.2,0.9,0.2,1); cursor: crosshair;
  box-shadow: 0 60px 100px rgba(0,0,0,0.95), 0 0 40px rgba(0,0,0,0.8),
              inset 0 4px 10px rgba(255,255,255,0.06), inset 0 -10px 30px rgba(0,0,0,0.8);
}
body[data-inst="acoustic"] .gt-frame {
  background: linear-gradient(90deg, #1c0a00, #3e1b04, #260e00, #140500);
  border: 1px solid rgba(80,40,10,0.5);
}
body[data-inst="electric"] .gt-frame {
  background: linear-gradient(90deg, #050510, #151525, #0a0a15, #000005);
  border: 1px solid rgba(20,40,80,0.5);
  box-shadow: 0 60px 100px rgba(0,0,0,0.95), inset 0 0 80px rgba(0,50,255,0.08);
}
.gt-frame::before {
  content: ''; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(90deg, transparent, transparent 11.2%, rgba(255,255,255,0.03) 11.3%, rgba(0,0,0,0.8) 11.5%, rgba(255,255,255,0.4) 11.7%, rgba(0,0,0,0.3) 11.9%, transparent 12%);
  pointer-events: none; z-index: 1;
}
.gt-frame::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle 6px at 29% 50%, rgba(200,220,240,0.7), transparent 7px),
              radial-gradient(circle 6px at 53% 50%, rgba(200,220,240,0.7), transparent 7px),
              radial-gradient(circle 6px at 76.5% 50%, rgba(200,220,240,0.7), transparent 7px);
  pointer-events: none; z-index: 2; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8)); mix-blend-mode: screen;
}
.gt-spotlight {
  position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.75) 100%);
}
body[data-inst="acoustic"] .gt-spotlight { background: radial-gradient(circle 180px at 90% 50%, rgba(0,0,0,0.95), transparent 185px), radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.9) 100%); }
body[data-inst="electric"] .gt-spotlight { background: linear-gradient(90deg, transparent 75%, rgba(10,20,40,0.6) 80%, rgba(0,0,0,0.8) 85%, transparent 95%), radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.9) 100%); }

.strum-zone-container { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-evenly; z-index: 10; }
.gt-string { width: 100%; flex: 1; position: relative; display: flex; align-items: center; }
.gt-string::after { content: ''; position: absolute; left: 0; right: 0; height: 2px; box-shadow: 0 16px 20px rgba(0,0,0,0.9); pointer-events: none; transition: all 0.1s; }
body[data-inst="acoustic"] .gt-string::after { background: linear-gradient(180deg, #aa6c39, #f9db91, #6b3e1b); }
body[data-inst="acoustic"] .gt-string[data-idx="1"]::after, body[data-inst="acoustic"] .gt-string[data-idx="0"]::after { background: linear-gradient(180deg, #888, #eee, #555); }
body[data-inst="electric"] .gt-string::after { background: linear-gradient(180deg, #667, #ccd, #445); }
.gt-string[data-idx="5"]::after { height: 6px; } .gt-string[data-idx="4"]::after { height: 5px; }
.gt-string[data-idx="3"]::after { height: 3.5px; } .gt-string[data-idx="2"]::after { height: 2.5px; }
.gt-string[data-idx="1"]::after { height: 1.5px; } .gt-string[data-idx="0"]::after { height: 1px; }

@keyframes vibrateStr { 0% { transform: translateY(0) scaleY(1); } 15% { transform: translateY(-4px) scaleY(1.5); } 30% { transform: translateY(4px) scaleY(1.5); } 45% { transform: translateY(-2px) scaleY(1.2); } 60% { transform: translateY(2px) scaleY(1.2); } 100% { transform: translateY(0) scaleY(1); } }
@keyframes acousticGlow { 0% { box-shadow: 0 16px 30px rgba(0,0,0,0.9), 0 0 30px rgba(255,180,50,0.9), 0 0 60px rgba(255,120,0,0.5); filter: brightness(1.8); } 100% { box-shadow: 0 16px 20px rgba(0,0,0,0.9); filter: brightness(1); } }
@keyframes electricGlow { 0% { box-shadow: 0 16px 30px rgba(0,0,0,0.9), 0 0 40px rgba(0,180,255,1), 0 0 80px rgba(100,80,255,0.7); filter: brightness(2.5); } 100% { box-shadow: 0 16px 20px rgba(0,0,0,0.9); filter: brightness(1); } }
.gt-string.plucked-acoustic::after { animation: vibrateStr 0.5s cubic-bezier(0.2,0.9,0.2,1), acousticGlow 1.5s ease-out forwards; }
.gt-string.plucked-electric::after { animation: vibrateStr 0.3s cubic-bezier(0.2,0.9,0.2,1), electricGlow 2.5s ease-out forwards; }

.gt-active-chord { position: absolute; top: 15px; right: 30px; font-family: var(--font-display); font-size: 64px; color: rgba(255,255,255,0.9); font-weight: bold; pointer-events: none; z-index: 20; opacity: 0.15; transition: opacity 0.3s; }
body[data-inst="acoustic"] .gt-active-chord { text-shadow: 0 0 20px rgba(0,0,0,0.9), 0 0 30px rgba(255,200,50,0.5); }
body[data-inst="electric"] .gt-active-chord { text-shadow: 0 0 20px rgba(0,0,0,0.9), 0 0 40px rgba(50,150,255,0.8); }
.gt-frame:hover .gt-active-chord { opacity: 0.8; }
#gt-hint { font-family: var(--font-mono); font-size: 11px; color: rgba(255,255,255,0.35); text-align: center; margin-top: 28px; letter-spacing: 1px; }

/* ════════════════════════════════════════
   RIGHT PANEL — RECORDER
   ════════════════════════════════════════ */
.rec-controls { display: flex; gap: 8px; margin-bottom: 14px; }
.rec-btn {
  flex: 1; padding: 14px 8px; border-radius: 10px;
  border: 1px solid var(--glass-border); background: var(--glass);
  color: var(--muted); cursor: pointer; font-size: 15px;
  transition: all 0.4s cubic-bezier(0.16,1,0.3,1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.rec-btn:hover { background: rgba(255,255,255,0.07); color: #fff; border-color: rgba(255,255,255,0.15); transform: translateY(-2px); }
#btn-rec.recording { border-color: #ff4f4f; color: #ff4f4f; box-shadow: 0 0 25px rgba(255,79,79,0.3); animation: pulseRec 1.4s infinite; }
@keyframes pulseRec { 0%,100% { box-shadow: 0 0 25px rgba(255,79,79,0.3); } 50% { box-shadow: 0 0 40px rgba(255,79,79,0.6); } }
#btn-play.playing { border-color: #4fffa5; color: #4fffa5; box-shadow: 0 0 25px rgba(79,255,165,0.3); }

#rec-timer { text-align: center; font-size: 30px; color: var(--gold); font-family: var(--font-mono); margin-bottom: 16px; font-weight: 700; text-shadow: 0 0 20px rgba(232,168,48,0.4); }
.slot-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 6px; }
.slot-btn { padding: 10px 0; border-radius: 8px; border: 1px solid var(--glass-border); background: rgba(0,0,0,0.3); color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 700; transition: all 0.3s; font-family: var(--font-mono); }
.slot-btn:hover { border-color: rgba(255,255,255,0.15); color: #fff; }
.slot-btn.active-slot { border-color: var(--gold); color: var(--gold); background: rgba(232,168,48,0.12); box-shadow: 0 0 12px rgba(232,168,48,0.2); }

.ref-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.ref-table td { padding: 5px 0; font-size: 9px; border-bottom: 1px solid rgba(255,255,255,0.03); color: var(--muted); font-family: var(--font-mono); }
.ref-table td:nth-child(2) { color: var(--gold); font-family: var(--font-display); font-size: 11px; font-weight: 600; }
.ref-table td:last-child { text-align: right; opacity: 0.45; font-size: 8px; text-transform: uppercase; letter-spacing: 0.04em; }

/* ════════════════════════════════════════
   RAGA & MIDI & THEME
   ════════════════════════════════════════ */
#midi-device-select {
  font-size: 10px; background: rgba(0,0,0,0.45);
  border: 1px solid var(--glass-border); color: var(--text);
  padding: 6px 8px; border-radius: 8px; width: 100%; outline: none;
}
.midi-refresh {
  background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border);
  border-radius: 6px; color: var(--text); padding: 6px;
  cursor: pointer; font-size: 9px; margin-top: 6px; width: 100%;
  transition: all 0.3s;
}
.midi-refresh:hover { background: rgba(232,168,48,0.08); color: var(--gold); border-color: var(--gold); }

select#raga-select {
  width: 100%; background: var(--glass);
  border: 1px solid var(--glass-border); border-radius: 10px;
  color: var(--text); padding: 8px 12px;
  font-family: var(--font-ui); font-size: 11px; font-weight: 500;
  outline: none; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  transition: border-color 0.3s;
}
select#raga-select:hover { border-color: var(--gold); }
.raga-info { margin-top: 10px; padding: 8px; background: var(--glass-inner); border-radius: 8px; }
#raga-name { color: var(--gold); font-size: 14px; font-family: var(--font-display); font-weight: 600; font-style: italic; }
#raga-thaat { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 2px; }

/* Theme row — 5 themes now */
.theme-row { display: flex; gap: 8px; justify-content: center; margin-bottom: 6px; flex-wrap: wrap; }
.theme-btn {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.12); cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2,0.8,0.2,1);
  box-shadow: 0 3px 8px rgba(0,0,0,0.5);
}
.theme-btn:hover { transform: scale(1.15); border-color: rgba(255,255,255,0.35); }
.theme-btn.active { border-color: var(--gold); box-shadow: 0 0 16px var(--glow); transform: scale(1.2); }
.theme-btn[data-theme='playful'] { background: radial-gradient(circle, #87CEEB, #FFD700); }
.theme-btn[data-theme='cinema']  { background: radial-gradient(circle, #e8a830, #c0392b, #1a0208); }
.theme-btn[data-theme='classic'] { background: radial-gradient(circle, #e0b354, #4a2a15); }
.theme-btn[data-theme='neon']    { background: radial-gradient(circle, #00f5ff, #ff00aa); }
.theme-btn[data-theme='modern']  { background: radial-gradient(circle, #4f8eff, #a855f7); }
.theme-btn[data-theme='ember']   { background: radial-gradient(circle, #ff6b1a, #1a0a00); }
.theme-label { display: flex; justify-content: center; gap: 10px; font-size: 8px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; flex-wrap: wrap; }

/* Active pills container */
#active-pills {
  display: flex; gap: 4px; min-height: 20px;
  align-items: center; justify-content: center;
  flex-wrap: wrap; margin-top: 2px;
}

/* Default body instrument state */
body:not([data-inst]) { --inst: harmonium; }
body[data-inst="harmonium"] { --inst: harmonium; }

/* MIDI badge */
#midi-badge {
  display: none; align-items: center; gap: 5px;
  background: rgba(80,250,150,0.08); border: 1px solid rgba(80,250,150,0.18);
  border-radius: 10px; padding: 4px 10px; font-size: 9px; color: #80ffa0; font-weight: 600;
}
.midi-dot { width: 5px; height: 5px; border-radius: 50%; background: #50e080; box-shadow: 0 0 6px #50e080; }

/* Particles */
#particle-canvas { position: absolute; inset: 0; pointer-events: none; z-index: 100; }

/* Visualizer */
#viz-bar { width: 100%; max-width: 960px; margin-top: 14px; height: 40px; }
#viz-canvas { width: 100%; height: 100%; }

/* ════════════════════════════════════════
   NOTE PILLS
   ════════════════════════════════════════ */
.note-pill {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  font-size: 12px; font-family: var(--font-display); font-weight: 600;
  background: var(--gold); color: var(--bg);
  box-shadow: 0 0 12px rgba(232,168,48,0.5);
  animation: pillPop 0.7s ease-out forwards;
  margin: 0 2px;
}
@keyframes pillPop {
  0%   { transform: scale(0.4) translateY(6px); opacity: 0; }
  20%  { transform: scale(1.25) translateY(-4px); opacity: 1; }
  100% { transform: scale(0.9) translateY(0); opacity: 0; }
}

/* ════════════════════════════════════════
   EXPORT BUTTON
   ════════════════════════════════════════ */
#btn-export {
  margin-top: 10px; width: 100%;
  border-color: rgba(232,168,48,0.15) !important;
  color: var(--muted) !important;
  font-size: 9px; text-transform: uppercase;
  font-family: var(--font-mono); font-weight: 600; letter-spacing: 0.12em;
}
#btn-export:hover { color: var(--gold) !important; border-color: var(--gold) !important; }

/* ════════════════════════════════════════
   PLAYFUL BRIGHT BACKGROUND (For Kids)
   ════════════════════════════════════════ */
#playful-bg {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: 1; pointer-events: none; overflow: hidden;
  background: linear-gradient(180deg, #87CEEB 0%, #E0F6FF 100%);
  opacity: 0; transition: opacity 1s ease;
}
body[data-theme='playful'] #ambient-bg { opacity: 0; }
body[data-theme='playful'] #playful-bg { opacity: 1; }

.sky-gradient {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 20%, rgba(255,255,255,0.4) 0%, transparent 60%);
}
.sun {
  position: absolute; top: 50px; right: 80px; width: 120px; height: 120px;
  background: #FFD700; border-radius: 50%;
  box-shadow: 0 0 60px #FFD700, 0 0 100px #FFA500;
  animation: sunPulse 4s infinite alternate ease-in-out;
}
@keyframes sunPulse { 0% { transform: scale(1); opacity: 0.9; } 100% { transform: scale(1.05); opacity: 1; } }

.cloud {
  position: absolute; background: white; border-radius: 50px;
  opacity: 0.8; filter: blur(2px);
  box-shadow: 0 8px 15px rgba(0,0,0,0.05);
}
.cloud::before, .cloud::after {
  content: ''; position: absolute; background: white; border-radius: 50%;
}
.cloud.c1 { width: 200px; height: 60px; top: 15%; left: -250px; animation: cloudFloat 40s linear infinite; }
.cloud.c1::before { width: 80px; height: 80px; top: -40px; left: 30px; }
.cloud.c1::after { width: 100px; height: 100px; top: -50px; right: 30px; }

.cloud.c2 { width: 150px; height: 50px; top: 40%; left: -200px; animation: cloudFloat 55s linear infinite; animation-delay: -10s; opacity: 0.6; transform: scale(0.7); }
.cloud.c2::before { width: 60px; height: 60px; top: -30px; left: 20px; }
.cloud.c2::after { width: 70px; height: 70px; top: -40px; right: 20px; }

.cloud.c3 { width: 250px; height: 80px; top: 60%; left: -300px; animation: cloudFloat 70s linear infinite; animation-delay: -25s; opacity: 0.9; transform: scale(1.2); }
.cloud.c3::before { width: 100px; height: 100px; top: -50px; left: 40px; }
.cloud.c3::after { width: 120px; height: 120px; top: -60px; right: 40px; }

@keyframes cloudFloat { 0% { transform: translateX(0); } 100% { transform: translateX(120vw); } }

/* ── SUPPORT CARD ── */
.support-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 16px !important;
  margin-top: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.support-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
  border-color: var(--accent);
}
.support-text {
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 12px;
  color: var(--text);
  opacity: 0.9;
}
.upi-box {
  background: var(--glass-inner);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 12px;
}
.upi-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
  opacity: 0.6;
}
.upi-id-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
#upi-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}
#copy-upi {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.2s;
}
#copy-upi:hover { background: rgba(255,255,255,0.1); }

.donate-btn-link { text-decoration: none; display: block; }
.donate-btn {
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, var(--accent), var(--rose, #f43f5e));
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, filter 0.2s;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}
.donate-btn:hover {
  transform: scale(1.02);
  filter: brightness(1.1);
}
.donate-btn:active { transform: scale(0.98); }
