/* 블록 퍼즐: 사이트 테마와 상관없이 어두운 게임 무대 + 보석 같은 블록 */
.stage:has(> .bp) { background: radial-gradient(120% 90% at 50% 0%, #4a2fb0 0%, #1d1650 42%, #0b0a20 100%); color: #fff; }

.bp { --pad: 7px; --gap: 4px; position: relative; display: flex; flex-direction: column; align-items: center; gap: 1.1rem; width: min(100%, 26rem); user-select: none; -webkit-user-select: none; }
.bp-scores { display: flex; justify-content: space-between; width: 100%; padding: 0 .25rem; }
.bp-scores div { display: flex; flex-direction: column; line-height: 1; gap: .3rem; }
.bp-scores .best { align-items: flex-end; }
.bp-scores span { font-size: .7rem; font-weight: 700; letter-spacing: .18em; color: rgb(255 255 255 / .55); }
.bp-scores b { font-size: 2.1rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; text-shadow: 0 0 18px rgb(140 120 255 / .7); }
.bp-scores .best b { font-size: 1.35rem; color: #ffd43b; text-shadow: 0 0 14px rgb(255 200 50 / .5); }
.bp-scores b.bump { animation: bump .35s; }
@keyframes bump { 35% { transform: scale(1.22); } }

.bp-board { display: grid; grid-template-columns: repeat(8, 1fr); gap: var(--gap); padding: var(--pad); width: 100%; aspect-ratio: 1; box-sizing: border-box; border-radius: 18px;
  background: linear-gradient(180deg, rgb(255 255 255 / .09), rgb(255 255 255 / .03)); border: 1px solid rgb(255 255 255 / .12);
  box-shadow: inset 0 2px 14px rgb(0 0 0 / .55), 0 24px 60px -24px rgb(0 0 0 / .8), 0 0 0 1px rgb(120 100 255 / .15); }
.cell { border-radius: 7px; background: rgb(255 255 255 / .05); box-shadow: inset 0 1px 3px rgb(0 0 0 / .4); }

/* 보석 블록: 색마다 색상각(--h)만 다르다 */
.c1 { --h: 262; } .c2 { --h: 150; } .c3 { --h: 88; } .c4 { --h: 22; } .c5 { --h: 315; } .c6 { --h: 205; } .c7 { --h: 55; }
.blk, .cell[class*=" c"] {
  background: linear-gradient(155deg, oklch(.9 .12 var(--h)) 0%, oklch(.72 .19 var(--h)) 45%, oklch(.56 .2 var(--h)) 100%);
  box-shadow: inset 0 2px 0 rgb(255 255 255 / .6), inset 0 -3px 0 rgb(0 0 0 / .28), inset 0 0 0 1px rgb(255 255 255 / .12), 0 0 14px -3px oklch(.72 .2 var(--h) / .7);
}
.cell.pv { opacity: .42; box-shadow: none; }
.cell.hl { animation: glow .5s ease-in-out infinite alternate; }
@keyframes glow { to { filter: brightness(1.45) saturate(1.2); transform: scale(1.04); } }
.cell.land { animation: land .22s ease-out; }
@keyframes land { 0% { transform: scale(1.2); filter: brightness(1.6); } 100% { transform: scale(1); } }
.cell.pop { animation: pop .3s ease-in forwards; }
@keyframes pop { 0% { transform: scale(1); } 35% { transform: scale(1.25); filter: brightness(2.2); } 100% { transform: scale(0); opacity: 0; } }

.bp-tray { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; min-height: 7.5rem; }
.slot { display: grid; place-items: center; min-height: 7.5rem; cursor: grab; touch-action: none; }
.slot:hover .piece { transform: scale(1.06); }
.piece { display: grid; gap: 3px; transition: transform .15s, opacity .15s; }
.piece.in { animation: dealIn .35s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes dealIn { from { transform: scale(0) rotate(-20deg); opacity: 0; } }
.slot.lifting .piece { opacity: .12; }
.slot.nofit .piece { filter: grayscale(1) brightness(.6); opacity: .45; }
.blk { border-radius: 5px; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; transition: none; will-change: transform; filter: drop-shadow(0 14px 22px rgb(0 0 0 / .45)); }
.slot.turn .piece { animation: wiggle 1.2s ease-in-out infinite; }
@keyframes wiggle { 0%, 70%, 100% { transform: rotate(0); } 80% { transform: rotate(-10deg); } 90% { transform: rotate(8deg); } }

/* 폭탄 */
.bz { background: radial-gradient(circle at 35% 30%, #ff8a65, #d6336c 60%, #7a1030) !important; box-shadow: 0 0 16px rgb(255 80 80 / .7) !important; opacity: .85; }
.cell.bz-target { outline: 2px solid #ff6b6b; outline-offset: -2px; background-color: rgb(255 80 80 / .25); animation: glow .35s ease-in-out infinite alternate; }

/* 아이템 */
.bp-items { display: flex; gap: .75rem; justify-content: center; }
.item { position: relative; display: flex; flex-direction: column; align-items: center; gap: .15rem; width: 4.25rem; padding: .55rem 0 .45rem; border: 1px solid rgb(255 255 255 / .14); border-radius: 14px; cursor: pointer; font: inherit; color: #fff; touch-action: none;
  background: linear-gradient(180deg, rgb(255 255 255 / .12), rgb(255 255 255 / .04)); box-shadow: inset 0 1px 0 rgb(255 255 255 / .15), 0 6px 16px -8px rgb(0 0 0 / .6); transition: transform .1s; }
.item:active { transform: scale(.94); }
.item svg { width: 1.5rem; height: 1.5rem; color: #9ec5ff; }
.item.bomb svg { color: #ff8787; }
.item .lbl { font-size: .7rem; font-weight: 600; color: rgb(255 255 255 / .7); }
.item kbd { font: inherit; font-size: .62rem; padding: 0 .25rem; border-radius: 4px; border: 1px solid rgb(255 255 255 / .25); color: rgb(255 255 255 / .85); }
@media (hover: none) { .item kbd { display: none; } } /* 터치 기기엔 키보드 표시 안 함 */
.item b { position: absolute; top: -.45rem; right: -.45rem; min-width: 1.35rem; height: 1.35rem; padding: 0 .3rem; border-radius: 999px; display: grid; place-items: center; font-size: .75rem; font-weight: 800; color: #2a1a00; background: linear-gradient(180deg, #ffe066, #fab005); box-shadow: 0 2px 6px rgb(0 0 0 / .4); }
.item.empty b { color: #fff; background: linear-gradient(180deg, #69db7c, #2f9e44); } /* "+" = 광고 보고 받기 */

.bp-toast { position: absolute; left: 50%; top: 4.2rem; z-index: 5; margin: 0; padding: .55rem 1rem; border-radius: 999px; white-space: nowrap; font-size: .85rem; font-weight: 600; color: #fff;
  background: rgb(20 16 50 / .92); border: 1px solid rgb(255 255 255 / .15); box-shadow: 0 10px 24px -8px rgb(0 0 0 / .6); pointer-events: none;
  opacity: 0; transform: translate(-50%, -8px); transition: opacity .2s, transform .2s; }
.bp-toast.show { opacity: 1; transform: translate(-50%, 0); }
.bp-link { border: 0; background: none; cursor: pointer; font: inherit; color: rgb(255 255 255 / .7); text-decoration: underline; text-underline-offset: 3px; margin-top: .6rem; padding: .4rem; }
.drag-ghost .blk { border-radius: 7px; }

/* 효과: 파편, 점수, 칭찬 문구 */
.spark { position: fixed; z-index: 60; width: 9px; height: 9px; border-radius: 3px; pointer-events: none; }
.float { position: fixed; z-index: 61; pointer-events: none; font-size: 1.5rem; font-weight: 800; color: #fff; text-shadow: 0 2px 10px rgb(0 0 0 / .6), 0 0 18px rgb(140 120 255 / .9); }
.praise { position: fixed; z-index: 62; pointer-events: none; white-space: nowrap; font-size: clamp(2.2rem, 10vw, 3.4rem); font-weight: 900; letter-spacing: -.02em;
  background: linear-gradient(180deg, #fffbe0, #ffd43b 55%, #ff9f1c); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 #b3540a) drop-shadow(0 8px 18px rgb(0 0 0 / .5)); }

/* 게임 오버 */
.bp-over { position: absolute; inset: -.5rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; text-align: center; border-radius: 20px;
  background: rgb(10 8 32 / .84); backdrop-filter: blur(6px); animation: fade .4s; }
.bp-over p { margin: 0; }
.bp-over-title { font-size: 2.4rem; font-weight: 900; letter-spacing: -.02em; text-shadow: 0 0 24px rgb(140 120 255 / .8); animation: drop .5s cubic-bezier(.3,1.5,.5,1); }
.bp-over-sub { color: rgb(255 255 255 / .6); font-size: .9rem; }
.bp-final { font-size: 3.2rem; font-weight: 800; letter-spacing: -.03em; margin: .4rem 0 .8rem !important; }
.bp-newbest { color: #ffd43b; font-weight: 900; letter-spacing: .1em; animation: glow .6s ease-in-out infinite alternate; }
.bp-cta { border: 0; cursor: pointer; font: inherit; font-weight: 800; font-size: 1.05rem; color: #2a1a00; padding: .85rem 2.4rem; border-radius: 999px;
  background: linear-gradient(180deg, #ffe066, #fab005); box-shadow: 0 5px 0 #c27c00, 0 12px 24px -8px rgb(250 176 5 / .7); transition: transform .1s, box-shadow .1s; }
.bp-cta:active { transform: translateY(4px); box-shadow: 0 1px 0 #c27c00; }
@keyframes fade { from { opacity: 0; } }
@keyframes drop { from { transform: translateY(-30px) scale(.8); opacity: 0; } }
