/* Variant pages: playground, demo tiles, options table, best practices. */

/* ---------- Playground ---------- */

.pg-stage {
  display: flex; flex-direction: column; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, var(--stage-glow), var(--surface) 70%);
}
.pg-hint { margin: 0; font-size: var(--fs-sm); font-weight: 500; color: var(--faint); min-height: 20px; }
.pg-scene { flex: 1; position: relative; display: grid; place-items: center; min-height: 240px; }
.pg-scene .demo-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 20px; }
.pg-bin { top: 0; right: 0; bottom: auto; }
.pg-actions .chip:disabled { opacity: .4; pointer-events: none; }
.pg-actions { z-index: 1; }
.panel .ctl[role=group] .chips { gap: 4px; }
.panel .chip { height: 28px; padding: 0 10px; font-size: 12px; }

/* ---------- Demo tiles ---------- */

.tile {
  position: relative; height: 270px; display: flex; flex-direction: column;
  border-radius: var(--r-md); overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, var(--stage-glow), var(--surface) 70%);
  box-shadow: inset 0 0 0 1px var(--line);
}
.tile-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 8px 0 16px; }
.tile-title { font-size: 13.5px; font-weight: 650; letter-spacing: -0.005em; color: var(--text); }
.tile-reset { width: 28px; height: 28px; }
.tile-body { position: relative; flex: 1; min-height: 0; margin: 8px 14px 0; display: flex; flex-direction: column; justify-content: center; }
.tile-hint { margin: 0; padding: 8px 16px 12px; font-size: 12px; font-weight: 450; color: var(--faint); }

.tl-item { display: block; border-radius: 14px; cursor: pointer; transition: opacity .5s var(--ease), transform .45s var(--spring); touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.tl-item.tl-static { cursor: default; }
.tl-item.grab { cursor: grab; }
.tl-list { display: flex; flex-direction: column; }
.tl-list-end { flex: 1; justify-content: flex-end; min-height: 0; overflow: hidden; }
.tl-slot { margin-bottom: 6px; overflow: hidden; transition: height .3s var(--ease), margin .3s var(--ease), opacity .2s; }
.tl-slot.gone { height: 0 !important; margin-bottom: 0; opacity: 0; }
.tl-slot.tl-right { display: flex; justify-content: flex-end; }
.tl-empty { padding: 18px 0; text-align: center; font-size: 13px; color: var(--muted); }
.tl-center { flex: 1; display: grid; place-items: center; min-height: 0; }
.tl-foot { display: flex; justify-content: center; gap: 6px; padding-top: 8px; }
.tl-btn { background: var(--raised); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.tl-btn:disabled { opacity: .45; cursor: default; }
.tl-grid { display: grid; gap: 6px; justify-content: center; align-content: center; }
.tl-grid .tl-item { border-radius: 12px; }
.tl-row { display: flex; justify-content: center; align-items: center; gap: 10px; flex: 1; }
.tl-doc { gap: 16px; }
.tl-doc .tl-item { border-radius: 0; }
.tl-score { text-align: center; font: 500 12px var(--mono); letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
.tl-tags { display: flex; flex-wrap: wrap; gap: 6px; align-content: center; justify-content: center; }
.tl-tags .tl-item { border-radius: 16px; }

.tl-target {
  position: relative; flex: none; display: grid; place-items: center; gap: 2px;
  width: 64px; height: 64px; border-radius: 16px;
  background: var(--wash); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 11px; font-weight: 500;
  transition: transform .35s var(--spring), color .2s;
}
.tl-target.bump { transform: scale(1.14); color: var(--accent); }
.tl-target svg { margin-top: 8px; }
.tl-bin { width: 48px; height: 48px; border-radius: 14px; align-self: flex-start; }
.tl-bin svg { margin: 0; }
.tl-stream { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: 1; }
.tl-side { display: flex; gap: 16px; align-items: center; flex: 1; min-height: 0; }
.tl-grow { flex: 1; min-width: 0; }

.tl-composer {
  display: flex; align-items: center; justify-content: space-between; margin-top: 8px;
  height: 40px; padding: 0 4px 0 14px; border-radius: 20px; background: var(--surface-2); color: var(--faint); font-size: 13px;
}
.tl-send { height: 32px; background: var(--accent-deep); color: #fff; box-shadow: none; }
[data-theme='light'] .tl-send { background: var(--accent); }

.tl-deck { position: relative; flex: 1; display: grid; place-items: center; min-height: 0; }
.tl-deck .tl-item { grid-area: 1 / 1; border-radius: 16px; box-shadow: var(--shadow); }
.tl-deck .tl-item:nth-last-child(2) { transform: rotate(-3deg) scale(.97); }
.tl-deck .tl-item:nth-last-child(3) { transform: rotate(3deg) scale(.94); }


.tl-profile, .tl-product { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 420px; }
.tl-product { gap: 16px; }
.tl-info { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.tl-info strong { font-size: 14px; font-weight: 680; letter-spacing: -0.01em; color: var(--text); }
.tl-info .tl-morph { margin-top: 8px; justify-items: start; }
.tl-morph { cursor: pointer; }
.tl-morph .tl-item { border-radius: 999px; }

.tl-lid {
  position: relative; flex: 1; margin: 2px 0 8px; border-radius: 16px;
  background: linear-gradient(160deg, #3A3D44, #24262B); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
[data-theme='light'] .tl-lid { background: linear-gradient(160deg, #D5D9E0, #BCC2CC); }
.tl-lid .tl-item { position: absolute; border-radius: 0; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25)); }

/* ---------- Options table ---------- */

.opt-table td:first-child code { color: var(--text); }
.opt-table td:nth-child(2), .opt-table td:nth-child(3) { white-space: nowrap; }
.opt-table td:nth-child(2) code, .opt-table td:nth-child(3) code { font: 12px var(--mono); padding: 1px 5px; border-radius: 6px; background: var(--wash); color: var(--text-2); }
.opt-type { white-space: normal; }
.opt-table td:nth-child(2) { white-space: normal; min-width: 120px; max-width: 220px; }

/* ---------- Best practices ---------- */

.bp { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bp li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 16px; border-radius: var(--r-sm);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  font-size: var(--fs-ui); line-height: 1.6; color: var(--text-2); text-wrap: pretty;
}
.bp li code { font: 12.5px var(--mono); padding: 1px 5px; border-radius: 6px; background: var(--wash); color: var(--text); }
.bp-icon { flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center; }
.bp-do .bp-icon { background: rgba(34, 197, 94, 0.14); color: #4ADE80; }
.bp-dont .bp-icon { background: rgba(239, 68, 68, 0.14); color: #F87171; }
[data-theme='light'] .bp-do .bp-icon { color: #15803D; }
[data-theme='light'] .bp-dont .bp-icon { color: #B91C1C; }

@media (max-width: 860px) {
  .tile { height: 260px; }
  .pg-stage { min-height: 360px; }
  .opt-table td:nth-child(4) { min-width: 220px; }
}
