.bp-game { --bp-ink: #183c35; --bp-green: #255e4f; width: 100%; max-width: 480px; margin: 0 auto; color: var(--bp-ink); position: relative; font-family: inherit; }
.bp-game *, .bp-drag-ghost * { box-sizing: border-box; }
.bp-game button { font: inherit; -webkit-tap-highlight-color: transparent; cursor: pointer; }
.bp-game button:focus-visible, .bp-keyboard summary:focus-visible { outline: 3px solid #dc8a4f; outline-offset: 3px; }
.bp-game button:disabled { cursor: default; }
.bp-scorebar { display: flex; align-items: center; gap: 25px; padding: 0 2px 17px; }
.bp-score, .bp-best { display: flex; flex-direction: column; gap: 3px; }
.bp-score span, .bp-best span { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #637970; }
.bp-score strong { font-size: 29px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.bp-best strong { font-size: 22px; line-height: 1.2; font-weight: 600; color: #60796e; font-variant-numeric: tabular-nums; }
.bp-restart { margin-left: auto; border: 1px solid #d7dfd6; min-height: 44px; padding: 0 12px; display: flex; align-items: center; gap: 6px; border-radius: 12px; background: #fbfcf8; color: #365e50; font-size: 12px !important; font-weight: 600 !important; }
.bp-restart:hover { background: #e9efe6; }
.bp-board-wrap { position: relative; }
.bp-board { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 5px; padding: 11px; background: #254e43; border: 1px solid #163b31; border-radius: 18px; aspect-ratio: 1; box-shadow: 0 5px 0 #193e33, 0 10px 24px #183c3510; touch-action: none; user-select: none; }
.bp-row { display: contents; }
.bp-cell { appearance: none; min-width: 0; width: 100%; padding: 0; border: 0; background: #365e52; border-radius: 5px; box-shadow: inset 0 1px 2px #0c2e2825; position: relative; aspect-ratio: 1; transition: background .13s; }
.bp-cell:focus-visible { z-index: 2; outline: 3px solid #fff5d7 !important; outline-offset: -3px !important; }
.bp-color-1 { background: #f2aa7e; box-shadow: inset 0 2px 0 #ffc7a0, inset 0 -2px 0 #cf865e; }
.bp-color-2 { background: #a79acb; box-shadow: inset 0 2px 0 #c7bae7, inset 0 -2px 0 #8679ae; }
.bp-color-3 { background: #78b5a5; box-shadow: inset 0 2px 0 #a5d8c7, inset 0 -2px 0 #5e9385; }
.bp-cell.bp-preview { background: var(--preview-color); opacity: .55; box-shadow: inset 0 0 0 2px #e2fff399; }
.bp-cell.bp-invalid { box-shadow: inset 0 0 0 2px #ff8b79; }
.bp-tray { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 19px; }
.bp-piece { min-width: 0; min-height: 103px; border: 1.5px solid transparent; border-radius: 13px; background: #e9ede5; color: #476559; padding: 13px 6px 20px; display: flex; align-items: center; justify-content: center; position: relative; touch-action: none; user-select: none; }
.bp-piece:hover:not(:disabled) { background: #e1e8db; }
.bp-piece.bp-selected { border-color: #477563; background: #e3ecdf; }
.bp-piece.bp-used { background: transparent; border: 1px dashed #dbe2d7; }
.bp-piece.bp-dragging .bp-piece-art { opacity: .2; }
.bp-piece-art { display: grid; grid-template-columns: repeat(var(--piece-cols, 1), 15px); grid-template-rows: repeat(var(--piece-rows, 1), 15px); gap: 2px; pointer-events: none; }
.bp-mini { display: block; width: 15px; height: 15px; border-radius: 3px; }
.bp-piece-number { position: absolute; bottom: 5px; font-size: 10px; font-weight: 600; opacity: .65; }
.bp-placed-mark { color: #9caf9c; font-size: 24px; align-self: center; }
.bp-status { text-align: center; min-height: 38px; margin: 14px 0 2px; font-size: 13px; line-height: 1.45; color: #385d4e; }
.bp-footnote { display: flex; justify-content: space-between; gap: 10px; color: #6b7f72; font-size: 10px; line-height: 1.5; padding: 0 2px; }
.bp-save::before { content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #7b9b77; margin-right: 5px; vertical-align: 2px; }
.bp-keyboard { margin-top: 15px; font-size: 12px; line-height: 1.6; color: #687e70; text-align: center; }
.bp-keyboard summary { display: inline-block; padding: 8px 12px; cursor: pointer; text-decoration: underline; text-decoration-color: #b8c8b7; text-underline-offset: 3px; }
.bp-keyboard p { max-width: 410px; margin: 3px auto 0; }
.bp-end { position: absolute; inset: 0; z-index: 5; border-radius: 18px; background: #142f28bd; display: grid; place-items: center; padding: 18px; }
.bp-end[hidden], .bp-confirm[hidden] { display: none; }
.bp-end-card { display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 310px; width: 100%; padding: 24px 20px; border-radius: 19px; background: #f8faf3; box-shadow: 0 20px 60px #132b3533; }
.bp-end-eyebrow { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .15em; color: #7d9077; }
.bp-end-card h2 { margin: 7px 0 5px; font-size: 24px; letter-spacing: -.03em; }
.bp-end-card p { margin: 0 0 15px; font-size: 12px; line-height: 1.5; color: #64806f; }
.bp-end-card strong { font-size: 46px; line-height: 1.1; letter-spacing: -.04em; }
.bp-end-caption { font-size: 11px; color: #708776; margin: 5px 0 20px; }
.bp-primary { min-height: 44px; border: 1px solid #255e4f; padding: 11px 22px; border-radius: 11px; background: #255e4f; color: #fff; font-weight: 600 !important; font-size: 14px !important; }
.bp-primary:hover { background: #164b3d; }
.bp-secondary { min-height: 44px; border: 1px solid #cbd7c6; padding: 11px 15px; border-radius: 11px; background: #f4f7ef; color: #315c4b; font-size: 14px !important; }
.bp-confirm { position: absolute; inset: 0; z-index: 8; background: #173c3570; backdrop-filter: blur(3px); border-radius: 18px; display: grid; align-items: start; justify-items: center; padding: 120px 20px 20px; }
.bp-confirm-card { background: #fafbf5; padding: 26px; border-radius: 18px; max-width: 360px; box-shadow: 0 10px 50px #12342740; }
.bp-confirm-card h2 { font-size: 22px; margin: 0 0 10px; }
.bp-confirm-card p { font-size: 14px; line-height: 1.55; color: #577261; margin: 0 0 24px; }
.bp-confirm-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.bp-drag-ghost { display: grid; grid-template-columns: repeat(var(--piece-cols), var(--ghost-step)); grid-template-rows: repeat(var(--piece-rows), var(--ghost-step)); position: fixed; pointer-events: none; z-index: 10000; opacity: .9; filter: drop-shadow(0 8px 6px #153d3445); }
.bp-ghost-cell { width: var(--ghost-size); height: var(--ghost-size); border-radius: 5px; }
.bp-ghost-invalid { opacity: .6; }
.bp-cleared { animation: bp-flash .4s ease-out; }
@keyframes bp-flash { 0% { background: #f8efbf; transform: scale(.88); } 100% { background: #365e52; transform: scale(1); } }
@media (max-width: 480px) {
  .bp-scorebar { gap: 19px; padding-bottom: 13px; }
  .bp-score strong { font-size: 26px; }
  .bp-board { gap: 4px; padding: 8px; border-radius: 14px; }
  .bp-cell, .bp-ghost-cell { border-radius: 4px; }
  .bp-tray { margin-top: 15px; gap: 9px; }
  .bp-piece { min-height: 100px; padding-top: 10px; }
  .bp-piece-art { grid-template-columns: repeat(var(--piece-cols, 1), 13px); grid-template-rows: repeat(var(--piece-rows, 1), 13px); }
  .bp-mini { width: 13px; height: 13px; }
  .bp-status { margin-top: 11px; font-size: 12px; }
  .bp-footnote { font-size: 9px; }
  .bp-keyboard { margin-top: 9px; }
  .bp-end-card { padding: 16px; }
  .bp-end-card h2 { font-size: 22px; }
  .bp-end-card strong { font-size: 38px; }
}
@media (prefers-reduced-motion: reduce) { .bp-cell { transition: none; } .bp-cleared { animation: none; } }
