/* Sentence Builder — chunky tiles on a light board.
   Chunks are big, rounded tiles (44px+ tall) you tap, not drag, so it works
   with one thumb on a phone. Placed chunks pop in; a finished line goes green
   and its tiles bounce one after another. */

/* ── packs ────────────────────────────────────────────────────────────── */
.bd-packs { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bd-pack { display: flex; gap: 14px; align-items: flex-start; text-align: left; padding: 16px; border-radius: 18px; border: 2px solid var(--line); background: var(--cyc); color: var(--ink); cursor: pointer; transition: transform .3s var(--ease-out), box-shadow .3s, border-color .2s; }
.bd-pack:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--ink); }
.bd-pack:focus-visible { outline: 3px solid var(--pen); outline-offset: 3px; }
.bd-pack.done { border-color: #1F9D55; background: #F3FBF6; }
.bd-pack.lock { background: var(--cyc-2); }
.bd-pack-ico { flex: none; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 1.7rem; background: var(--wb-soft); }
.bd-pack:nth-child(4n+2) .bd-pack-ico { background: var(--sound-soft); } .bd-pack:nth-child(4n+3) .bd-pack-ico { background: var(--pen-soft); } .bd-pack:nth-child(4n) .bd-pack-ico { background: var(--lab-soft); }
.bd-pack.lock .bd-pack-ico { background: var(--cyc); }
.bd-pack-body { display: grid; gap: 6px; flex: 1; min-width: 0; }
.bd-pack-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bd-lv { font-family: var(--f-display); font-size: .8rem; letter-spacing: .08em; color: #136B39; background: var(--wb-soft); padding: 3px 10px; border-radius: 999px; font-variation-settings: 'wght' 720; }
.bd-lock { font-family: var(--f-display); font-size: .8rem; letter-spacing: .04em; color: var(--ink); background: var(--pen); padding: 3px 10px; border-radius: 999px; font-variation-settings: 'wght' 720; }
.bd-pack-name { font-family: var(--f-display); font-size: 1.25rem; letter-spacing: -.02em; line-height: 1.15; font-variation-settings: 'opsz' 36, 'wght' 750; }
.bd-pack-why { font-size: 1rem; line-height: 1.45; color: var(--ink-2); }
.bd-pack-meta { font-size: .9rem; color: var(--ink-2); }
.bd-pack .pp-bar { margin-top: 2px; }
@media (max-width: 720px) { .bd-packs { grid-template-columns: minmax(0, 1fr); } }

/* ── building ─────────────────────────────────────────────────────────── */
.bd-card { display: grid; gap: 14px; padding: clamp(16px, 3vw, 28px); border-radius: 22px; background: linear-gradient(160deg, #F3FBF6, #FBFCFF 55%, var(--sound-soft)); border: 2px solid #CDEBD9; }
.bd-kicker { font-family: var(--f-display); font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: #136B39; font-variation-settings: 'wght' 700; }
.bd-use { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 14px; background: var(--cyc); box-shadow: inset 0 0 0 1.5px var(--line); font-size: 1.1rem; line-height: 1.45; color: var(--ink); }
.bd-use b { font-family: var(--f-display); font-variation-settings: 'wght' 700; }

.bd-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 84px; padding: 14px; border-radius: 18px; background: var(--cyc); border: 2.5px dashed var(--line-2); transition: border-color .3s, background .3s; }
.bd-line.good { border-style: solid; border-color: #1F9D55; background: #E5F6EC; }
.bd-slot { min-width: 64px; height: 50px; border-radius: 12px; border: 2px dashed var(--line-2); background: var(--cyc-2); }
.bd-slot.next { border-color: var(--sound); background: var(--sound-soft); animation: bd-breathe 1.6s ease-in-out infinite; }
@keyframes bd-breathe { 50% { box-shadow: 0 0 0 4px var(--sound-soft); } }
.bd-end { font-family: var(--f-display); font-size: 2rem; line-height: 1; color: var(--ink-3); font-variation-settings: 'wght' 800; padding: 0 4px; }

.bd-pool { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; min-height: 66px; padding: 14px; border-radius: 18px; background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 1.5px var(--line); }
.bd-empty { align-self: center; font-size: 1rem; color: var(--ink-2); }

.bd-chunk { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 50px; padding: 10px 16px; border-radius: 14px; border: 0; font-family: var(--f-display); font-size: 1.2rem; line-height: 1.2; letter-spacing: -.01em; font-variation-settings: 'opsz' 24, 'wght' 650; cursor: pointer; transition: transform .2s var(--ease-out), background .2s, box-shadow .2s; -webkit-tap-highlight-color: transparent; }
.bd-chunk:focus-visible { outline: 3px solid var(--pen); outline-offset: 3px; }
.bd-chunk.pool { background: var(--cyc); color: var(--ink); box-shadow: 0 0 0 2px var(--ink), 0 4px 0 0 var(--ink); margin-bottom: 4px; }
.bd-chunk.pool.deal { animation: bd-deal .35s var(--ease-out) both; animation-delay: calc(var(--d) * 40ms); }
.bd-chunk.pool:hover { transform: translateY(-2px); background: var(--pen-soft); }
.bd-chunk.pool:active { transform: translateY(3px); box-shadow: 0 0 0 2px var(--ink), 0 1px 0 0 var(--ink); }
.bd-k { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--cyc-2); font-family: var(--f-mono); font-size: .75rem; color: var(--ink-2); font-variation-settings: normal; }
@media (hover: none) { .bd-k { display: none; } }
@keyframes bd-deal { from { opacity: 0; transform: translateY(10px) scale(.92); } }

.bd-chunk.placed { background: var(--ink); color: var(--cyc); box-shadow: var(--shadow-1); }
.bd-chunk.placed:hover { background: var(--black); }
.bd-chunk.placed.in { animation: bd-in .32s var(--ease-out); }
@keyframes bd-in { from { transform: translateY(18px) scale(.85); opacity: .3; } }
.bd-chunk.placed.fixed { background: #1F9D55; color: #fff; cursor: default; }
.bd-chunk.placed.yes { animation: bd-yes .5s var(--ease-out); }
@keyframes bd-yes { 40% { transform: scale(1.1); } }
.bd-chunk.placed.no { background: var(--live); color: #fff; animation: bd-no .45s ease-in-out; }
@keyframes bd-no { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.bd-line.good .bd-chunk.placed { background: #1F9D55; color: #fff; cursor: default; animation: bd-wave .6s var(--ease-out) both; animation-delay: calc(var(--d) * 80ms); }
@keyframes bd-wave { 40% { transform: translateY(-10px); } }

.bd-tools .btn { min-height: 44px; }
.bd-tools .btn:disabled { opacity: .45; cursor: not-allowed; }
.bd-keys { text-align: center; }
@media (hover: none) { .bd-keys { display: none; } }

/* ── after the sentence is built ──────────────────────────────────────── */
.bd-fb { display: grid; gap: 12px; padding: 18px clamp(16px, 2.6vw, 24px); border-radius: 20px; border: 2px solid #A7DDBE; background: #F3FBF6; animation: gm-in .35s var(--ease-out); }
.bd-fb.shown { border-color: var(--line-2); background: var(--cyc-2); }
.bd-fb-head { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; font-family: var(--f-display); font-variation-settings: 'wght' 750; }
.bd-fb-head b { font-size: 1.35rem; color: #136B39; margin-right: auto; }
.bd-fb.shown .bd-fb-head b { color: var(--ink); }
.bd-fb-head > span:last-child { font-size: 1.05rem; padding: 4px 12px; border-radius: 999px; background: var(--cyc); color: #136B39; }
.bd-fb.shown .bd-fb-head > span:last-child { color: var(--ink-2); }
.bd-alt { font-size: 1.02rem; line-height: 1.5; color: var(--ink); padding: 10px 14px; border-radius: 12px; background: var(--cyc); }
.bd-hears { display: flex; gap: 8px; flex-wrap: wrap; }
.bd-hear { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 18px; border-radius: 999px; border: 0; background: var(--sound); color: #fff; font-family: var(--f-display); font-size: 1rem; font-variation-settings: 'wght' 700; cursor: pointer; transition: transform .2s var(--ease-out), background .2s; }
.bd-hear:hover { background: var(--sound-2); transform: translateY(-1px); }
.bd-hear.slow { background: var(--cyc); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.bd-hear.on { animation: lu-pulse 1s ease-in-out infinite; }
.bd-hear.mini { flex: none; width: 44px; height: 44px; padding: 0; justify-content: center; font-size: .95rem; }
.bd-tip { font-size: 1.08rem; line-height: 1.55; color: var(--ink); }
.bd-tip b { font-family: var(--f-display); color: #136B39; font-variation-settings: 'wght' 750; }
.bd-say { font-size: 1rem; color: var(--ink-2); }

/* results */
.gm-results .review li:has(.bd-rv) { padding: 0; background: none; }
.bd-rv { display: flex; gap: 12px; align-items: center; padding: 10px 12px 10px 14px; border-radius: 14px; background: var(--cyc-2); }
.bd-rv-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.bd-rv-t { font-family: var(--f-display); font-size: 1.08rem; line-height: 1.35; color: var(--ink); font-variation-settings: 'opsz' 24, 'wght' 650; }
.bd-rv-use { font-size: .95rem; color: var(--ink-2); }
.bd-rv .lu-stars { flex: none; font-size: .95rem; }
@media (max-width: 480px) { .bd-rv { flex-wrap: wrap; } .bd-rv-body { flex-basis: calc(100% - 56px); } .bd-rv .lu-stars { order: 3; } }

.gm-board[data-game="builder"] { scroll-margin-top: calc(var(--bar-h, 64px) + 16px); }

@media (prefers-reduced-motion: reduce) {
  .bd-slot.next, .bd-chunk.pool.deal, .bd-chunk.placed.in, .bd-chunk.placed.yes, .bd-chunk.placed.no, .bd-line.good .bd-chunk.placed, .bd-hear.on { animation: none; }
}
.gm-results .review:has(.bd-rv) { padding-left: 0; margin-left: 0; }
