.cb { max-width: 460px; margin: 0 auto; padding: 10px 0 16px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; color: #dfe9ff; position: relative; }
.cb [hidden] { display: none !important; }
.cb-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 12px; padding: 0 2px; }
.cb-scores > div { white-space: nowrap; }
.cb-scores { display: flex; gap: 18px; font-size: 13px; color: #8aa3c4; align-items: baseline; min-width: 0; }
.cb-scores b { display: inline-block; color: #fff; font-size: 20px; margin-left: 5px; font-variant-numeric: tabular-nums; }
.cb-scores b.bump { animation: cb-bump .3s ease; }
.cb-combo { color: #ffd166; font-weight: 800; white-space: nowrap; }
.cb-btn { min-width: 96px; background: #0b1328; color: #dfe9ff; border: 1px solid #1c2b4a; border-radius: 10px; padding: 8px 14px; min-height: 36px; font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; transition: background-color .15s, transform .1s, filter .15s; }
.cb-btn:active { transform: scale(0.97); }
.cb-btn-primary { background: #ffd166; color: #1a1200; border-color: #ffd166; }
.cb-btn-primary:hover { filter: brightness(1.06); }
.cb-btn.armed { background: #ff6b81; border-color: #ff6b81; color: #1a0006; }
.cb-btn-lg { padding: 11px 26px; font-size: 15px; min-height: 44px; }
.cb-bay { --cell: 44px; display: grid; grid-template-columns: repeat(8, var(--cell)); gap: 4px; padding: 6px; background: #060b18; border: 1px solid #1c2b4a; border-radius: 12px; width: max-content; margin: 0 auto 14px; position: relative; }
.cb-bay:focus { outline: none; } .cb-bay:focus-visible { outline: 2px solid #55d6ff; outline-offset: 3px; }
.cb-cell { width: var(--cell); height: var(--cell); border-radius: 6px; background: #0f1a30; transition: background-color .08s, box-shadow .12s; }
.cb-cell.on { background: var(--col, #55d6ff); box-shadow: inset 0 -3px 0 rgba(0,0,0,0.25), inset 0 2px 0 rgba(255,255,255,0.25); }
.cb-cell.ok { background: rgba(85,214,255,0.32); box-shadow: inset 0 0 0 1.5px rgba(85,214,255,0.7); }
.cb-cell.bad { background: rgba(255,107,129,0.28); box-shadow: inset 0 0 0 1.5px rgba(255,107,129,0.6); }
.cb-cell.on.will { box-shadow: inset 0 -3px 0 rgba(0,0,0,0.25), inset 0 2px 0 rgba(255,255,255,0.25), 0 0 0 2px #fff, 0 0 12px rgba(255,255,255,0.45); }
.cb-cell.ok.will { background: rgba(85,214,255,0.55); }
.cb-cell.drop { animation: cb-drop .2s cubic-bezier(.3,.7,.4,1.4); }
.cb-cell.clear { animation: cb-clear .4s ease forwards; }
.cb-tray { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; min-height: 110px; touch-action: none; }
.cb-slot { display: flex; align-items: center; justify-content: center; min-height: 104px; background: #0b1328; border: 1px solid #1c2b4a; border-radius: 12px; padding: 6px; cursor: grab; transition: border-color .15s, background-color .15s; }
.cb-slot:hover:not([aria-disabled]) { border-color: #2b4470; }
.cb-slot[aria-disabled] { cursor: default; }
.cb-slot:focus { outline: none; } .cb-slot:focus-visible, .cb-slot.sel { border-color: #55d6ff; box-shadow: 0 0 0 1px #55d6ff; }
.cb-slot.fresh .cb-piece { animation: cb-in .32s cubic-bezier(.3,.7,.4,1.3) backwards; animation-delay: calc(var(--i) * 60ms); }
.cb-piece { display: grid; gap: 3px; transition: opacity .15s; }
.cb-piece.used { visibility: hidden; }
.cb-piece.dead { opacity: 0.3; filter: grayscale(0.6); }
.cb-slot:has(.dead) { cursor: not-allowed; }
.cb-piece i { display: block; width: var(--mini, 22px); height: var(--mini, 22px); border-radius: 4px; background: var(--col); box-shadow: inset 0 -2px 0 rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.25); }
.cb-piece i.e, .cb-ghost i.e { visibility: hidden; }
.cb-ghost { position: fixed; z-index: 60; pointer-events: none; display: grid; gap: 4px; filter: drop-shadow(0 10px 16px rgba(0,0,0,0.55)); }
.cb-ghost i { display: block; width: var(--cell); height: var(--cell); border-radius: 6px; background: var(--col); box-shadow: inset 0 -3px 0 rgba(0,0,0,0.25), inset 0 2px 0 rgba(255,255,255,0.3); }
html.cb-dragging, html.cb-dragging * { cursor: grabbing !important; }
.cb-float { position: absolute; left: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; color: #ffd166; font-weight: 800; font-size: 30px; line-height: 1.1; pointer-events: none; animation: cb-float 1s cubic-bezier(.2,.7,.3,1) forwards; z-index: 5; text-shadow: 0 2px 10px rgba(0,0,0,0.7); white-space: nowrap; }
.cb-float small { font-size: 14px; letter-spacing: 0.04em; color: #fff; }
.cb-help { text-align: center; color: #8aa3c4; font-size: 12.5px; line-height: 1.5; margin: 14px 0 0; text-wrap: balance; }
.cb-help kbd { background: #16213a; color: #bfe9ff; border-radius: 3px; padding: 0 5px; font-family: inherit; font-size: 11.5px; }
@media (hover: none) { .cb-keys { display: none; } }
.cb-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cb-overlay { position: absolute; inset: 0; background: rgba(2,5,14,0.72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 70; padding: 16px; border-radius: 12px; animation: cb-fade .25s ease; }
.cb-dialog { background: #0b1328; border: 1px solid #244b6b; border-radius: 16px; padding: 26px 22px 22px; width: min(100%, 320px); text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,0.5); animation: cb-pop .3s cubic-bezier(.3,.7,.4,1.2); }
.cb-dialog h3 { margin: 0 0 6px; color: #fff; font-size: 22px; } .cb-dialog p { margin: 0 0 14px; color: #8aa3c4; font-size: 14px; }
.cb-dialog b { color: #ffd166; font-size: 44px; line-height: 1; display: block; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.cb-dialog .cb-sub { margin-bottom: 18px; }
@keyframes cb-clear { 0% { background: var(--col); transform: scale(1); } 35% { background: #fff; transform: scale(1.08); } 100% { background: #0f1a30; transform: scale(0.9); box-shadow: none; } }
@keyframes cb-drop { from { transform: scale(0.82); } to { transform: scale(1); } }
@keyframes cb-in { from { transform: scale(0.6); opacity: 0; } }
@keyframes cb-bump { 40% { transform: scale(1.18); color: #ffd166; } }
@keyframes cb-float { 0% { opacity: 0; transform: translate(-50%, -30%) scale(0.8); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); } 100% { opacity: 0; transform: translate(-50%, -140%) scale(1); } }
@keyframes cb-fade { from { opacity: 0; } }
@keyframes cb-pop { from { transform: scale(0.92); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cb *, .cb-ghost { animation: none !important; transition: none !important; } }
@media (max-width: 420px) { .cb-scores { gap: 12px; } .cb-btn { padding: 8px 12px; } .cb-slot { min-height: 92px; } }
/* ---- full-screen (immersive) layout: sizes come from fit() in game.js ---- */
.cb.imm { max-width: none; width: 100%; margin: 0; padding: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.cb.imm .cb-top { width: var(--bayw); height: 40px; margin: 0; flex: none; }
.cb.imm .cb-bay { margin: 0; flex: none; }
.cb.imm .cb-tray { width: var(--trayw, var(--bayw)); min-height: 0; flex: none; }
.cb.imm .cb-slot { min-height: var(--slot-h); }
.cb.imm .cb-help { display: none; }
.cb.imm .cb-scores { gap: 14px; }
.cb.imm .cb-scores b { font-size: 18px; }
.cb.imm .cb-overlay { border-radius: 0; }
.cb.imm.wide { display: grid; grid-template-columns: var(--bayw) var(--sidew, 250px); grid-template-rows: 1fr 40px auto 1fr; column-gap: 12px; row-gap: 12px; align-content: center; justify-content: center; }
.cb.imm.wide .cb-bay { grid-column: 1; grid-row: 1 / 5; align-self: center; }
.cb.imm.wide .cb-top { grid-column: 2; grid-row: 2; width: auto; }
.cb.imm.wide .cb-tray { grid-column: 2; grid-row: 3; width: auto; align-self: start; grid-template-columns: repeat(var(--tray-cols), 1fr); }
