/* SlideGlyph: the gallery. A framed picture cut into tiles. */
@property --g { syntax: "<length>"; inherits: true; initial-value: 6px; }
@property --r { syntax: "<length>"; inherits: true; initial-value: 10px; }

.slCard{ overflow: visible; }
.slTop{ display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.slStats{ display: flex; gap: 14px; font-size: 12px; color: var(--w-dim); }
.slStats b{ display: block; font-family: var(--w-font); font-weight: 400; font-size: 20px; line-height: 1; color: var(--w-accent-text); font-variant-numeric: tabular-nums; }
.slHead{ display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 10px 2px 6px; flex-wrap: wrap; }
.slArtName{ font-family: var(--w-font); font-size: clamp(22px, 6vw, 28px); line-height: 1.05; color: var(--w-ink); }
.slLabel{ font-size: 12.5px; color: var(--w-dim); }
.slPlaced{ --p: 0; height: 6px; border-radius: 999px; background: var(--w-bg-0); box-shadow: inset 0 0 0 1px var(--w-line-soft); overflow: hidden; margin: 2px 0 4px; }
.slPlaced::before{ content: ""; display: block; height: 100%; width: calc(var(--p) * 100%); border-radius: inherit; background: linear-gradient(90deg, var(--w-accent-lo), var(--w-accent), var(--w-accent-hi)); transition: width .3s ease; }
.slPlacedText{ font-size: 11.5px; color: var(--w-dim); text-align: right; }
.slMsg{ height: 0; overflow: hidden; opacity: 0; text-align: center; font-size: 13.5px; font-weight: 700; color: var(--w-warn-text); transition: opacity .25s, height .25s; }
.slMsg.show{ height: 20px; opacity: 1; }

/* ---------- the frame ---------- */
.slFrame{
  position: relative; width: min(100%, 460px); margin: 8px auto 10px; padding: 12px; border-radius: 24px;
  background: linear-gradient(145deg, #3a2a20, #1c130d); box-shadow: inset 0 2px 0 rgba(255,255,255,.12), inset 0 -3px 0 rgba(0,0,0,.4), 0 18px 40px var(--w-drop);
}
.slFrame::before{ content: ""; position: absolute; inset: 5px; border-radius: 20px; border: 2px solid rgba(255,214,140,.35); pointer-events: none; }
.slTray{
  --g: 6px; --r: 10px;
  position: relative; width: 100%; aspect-ratio: 1; border-radius: 14px; background: #120c08;
  box-shadow: inset 0 4px 14px rgba(0,0,0,.7);
  touch-action: none; user-select: none; -webkit-user-select: none; overflow: hidden;
  transition: --g .6s cubic-bezier(.2,.8,.2,1), --r .6s ease;
}
.slTile{
  --s: calc((100% - (var(--n) + 1) * var(--g)) / var(--n));
  position: absolute; width: var(--s); height: var(--s);
  left: calc(var(--g) + var(--x) * (var(--s) + var(--g)));
  top:  calc(var(--g) + var(--y) * (var(--s) + var(--g)));
  border-radius: var(--r);
  background-image: var(--art);
  background-size: calc(var(--n) * 100%) calc(var(--n) * 100%);
  background-position: calc(var(--hx) / (var(--n) - 1) * 100%) calc(var(--hy) / (var(--n) - 1) * 100%);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.35), inset 0 -3px 0 rgba(0,0,0,.25), 0 4px 8px rgba(0,0,0,.45);
  transition: left .16s cubic-bezier(.2,.9,.3,1.15), top .16s cubic-bezier(.2,.9,.3,1.15), box-shadow .3s ease, filter .2s;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.slTray.instant .slTile{ transition: none; }
.slTile:hover{ filter: brightness(1.06); }
.slNum{
  position: absolute; left: 6%; bottom: 5%; display: none;
  font: 400 clamp(12px, calc(var(--s) * .26), 26px)/1 var(--w-font);
  color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.55), 0 0 6px rgba(0,0,0,.6);
  pointer-events: none;
}
.slTray.nums .slNum{ display: block; }
.slTile.home .slNum{ color: #ffd86b; }
.slTile.hint{ z-index: 3; animation: slHint 1s ease-in-out infinite; box-shadow: 0 0 0 3px #ffcc1f, 0 0 22px rgba(255,204,31,.8); }
@keyframes slHint{ 0%,100%{ filter: brightness(1) } 50%{ filter: brightness(1.25) } }
.slTile.nope{ animation: slNope .3s ease; }
@keyframes slNope{ 0%,100%{ translate: 0 } 30%{ translate: -4px 0 } 60%{ translate: 4px 0 } }
.slLast{ opacity: 0; pointer-events: none; transition: opacity .5s ease .25s; }

/* the picture becomes whole: seams close, the last piece arrives, a shine sweeps */
.slTray.won{ --g: 0px; --r: 0px; }
.slTray.won .slTile{ box-shadow: none; cursor: default; }
.slTray.won .slNum{ opacity: 0; transition: opacity .3s; }
.slTray.won .slLast{ opacity: 1; }
.slTray.whole::after{
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 48%, transparent 66%) -150% 0 / 60% 100% no-repeat;
  animation: slShine 1.1s ease .1s forwards;
}
@keyframes slShine{ to{ background-position: 250% 0; } }

/* peek */
.slPeekImg{ position: absolute; inset: 12px; border-radius: 14px; background-size: cover; opacity: 0; pointer-events: none; transition: opacity .18s ease; z-index: 5; box-shadow: 0 0 0 2px rgba(255,214,140,.5); }
.slPeekImg.show{ opacity: 1; }

/* ---------- action bar ---------- */
.slBar{ display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; margin: 10px 4px 4px; }
.slKey{
  -webkit-appearance: none; appearance: none; cursor: pointer; border: 0; padding: 0; background: none;
  display: inline-flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--w-ink); font: 400 11px/1 var(--w-font); letter-spacing: .06em; text-transform: uppercase;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.slKey .slRound{
  position: relative; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 22px;
  background: linear-gradient(180deg, var(--w-bg-3), var(--w-bg-1)); border: 1px solid var(--w-line);
  box-shadow: inset 0 1px 0 var(--w-edge-hi), 0 6px 0 var(--w-bg-0), 0 10px 18px var(--w-drop); transition: transform .12s, box-shadow .12s;
}
.slKey:active .slRound{ transform: translateY(4px); box-shadow: inset 0 1px 0 var(--w-edge-hi), 0 2px 0 var(--w-bg-0), 0 6px 12px var(--w-drop); }
.slKey[disabled]{ opacity: .4; cursor: default; }
.slKey.gold .slRound{ background: linear-gradient(180deg, #ffd860, #ffae1a); color: #3a2300; border-color: #c98200; box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 6px 0 #a86a00, 0 10px 18px var(--w-drop); }
.slKey.gold.spent .slRound{ filter: grayscale(.85) brightness(.8); }
.slBadge{ position: absolute; right: -4px; top: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; display: grid; place-items: center; font: 800 11px/1 system-ui, sans-serif; color: #fff; background: #c81e3a; border: 2px solid var(--w-bg-1); }
.slKey[aria-pressed="true"] .slRound{ box-shadow: inset 0 0 0 2px var(--w-accent), 0 6px 0 var(--w-bg-0), 0 10px 18px var(--w-drop); }
.slMiniRow{ display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 12.5px; color: var(--w-dim); }

/* ---------- done panel ---------- */
.slDone{ position: absolute; inset: 0; z-index: 40; display: grid; place-items: end center; padding-bottom: 8%; border-radius: inherit; opacity: 0; transition: opacity .35s ease; pointer-events: none; }
.slDone[hidden]{ display: none; }
.slDone.show{ opacity: 1; pointer-events: auto; }
.slDonePanel{ text-align: center; padding: 16px 18px 14px; border-radius: 18px; background: color-mix(in srgb, var(--w-bg-1) 92%, transparent); backdrop-filter: blur(6px); box-shadow: 0 18px 40px rgba(0,0,0,.45), inset 0 0 0 1px var(--w-line); transform: translateY(12px) scale(.96); transition: transform .45s cubic-bezier(.2,1.4,.4,1); width: min(88%, 320px); }
.slDone.show .slDonePanel{ transform: none; }
.slDoneTitle{ font-family: var(--w-font); font-size: 22px; line-height: 1.1; color: var(--w-ink); margin: 0 0 6px; }
.slDoneStats{ font-size: 13.5px; color: var(--w-dim); margin-bottom: 12px; }
.slDoneBtns{ display: flex; gap: 8px; }
.slKeyBig{ -webkit-appearance: none; appearance: none; flex: 1; border: 0; cursor: pointer; padding: 12px 14px; border-radius: 14px; font: 400 15px/1 var(--w-font); color: #fff; background: linear-gradient(180deg, #4d8dff, #2563eb); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 5px 0 #1a46b0; }
.slKeyGhost{ -webkit-appearance: none; appearance: none; cursor: pointer; padding: 12px 14px; border-radius: 14px; font: 400 15px/1 var(--w-font); color: var(--w-ink); background: var(--w-bg-2); border: 1px solid var(--w-line); }

.slHelpBox{ margin: 10px 0; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--card) 70%, var(--bg)); border: 1px solid var(--line); }
.slHelpKicker{ font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.slHelpList{ margin: 0; padding-left: 18px; }
.slHelpList li{ margin: 4px 0; }
.slHelpActions, .slShareActions{ display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

@media (max-width: 420px){
  .slFrame{ padding: 9px; border-radius: 20px; }
  .slTray{ --g: 4px; --r: 8px; }
  .slKey .slRound{ width: 48px; height: 48px; font-size: 20px; }
}
@media (prefers-reduced-motion: reduce){ .slTile, .slTray, .slPeekImg{ transition: none; } .slTile.hint, .slTray.whole::after{ animation: none; } }

/* the world dresses every card button; these are round keys, not slabs */
:root body.gv-world .slCard .slKey{ background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; min-width: 0; color: var(--w-ink); }
