/* Bond Type Sorter: the sample ticket and the Materials Sorting Desk inside the practice shell's stage. */
.bts { position: absolute; inset: 0; display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 12px; padding: 8px 12px; }
.bts-panel { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; padding: 2px; }

/* the sample ticket */
.bts-ticket { padding: 8px 12px 10px; border-radius: var(--tlg-radius-lg, 14px); border: 2px dashed #9fb0cc; background: #f3f6fc; color: #14223a; }
.bts-ticket-k { margin: 0; font-size: 16px; font-weight: 800; text-transform: uppercase; letter-spacing: var(--tlg-tracking-caps, .08em); color: #2b4a7a; }
.bts-ticket-h { margin: 0 0 4px; font-size: 20px; line-height: 1.25; }
.bts-given { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bts-given li { display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; border-radius: 8px; background: #ffffff; border: 1px solid #d5dceb; }
.bts-given-k { font-size: 16px; font-weight: 800; color: #5a6a86; }
.bts-given-v { font-size: 17px; line-height: 1.35; }
html[data-theme="dark"] .bts-ticket { background: #18233a; color: #e4ebf8; border-color: #4a6290; }
html[data-theme="dark"] .bts-ticket-k { color: #a9c3f0; }
html[data-theme="dark"] .bts-given li { background: #111a2c; border-color: #33466b; }
html[data-theme="dark"] .bts-given-k { color: #a9b8d3; }

.bts-how { margin: 0; font-size: 16px; color: var(--tlg-text-muted, #4b5d68); }
.bts-msg { margin: 0; min-height: 1.2em; font-size: 16px; font-weight: 700; color: var(--tlg-danger, #b42318); }
html[data-theme="dark"] .bts-msg { color: #ffb4a8; }
.bts-about { font-size: 16px; line-height: 1.4; }
.bts-about summary { cursor: pointer; font-weight: 700; }
.bts-about p { margin: 4px 0 0; }

/* the desk */
.bts-view { position: relative; min-width: 0; min-height: 0; display: flex; align-items: flex-start; justify-content: center; }
.bts-scene { position: relative; width: 100%; aspect-ratio: 720 / 620; border-radius: var(--tlg-radius-lg, 14px); overflow: hidden; border: var(--tlg-border-width, 1px) solid var(--tlg-border, #a5b6c1); user-select: none; -webkit-user-select: none; touch-action: none; }
.bts-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
html.bts-dragging, html.bts-dragging * { cursor: grabbing !important; }
.bts-wall { fill: url(#bts-g-wall); }
.bts-tile { fill: url(#bts-p-tile); }
.bts-floor { fill: url(#bts-g-floor); }
html[data-theme="dark"] .bts-wall { fill: url(#bts-g-wall-d); }
html[data-theme="dark"] .bts-tile { fill: url(#bts-p-tile-d); }
html[data-theme="dark"] .bts-floor { fill: url(#bts-g-floor-d); }
html[data-theme="dark"] .bts-glow { opacity: .45; }

.bts-t { font-family: var(--tlg-font-body, system-ui, sans-serif); fill: #1d2b38; }
.bts-sign { font-size: 25px; font-weight: 800; fill: #f6e7b8; letter-spacing: .02em; }
.bts-t-poster, .bts-t-jar { font-size: 17px; font-weight: 700; fill: #2b2418; }
html[data-theme="dark"] .bts-t-jar { fill: #dfe6f2; }
.bts-t-rowlab { font-size: 18px; font-weight: 800; fill: #2b2418; }
.bts-t-cell { font-size: 18px; font-weight: 800; fill: #1d2b38; }
.bts-t-label { font-size: 26px; font-weight: 900; fill: #1d2b38; }
.bts-t-small { font-size: 18px; font-weight: 800; fill: #1d2b38; }
.bts-t-onbench { fill: #eef3fa; }
.bts-t-pole { font-size: 20px; font-weight: 900; fill: #ffffff; paint-order: stroke; stroke: #111; stroke-width: 3px; }
.bts-t-bezel { font-size: 17px; font-weight: 800; fill: #c9d6ea; letter-spacing: .03em; }
.bts-led { fill: #3ad07a; }
.bts-t-standby { font-size: 18px; font-weight: 700; fill: #8fa7c9; }
.bts-t-atom { font-size: 16px; font-weight: 800; fill: #ffffff; }
.bts-t-atom-dark { fill: #2b2418; }
.bts-t-ion { font-size: 16px; font-weight: 900; fill: #10202c; }
.bts-t-mol { font-size: 16px; font-weight: 900; fill: #ffffff; paint-order: stroke; stroke: #0a1626; stroke-width: 4px; }
.bts-t-tag { font-size: 16px; font-weight: 700; fill: #9fb6d6; font-style: italic; }
.bts-t-legend { font-size: 17px; font-weight: 800; fill: #ffe9a8; }
.bts-t-tagname { font-size: 20px; font-weight: 900; fill: #22365a; }
.bts-t-x { font-size: 40px; font-weight: 900; fill: #ff6b5a; paint-order: stroke; stroke: #5c120b; stroke-width: 4px; }
.bts-t-ex { font-size: 20px; font-weight: 800; fill: #ffffff; }
.bts-wire { stroke: #c2412d; stroke-width: 4; fill: none; stroke-linejoin: round; }

/* the bins (real buttons over the floor) */
.bts-bins { position: absolute; inset: 0; margin: 0; padding: 0; border: 0; min-width: 0; pointer-events: none; }
.bts-legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bts-bin {
  position: absolute; pointer-events: auto; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px;
  padding: 10px 6px 6px; font: inherit; font-size: 17px; font-weight: 800; line-height: 1.15; color: #ffffff; text-align: center; cursor: pointer;
  border: 3px solid #16263c; border-top-width: 6px; border-radius: 6px 6px 18px 18px; clip-path: polygon(0 0, 100% 0, 94% 100%, 6% 100%);
  background: linear-gradient(180deg, #4c6a8c 0%, #3a5576 60%, #2c4360 100%); box-shadow: inset 0 6px 0 rgba(255, 255, 255, .12); touch-action: manipulation;
}
.bts-ico { width: 64px; height: 40px; flex: none; background: rgba(255, 255, 255, .9); border-radius: 8px; padding: 2px; }
.bts-bin-t { text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.bts-bin:hover:not(:disabled):not([aria-pressed="true"]), .bts-bin.is-over { background: linear-gradient(180deg, #5d80a8 0%, #46668e 60%, #344f70 100%); }
.bts-bin.is-over { outline: 4px solid #ffe27a; outline-offset: -8px; }
.bts-bin[aria-pressed="true"] { background: linear-gradient(180deg, #2a3f63 0%, #1f3050 60%, #172440 100%); border-color: #e0b73a; }
.bts-bin[aria-pressed="true"]::after { content: '✓ chosen'; position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); padding: 0 8px; border-radius: 9px; font-size: 16px; font-weight: 900; color: #3a2a00; background: #ffe27a; white-space: nowrap; }
.bts-bin.is-right { outline: 5px dashed #3ad07a; outline-offset: -11px; }
.bts-bin.is-right::before, .bts-bin.is-wrong::before { position: absolute; top: 6px; right: 10px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; font-weight: 900; line-height: 1; animation: bts-pop .25s ease-out; }
.bts-bin.is-right::before { content: '✓'; color: #0d2a1a; background: #7ee2a8; }
.bts-bin.is-wrong::before { content: '✗'; color: #ffffff; background: #c2412d; }
.bts :focus-visible { outline: 4px solid #ffb84d; outline-offset: -6px; }
.bts button:disabled { cursor: default; }
.bts.is-locked .bts-bin:not([aria-pressed="true"]) { filter: saturate(.6) brightness(.9); }
html[data-theme="dark"] .bts-scene { border-color: #3a4a62; }

/* drag ghost */
html .bts-ghost { position: fixed; z-index: 1000; pointer-events: none; padding: 8px 14px; border-radius: 10px; font-size: 20px; font-weight: 900; color: #22365a; background: #fffaf0; border: 3px solid #d4a94a; box-shadow: 0 10px 22px rgba(0, 0, 0, .3); transform: rotate(-3deg); white-space: nowrap; }

/* reveal badge (over the wall, beside the sign) */
.bts-badge { position: absolute; left: 47%; right: 2%; top: 2.5%; padding: 6px 12px; border-radius: 10px; font-size: 16px; font-weight: 700; line-height: 1.3; pointer-events: none;
  background: rgba(255, 255, 255, .97); color: #10202c; border: 3px solid #2e7d5b; box-shadow: 0 3px 8px rgba(0, 0, 0, .2); animation: bts-pop .25s ease-out; }
.bts-badge.is-bad { border-color: #b42318; }
.bts-badge.is-count { border-color: #2f6fb5; }
@keyframes bts-pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }

/* briefing + start */
.bts-example-svg { display: block; width: 100%; height: auto; max-height: 440px; }
.bts-start-svg { display: block; width: 100%; height: 100%; }

@media (prefers-reduced-motion: reduce) { .bts-badge, .bts-bin::before { animation: none !important; } html .bts-ghost { transform: none; } }
@media (max-width: 1100px) { .bts { grid-template-columns: 290px minmax(0, 1fr); } .bts-bin { font-size: 16px; } }
@media (max-width: 900px) {
  .bts { position: static; grid-template-columns: 1fr; }
  .bts-panel { overflow: visible; }
  .bts-view { display: block; order: -1; }
  .bts-scene { width: 100% !important; }
  .bts-ico { width: 48px; height: 30px; }
}
@media (max-width: 520px) { .bts-bin { font-size: 16px; padding: 6px 2px 4px; } .bts-bin[aria-pressed="true"]::after { content: '✓'; } }
