
*{box-sizing:border-box}
html,body{margin:0;height:100%;background:#000;color:#fff;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;overflow:hidden}
.topbar{display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:center;padding:12px 16px;border-bottom:1px solid rgba(255,255,255,.18);position:relative;z-index:5}
.brand{font-weight:700;letter-spacing:.18em;font-size:16px;text-transform:lowercase}
.brand .neon{color:#ff4d8d}
.count{margin-left:10px;opacity:.6}
.controls,.event-box{display:flex;gap:8px;flex-wrap:wrap}
input,select,button{background:rgba(20,20,20,.72);color:#fff;border:1px solid rgba(255,255,255,.28);border-radius:8px;padding:8px 10px}
main{position:relative;height:calc(100% - 110px)}
.stage{position:absolute;inset:0;perspective:1200px;overflow:hidden;background:#000}
.stage::before{
  content:"";position:absolute;left:50%;top:38%;
  width:1100px;height:620px;margin-left:-550px;margin-top:-240px;
  background:radial-gradient(ellipse at center,
    rgba(255,255,255,.42) 0%,
    rgba(255,255,255,.16) 38%,
    transparent 72%);
  filter:blur(28px);
  pointer-events:none;z-index:0;
}
.wheel{position:absolute;left:50%;top:36%;width:0;height:0;transform-style:preserve-3d}
.card{position:absolute;width:220px;height:220px;margin-left:-110px;margin-top:-110px;cursor:pointer}
.card .face{
  width:220px;height:220px;border-radius:4px;overflow:hidden;
  background:#111;position:relative;z-index:2;
  border:1px solid rgba(255,255,255,.16);
}
.card .face img{width:220px;height:220px;object-fit:cover;display:block}
.card .label{
  position:absolute;left:0;right:0;top:calc(100% + 100px);
  text-align:center;font-size:11px;opacity:0;text-shadow:0 1px 8px #000;z-index:3
}
.card.active .label{opacity:0}

/* Floor mirror: clipped box UNDER the jacket only */
.card .reflection{
  position:absolute;left:0;top:220px;width:220px;height:100px;
  overflow:hidden;pointer-events:none;z-index:1;
  transform:none;           /* never flip this box */
  transform-style:flat;     /* keep 3D parent from leaking */
  -webkit-mask-image:linear-gradient(to bottom, rgba(0,0,0,.5), transparent 90%);
  mask-image:linear-gradient(to bottom, rgba(0,0,0,.5), transparent 90%);
}
.card .reflection img{
  display:block;width:220px;height:220px;object-fit:cover;
  /* show bottom half of cover, then invert — stays inside the 100px clip */
  margin-top:-120px;
  transform:scaleY(-1);
  transform-origin:center center;
  filter:brightness(.55);
  opacity:.55;
}
.card:not(.active) .reflection{opacity:.35}

.hidden{display:none!important}
.glass{background:rgba(8,8,8,.86);border:1px solid rgba(255,255,255,.22)}
.detail{position:fixed;right:18px;top:88px;bottom:18px;width:min(340px,92vw);z-index:90;padding:18px;border-radius:14px;overflow:auto;pointer-events:auto}
.detail img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:8px}
.playlist{position:absolute;left:16px;right:16px;bottom:16px;z-index:40;border-radius:14px;padding:12px;max-height:42%;overflow:auto}
.hint{position:fixed;bottom:6px;left:0;right:0;text-align:center;font-size:11px;opacity:.4}
.empty{position:absolute;inset:0;display:grid;place-items:center}

.caption{position:absolute;left:50%;top:calc(36% + 240px);bottom:auto;transform:translateX(-50%);width:min(520px,90vw);text-align:center;z-index:4;pointer-events:none;opacity:0;transition:opacity 1.15s ease}
.caption.show{opacity:1}
.caption-artist{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;font-weight:800;font-size:12px;letter-spacing:.24em;text-transform:uppercase;color:#ff4d8d;margin-bottom:7px}
.caption-title{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;font-weight:800;font-size:24px;letter-spacing:-0.03em;line-height:1.15;color:#fff;margin-bottom:12px}
.caption-body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;font-size:14px;line-height:1.55;color:#ddd;margin:0}

.value-total{font-size:12px;letter-spacing:.08em;color:#ff4d8d;white-space:nowrap;padding:6px 8px}

.card .heart{
  position:absolute;right:8px;bottom:8px;z-index:6;
  width:30px;height:30px;border:none;border-radius:50%;
  background:rgba(0,0,0,.5);color:rgba(255,255,255,.75);
  font-size:15px;line-height:1;cursor:pointer;padding:0;
  display:grid;place-items:center;
  backdrop-filter:blur(4px);
}
.card .heart:hover{color:#fff;background:rgba(0,0,0,.7)}
.card .heart.on{
  color:#ff4d8d;
  text-shadow:0 0 10px rgba(255,77,141,.75);
  background:rgba(40,0,30,.55);
}
.card:not(.active) .heart{width:22px;height:22px;font-size:12px;opacity:.9}

.card .trash{
  position:absolute;left:8px;bottom:8px;z-index:6;
  width:30px;height:30px;border:none;border-radius:50%;
  background:rgba(0,0,0,.5);color:rgba(255,255,255,.75);
  font-size:15px;line-height:1;cursor:pointer;padding:0;
  display:grid;place-items:center;
  backdrop-filter:blur(4px);
}
.card .trash:hover{color:#fff;background:rgba(0,0,0,.7)}
.card:not(.active) .trash{width:22px;height:22px;font-size:12px;opacity:.9}
.card .trash svg{width:14px;height:14px;display:block}
.card:not(.active) .trash svg{width:11px;height:11px}

.hibala-modal-backdrop{
  position:fixed;inset:0;z-index:200;
  background:rgba(0,0,0,.72);
  display:grid;place-items:center;
}
.hibala-modal{
  background:#000;color:#fff;
  border:1px solid #ff4d8d;border-radius:12px;
  padding:22px 20px 16px;width:min(380px,92vw);
  box-shadow:0 0 24px rgba(255,77,141,.28);
}
.hibala-modal p{margin:0 0 18px;font-size:15px;line-height:1.45}
.hibala-modal-actions{display:flex;gap:10px;justify-content:flex-end}
.hibala-modal .hibala-cancel{
  background:transparent;color:#fff;
  border:1px solid rgba(255,255,255,.35);
  border-radius:8px;padding:8px 14px;cursor:pointer;
}
.hibala-modal .hibala-cancel:hover{border-color:#fff}
.hibala-modal .hibala-delete{
  background:#ff4d8d;color:#fff;border:none;
  border-radius:8px;padding:8px 14px;cursor:pointer;font-weight:700;
}
.hibala-modal .hibala-delete:hover{background:#ff6ba3}

body.collection .back-scan{color:#ff4d8d;text-decoration:none;margin-right:12px;letter-spacing:.08em;font-size:12px;font-weight:600}
body.collection .back-scan:hover{text-decoration:underline}
body.collection #gate{position:fixed;inset:0;display:grid;place-items:center;z-index:80;background:#000;color:#fff;text-align:center;padding:24px}
body.collection #gate a{color:#ff4d8d}
body.collection #who{margin-left:8px}

#add-photo-wrap{
  position:relative;display:grid;place-items:center;
  width:44px;height:44px;min-width:44px;
  overflow:hidden;border-radius:8px;
  border:2px dashed #ff4d8d;background:rgba(255,77,141,.12)
}
.add-photo-label{display:block;padding:0;background:transparent;color:#ff4d8d;font-size:28px;font-weight:400;line-height:1;pointer-events:none}
#disc-image-input,#game-image-input{position:absolute;inset:0;width:100%;height:100%;opacity:0;font-size:28px;cursor:pointer}
@media (max-width:820px){
  .topbar{grid-template-columns:1fr 44px;grid-template-areas:"brand add" "controls controls"}
  .topbar .brand{grid-area:brand;min-width:0}
  .topbar .controls,.topbar .event-box{grid-area:controls}
  .topbar #add-photo-wrap{grid-area:add;justify-self:end}
}

body.disc-golf .card .face,
body.disc-golf .card .reflection,
body.disc-golf .detail img,
body.disc-golf .suggest-thumb{
  background:#000
}
body.disc-golf .card .face img,
body.disc-golf .detail img,
body.disc-golf .suggest-thumb img{
  background:#000;
  object-fit:contain;
  filter:url(#disc-on-black)
}
body.disc-golf .card .reflection img{
  background:#000;
  object-fit:contain;
  filter:url(#disc-on-black) brightness(.55)
}
