
.sbd-app, .sbd-app * { box-sizing: border-box; }
.sbd-app { --sbd-ink: #eef3fb; --sbd-muted: #a9b8d0; --sbd-line: rgba(255, 255, 255, .14); --sbd-glass: rgba(10, 17, 30, .74);
  --sbd-good: #6ee7b7; --sbd-bad: #fda4af; --sbd-gold: #ffd166; --sbd-accent: #e879f9;
  --gs-ink: var(--sbd-ink); --gs-muted: var(--sbd-muted); --gs-line: #2a3550; --gs-accent: #e879f9; --gs-accent-ink: #2a0a33;
  --gs-panel: #111827; --gs-bg: #0b1220; --gs-chip: rgba(17, 24, 39, .9);
  position: relative; display: flex; flex-direction: column; color: var(--sbd-ink); font: 16px/1.45 "Segoe UI", system-ui, Arial, sans-serif; overflow: clip; }
.sbd-app.sbd-embedded { height: clamp(560px, calc(100svh - 110px), 880px); clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); border: 1px solid #2a3550; background: #0b1220; }
.sbd-app.gs-fs { background: #0b1220; }
.sbd-app :where(button) { font: inherit; color: inherit; cursor: pointer; }
.sbd-app :where(button):focus-visible { outline: 2px solid var(--sbd-gold); outline-offset: 2px; }
.sbd-app .gs-stage, .sbd-app .gs-main { min-height: 0; }
.sbd-app.gs-wide .gs-stage { align-items: stretch; grid-template-rows: minmax(0, 1fr); }
.sbd-app .gs-side { min-height: 0; overflow: auto; }
.sbd-msg { text-align: center; padding: 20px 10px; color: var(--sbd-muted); }
.sbd-body { position: relative; flex: 1; min-height: 0; display: flex; }
.sbd-stage { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: #0a0f1c;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
.sbd-scene { position: absolute; inset: 0; top: var(--sbd-hud, 0px); z-index: 0; pointer-events: none; background: linear-gradient(180deg, #16223a, #0a0f1c); }
.sbd-scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sbd-scene.sbd-plain { background: linear-gradient(180deg, #1a2540 0, #101828 60%, #0a0f1c); }
.sbd-yard-name { display: none; position: absolute; z-index: 3; right: 10px; top: 8px; pointer-events: none; font: 600 11px "Segoe UI", Arial, sans-serif; letter-spacing: .5px; color: #f8ead0;
  background: rgba(6, 8, 16, .5); padding: 2px 10px; clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px); text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
.sbd-scene.pw-live .sbd-yard-name { display: block; }
.sbd-stage::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 62%; z-index: 1; pointer-events: none; background: linear-gradient(transparent, rgba(5, 8, 14, .72) 30%); }
.sbd-top { position: relative; z-index: 3; display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; pointer-events: none;
  background: rgba(10, 15, 28, .96); border-bottom: 1px solid rgba(255, 255, 255, .1); }   
.sbd-top > * { pointer-events: auto; }
.sbd-hud { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; width: min(100%, 640px); align-self: center; pointer-events: none; }
.sbd-chip-box { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px; min-width: 0; background: var(--sbd-glass); border: 1px solid var(--sbd-line);
  backdrop-filter: blur(4px); clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); }
.sbd-chip-box small { font: 700 9px/1 monospace; letter-spacing: 1.3px; color: var(--sbd-muted); text-transform: uppercase; white-space: nowrap; }
.sbd-chip-box b { display: inline-flex; align-items: center; gap: 5px; font: 800 16px/1.15 monospace; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sbd-chip-box b.g { color: var(--sbd-gold); }
#sbdPoints.bump { animation: sbdBump .5s ease; }
@keyframes sbdBump { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
.sbd-band { font-size: 11px; font-weight: 700; padding: 1px 6px; clip-path: polygon(3px 0, 100% 0, 100% calc(100% - 3px), calc(100% - 3px) 100%, 0 100%, 0 3px); background: var(--b); color: #0b1020; }
.sbd-topic { align-self: center; width: min(100%, 640px); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 7px 12px; min-height: 24px;
  background: rgba(10, 17, 30, .78); border: 1px solid rgba(232, 121, 249, .3); backdrop-filter: blur(4px);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
.sbd-topic-icon { font-size: 22px; }
.sbd-topic-text { display: flex; flex-direction: column; line-height: 1.2; font-size: 15px; min-width: 0; }
.sbd-topic-name { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: #f0abfc; font-weight: 700; }
.sbd-goal { margin-left: auto; font-size: 12px; color: #cbd5e1; background: rgba(0, 0, 0, .35); padding: 3px 9px; clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px); }
.sbd-goal b { color: var(--sbd-gold); }
.sbd-yardspace { position: relative; z-index: 3; flex: 1 1 0; min-height: 84px; pointer-events: none; }   
.sbd-say { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); width: min(94%, 600px); max-height: 100%; overflow-y: auto; pointer-events: auto; }
.sbd-say:empty { display: none; }
.sbd-fb { font-size: 13.5px; line-height: 1.4; padding: 7px 11px; background: rgba(8, 12, 22, .9); animation: sbdFade .3s ease;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); border: 1px solid var(--sbd-line); }
@keyframes sbdFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sbd-fb.good { color: #a7f3d0; border-color: rgba(52, 211, 153, .4); }
.sbd-fb.bad { color: #fecdd3; border-color: rgba(255, 107, 129, .4); }
.sbd-fb.near { color: #fde68a; border-color: rgba(255, 209, 102, .4); }
.sbd-fb.info { color: #bfdbfe; }
.sbd-fb-title { color: #fff; font-weight: 700; margin-bottom: 3px; }
.sbd-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.sbd-chip { font-size: 11.5px; padding: 2px 8px; background: rgba(255, 255, 255, .09); color: #cbd5e1; white-space: nowrap; clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px); }
.sbd-chip b { color: #fff; }
.sbd-chip.strong { background: rgba(255, 209, 102, .16); color: var(--sbd-gold); }
.sbd-chip.struct { background: rgba(232, 121, 249, .16); color: #f0abfc; }
.sbd-chip.total { background: rgba(52, 211, 153, .2); color: #6ee7b7; font-weight: 700; }
.sbd-ai-tag { display: inline-block; margin-left: 4px; padding: 0 7px; background: rgba(139, 92, 246, .25); color: #ede9fe; font-size: 10.5px; font-weight: 800; vertical-align: middle; }
.sbd-board { position: relative; z-index: 3; margin: 0 10px; padding: 8px 10px; background: linear-gradient(180deg, rgba(14, 20, 34, .82), rgba(10, 14, 24, .9)); border: 1px solid #2a3550;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
.sbd-line { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-height: 58px; padding: 6px 8px; border: 2px dashed rgba(232, 121, 249, .4); background: rgba(232, 121, 249, .05); transition: border-color .2s; }
.sbd-line:not(.empty) { border-style: solid; border-color: rgba(232, 121, 249, .55); }
.sbd-line-empty { color: #8a98b2; font-size: 14px; margin: auto; text-align: center; }
.sbd-line.shake { animation: sbdShake .42s; border-color: #ff6b81; }
.sbd-line.glow { animation: sbdGlow .9s ease; }
@keyframes sbdShake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes sbdGlow { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .7); border-color: #34d399; } 100% { box-shadow: 0 0 0 16px rgba(52, 211, 153, 0); } }
.sbd-stop { font-size: 30px; line-height: 1; font-weight: 900; color: #f0abfc; margin-left: -3px; align-self: flex-end; padding-bottom: 6px; }
.sbd-meter { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: #8ea0bb; margin-top: 6px; }
.sbd-meter .adv { color: var(--sbd-gold); }
.sbd-meter-pts { margin-left: auto; color: #a5b4cb; }
.sbd-hints:empty { display: none; }
.sbd-hint-row { font-size: 13px; color: #fde68a; background: rgba(255, 209, 102, .08); border: 1px dashed rgba(255, 209, 102, .35); padding: 5px 10px; margin-top: 6px; }
.sbd-hint-row.fresh { animation: sbdFade .5s ease; }
.sbd-tile { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 6px 13px;
  font-size: 16px; font-weight: 700; color: #2a1d0b; background: linear-gradient(180deg, #fffaf0, #f6e7c8); border: 1px solid #d9c39a; border-bottom-width: 3px;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; transition: transform .12s, opacity .15s; }
.sbd-tile:hover { transform: translateY(-2px); }
.sbd-tile:focus-visible { outline: 3px solid #e879f9; outline-offset: -3px; }
.sbd-tile.adv { background: linear-gradient(180deg, #fff6d1, #ffe08a); border-color: #e0b33c; }
.sbd-tile.adv::after { content: '✦'; position: absolute; top: 1px; right: 3px; font-size: 10px; color: #b7791f; }
.sbd-tile.comma { min-width: 44px; padding: 6px 8px; font-size: 22px; font-weight: 900; color: #6b21a8; background: linear-gradient(180deg, #f8e8ff, #ead1ff); border-color: #c79be8; }
.sbd-tile.ghost { background: transparent; border: 1px dashed #2f3a52; color: transparent; cursor: default; clip-path: none; }
.sbd-tile.typed { outline: 3px solid #e879f9; outline-offset: -3px; }
.sbd-tile.lifted { opacity: .25; }
.sbd-tile.pop { animation: sbdPop .28s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes sbdPop { from { transform: scale(.6); } to { transform: scale(1); } }
.sbd-line .sbd-tile { background: linear-gradient(180deg, #fff, #eef2ff); border-color: #b8c2e0; color: #111b33; }
.sbd-line .sbd-tile.adv { background: linear-gradient(180deg, #fff6d1, #ffe08a); border-color: #e0b33c; color: #2a1d0b; }
.sbd-line .sbd-tile.comma { background: linear-gradient(180deg, #f8e8ff, #ead1ff); color: #6b21a8; }
.sbd-drag { position: fixed; left: 0; top: 0; z-index: 10000; pointer-events: none; opacity: .95; cursor: grabbing; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .5)); }
.sbd-caret { width: 4px; align-self: stretch; min-height: 38px; background: #e879f9; box-shadow: 0 0 10px #e879f9; animation: sbdBlink .8s ease-in-out infinite alternate; }
@keyframes sbdBlink { from { opacity: 1; } to { opacity: .35; } }
.sbd-lower { position: relative; z-index: 3; flex: 0 1 auto; min-height: 0; max-height: 58%; overflow-y: auto; padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px; }
.sbd-bank-head { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: #8ea0bb; }
.sbd-keys { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 400; }
.sbd-typed { background: #1f2633; color: #f0abfc; padding: 1px 7px; font-family: monospace; text-transform: none; letter-spacing: 0; }
.sbd-bank { display: flex; flex-wrap: wrap; gap: 7px; }
.sbd-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sbd-btn { background: rgba(255, 255, 255, .06); color: #e2e8f0; border: 1px solid #2a3550; padding: 9px 14px; font-size: 14px; font-weight: 700; min-height: 44px; min-width: 44px;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.sbd-btn:hover:not(:disabled) { border-color: #e879f9; color: #fff; }
.sbd-btn:disabled { opacity: .4; cursor: default; }
.sbd-check { flex: 1 1 160px; background: linear-gradient(135deg, #d946ef, #8b5cf6); border: 0; color: #fff; font-size: 15px; }
.sbd-hint-n { display: inline-block; min-width: 18px; padding: 0 4px; margin-left: 2px; background: #ffd166; color: #1a1206; font-size: 11px; }
.sbd-built { display: flex; flex-direction: column; gap: 5px; }
.sbd-slot { display: flex; align-items: center; gap: 10px; background: rgba(10, 14, 22, .7); border: 1px dashed #2a3550; padding: 5px 9px; min-height: 32px; }
.sbd-slot.done { border-style: solid; border-color: rgba(52, 211, 153, .4); background: rgba(52, 211, 153, .06); }
.sbd-slot.fresh { animation: sbdIn .6s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes sbdIn { from { transform: translateY(-14px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.sbd-slot-n { flex: 0 0 auto; width: 22px; height: 22px; background: #1f2633; color: #8ea0bb; font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; transform: rotate(45deg); }
.sbd-slot-n { transform: none; clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px); }
.sbd-slot.done .sbd-slot-n { background: #34d399; color: #062e22; }
.sbd-slot-body { flex: 1; min-width: 0; }
.sbd-slot-empty { color: #66748c; font-size: 13px; }
.sbd-slot-text { color: #f1f5f9; font-size: 13.5px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbd-slot-score { flex: 0 0 auto; font-family: monospace; font-weight: 900; font-size: 16px; color: var(--sbd-gold); }
.sbd-float { position: absolute; z-index: 6; transform: translate(-50%, 0); font-size: 30px; font-weight: 900; color: #6ee7b7; text-shadow: 0 2px 12px rgba(52, 211, 153, .7); pointer-events: none; animation: sbdFloat 1.4s ease-out forwards; }
@keyframes sbdFloat { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.7); } 20% { opacity: 1; transform: translate(-50%, -6px) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -60px) scale(1); } }
.sbd-complete { position: absolute; inset: 0; z-index: 5; display: flex; align-items: flex-end; justify-content: center; padding: 10px; overflow-y: auto;
  background: linear-gradient(to bottom, rgba(5, 8, 14, 0) 0, rgba(5, 8, 14, 0) 24%, rgba(5, 8, 14, .85) 46%); }
.sbd-complete[hidden] { display: none; }
.sbd-complete-card { width: min(100%, 560px); margin-top: auto; padding: 12px 14px; text-align: center; background: linear-gradient(180deg, #151d31, #0d1322); border: 1px solid rgba(232, 121, 249, .4);
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); animation: sbdPop .45s cubic-bezier(.3, 1.4, .5, 1); }
.sbd-stars { font-size: 28px; letter-spacing: 4px; color: rgba(255, 255, 255, .25); }
.sbd-stars .on { color: var(--sbd-gold); text-shadow: 0 0 10px rgba(255, 209, 102, .7); }
.sbd-c-title { font-weight: 800; font-size: 19px; }
.sbd-c-sub { color: var(--sbd-muted); font-size: 13px; margin-bottom: 6px; }
.sbd-c-yours { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 10px; text-align: left; }
.sbd-c-row { display: flex; gap: 10px; justify-content: space-between; font-size: 13.5px; background: rgba(255, 255, 255, .06); padding: 5px 9px; }
.sbd-c-row b { color: var(--sbd-gold); font-family: monospace; }
.sbd-c-model { text-align: left; background: rgba(255, 209, 102, .08); border: 1px solid rgba(255, 209, 102, .3); padding: 8px 11px; margin-bottom: 10px; }
.sbd-c-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--sbd-gold); margin-bottom: 3px; }
.sbd-c-best { font-size: 14.5px; color: #fff; font-weight: 700; line-height: 1.4; margin-bottom: 4px; }
.sbd-complete .sbd-check { width: 100%; }
.sbd-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
@media (max-width: 640px) {
  .sbd-tile { font-size: 15px; padding: 6px 10px; }
  .sbd-bank { gap: 6px; }
  .sbd-keys { display: none; }
  .sbd-btn { padding: 9px 11px; }
  .sbd-check { flex-basis: 100%; order: 9; }
  .sbd-actions .sbd-btn:not(.sbd-check) { flex: 1 1 0; }
}
@media (max-width: 420px) {
  .sbd-app.gs-root .gs-bar { gap: 4px; }
  .sbd-app.gs-root .gs-btn { min-width: 40px; padding: 0 6px; }
  .sbd-app .gs-title { font-size: 13px; letter-spacing: .04em; }
  .sbd-chip-box small { font-size: 8.5px; letter-spacing: 1px; }
  .sbd-chip-box b { font-size: 14px; }
}
@media (max-height: 700px) { .sbd-yardspace { min-height: 40px; } .sbd-topic-icon { display: none; } }
@media (prefers-reduced-motion: reduce) { .sbd-line.shake, .sbd-line.glow, .sbd-float, .sbd-slot.fresh, .sbd-tile.pop { animation: none; } }
