/* Nightfall — interface: gallery, colour rail, settings, overlays. */

/* ══════════════ GALLERY ══════════════ */
#gallery{ overflow-y:auto; overflow-x:hidden; padding:0 18px calc(24px + var(--safe-b)); }
.gal-head{ padding:42px 0 18px; text-align:center; }
.gal-head h1{ font-size:30px; color:var(--ui-fg); }
.gal-head .sub{ margin:6px 0 0; color:var(--ui-fg-dim); font-size:13px; }

.filters{ display:flex; flex-direction:column; gap:8px; align-items:center; margin-bottom:22px; }
.chips{ display:flex; flex-wrap:wrap; gap:6px; justify-content:center; }
.chips button{
  padding:7px 14px; min-height:36px; border-radius:20px;
  border:1px solid var(--ui-line); color:var(--ui-fg-dim); font-size:13px;
  transition:color .4s var(--ease-ui), background .4s var(--ease-ui), border-color .4s var(--ease-ui);
}
.chips button[aria-pressed="true"]{ color:var(--ui-fg); background:var(--ui-bg-2); border-color:var(--ui-glow); }

.shelf-title{ font-size:14px; color:var(--ui-fg-dim); letter-spacing:.16em; margin:18px 0 10px; }
.shelf{ display:grid; grid-template-columns:repeat(auto-fill,minmax(148px,1fr)); gap:14px; }

.card{
  display:block; text-align:left; border-radius:14px; overflow:hidden;
  background:var(--ui-bg-2); border:1px solid var(--ui-line); padding:0;
  transition:transform .5s var(--ease-soft), border-color .5s var(--ease-ui);
}
.card:hover{ border-color:var(--ui-glow); }
.card:active{ transform:scale(.985); }
.card .thumb{ display:block; width:100%; aspect-ratio:1/1; background:var(--paper); }
.card .thumb svg{ display:block; width:100%; height:100%; }
.card .cap{ display:flex; align-items:center; justify-content:space-between; gap:8px; padding:9px 11px 11px; }
.card .nm{ font-size:12.5px; color:var(--ui-fg); }
.card .tr{ font-size:11px; color:var(--ui-fg-dim); letter-spacing:.1em; }
.card .ring{ width:18px; height:18px; flex:0 0 18px; border-radius:50%;
  background:conic-gradient(var(--ui-glow) var(--p,0deg), rgba(255,255,255,.07) 0); }

.gal-foot{ display:flex; flex-direction:column; align-items:center; gap:14px; margin-top:28px; }
.surprise{
  min-height:52px; padding:0 34px; border-radius:26px;
  border:1px solid var(--ui-line); background:var(--ui-bg-2); color:var(--ui-fg);
  font-size:15px; letter-spacing:.08em;
  transition:border-color .5s var(--ease-ui);
}
.surprise:hover{ border-color:var(--ui-glow); }
.linkbtn{ color:var(--ui-fg-dim); font-size:13px; padding:10px 12px; min-height:44px;
  transition:color .4s var(--ease-ui); }
.linkbtn:hover{ color:var(--ui-fg); }

/* ══════════════ PLAY ══════════════ */
body.screen-play #play{
  grid-template-columns:1fr var(--rail-w);
  grid-template-rows:auto 1fr auto;
}
#play .stage{ grid-column:1; grid-row:2; background:var(--page); }

/* A real row with a solid background rather than something floating over the
   picture: up here a tap belongs to the bar, never to the artwork beneath. */
.play-head{
  grid-column:1 / -1; grid-row:1; position:relative; z-index:5;
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  min-height:44px; padding:4px 8px;
  background:var(--ui-bg); border-bottom:1px solid var(--ui-line);
}
.tally{ display:flex; gap:16px; font-size:12.5px; color:var(--ui-fg-dim); letter-spacing:.06em; }
.tally b{ color:var(--ui-fg); font-weight:400; }
.prog{ position:absolute; left:0; right:0; bottom:-1px; height:2px; background:transparent; }
.prog-fill{ height:100%; width:0%; background:var(--ui-glow); transition:width .9s var(--ease-soft); }

/* how close wander sits, and how close a pinch leaves you */
.zoombar{
  grid-column:1; grid-row:3;
  display:flex; align-items:center; gap:10px; padding:6px 14px;
  background:var(--ui-bg); border-top:1px solid var(--ui-line);
}
.zoombar input[type=range]{ flex:1; accent-color:var(--ui-glow); background:transparent; min-height:32px; }
.zb{ width:34px; height:34px; border-radius:50%; font-size:17px; line-height:1;
     color:var(--ui-fg-dim); border:1px solid transparent; }
.zb:hover{ color:var(--ui-fg); border-color:var(--ui-line); }

.rail{
  grid-column:2; grid-row:2 / span 2;
  display:flex; flex-direction:column; justify-content:flex-end; align-items:center; gap:12px;
  padding:14px 8px calc(14px + var(--safe-b));
  background:var(--ui-bg); border-left:1px solid var(--ui-line);
}
.upcoming{ display:flex; flex-direction:column-reverse; gap:7px; align-items:center; }
.sw{ border-radius:50%; border:1px solid rgba(0,0,0,.25); }
.upcoming .sw{ width:26px; height:26px; opacity:.5; }
.upcoming .sw:nth-child(1){ opacity:.92; }
.upcoming .sw:nth-child(2){ opacity:.74; }
.upcoming .sw:nth-child(3){ opacity:.6; }

.railmain{ display:flex; flex-direction:column; align-items:center; gap:10px; }
.current{
  width:70px; height:70px; border-radius:50%; position:relative;
  border:1px solid rgba(0,0,0,.3);
  box-shadow:0 0 0 1px var(--ui-line), 0 0 22px -4px var(--ui-glow), inset 0 2px 6px rgba(0,0,0,.28);
  transition:background 700ms var(--ease-soft), transform 500ms var(--ease-soft);
}
.current.pop{ animation:swpop 900ms var(--ease-soft); }
@keyframes swpop{ 0%{ transform:scale(.97); opacity:.45 } 100%{ transform:scale(1); opacity:1 } }
.current.letgo{ animation:swgo 700ms var(--ease-soft); }
@keyframes swgo{ 0%{ transform:translateY(0); opacity:1 } 100%{ transform:translateY(26px); opacity:0 } }

.holds{ display:grid; grid-template-columns:repeat(2,auto); gap:7px; justify-content:center; }
.holds[data-n="1"]{ grid-template-columns:auto; }
.holds[data-n="5"]{ grid-template-columns:repeat(3,auto); }
.hold{
  width:34px; height:34px; border-radius:50%;
  border:1px dashed var(--ui-line); background:transparent;
  transition:background 600ms var(--ease-soft), border-color .4s var(--ease-ui);
}
.hold.full{ border-style:solid; border-color:rgba(0,0,0,.3); }
.hold:hover{ border-color:var(--ui-glow); }

.railbtns{ display:flex; gap:6px; }
.rb{
  width:44px; height:44px; border-radius:50%; font-size:17px; line-height:1;
  color:var(--ui-fg-dim); border:1px solid transparent;
  transition:color .4s var(--ease-ui), border-color .4s var(--ease-ui);
}
.rb:hover{ color:var(--ui-fg); border-color:var(--ui-line); }
.rb[disabled]{ opacity:.28; pointer-events:none; }
.rb[aria-pressed="true"]{ color:var(--ui-fg); border-color:var(--ui-glow); background:var(--ui-bg-2); }
/* muted: a line drawn through the note, rather than a second glyph that may
   or may not exist in the system font */
#muteBtn{ position:relative; }
#muteBtn.off::after{
  content:''; position:absolute; left:50%; top:50%; width:22px; height:1.5px;
  background:currentColor; transform:translate(-50%,-50%) rotate(-45deg);
  border-radius:1px;
}

@media (max-width:719px){
  body.screen-play #play{ grid-template-columns:1fr; grid-template-rows:auto 1fr auto auto; }
  #play .stage{ grid-row:2; }
  .zoombar{ grid-row:3; }
  .rail{
    grid-column:1; grid-row:4;
    flex-direction:row; flex-wrap:wrap; justify-content:center; align-items:center; gap:10px;
    border-left:0; border-top:1px solid var(--ui-line);
    padding:10px 12px calc(10px + var(--safe-b));
  }
  .upcoming{ width:100%; flex-direction:row-reverse; justify-content:center; }
  .railmain{ flex-direction:row; }
  .current{ width:62px; height:62px; }
}

/* ══════════════ OVERLAYS ══════════════ */
.veil{
  position:fixed; inset:0; z-index:80; display:grid; place-items:center;
  background:var(--page); text-align:center;
  transition:opacity 900ms var(--ease-soft);
}
.veil h2{ font-size:28px; color:var(--ui-fg); }
.veil p{ color:var(--ui-fg-dim); font-size:14px; margin-top:10px;
  animation:pulse 5s ease-in-out infinite; }
@keyframes pulse{ 0%,100%{ opacity:.45 } 50%{ opacity:.9 } }
.veil.gone{ opacity:0; pointer-events:none; }

.panel-back{ position:fixed; inset:0; z-index:95; background:rgba(0,0,0,.5); }
.panel{
  position:fixed; z-index:96; left:0; right:0; bottom:0; max-height:86vh;
  background:var(--ui-bg); border-top:1px solid var(--ui-line);
  border-radius:20px 20px 0 0; box-shadow:0 -18px 50px rgba(0,0,0,.5);
  animation:rise 520ms var(--ease-soft);
}
@media (min-width:720px){ .panel{ left:auto; width:420px; right:0; top:0; bottom:0; max-height:none;
  border-radius:20px 0 0 20px; animation:slide 520ms var(--ease-soft); } }
@keyframes rise{ from{ transform:translateY(24px); opacity:0 } }
@keyframes slide{ from{ transform:translateX(24px); opacity:0 } }
.panel-grip{ width:38px; height:4px; border-radius:2px; background:var(--ui-line); margin:10px auto 0; }
.panel-scroll{ overflow-y:auto; max-height:calc(86vh - 20px); padding:12px 20px calc(24px + var(--safe-b)); }
@media (min-width:720px){ .panel-scroll{ max-height:100vh; } }
.panel h3{ font-size:12px; letter-spacing:.2em; color:var(--ui-fg-dim); margin:22px 0 9px; }
.panel .hint{ font-size:12px; color:var(--ui-fg-dim); margin:0 0 10px; }

.seg{ display:flex; gap:6px; flex-wrap:wrap; }
.seg button{
  flex:1 1 auto; min-width:60px; min-height:44px; padding:0 14px; border-radius:12px;
  border:1px solid var(--ui-line); color:var(--ui-fg-dim); font-size:13.5px;
  transition:color .4s var(--ease-ui), background .4s var(--ease-ui), border-color .4s var(--ease-ui);
}
.seg button[aria-pressed="true"]{ color:var(--ui-fg); background:var(--ui-bg-2); border-color:var(--ui-glow); }

.row{ display:flex; align-items:center; justify-content:space-between; gap:14px;
  min-height:48px; font-size:14px; color:var(--ui-fg); }
.row em{ display:block; font-style:normal; font-size:12px; color:var(--ui-fg-dim); }
.row input[type=range]{ flex:1; max-width:200px; accent-color:var(--ui-glow); background:transparent; }
.row input[type=checkbox]{ width:46px; height:28px; accent-color:var(--ui-glow); }
.nowplaying{ font-size:13px; color:var(--ui-fg-dim); font-style:italic; }
.panel-acts{ display:flex; flex-direction:column; align-items:flex-start; }
.done{ display:block; width:100%; min-height:50px; margin-top:26px; border-radius:14px;
  border:1px solid var(--ui-line); background:var(--ui-bg-2); color:var(--ui-fg); letter-spacing:.08em; }

.finish{ position:fixed; inset:0; z-index:92; display:grid; place-items:center;
  background:rgba(0,0,0,.45); animation:fadein 1.6s var(--ease-soft); }
@keyframes fadein{ from{ opacity:0 } }
.finish-in{ text-align:center; padding:34px 30px; border-radius:20px;
  background:var(--ui-bg); border:1px solid var(--ui-line); }
.finish h2{ font-size:24px; color:var(--ui-fg); }
.finish p{ color:var(--ui-fg-dim); font-size:13px; margin:8px 0 18px; }
.finish-acts{ display:flex; flex-direction:column; gap:2px; }

.toast{ position:fixed; z-index:97; left:50%; bottom:calc(22px + var(--safe-b));
  transform:translateX(-50%); padding:11px 18px; border-radius:20px;
  background:var(--ui-bg-2); border:1px solid var(--ui-line); color:var(--ui-fg);
  font-size:13px; animation:fadein .6s var(--ease-soft); }

.card .del{ font-size:11px; color:var(--ui-fg-dim); padding:4px 6px; border-radius:8px; }
.card .del:hover{ color:var(--ui-fg); }
