/* 버거 가게 — 캔버스 하나 + 위 점수판 + 제목 · 끝 · 가게 꾸미기 판 (따뜻한 가게 색: 빨강 차양 · 겨자 · 크림) */
.stage.bg { --btn-a: #ffe066; --btn-b: #ffab1f; --btn-edge: #c76a00;
  display: block; background: #262a58; overscroll-behavior: none; touch-action: none; }
.bg-cv { position: absolute; left: 0; top: 0; display: block; touch-action: none; outline: none; cursor: pointer; }

/* ── 위 점수판: 아이콘 + 숫자 알약 ── */
.bg-hud { position: absolute; left: 0; right: 0; top: 0; z-index: 2; display: flex; gap: 6px; justify-content: center; padding: 6px 8px 0; pointer-events: none; }
.bg-h { display: flex; align-items: center; gap: 5px; padding: 3px 12px 3px 4px; border-radius: 999px; min-width: 0;
  background: linear-gradient(rgba(30, 18, 50, 0.82), rgba(30, 18, 50, 0.92)); border: 1.5px solid rgba(255, 255, 255, 0.18); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 3px 0 rgba(0, 0, 0, 0.3); }
.bg-h > svg { width: 28px; height: 28px; flex: none; padding: 3px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); }
.bg-h b { display: block; font-family: "Fredoka", var(--title); font-weight: 600; font-size: 20px; line-height: 1.2; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bg-h-time.low { background: linear-gradient(#d8342b, #9a1410); border-color: #ffb3a8; animation: bg-pulse 0.5s ease-in-out infinite alternate; }
.bg-h-money { flex: 0 1 230px; min-width: 130px; padding-right: 14px; }
.bg-mw { flex: 1; min-width: 0; }
.bg-h-money b { color: #ffd23f; font-size: 17px; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; }
.bg-prog { position: relative; height: 7px; margin: 3px 0 2px; border-radius: 4px; background: rgba(255, 255, 255, 0.14); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4); }
.bg-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 4px; background: linear-gradient(#ffe066, #ff9d2e); box-shadow: 0 0 6px rgba(255, 190, 60, 0.6); transition: width 0.35s cubic-bezier(0.3, 1.4, 0.5, 1); }
.bg-prog em { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; background: #5a5578; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); transition: background 0.2s, transform 0.3s cubic-bezier(0.3, 1.8, 0.5, 1); }
.bg-prog em.on { background: #ffd23f; transform: scale(1.45); filter: drop-shadow(0 0 4px #ffd23f); }
@keyframes bg-pulse { to { transform: scale(1.08); } }

/* 가운데 알림 띠 */
.bg-banner { position: absolute; left: 50%; top: 34%; z-index: 4; transform: translate(-50%, -50%); pointer-events: none; text-align: center; padding: 12px 30px 14px; border-radius: 22px;
  background: linear-gradient(#ff6b5a, #d93b2b); border: 3px solid #fff2c4; box-shadow: 0 6px 0 #8c1f14, 0 16px 30px rgba(0, 0, 0, 0.35); max-width: 92%; }
.bg-banner[hidden] { display: none; }
.bg-banner.go { animation: bg-banner 0.45s cubic-bezier(.2, 1.6, .4, 1); }
.bg-banner b { display: block; font-family: "Black Han Sans", var(--title); font-weight: 400; font-size: 32px; color: #fff; white-space: nowrap; text-shadow: 0 3px 0 #8c1f14; }
.bg-banner span { display: block; font-size: 15px; font-weight: 800; color: #fff2c4; margin-top: 2px; }
.bg-banner span:empty { display: none; }
@keyframes bg-banner { from { transform: translate(-50%, -50%) scale(0.5) rotate(-6deg); opacity: 0; } }

/* ── 공통 입체 PLAY 단추 ── */
.aaa-play { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 230px; max-width: 100%;
  padding: 14px 34px 16px; border: 0; border-radius: 22px; cursor: pointer; overflow: hidden;
  font-family: "Black Han Sans", var(--title); font-size: 30px; line-height: 1.05; color: #fff; letter-spacing: 0.01em;
  -webkit-text-stroke: 1.5px var(--btn-edge); paint-order: stroke fill; text-shadow: 0 3px 0 var(--btn-edge);
  background: linear-gradient(var(--btn-a), var(--btn-b)); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.6), inset 0 -4px 0 rgba(0, 0, 0, 0.12), 0 7px 0 var(--btn-edge), 0 14px 26px rgba(0, 0, 0, 0.35);
  animation: aaa-breathe 2.4s ease-in-out infinite; transition: transform 0.08s, box-shadow 0.08s; }
.aaa-play::after { content: ''; position: absolute; top: -20%; bottom: -20%; width: 40%; left: -60%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent); animation: aaa-shine 3s ease-in-out infinite; }
.aaa-play .pl-ico { font-size: 0.7em; -webkit-text-stroke: 0; text-shadow: none; opacity: 0.95; }
.aaa-play:hover { filter: brightness(1.06); }
.aaa-play:active { transform: translateY(6px) scale(0.98); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.5), 0 1px 0 var(--btn-edge), 0 4px 10px rgba(0, 0, 0, 0.3); animation: none; }
@keyframes aaa-breathe { 50% { transform: scale(1.045); } }
@keyframes aaa-shine { 0%, 55% { left: -60%; } 85%, 100% { left: 130%; } }

/* ── 제목 화면: 가게 앞 ── */
.bg .bg-title { background: radial-gradient(70% 55% at 50% 42%, #fff3d6 0%, #ffd890 45%, #f0a64a 100%); backdrop-filter: none; padding: 0 14px 12px; overflow: hidden; touch-action: pan-y; }
.bg-title::before { content: ''; position: absolute; inset: 0; opacity: 0.35; pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.5) 0 18px, transparent 18px 44px); }
.bg-title::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 16%; pointer-events: none;
  background: linear-gradient(#4450dc 0 10px, #3a43c0 10px 22px, #262a58 22px); box-shadow: 0 -6px 0 rgba(255, 255, 255, 0.35); }
.t-awning { position: absolute; left: 0; right: 0; top: 0; height: 54px; z-index: 1; pointer-events: none;
  background: radial-gradient(circle at 22px 32px, transparent 0, transparent 0) , repeating-linear-gradient(90deg, #ff5a4a 0 44px, #fff6e6 44px 88px);
  -webkit-mask: radial-gradient(22px 14px at 22px 40px, #000 98%, transparent) 0 0 / 44px 54px repeat-x, linear-gradient(#000, #000) 0 0 / 100% 40px no-repeat;
  mask: radial-gradient(22px 14px at 22px 40px, #000 98%, transparent) 0 0 / 44px 54px repeat-x, linear-gradient(#000, #000) 0 0 / 100% 40px no-repeat;
  filter: drop-shadow(0 6px 4px rgba(120, 40, 0, 0.3)); animation: bg-flap 3s ease-in-out infinite; transform-origin: 50% 0; }
@keyframes bg-flap { 50% { transform: scaleY(1.06); } }
.t-wrap { position: relative; z-index: 2; width: min(460px, 100%); height: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; overflow: auto; padding-top: 56px; scrollbar-width: none; }
.t-scene { position: relative; width: 280px; height: 170px; flex: none; }
/* 떨어져 쌓이는 버거 */
.tb-stack { position: absolute; left: 50%; bottom: 6px; width: 150px; height: 150px; margin-left: -110px; }
.tb-stack::before { content: ''; position: absolute; left: -12px; right: -12px; bottom: -6px; height: 18px; border-radius: 50%; background: #fff; box-shadow: inset 0 -4px 0 #d8dcf5, 0 6px 10px rgba(120, 50, 0, 0.3); }
.tb-l { position: absolute; left: 0; right: 0; display: block; animation: bg-drop 4.8s cubic-bezier(0.3, 1.5, 0.5, 1) infinite both; }
.tb-b { bottom: 4px; height: 30px; border-radius: 10px 10px 18px 18px; background: linear-gradient(#f8bd68, #cf7d2c); animation-delay: 0s; }
.tb-p { bottom: 30px; height: 28px; left: -6px; right: -6px; border-radius: 14px; background: linear-gradient(#9a5a30, #5e3418); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.15); animation-delay: 0.35s; }
.tb-c { bottom: 54px; height: 12px; left: -8px; right: -8px; background: #ffd23f; clip-path: polygon(0 0, 100% 0, 100% 60%, 80% 60%, 74% 100%, 68% 60%, 30% 60%, 24% 100%, 18% 60%, 0 60%); animation-delay: 0.7s; }
.tb-le { bottom: 60px; height: 14px; left: -10px; right: -10px; border-radius: 8px; background: radial-gradient(circle at 10px 14px, #4fb84f 9px, transparent 10px) 0 0 / 20px 14px repeat-x, #7ee07a; animation-delay: 1.05s; }
.tb-t { bottom: 70px; height: 14px; left: 4px; right: 4px; border-radius: 8px; background: linear-gradient(90deg, #e8413a 48%, transparent 48% 52%, #e8413a 52%); animation-delay: 1.4s; }
.tb-B { bottom: 80px; height: 56px; border-radius: 75px 75px 12px 12px; background: radial-gradient(ellipse at 35% 30%, #fff3d0 0 8%, transparent 9%), radial-gradient(circle at 30% 40%, #fff6df 2.5px, transparent 3px) 0 0 / 24px 18px, linear-gradient(#ffcd7a, #e08a2e); animation-delay: 1.75s; }
@keyframes bg-drop { 0% { transform: translateY(-260px); opacity: 0; } 4% { opacity: 1; } 12% { transform: translateY(0) scaleY(1); } 15% { transform: scale(1.08, 0.82); } 19%, 86% { transform: none; opacity: 1; } 95%, 100% { transform: translateY(20px); opacity: 0; } }
.t-chef { position: absolute; right: 0; bottom: 0; width: 104px; animation: bg-chef 1.8s ease-in-out infinite; transform-origin: 50% 100%; }
.t-chef img { width: 100%; display: block; filter: drop-shadow(0 8px 10px rgba(120, 50, 0, 0.35)); }
.t-chef .hat { position: absolute; left: 22%; top: -30px; width: 56%; height: 44px; border-radius: 22px 22px 6px 6px; background: radial-gradient(circle at 30% 30%, #fff 0, #f2f2f8 70%); box-shadow: inset 0 -8px 0 #e3e4f0, 0 4px 6px rgba(0, 0, 0, 0.15); z-index: 1; }
.t-chef .hat::before { content: ''; position: absolute; left: -14%; right: -14%; top: -10px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 25% 60%, #fff 0 34%, transparent 35%), radial-gradient(circle at 75% 60%, #fff 0 34%, transparent 35%), radial-gradient(circle at 50% 35%, #fff 0 40%, transparent 41%); }
@keyframes bg-chef { 50% { transform: rotate(-4deg) translateY(-4px); } }
.t-steam { position: absolute; left: 34px; bottom: 150px; width: 80px; height: 40px; pointer-events: none; }
.t-steam i { position: absolute; bottom: 0; width: 10px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, 0.7); filter: blur(3px); animation: bg-steam 2.4s ease-out infinite; }
.t-steam i:nth-child(1) { left: 10px; } .t-steam i:nth-child(2) { left: 34px; animation-delay: 0.8s; } .t-steam i:nth-child(3) { left: 58px; animation-delay: 1.6s; }
@keyframes bg-steam { from { transform: translateY(10px) scaleY(0.6); opacity: 0; } 40% { opacity: 0.8; } to { transform: translateY(-30px) scaleY(1.2) translateX(6px); opacity: 0; } }
.t-logo { margin: 8px 0 0; font-family: "Black Han Sans", var(--title); font-weight: 400; font-size: clamp(42px, 11vw, 62px); line-height: 1.05; transform: rotate(-3deg); }
.t-logo span { display: inline-block; background: linear-gradient(#fff6c8 8%, #ffd23f 50%, #ff8a1f 92%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 0 #9c2a12) drop-shadow(0 -2px 0 #9c2a12) drop-shadow(3px 0 0 #9c2a12) drop-shadow(-3px 0 0 #9c2a12) drop-shadow(0 8px 0 #5a1606); animation: bg-logo 2.6s ease-in-out infinite; }
@keyframes bg-logo { 50% { transform: translateY(-4px) scale(1.02); } }
.t-sub { margin: 10px 0 10px; color: #6a2e08; font-size: 15px; font-weight: 700; }
.t-badges { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.t-badges > span { display: inline-flex; align-items: center; gap: 5px; padding: 3px 12px 3px 4px; border-radius: 999px; background: rgba(90, 30, 0, 0.78); color: #fff; box-shadow: 0 3px 0 rgba(60, 20, 0, 0.4); }
.t-badges svg { width: 24px; height: 24px; padding: 2px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); }
.t-badges .t-stars svg { fill: #ffd23f; }
.t-badges b { font-family: "Fredoka", var(--title); font-weight: 600; font-size: 17px; }
.t-row { display: flex; gap: 8px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.t-mini { font: inherit; font-size: 14px; font-weight: 800; padding: 9px 16px; border-radius: 14px; border: 0; cursor: pointer; color: #fff; background: linear-gradient(#5a64e8, #3f48c8); box-shadow: 0 4px 0 #262c8a; }
.t-mini:active { transform: translateY(3px); box-shadow: 0 1px 0 #262c8a; }
.t-mini.b-reset { background: rgba(90, 30, 0, 0.55); box-shadow: 0 4px 0 rgba(60, 20, 0, 0.5); font-weight: 700; }
.t-mini[hidden] { display: none; }
.t-keys { margin: 14px 0 0; padding: 6px 12px; border-radius: 12px; font-size: 12px; line-height: 1.45; color: #dfe2ff; background: rgba(20, 22, 60, 0.75); max-width: 440px; }

/* ── 결과 화면 ── */
.bg .bg-end { background: rgba(40, 14, 0, 0.6); backdrop-filter: blur(5px); overflow: auto; touch-action: pan-y; }
.r-card { position: relative; width: min(400px, 100%); text-align: center; padding: 48px 22px 20px; margin: 22px 0 6px; border-radius: 28px; color: #4a2300;
  background: linear-gradient(170deg, #fff7e2, #ffe2a8 60%, #ffcf7a); border: 3px solid #fff; box-shadow: 0 10px 0 #b4621c, 0 26px 50px rgba(0, 0, 0, 0.45), inset 0 -6px 0 rgba(200, 110, 20, 0.2); }
.r-card.in { animation: bg-cardin 0.55s cubic-bezier(0.25, 1.5, 0.45, 1); }
@keyframes bg-cardin { from { transform: translateY(40px) scale(0.7); opacity: 0; } }
.r-ribbon { position: absolute; left: 50%; top: 0; transform: translate(-50%, -30%); width: max-content; max-width: 108%; padding: 10px 28px 12px; font-family: "Black Han Sans", var(--title); font-size: 25px; white-space: nowrap;
  color: #fff; background: linear-gradient(#ff6b5a, #d93b2b); border-radius: 14px; box-shadow: 0 5px 0 #8c1f14, 0 10px 18px rgba(0, 0, 0, 0.3); text-shadow: 0 2px 0 #8c1f14; }
.r-ribbon::before, .r-ribbon::after { content: ''; position: absolute; top: 12px; width: 22px; height: 100%; background: #a8281a; z-index: -1; }
.r-ribbon::before { left: -14px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 40% 50%); }
.r-ribbon::after { right: -14px; clip-path: polygon(0 0, 100% 0, 60% 50%, 100% 100%, 0 100%); }
.r-stars { display: flex; justify-content: center; align-items: flex-end; gap: 6px; margin: 2px 0 0; }
.rs { width: 64px; height: 64px; display: block; opacity: 0.4; transform: scale(0.85); font-style: normal; }
.rs.s2 { width: 84px; height: 84px; margin-bottom: 10px; }
.rs svg { width: 100%; height: 100%; fill: #e3b46c; stroke: rgba(140, 70, 0, 0.35); stroke-width: 1; }
.rs.pop { opacity: 1; animation: bg-star 0.5s cubic-bezier(0.25, 1.8, 0.45, 1) forwards; }
.rs.on svg { fill: #ffd23f; stroke: #fff6b0; stroke-width: 1.2; filter: drop-shadow(0 3px 0 #c77a00) drop-shadow(0 0 10px rgba(255, 200, 60, 0.9)); }
@keyframes bg-star { from { transform: scale(2.4) rotate(-40deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
.r-score { display: flex; align-items: center; justify-content: center; gap: 8px; }
.r-score svg { width: 40px; height: 40px; }
.r-score b { font-family: "Fredoka", "Black Han Sans", var(--title); font-weight: 600; font-size: 50px; line-height: 1.1; color: #e06a00; text-shadow: 0 3px 0 #fff, 0 5px 0 rgba(160, 70, 0, 0.35); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bg .e-msg { margin: 2px 0 10px; font-size: 15px; font-weight: 800; color: #8a3a06; }
.r-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0 0 10px; }
.r-stats div { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 16px; background: rgba(255, 255, 255, 0.6); box-shadow: inset 0 -3px 0 rgba(200, 110, 20, 0.18); min-width: 0; }
.r-stats svg { width: 26px; height: 26px; }
.r-stats b { font-family: "Fredoka", var(--title); font-weight: 600; font-size: 22px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.r-stats span { font-size: 11.5px; color: #9a5a20; }
.e-best { min-height: 1.4em; margin: 0 0 8px; font-size: 13px; color: #9a5a20; }
.e-best[hidden] { display: none; }
.e-best.r-best-badge { display: inline-block; padding: 5px 14px; border-radius: 999px; font-family: var(--title); font-size: 18px; color: #4a2300; background: linear-gradient(#fff1a0, #ffc83d); box-shadow: 0 3px 0 #c77a00; animation: bg-badge 0.6s cubic-bezier(0.25, 1.8, 0.45, 1); }
@keyframes bg-badge { from { transform: scale(0) rotate(-10deg); } }
.r-next { margin: 0 0 14px; padding: 7px 10px; border-radius: 12px; font-size: 14px; font-weight: 700; color: #8a3a06; background: rgba(255, 255, 255, 0.55); border: 1.5px dashed rgba(200, 110, 20, 0.5); }
.r-card .aaa-play { width: 100%; }
.r-shop { display: block; width: 100%; margin-top: 14px; font: inherit; font-size: 15px; font-weight: 800; padding: 11px; border-radius: 16px; border: 0; cursor: pointer; color: #fff; background: linear-gradient(#5a64e8, #3f48c8); box-shadow: 0 5px 0 #262c8a; }
.r-shop:active { transform: translateY(3px); box-shadow: 0 2px 0 #262c8a; }
.r-links { display: flex; gap: 8px; margin-top: 12px; }
.r-link { flex: 1; padding: 8px 6px; border-radius: 12px; font-size: 13px; color: #8a3a06; background: rgba(255, 255, 255, 0.5); border: 1px solid rgba(200, 110, 20, 0.3); text-align: center; text-decoration: none; }

/* ── 가게 꾸미기 판 ── */
.bg .ov-shop { background: rgba(40, 14, 0, 0.6); backdrop-filter: blur(5px); }
.bg .ov-shop .panel { background: linear-gradient(170deg, #fff7e2, #ffe2a8 60%, #ffcf7a); color: #4a2300; border: 3px solid #fff; box-shadow: 0 10px 0 #b4621c, 0 26px 50px rgba(0, 0, 0, 0.45); touch-action: pan-y; }
.bg .ov-shop h2 { font-family: "Black Han Sans", var(--title); font-weight: 400; color: #d93b2b; }
.s-wallet { font-weight: 800; color: #e06a00 !important; }
.bg-ups { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 12px; text-align: left; }
.bg-up { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.65); box-shadow: inset 0 -3px 0 rgba(200, 110, 20, 0.18); }
.bg-up i { font-style: normal; font-size: 26px; text-align: center; }
.bg-up b { display: block; font-size: 15px; color: #4a2300; }
.bg-up span { display: block; font-size: 12.5px; color: #9a5a20; line-height: 1.35; }
.bg-up button { font: inherit; font-weight: 800; font-size: 14px; padding: 8px 12px; border-radius: 12px; border: 0; background: linear-gradient(#ffe066, #ffab1f); box-shadow: 0 3px 0 #c76a00; color: #4a2300; cursor: pointer; white-space: nowrap; }
.bg-up button:disabled { background: rgba(160, 100, 40, 0.18); box-shadow: none; color: #b08a60; cursor: default; }
.bg-up.own { box-shadow: inset 0 0 0 2px rgba(23, 179, 155, 0.6); }
.bg-up.own button:disabled { background: rgba(23, 179, 155, 0.18); color: #0f8f78; }
.bg .ov-shop .big-btn { background: linear-gradient(#ff6b5a, #d93b2b); box-shadow: 0 5px 0 #8c1f14; }

@media (max-width: 520px) {
  .bg-h { padding-right: 10px; }
  .bg-h > svg { width: 25px; height: 25px; }
  .bg-h b { font-size: 18px; }
  .bg-h-money b { font-size: 15px; }
  .aaa-play { font-size: 26px; min-width: 210px; padding: 13px 24px 15px; }
}
@media (max-height: 640px) {
  .t-scene { transform: scale(0.75); margin: -20px 0 -26px; }
  .t-sub { display: none; }
  .t-keys { display: none; }
}
@media (max-height: 420px) {
  .t-scene { display: none; }
  .bg .panel { width: min(640px, 100%); padding: 12px 18px; }
  .bg-hud { padding-top: 4px; }
  .rs { width: 48px; height: 48px; } .rs.s2 { width: 60px; height: 60px; }
}
