/* 블록 퍼즐 — 밤바다 유리 사탕 블록 */

/* ── 공통 틀(퍼즐 6종이 같이 쓰는 모양): 제목 화면 · PLAY 단추 · HUD 알약 · 결과 별 · 손가락 안내 ──
   게임마다 바꾸는 색: --k-a(로고 위) --k-b(로고 아래) --k-edge(로고 테두리) --k-glow(빛) */
.k-title { position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 18px 16px; text-align: center; overflow: hidden; }
.k-title[hidden] { display: none; }
.k-title > * { position: relative; z-index: 2; }
.k-title .k-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.k-bot { width: 86px; height: 86px; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.35)); animation: k-bob 2.4s ease-in-out infinite; }
@keyframes k-bob { 50% { transform: translateY(-9px) rotate(-3deg); } }
.k-logo { position: relative; margin: 0; font-family: 'Black Han Sans', var(--title); font-weight: 400; font-size: clamp(42px, 8.4vw, 82px); line-height: 1; letter-spacing: -0.01em; white-space: nowrap; }
.k-logo span { position: relative; display: inline-block; background: linear-gradient(180deg, #fff 8%, var(--k-a, #ffe27a) 46%, var(--k-b, #ff9a3c) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.k-logo::before { content: attr(data-t); position: absolute; inset: 0; z-index: -1; -webkit-text-stroke: 12px var(--k-edge, #3a1d6e); color: var(--k-edge, #3a1d6e); text-shadow: 0 8px 0 var(--k-edge, #3a1d6e), 0 16px 26px rgba(0, 0, 0, 0.45); }
.k-logo small { display: block; font-size: 0.34em; margin-top: 6px; }
.k-sub { margin: -4px 0 2px; max-width: 420px; font-size: 15px; line-height: 1.45; color: rgba(255, 255, 255, 0.86); text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); }
@media (max-width: 420px) { .k-logo { font-size: clamp(36px, 11vw, 54px); } .k-bot { width: 70px; height: 70px; } }

/* 크고 도톰한 입체 단추 (모든 게임 같은 금빛) */
.k-play { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-width: 230px; padding: 15px 44px 17px; border: 0; border-radius: 24px; cursor: pointer; overflow: hidden;
  font-family: 'Black Han Sans', var(--title); font-size: 32px; line-height: 1; color: #fff; letter-spacing: 0.02em; text-shadow: 0 3px 0 rgba(150, 60, 0, 0.55);
  background: linear-gradient(180deg, #ffe066 0%, #ffb21e 52%, #ff8a00 100%);
  box-shadow: 0 8px 0 #c25e00, 0 14px 26px rgba(0, 0, 0, 0.38), inset 0 3px 0 rgba(255, 255, 255, 0.65), inset 0 -4px 0 rgba(200, 80, 0, 0.35);
  animation: k-breathe 1.8s ease-in-out infinite; transition: transform 0.08s, box-shadow 0.08s; }
.k-play::before { content: ''; position: absolute; left: 10px; right: 10px; top: 5px; height: 42%; border-radius: 18px 18px 40% 40%; background: linear-gradient(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0)); pointer-events: none; }
.k-play::after { content: ''; position: absolute; top: -20%; bottom: -20%; width: 34%; left: -50%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.75), transparent); transform: skewX(-18deg); animation: k-shine 2.8s ease-in-out infinite; pointer-events: none; }
.k-play svg { width: 0.9em; height: 0.9em; fill: #fff; filter: drop-shadow(0 3px 0 rgba(150, 60, 0, 0.55)); }
.k-play:hover { filter: brightness(1.06); }
.k-play:active { transform: translateY(6px) scale(0.98); box-shadow: 0 2px 0 #c25e00, 0 6px 12px rgba(0, 0, 0, 0.3), inset 0 3px 0 rgba(255, 255, 255, 0.65); animation: none; }
.k-play.small { min-width: 0; font-size: 24px; padding: 12px 26px 14px; border-radius: 18px; }
.k-play.wide { width: 100%; }
@keyframes k-breathe { 50% { transform: scale(1.045); } }
@keyframes k-shine { 0%, 55% { left: -50%; } 100% { left: 130%; } }

.k-ghost[hidden], .k-play[hidden], .k-best[hidden], .k-link[hidden] { display: none; }
/* 작은 보조 단추 · 고르기 칩 */
.k-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 16px; border: 2px solid rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.1); color: #fff; font-family: var(--title); font-size: 17px; cursor: pointer; text-decoration: none; backdrop-filter: blur(4px); box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25); }
.k-ghost:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); }
.k-link { display: inline-block; margin-top: 2px; font-size: 14px; color: rgba(255, 255, 255, 0.72); text-decoration: underline; text-underline-offset: 3px; }

/* HUD 알약: 아이콘 + 숫자 */
.k-pill { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 4px; border-radius: 999px; background: linear-gradient(180deg, rgba(20, 16, 50, 0.72), rgba(20, 16, 50, 0.55)); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.14), 0 4px 10px rgba(0, 0, 0, 0.25); color: #fff; }
.k-pill i { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(180deg, var(--ic1, #ffd75e), var(--ic2, #ff9d1c)); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.55), inset 0 -3px 0 rgba(0, 0, 0, 0.2); }
.k-pill i svg { width: 19px; height: 19px; fill: #fff; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.3)); }
.k-pill b { font-family: 'Black Han Sans', var(--title); font-weight: 400; font-size: 22px; line-height: 1; min-width: 1.2em; text-align: center; letter-spacing: 0.01em; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); }
.k-pill small { font-size: 11px; opacity: 0.7; margin-left: -2px; }
.k-pill.k-hot b { color: #ffd75e; }
.k-pop { animation: k-pop 0.36s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes k-pop { 0% { transform: scale(1); } 35% { transform: scale(1.32) translateY(-2px); } 100% { transform: scale(1); } }
.k-best { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px 7px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.28); box-shadow: inset 0 0 0 2px rgba(255, 215, 94, 0.45); color: #ffe7a0; font-family: var(--title); font-size: 17px; }
.k-best i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(#ffe27a, #ffa41c); }
.k-best i svg { width: 17px; height: 17px; fill: #fff; }
.k-best b { font-family: 'Black Han Sans', var(--title); font-weight: 400; font-size: 21px; color: #fff; }

/* 결과 화면 카드 */
.k-res { position: absolute; inset: 0; z-index: 12; display: grid; place-items: center; padding: 16px; background: radial-gradient(ellipse at 50% 40%, rgba(40, 30, 90, 0.55), rgba(10, 8, 30, 0.86)); backdrop-filter: blur(3px); }
.k-res[hidden] { display: none; }
.k-card { position: relative; width: min(380px, 100%); max-height: 100%; overflow: auto; padding: 16px 22px 20px; border-radius: 28px; text-align: center; color: #fff;
  background: linear-gradient(180deg, var(--k-card1, #3b2f86) 0%, var(--k-card2, #231a5c) 100%); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.16), inset 0 3px 0 rgba(255, 255, 255, 0.25), 0 26px 60px rgba(0, 0, 0, 0.5);
  animation: k-card-in 0.45s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes k-card-in { from { transform: translateY(40px) scale(0.85); opacity: 0; } }
.k-card h2 { margin: 0 0 2px; font-family: 'Black Han Sans', var(--title); font-weight: 400; font-size: 34px; line-height: 1.1; color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35); }
.k-card p { margin: 0 0 10px; color: rgba(255, 255, 255, 0.78); font-size: 15px; }
.k-stars { display: flex; justify-content: center; align-items: flex-end; gap: 2px; margin: 0 0 4px; }
.k-stars span { width: 62px; height: 62px; display: block; }
.k-stars span:nth-child(2) { width: 82px; height: 82px; margin-bottom: 12px; }
.k-stars svg { width: 100%; height: 100%; overflow: visible; }
.k-stars .bg { fill: #1a1446; stroke: rgba(255, 255, 255, 0.25); stroke-width: 1.4; }
.k-stars .fg { fill: url(#k-gold); stroke: #b86a00; stroke-width: 1.4; transform-origin: 12px 12px; transform: scale(0); }
.k-stars .on .fg { animation: k-stamp 0.42s cubic-bezier(.3, 1.9, .5, 1) forwards; }
@keyframes k-stamp { 0% { transform: scale(2.4) rotate(-30deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.k-score { display: block; margin: 4px 0 2px; font-family: 'Black Han Sans', var(--title); font-weight: 400; font-size: 56px; line-height: 1.05; background: linear-gradient(#fff, #ffe48a); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.35)); }
.k-rows { display: grid; gap: 6px; margin: 8px 0 12px; }
.k-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; border-radius: 14px; background: rgba(0, 0, 0, 0.22); font-size: 15px; }
.k-row b { font-family: 'Black Han Sans', var(--title); font-weight: 400; font-size: 20px; }
.k-next { margin: 0 0 12px; padding: 8px 12px; border-radius: 14px; background: rgba(255, 215, 94, 0.14); box-shadow: inset 0 0 0 1.5px rgba(255, 215, 94, 0.4); color: #ffe7a0; font-size: 14px; }
.k-next:empty { display: none; }
.k-ribbon { position: relative; display: inline-block; margin: 2px 0 8px; padding: 6px 26px; font-family: 'Black Han Sans', var(--title); font-size: 20px; color: #fff; background: linear-gradient(#ff5d8f, #e0245e); box-shadow: 0 4px 0 #9c1240; border-radius: 6px; transform: rotate(-3deg); animation: k-ribbon 0.6s 0.3s cubic-bezier(.3, 1.8, .5, 1) both; }
.k-ribbon[hidden] { display: none; }
@keyframes k-ribbon { from { transform: rotate(-3deg) scale(0); } }
.k-card .k-play { margin-top: 4px; }
.k-card .k-link { margin-top: 12px; }

/* 손가락 안내 */
.k-hand { position: absolute; left: 0; top: 0; z-index: 9; width: 58px; height: 58px; pointer-events: none; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.4)); }
.k-hand svg { width: 100%; height: 100%; transform-origin: 30% 8%; }
.k-hand.press svg { transform: scale(0.85); }
.k-tap { position: absolute; z-index: 8; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; border: 4px solid #fff; pointer-events: none; animation: k-tap 0.6s ease-out forwards; }
@keyframes k-tap { from { transform: scale(0.3); opacity: 0.9; } to { transform: scale(1.4); opacity: 0; } }
.k-tipbox { position: absolute; left: 50%; z-index: 9; transform: translateX(-50%); padding: 8px 16px; border-radius: 14px; background: rgba(15, 10, 40, 0.82); color: #fff; font-family: var(--title); font-size: 17px; white-space: nowrap; pointer-events: none; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); animation: k-tip-in 0.4s ease-out both; }
@keyframes k-tip-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* 콤보 글자 */
.sb-float.k-combo { font-family: 'Black Han Sans', var(--title); -webkit-text-stroke: 7px rgba(40, 10, 70, 0.92); letter-spacing: 0.02em; }
@media (prefers-reduced-motion: reduce) { .k-play, .k-bot { animation: none; } }

.stage.bp { --k-a: #9fe9ff; --k-b: #6a7bff; --k-edge: #1a1660; --k-card1: #34348f; --k-card2: #1a1a55;
  background: radial-gradient(60% 45% at 18% 12%, rgba(120, 90, 255, 0.45), transparent 70%), radial-gradient(55% 40% at 85% 85%, rgba(40, 200, 220, 0.32), transparent 70%), linear-gradient(180deg, #2b2a7a 0%, #1a1b55 55%, #11123a 100%);
  gap: 6px; padding: 8px 0 6px; }
.stage.bp::before { content: ''; position: absolute; inset: -20%; pointer-events: none; opacity: 0.55;
  background: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.12) 0 2px, transparent 3px), radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.1) 0 1.5px, transparent 2.5px), radial-gradient(circle at 40% 80%, rgba(160, 220, 255, 0.14) 0 2px, transparent 3px);
  background-size: 180px 180px, 240px 240px, 300px 300px; animation: bp-drift 40s linear infinite; }
@keyframes bp-drift { to { transform: translate(-120px, -200px); } }
.bp-top { position: relative; z-index: 2; width: min(calc(100% - 20px), max(var(--bw, 320px), 300px)); display: flex; align-items: center; gap: 8px; flex: none; }
.bp-top .k-pill b { min-width: 2.2em; text-align: left; }
.bp-combo { flex: none; margin-left: auto; font-family: 'Black Han Sans', var(--title); font-size: 17px; line-height: 1; padding: 8px 13px; border-radius: 999px; white-space: nowrap;
  background: linear-gradient(135deg, #3ee0b5, #7b6cff); color: #fff; box-shadow: 0 4px 0 #3a2fa8, 0 8px 18px rgba(62, 224, 181, 0.35); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
  opacity: 0; transform: scale(0.6); transition: opacity 0.2s, transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1); pointer-events: none; }
.bp-combo.on { opacity: 1; transform: scale(1); animation: bp-hot 0.9s ease-in-out infinite; }
@keyframes bp-hot { 50% { filter: brightness(1.2); } }
.bp-combo i { font-style: normal; font-size: 9px; letter-spacing: 1px; vertical-align: 2px; margin-left: 2px; color: #ffd23f; }
.bp-combo i em { font-style: normal; color: rgba(255, 255, 255, 0.3); }
.bp-restart { flex: none; margin-left: auto; min-width: 42px; height: 42px; padding: 0 10px; }
.bp-combo.on + .bp-restart { margin-left: 0; }
.bp-restart svg { width: 20px; height: 20px; fill: #fff; }
.bp-restart.sure { background: #ff6b5a; border-color: #ff6b5a; font-size: 14px; font-weight: 800; }
.bp-wrap { flex: 1; min-height: 0; width: 100%; position: relative; z-index: 1; }
.bp-cv { position: absolute; left: 0; top: 0; display: block; touch-action: none; cursor: grab; }
.bp-cv:active { cursor: grabbing; }
.bp-hint { position: relative; z-index: 1; display: none; margin: 0; font-size: 12.5px; color: #8f96c8; flex: none; }
@media (hover: hover) and (pointer: fine) { .bp-hint { display: block; } }
@media (max-width: 360px) { .bp-top .k-pill { padding-right: 8px; } .bp-combo { font-size: 15px; padding: 6px 9px; } }

/* 제목 화면 */
.bp .ov-start { background: radial-gradient(60% 50% at 50% 40%, rgba(130, 110, 255, 0.5), transparent 70%), linear-gradient(180deg, #2b2a7a 0%, #1a1b55 60%, #11123a 100%); }
.bp-bot { width: 110px; height: 113px; display: block; filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.4)); animation: k-bob 2.4s ease-in-out infinite; }
.bp-deco { position: absolute; display: flex; flex-direction: column; gap: 3px; transform: scale(var(--s)); animation: bp-float 6s ease-in-out infinite; opacity: 0.85; }
.bp-deco span { display: flex; gap: 3px; }
.bp-deco b { width: 30px; height: 30px; border-radius: 7px; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 55%, #fff), var(--c) 50%, color-mix(in srgb, var(--c) 60%, #000));
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.45), inset 0 -4px 0 rgba(0, 0, 0, 0.2), 0 6px 12px rgba(0, 0, 0, 0.3); }
.bp-deco b.e { background: none; box-shadow: none; }
@keyframes bp-float { 0%, 100% { translate: 0 0; rotate: -8deg; } 50% { translate: 0 -16px; rotate: 6deg; } }
@media (max-width: 500px) { .bp-deco { opacity: 0.45; } .bp-deco b { width: 22px; height: 22px; } }
@media (max-height: 560px) { .bp-bot { width: 70px; height: 72px; } .ov-start .k-sub { display: none; } }
