:root{
  --bg: #0b0c10;
  --panel: rgba(20, 22, 30, 0.82);
  --stroke: rgba(255,255,255,0.10);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.62);
}

*{ box-sizing:border-box; }
html,body{ height:100%; margin:0; background:var(--bg); color:var(--text); font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial; }

#stage{
  position:fixed;
  inset:0;
}

.topbar{
  position:fixed;
  left:16px;
  right:16px;
  top:16px;
  padding:12px 14px;
  border:1px solid var(--stroke);
  background:var(--panel);
  border-radius:16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  z-index:10;
  backdrop-filter: blur(10px);
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width: 260px;
}
.dot{
  width:10px;height:10px;border-radius:999px;
  background: rgba(255,255,255,0.8);
}
.title{ font-weight:650; letter-spacing:0.2px; }
.subtitle{ font-size:12px; color:var(--muted); margin-top:2px; }

.controls{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.btn{
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding:8px 10px;
  border-radius:12px;
  cursor:pointer;
  font-size:13px;
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.btn.secondary{ background: rgba(255,255,255,0.03); }
.btn:disabled{ opacity:0.45; cursor:not-allowed; }
.btn input{ display:none; }

select{
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding:8px 10px;
  border-radius:12px;
  font-size:13px;
  outline:none;
}

.hud{
  position:fixed;
  left:16px;
  bottom:16px;
  padding:10px 12px;
  border:1px solid var(--stroke);
  background: rgba(20, 22, 30, 0.70);
  border-radius:14px;
  max-width:min(720px, calc(100vw - 32px));
  font-size:12px;
  color:var(--muted);
  z-index:10;
  backdrop-filter: blur(10px);
  line-height:1.35;
  white-space:pre-wrap;
}

/* -------------------------- Artwork overlay -------------------------- */

.overlay{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,0.55);
  z-index:50;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
  backdrop-filter: blur(6px);
}

.overlay-card{
  width: min(980px, 100%);
  border:1px solid var(--stroke);
  background: rgba(16, 18, 24, 0.92);
  border-radius: 18px;
  overflow:hidden;
  position:relative;
}

.overlay-close{
  position:absolute;
  top:10px;
  right:10px;
  width:36px;
  height:36px;
  border-radius:12px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor:pointer;
  font-size:20px;
  line-height:34px;
}

.overlay-body{
  display:grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap:0;
}

.overlay-imgwrap{
  background: rgba(255,255,255,0.03);
  min-height: 420px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.overlay-imgwrap img{
  max-width:100%;
  max-height: 74vh;
  display:block;
}

.overlay-info{
  padding:16px 16px 18px 16px;
}

.overlay-title{
  font-weight:700;
  font-size:18px;
  margin-bottom:8px;
}

.overlay-meta{
  font-size:13px;
  color:var(--muted);
  margin-bottom:12px;
  line-height:1.35;
}

.overlay-desc{
  font-size:13px;
  color: rgba(255,255,255,0.78);
  line-height:1.45;
  white-space:pre-wrap;
}

.overlay-hint{
  margin-top:14px;
  font-size:12px;
  color: var(--muted);
}

@media (max-width: 820px){
  .overlay-body{ grid-template-columns: 1fr; }
  .overlay-imgwrap{ min-height: 240px; }
}
.overlay[hidden]{ display:none !important; pointer-events:none !important; }



/* HUD quality-of-life */
#hud.hud-hidden{
  opacity:0;
  pointer-events:none;
  transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease;
}
#hud{
  transition: opacity .25s ease, transform .25s ease;
}
.hud-card{
  position: relative;
}
.hud-x{
  position:absolute;
  top:10px;
  right:10px;
  width:28px;
  height:28px;
  border-radius: 10px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor:pointer;
  line-height: 24px;
  font-size: 18px;
}
.hud-x:hover{ background: rgba(255,255,255,0.12); }
