html, body { margin: 0; height: 100%; background: #000; }
#app { position: fixed; inset: 0; overflow: hidden; background: #000; color: #e6e8f2;
       font-family: system-ui, -apple-system, "Segoe UI", sans-serif; user-select: none; -webkit-user-select: none; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

body:not(.ui-on) { cursor: none; }
.hidden { display: none !important; }

button { font: inherit; font-size: 13px; color: #e6e8f2; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
         border-radius: 8px; padding: 6px 12px; cursor: pointer; }
button:hover { background: rgba(255,255,255,.16); }

/* Things that fade out when the mouse is idle */
.chrome, #hud { transition: opacity .6s ease; }
body:not(.ui-on) .chrome, body:not(.ui-on) #hud { opacity: 0; pointer-events: none; }
body.ui-hidden .chrome, body.ui-hidden #hud, body.ui-hidden #toast { opacity: 0 !important; pointer-events: none; }

#hud { position: absolute; left: 18px; top: 14px; pointer-events: none; text-shadow: 0 1px 10px rgba(0,0,0,.8); }
#sceneName { font-size: 20px; font-weight: 600; letter-spacing: .01em; }
#info { font-size: 13px; opacity: .65; margin-top: 2px; font-variant-numeric: tabular-nums; }

#topRight { position: absolute; right: 14px; top: 12px; display: flex; gap: 8px; }
#topRight button { background: rgba(10,10,18,.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
#topRight button.on { background: rgba(155,140,255,.28); border-color: rgba(155,140,255,.8); }
.note { font-size: 12px; line-height: 1.45; color: #7d829c; margin: -2px 0 10px; }

#transport { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(600px, calc(100% - 32px));
             box-sizing: border-box; display: flex; align-items: center; gap: 12px; padding: 10px 14px;
             background: rgba(10,10,18,.62); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
             border: 1px solid rgba(255,255,255,.1); border-radius: 12px; }
#transport button { width: 36px; height: 32px; padding: 0; flex: none; }
#transport button svg { width: 16px; height: 16px; display: block; margin: auto; }
#transport button.on { background: rgba(155,140,255,.28); border-color: rgba(155,140,255,.8); }
@media (max-width: 560px) {
  #transport { gap: 8px; padding: 10px; }
  #transport button { width: 32px; }
  #transport #cover { display: none; }
}
#trackBox { flex: 1; min-width: 0; }
#trackName { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
#trackTime { font-size: 12px; color: #9aa0bd; font-variant-numeric: tabular-nums; flex: none; }
#seek { width: 100%; margin: 0; accent-color: #9b8cff; display: block; }
#seek:disabled { opacity: .35; }

/* Scene name card: fades in with letters drawing together, holds, then fades out. */
#title { position: absolute; left: 0; right: 0; bottom: 13%; text-align: center; pointer-events: none; opacity: 0;
         font-size: clamp(26px, 5.2vw, 68px); font-weight: 200; letter-spacing: .32em; text-transform: uppercase;
         padding-left: .32em; color: #fff; text-shadow: 0 0 18px rgba(155,140,255,.9), 0 0 48px rgba(255,79,163,.45); }
#title.show { animation: titleCard 2.4s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes titleCard {
  0%   { opacity: 0; letter-spacing: .8em; filter: blur(10px); }
  22%  { opacity: 1; letter-spacing: .32em; filter: blur(0); }
  70%  { opacity: 1; }
  100% { opacity: 0; letter-spacing: .26em; filter: blur(4px); }
}
body.ui-hidden #title { display: none; }
@media (prefers-reduced-motion: reduce) {
  #title.show { animation-duration: 1.6s; }
  @keyframes titleCard { 0% { opacity: 0; } 20% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
}

/* Now playing card: the song's cover, title and artist for a few seconds when a song starts. */
#nowPlaying { position: absolute; left: 18px; bottom: 18px; display: flex; align-items: center; gap: 12px; box-sizing: border-box;
              max-width: min(340px, calc(100% - 36px)); padding: 10px 16px 10px 10px; border-radius: 12px; pointer-events: none; opacity: 0;
              background: rgba(14,14,26,.82); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
#nowPlaying.noCover { padding-left: 16px; }
#nowPlaying.show { animation: nowPlaying 5.5s ease forwards; }
@keyframes nowPlaying { 0% { opacity: 0; } 8% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; } }
#nowPlaying > div { min-width: 0; }
#npCover { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex: none; box-shadow: 0 2px 12px rgba(0,0,0,.5); }
#npTitle { font-size: 15px; font-weight: 600; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
#npArtist { font-size: 13px; color: #a6abc6; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Clear of the recording badge, and of the player bar when the window is too narrow for both side by side. */
#nowPlaying:has(~ #rec:not(.hidden)) { bottom: 62px; }
@media (max-width: 1340px) { #nowPlaying { bottom: 86px; } }
body.ui-hidden #nowPlaying { display: none; }

#rec { position: absolute; left: 18px; bottom: 18px; display: flex; align-items: center; gap: 8px;
       padding: 6px 12px; font-size: 13px; font-variant-numeric: tabular-nums; border-radius: 999px;
       background: rgba(14,14,26,.8); border: 1px solid rgba(255,80,90,.5); pointer-events: none; }
#rec .dot { width: 9px; height: 9px; border-radius: 50%; background: #ff3b4f; animation: recBlink 1.2s ease-in-out infinite; }
@keyframes recBlink { 50% { opacity: .25; } }
#cover { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; flex: none; box-shadow: 0 2px 12px rgba(0,0,0,.5); }
#looksList .look { display: flex; gap: 6px; margin: 6px 0; }
#looksList .lookLoad { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lookNew { display: flex; gap: 6px; margin: 8px 0; }
.lookNew input { flex: 1; min-width: 0; font: inherit; font-size: 13px; color: #e6e8f2; background: #1a1a2a;
                 border: 1px solid rgba(255,255,255,.14); border-radius: 8px; padding: 6px 8px; }
button:disabled { opacity: .4; cursor: default; }
#mixList { display: grid; grid-template-columns: 1fr 1fr; column-gap: 10px; }
#mixList .check { margin: 6px 0; }

#toast { position: absolute; left: 50%; top: 18px; transform: translate(-50%, -8px); max-width: min(520px, calc(100% - 40px));
         padding: 10px 16px; font-size: 13px; line-height: 1.45; text-align: center; border-radius: 10px;
         background: rgba(14,14,26,.88); border: 1px solid rgba(255,255,255,.12); opacity: 0; pointer-events: none;
         transition: opacity .3s, transform .3s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

#dropZone { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; font-size: 22px;
            background: rgba(20,16,40,.6); border: 2px dashed rgba(155,140,255,.7); box-sizing: border-box; pointer-events: none; }
#dropZone.show { display: flex; }

/* Start screen */
#start { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box;
         background: radial-gradient(ellipse at center, rgba(30,20,60,.55), rgba(0,0,0,.85)); overflow-y: auto; }
#start.open { display: flex; }
#startCard { position: relative; width: min(760px, 100%); text-align: center; }
#startCard h1 { margin: 0; font-size: clamp(30px, 6vw, 52px); font-weight: 700; letter-spacing: -.02em;
                background: linear-gradient(90deg, #00e5ff, #9b8cff, #ff4fa3, #ffab40); -webkit-background-clip: text; background-clip: text;
                color: transparent; }
#startCard .sub { margin: 8px 0 26px; color: #a6abc6; font-size: 16px; }
#startClose { position: absolute; right: 0; top: 0; }
#sources { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.src { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 14px 18px; border-radius: 14px; text-align: center;
       background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); transition: transform .15s, background .15s, border-color .15s; }
.src:hover { transform: translateY(-2px); background: rgba(155,140,255,.12); border-color: rgba(155,140,255,.5); }
.src .icon { font-size: 30px; line-height: 1.2; }
.src .t { font-size: 16px; font-weight: 600; }
.src .d { font-size: 12.5px; line-height: 1.45; color: #a6abc6; }
#micRow { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; font-size: 13px; color: #a6abc6; }
#micRow select { width: auto; min-width: 0; max-width: min(360px, 60vw); }
.foot { margin-top: 22px; font-size: 12.5px; color: #7d829c; }

/* Settings panel */
#panel { position: absolute; top: 0; right: 0; bottom: 0; width: 310px; max-width: 88%; box-sizing: border-box; padding: 14px 18px 28px;
         overflow-y: auto; background: rgba(12,12,22,.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
         border-left: 1px solid rgba(255,255,255,.08); transform: translateX(102%); transition: transform .25s ease; }
#panel.open { transform: none; }
.head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.sec { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: #7d829c; margin: 18px 0 6px; padding-top: 12px;
       border-top: 1px solid rgba(255,255,255,.07); }
.row { margin: 10px 0; }
.top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.val { color: #9aa0bd; font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; margin: 0; accent-color: #9b8cff; }
select { width: 100%; font: inherit; font-size: 13px; color: #e6e8f2; background: #1a1a2a; border: 1px solid rgba(255,255,255,.14);
         border-radius: 8px; padding: 6px 8px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 12px 0; cursor: pointer; }
.check input { accent-color: #9b8cff; width: 15px; height: 15px; margin: 0; }
.btns { display: flex; gap: 8px; margin: 18px 0 10px; }
.btns button { flex: 1; }
#keys { width: 100%; border-collapse: collapse; font-size: 12.5px; }
#keys td { padding: 3px 0; }
#keys td:first-child { color: #9aa0bd; white-space: nowrap; padding-right: 12px; }
#version { font-size: 11.5px; color: #6c7190; text-align: center; margin-top: 8px; }
