/* ===== 게임 요소: 책상 친구 · 시한폭탄 · 포춘 쿠키 · 배지 · 프로필 · 랭킹 · 길드 ===== */

/* ── 책상 친구 코너 (책상 가운데 아래) ── */
.obj-buddy .obj-fallback { display: block; }
.buddy-corner { display: flex; align-items: flex-end; gap: clamp(8px, 1.4vw, 18px); padding: clamp(8px, 1vw, 14px) clamp(10px, 1.4vw, 18px); border-radius: 20px; background: rgba(255, 248, 236, .14); border: 1.5px dashed rgba(255, 236, 200, .35); box-shadow: inset 0 0 30px rgba(0, 0, 0, .12); }
.buddy-corner.has-bombs { background: rgba(255, 90, 95, .1); border-color: rgba(255, 140, 140, .45); }
.buddy-corner.mood-scared { animation: dangerPulse 1.2s ease-in-out infinite; }
@keyframes dangerPulse { 50% { box-shadow: inset 0 0 40px rgba(255, 60, 60, .35), 0 0 24px rgba(255, 70, 70, .35); } }
:root[data-theme="light"] .buddy-corner { background: rgba(255, 255, 255, .35); border-color: rgba(140, 100, 60, .3); }
.bc-buddy { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; width: clamp(78px, 11vw, 140px); }
.bc-avatar { width: 100%; padding: 0; background: none; border: 0; cursor: pointer; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .35)); }
.bc-avatar .buddy { width: 100%; height: auto; display: block; overflow: visible; }
.bc-avatar.poked .bd-root { animation: poke .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes poke { 30% { transform: translateY(-14px) scale(1.06, .94); } 60% { transform: translateY(0) scale(.94, 1.06); } }
.bc-swap { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: rgba(20, 16, 24, .55); color: #fff; opacity: .8; }
.bc-swap:hover { opacity: 1; }
.bc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.bc-bubble { position: relative; align-self: flex-start; max-width: 100%; padding: 8px 14px; border-radius: 16px 16px 16px 4px; background: #fffdf7; color: #3f2f24; font-weight: 800; font-size: clamp(12px, 1.1vw, 14.5px); box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .45); animation: bubbleIn .4s cubic-bezier(.3, 1.5, .5, 1); }
.bc-bubble::before { content: ''; position: absolute; left: -7px; bottom: 6px; border: 8px solid transparent; border-right-color: #fffdf7; border-left: 0; }
.mood-scared .bc-bubble { background: #ffe8e8; color: #9c1f2b; animation: bubbleShake .4s ease-in-out infinite; }
.mood-scared .bc-bubble::before { border-right-color: #ffe8e8; }
@keyframes bubbleIn { from { transform: scale(.6) translateY(8px); opacity: 0; } }
@keyframes bubbleShake { 25% { transform: translateX(-2px) rotate(-1deg); } 75% { transform: translateX(2px) rotate(1deg); } }
.bc-lock { font-size: clamp(10.5px, .95vw, 12.5px); font-weight: 700; color: rgba(255, 240, 220, .85); }
:root[data-theme="light"] .bc-lock { color: #6b4a2f; }

/* 친구 SVG 공통 · 표정별 움직임 */
.buddy .bd-shadow { fill: rgba(0, 0, 0, .22); }
.buddy .bd-blush { fill: #ff9aa8; opacity: .55; }
.buddy .bd-eye-arc, .buddy .bd-brow { fill: none; stroke: #3a2a22; stroke-width: 2.6; stroke-linecap: round; }
.buddy .bd-note { font: 900 14px/1 system-ui, sans-serif; fill: #ff7aa2; }
.buddy .bd-root { transform-box: view-box; transform-origin: 60px 112px; }
.buddy .bd-eyes { transform-box: fill-box; transform-origin: center; animation: bdBlink 4.2s infinite; }
@keyframes bdBlink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
.mood-happy .bd-root { animation: bdBob 2.8s ease-in-out infinite; }
@keyframes bdBob { 50% { transform: translateY(-3px) rotate(-1.5deg); } }
.mood-happy .bd-note { animation: bdNote 2.4s ease-in-out infinite; }
.mood-happy .bd-note.n2 { animation-delay: 1.2s; }
@keyframes bdNote { 0% { opacity: 0; transform: translateY(6px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(6px, -12px); } }
.mood-calm .bd-root { animation: bdSway 3.4s ease-in-out infinite; }
@keyframes bdSway { 50% { transform: rotate(2deg); } }
.mood-worried .bd-root { animation: bdShiver .5s ease-in-out infinite; }
@keyframes bdShiver { 25% { transform: translateX(-1.2px) rotate(-1deg); } 75% { transform: translateX(1.2px) rotate(1deg); } }
.mood-scared .bd-root { animation: bdShake .16s linear infinite; }
@keyframes bdShake { 25% { transform: translate(-2px, 1px) rotate(-2deg); } 50% { transform: translate(2px, -1px); } 75% { transform: translate(-1px, -1px) rotate(2deg); } }
.buddy .bd-sweat { animation: bdSweat 1.6s ease-in infinite; transform-box: fill-box; }
@keyframes bdSweat { 0% { transform: translateY(-3px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(8px); opacity: 0; } }
.buddy .bd-tear { animation: bdTear 1s ease-in infinite; transform-box: fill-box; transform-origin: top; }
.buddy .bd-tear.r { animation-delay: .5s; }
@keyframes bdTear { 0% { transform: scaleY(.3); opacity: .4; } 60% { transform: scaleY(1.1); opacity: 1; } 100% { transform: scaleY(1.2) translateY(4px); opacity: 0; } }
.buddy .bd-pupil { animation: bdPupil .3s linear infinite; }
@keyframes bdPupil { 50% { transform: translate(.6px, -.6px); } }
.buddy .bd-shock { animation: bdShock .5s steps(2) infinite; }
@keyframes bdShock { 50% { opacity: .3; } }
.buddy .bd-ears.up { transform-box: view-box; transform-origin: 60px 40px; animation: bdEarsUp .25s ease-in-out infinite alternate; }
@keyframes bdEarsUp { to { transform: translateY(-3px); } }
.buddy .bd-ears.flop { transform-box: view-box; transform-origin: 60px 44px; transform: rotate(-4deg); }

/* ── 시한폭탄 (심지가 타들어 감) ── */
.bc-bombs { display: flex; align-items: flex-end; gap: clamp(6px, 1vw, 14px); flex-wrap: wrap; }
.dbomb { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; width: clamp(70px, 8.4vw, 112px); padding: 0; background: none; border: 0; cursor: pointer; transition: transform .2s; }
.dbomb:hover, .dbomb:focus-visible { transform: translateY(-6px) scale(1.06); }
.dbomb-svg { width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 8px 8px rgba(0, 0, 0, .35)); }
.dbomb .db-body { transform-box: fill-box; transform-origin: center; }
.dbomb.lv0 .dbomb-svg { animation: dbSway 3s ease-in-out infinite; }
.dbomb.lv1 .dbomb-svg { animation: dbWobble .9s ease-in-out infinite; }
.dbomb.lv2 .dbomb-svg { animation: dbShake .25s linear infinite; }
.dbomb.lv3 .dbomb-svg { animation: dbShake .12s linear infinite; }
.dbomb.lv3 .db-body { animation: dbFlash .5s steps(2) infinite; }
@keyframes dbSway { 50% { transform: rotate(-3deg); } }
@keyframes dbWobble { 25% { transform: rotate(-4deg) scale(1.02); } 75% { transform: rotate(4deg) scale(.98); } }
@keyframes dbShake { 25% { transform: translate(-1.5px, .5px) rotate(-2deg); } 50% { transform: translate(1.5px, -.5px); } 75% { transform: translate(-.5px, -1px) rotate(2deg); } }
@keyframes dbFlash { 50% { fill: #b3243a; } }
.dbomb .db-danger { animation: dbDanger 1s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes dbDanger { 50% { transform: scale(1.15); opacity: .6; } }
.dbomb .db-star { animation: dbSpark .18s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes dbSpark { 0% { transform: scale(.8) rotate(0deg); } 50% { transform: scale(1.25) rotate(25deg); } 100% { transform: scale(.85) rotate(45deg); } }
.dbomb.lv2 .db-star, .dbomb.lv3 .db-star { animation-duration: .1s; }
.dbomb .db-ember { animation: dbEmber .9s ease-out infinite; }
.dbomb .db-ember.e2 { animation-delay: .3s; } .dbomb .db-ember.e3 { animation-delay: .6s; }
@keyframes dbEmber { 0% { transform: translate(0, 0); opacity: 1; } 100% { transform: translate(var(--ex, 8px), -14px); opacity: 0; } }
.dbomb .db-ember.e1 { --ex: -9px; } .dbomb .db-ember.e3 { --ex: 4px; }
.dbomb .db-sweat { animation: bdSweat 1.4s ease-in infinite; transform-box: fill-box; }
.dbomb-tag { display: flex; flex-direction: column; align-items: center; max-width: 100%; }
.dbomb-tag .bomb-chip { font-size: 10.5px; padding: 1px 7px; white-space: nowrap; }
.dbomb-tag em { font-style: normal; font-size: 10.5px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:root[data-theme="light"] .dbomb-tag em { color: #3f2f24; text-shadow: none; }
.bc-more { align-self: center; font-weight: 900; color: #fff; background: #ff5a5f; padding: 4px 10px; border-radius: 999px; }

/* ── 평화로울 때: 포춘 쿠키 · 채널 ── */
.bc-peace { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.bc-cookie, .bc-channel { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 16px; background: #fffdf7; color: #3f2f24; border: 0; box-shadow: 0 8px 16px -8px rgba(0, 0, 0, .5); text-align: left; transition: transform .2s, box-shadow .2s; min-width: 0; text-decoration: none; }
.bc-cookie:hover, .bc-channel:hover, .bc-cookie:focus-visible, .bc-channel:focus-visible { transform: translateY(-3px) rotate(-1deg); box-shadow: 0 12px 22px -8px rgba(0, 0, 0, .55), 0 0 0 3px rgba(255, 210, 120, .7); }
.bc-cookie-art { width: clamp(48px, 5vw, 64px); flex: none; animation: cookieIdle 2.6s ease-in-out infinite; }
.bc-cookie-art .ck-svg { width: 100%; height: auto; display: block; }
.bc-cookie-art .ck-crack, .bc-cookie-art .ck-paper { display: none; }
@keyframes cookieIdle { 50% { transform: rotate(-6deg) translateY(-2px); } }
.bc-cookie-text, .bc-channel > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.bc-cookie b, .bc-channel b { font-size: clamp(12.5px, 1.1vw, 14.5px); font-weight: 900; }
.bc-cookie em, .bc-channel em { font-style: normal; font-size: 11.5px; color: #8a7b68; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-logo { position: relative; flex: none; width: clamp(40px, 4vw, 52px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: linear-gradient(135deg, #fff1c4, #ffd166); box-shadow: 0 0 0 3px #fff, 0 0 0 5px #ff5a5f, 0 4px 10px rgba(0, 0, 0, .3); }
.ch-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ch-logo::after { content: '🥚'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; z-index: -1; }

/* 메뉴판 단품: 📺 유튜브 보기 (쿠키) */
.dish.dish-tube { background: radial-gradient(circle at 50% 40%, #ffe6a8, #ff8a8a 70%, #c94a5a); }
.dish-cookie { position: absolute; left: 50%; top: 40%; width: 60%; transform: translate(-50%, -50%); animation: cookieIdle 2.6s ease-in-out infinite; }
.dish-cookie .ck-svg { width: 100%; height: auto; display: block; }
.dish-cookie .ck-crack, .dish-cookie .ck-paper { display: none; }
.dish-logo { position: absolute; right: 10px; top: 10px; width: 38px; }
.dish.has-art .dish-cookie { display: none; }

/* ── 포춘 쿠키 창 ── */
.modal.fc-modal { width: min(94vw, 560px); }
.modal.fc-modal .modal-actions { display: none; }
.fc { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.fc-types { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.fc-lists { text-align: center; margin-top: -4px; }
.fc-stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 0 4px; }
.fc.opened .fc-stage { padding: 0; }
.fc-cookie { position: relative; width: min(260px, 70%); padding: 0; background: none; border: 0; cursor: pointer; transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.fc.opened .fc-cookie { width: min(170px, 46%); cursor: default; }
.fc-cookie .ck-svg { width: 100%; height: auto; display: block; overflow: visible; filter: drop-shadow(0 14px 14px rgba(0, 0, 0, .3)); }
.fc-cookie:not(.open):not(.cracking) .ck-svg { animation: cookieIdle 2s ease-in-out infinite; }
.fc-cookie:not(.open):hover .ck-svg { transform: scale(1.05) rotate(-4deg); }
.fc-cookie .ck-crack { opacity: 0; }
.fc-cookie .ck-paper { opacity: 0; }
.fc-cookie .ck-half { transform-box: view-box; transform-origin: 100px 90px; transition: transform .45s cubic-bezier(.3, 1.4, .5, 1); }
.fc-cookie.cracking .ck-svg { animation: cookieShake .12s linear infinite; }
.fc-cookie.cracking .ck-crack { opacity: 1; transition: opacity .3s .25s; }
@keyframes cookieShake { 25% { transform: rotate(-5deg) scale(1.04); } 75% { transform: rotate(5deg) scale(1.04); } }
.fc-cookie.open .ck-left { transform: translate(-30px, 8px) rotate(-28deg); }
.fc-cookie.open .ck-right { transform: translate(30px, 8px) rotate(28deg); }
.fc-cookie.open .ck-fold, .fc-cookie.open .ck-crack { opacity: 0; }
.fc-crumbs { position: absolute; left: 50%; top: 45%; pointer-events: none; }
.fc-crumbs i { position: absolute; width: 7px; height: 6px; border-radius: 40%; background: #d99a46; opacity: 0; }
.fc-cookie.open .fc-crumbs i { animation: crumb .7s ease-out forwards; }
@keyframes crumb { 0% { opacity: 1; transform: rotate(var(--a)) translateX(0); } 100% { opacity: 0; transform: rotate(var(--a)) translateX(var(--d)) translateY(30px); } }
.fc-confetti { position: absolute; left: 50%; top: 40%; pointer-events: none; }
.fc-confetti i { position: absolute; width: 8px; height: 12px; border-radius: 2px; background: var(--c); animation: confetti 1.4s ease-out forwards; }
@keyframes confetti { 0% { transform: rotate(var(--a)) translateY(0) scale(.4); opacity: 1; } 100% { transform: rotate(var(--a)) translateY(-150px) rotate(320deg) scale(1); opacity: 0; } }
.fc-hint { font-weight: 800; color: var(--text-2); animation: breathe 2.2s ease-in-out infinite; }
.fc-slip { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 12px; background: #fffdf5; color: #3f2f24; box-shadow: 0 14px 28px -14px rgba(0, 0, 0, .6); transform-origin: 50% 0; animation: slipOut .6s cubic-bezier(.2, 1.3, .5, 1); background-image: repeating-linear-gradient(0deg, transparent 0 26px, rgba(120, 90, 60, .07) 26px 27px); }
@keyframes slipOut { from { transform: scaleY(.1) translateY(-30px); opacity: 0; } }
.fc.rare .fc-slip { background: linear-gradient(135deg, #fff6d0, #ffe28a 50%, #fff6d0); box-shadow: 0 0 0 3px #ffd166, 0 0 30px rgba(255, 200, 80, .7); }
.fc-fortune { text-align: center; font-weight: 900; font-size: 15px; color: #7a3e3e; }
.fc.rare .fc-fortune { font-size: 17px; color: #b35c00; animation: rareGlow 1.2s ease-in-out infinite; }
@keyframes rareGlow { 50% { text-shadow: 0 0 12px rgba(255, 180, 60, .9); } }
.fc-video { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; }
.fc-video img { width: 100%; height: 100%; object-fit: contain; display: block; }
.fc-src { position: absolute; left: 8px; top: 8px; font-size: 11.5px; font-weight: 800; color: #fff; background: rgba(0, 0, 0, .65); padding: 2px 8px; border-radius: 6px; }
.fc-title { font-size: 15px; line-height: 1.4; }
.fc-meta { font-size: 12px; color: #8a7b68; }
.fc-end { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; font-weight: 800; }
.fc-slip .segmented { --surface: #fff; --surface-2: #f6efe3; --border: rgba(120, 90, 60, .2); --text: #3f2f24; --text-2: #7a6a58; }
.fc-slip .btn { --surface-2: #fff; --surface-3: #fff1e0; --border: rgba(120, 90, 60, .22); --text: #3f2f24; --text-2: #6b5d4d; color: #3f2f24; }
.fc-slip .btn-primary { --mode-color: #ff5a5f; color: #fff; }
.fc-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

/* ── 책상 친구 고르기 ── */
.modal.bp-modal { width: min(94vw, 720px); }
.modal.bp-modal .modal-actions { display: none; }
.bp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 12px 0; }
.bp-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 10px; border-radius: 18px; background: var(--surface-2); border: 2px solid var(--border); text-align: center; transition: transform .2s, border-color .2s, background .2s; }
.bp-card .buddy { width: 82px; height: auto; overflow: visible; }
.bp-card b { font-size: 14px; } .bp-card em { font-style: normal; font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.bp-card:hover { transform: translateY(-3px); }
.bp-card.on { border-color: var(--accent, #ffb547); background: color-mix(in srgb, var(--bd) 22%, var(--surface-2)); }
.bp-moods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 10px; border-radius: 16px; background: var(--surface-2); margin-bottom: 12px; }
.bp-mood { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; font-weight: 800; color: var(--text-2); }
.bp-mood .buddy { width: 64px; height: auto; overflow: visible; }

/* ── 책상 배치: 휴대폰(세로 · 가로)에서도 친구 · 폭탄 · 조명이 항상 보이게 ── */
@media (max-width: 760px), (max-height: 560px) and (orientation: landscape) {
  .obj-buddy { grid-area: buddy; display: block !important; }
  .obj-lamp { grid-area: lamp; display: block !important; }
  .obj-lamp .obj-fallback { aspect-ratio: 16 / 10; max-height: 120px; margin: 0 auto; }
  .bc-buddy { width: 84px; }
  .dbomb { width: 70px; }
}
@media (max-width: 760px) {
  .table-stage { grid-template-columns: repeat(6, 1fr); grid-template-areas: "sticky sticky sticky sticky sticky sticky" "buddy buddy buddy buddy buddy buddy" "menu menu menu notebook notebook notebook" "diary diary radio radio lamp lamp"; }
  .obj-diary, .obj-radio { width: auto !important; }
  .obj-diary .diary-cover, .obj-radio .radio-body { aspect-ratio: 4 / 3; }
  .bc-peace { flex-direction: column; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .table-stage { grid-template-columns: .9fr 1fr .65fr .65fr .65fr; grid-template-areas: "menu notebook sticky sticky sticky" "menu notebook buddy buddy buddy" "menu notebook diary radio lamp"; gap: 22px 10px; }
  .bc-buddy { width: 70px; }
  .bc-swap { display: none; }
  .bc-bubble { font-size: 12px; padding: 6px 10px; }
  .bc-lock { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .buddy *, .dbomb *, .dbomb .dbomb-svg, .bc-cookie-art, .dish-cookie, .buddy-corner { animation: none !important; }
}
/* 포춘 쿠키 쪽지: 버튼까지 한 화면에 */
.fc.opened .fc-cookie { width: min(120px, 34%); }
.fc-video { width: 100%; max-width: 380px; margin: 0 auto; }
.fc-slip { padding: 12px 14px; gap: 6px; }
.fc-title { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-height: 760px) { .fc-video { max-width: 300px; } .fc-types .chip { padding: 5px 10px; } }

/* ── 재생 화면: 💣 폭탄 알약 (위쪽 가운데, 늘 보임) ── */
.bomb-pill { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 8; display: flex; align-items: center; gap: 8px; max-width: min(520px, 60vw); padding: 6px 14px 6px 10px; border-radius: 999px; background: rgba(30, 18, 26, .82); color: #fff; font-size: 13px; box-shadow: 0 6px 18px rgba(0, 0, 0, .4); border: 1px solid rgba(255, 120, 120, .35); pointer-events: none; }
.bomb-pill .bp-ic { font-size: 16px; animation: dbWobble .9s ease-in-out infinite; display: inline-block; }
.bomb-pill .bp-sep { width: 1px; height: 14px; background: rgba(255, 255, 255, .25); }
.bomb-pill .bp-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }
.bomb-pill .bomb-chip { font-size: 12px; white-space: nowrap; }
.bomb-pill.danger { background: rgba(120, 16, 30, .9); animation: dangerPulse 1.2s ease-in-out infinite; }
.bomb-pill.danger .bp-ic { animation: dbShake .2s linear infinite; }
@media (max-width: 600px) { .bomb-pill { top: 12px; padding: 4px 10px 4px 8px; gap: 5px; font-size: 12px; } .bomb-pill .bp-name, .bomb-pill .bp-sep { display: none; } }

/* ── 🎮 시작 화면 ── */
.splash { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; overflow: hidden; background: linear-gradient(135deg, #ffd6e8, #fff1c4 45%, #c9e8ff); opacity: 0; transition: opacity .4s, transform .65s cubic-bezier(.6, 0, .4, 1); }
.splash.in { opacity: 1; }
.splash.out { opacity: 0; transform: scale(1.35); }
.sp-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.splash.no-gl .sp-bg { display: none; }
.sp-float { position: absolute; inset: 0; pointer-events: none; }
.sp-float i { position: absolute; left: var(--x); bottom: -60px; font-style: normal; font-size: clamp(22px, 3.4vw, 40px); opacity: .55; filter: drop-shadow(0 6px 8px rgba(120, 60, 90, .25)); animation: spFloat var(--d) linear infinite; animation-delay: var(--delay); }
@keyframes spFloat { 0% { transform: translateY(0) rotate(-10deg); } 50% { transform: translateY(-55vh) translateX(18px) rotate(10deg); } 100% { transform: translateY(-115vh) rotate(-8deg); } }
.sp-center { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 34px; text-align: center; }
.sp-buddy { width: clamp(130px, 18vw, 200px); animation: spBounce 2.2s cubic-bezier(.3, 1.4, .5, 1) infinite; filter: drop-shadow(0 18px 18px rgba(120, 60, 90, .28)); }
.sp-buddy .buddy { width: 100%; height: auto; overflow: visible; }
@keyframes spBounce { 0%, 100% { transform: translateY(0) scale(1, 1); } 40% { transform: translateY(-16px) scale(.97, 1.03); } 55% { transform: translateY(0) scale(1.05, .95); } }
.sp-logo { position: relative; margin: 0; font: 900 clamp(48px, 9vw, 96px)/1 "Noto Sans KR", system-ui, sans-serif; letter-spacing: -.03em; color: #fff; -webkit-text-stroke: 3px #5a3a8a; paint-order: stroke fill; text-shadow: 0 6px 0 #5a3a8a, 0 14px 24px rgba(90, 58, 138, .35); animation: spLogo .8s cubic-bezier(.3, 1.6, .5, 1) both; }
.sp-logo.has-art span { display: none; }
.sp-logo-img { max-height: 120px; display: block; }
@keyframes spLogo { from { transform: scale(.4) rotate(-8deg); opacity: 0; } }
.sp-sub { margin: 0; font-weight: 800; font-size: clamp(14px, 1.8vw, 18px); color: #5a3a8a; background: rgba(255, 255, 255, .7); padding: 4px 14px; border-radius: 999px; }
.sp-start { margin-top: 8px; padding: 16px 44px; border-radius: 999px; border: 0; font: 900 clamp(18px, 2.4vw, 24px)/1 "Noto Sans KR", system-ui, sans-serif; color: #fff; background: linear-gradient(180deg, #ff8fb1, #ff5f8f); box-shadow: 0 8px 0 #c43c6c, 0 18px 30px rgba(196, 60, 108, .35); cursor: pointer; animation: spPulse 1.6s ease-in-out infinite; }
.sp-start:hover { filter: brightness(1.06); }
.sp-start:active { transform: translateY(6px); box-shadow: 0 2px 0 #c43c6c, 0 8px 16px rgba(196, 60, 108, .3); }
.sp-start:focus-visible { outline: 4px solid #fff; outline-offset: 4px; }
@keyframes spPulse { 50% { transform: scale(1.05); } }
.sp-credit { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: 13px; font-weight: 800; color: #5a3a8a; opacity: .85; }
.sp-credit img { width: 22px; height: 22px; border-radius: 50%; }
@media (prefers-reduced-motion: reduce) { .sp-float i, .sp-buddy, .sp-start, .sp-logo { animation: none; } }
/* 휴대폰 격자: 순서(order)가 바뀐 물건이 책상 바닥 밑으로 깔리지 않게 */
@media (max-width: 760px), (max-height: 560px) and (orientation: landscape) {
  .table-stage > .table-surface { z-index: 0; }
  .table-stage > .obj { z-index: 1; }
}
/* 포춘 쿠키: 높이가 낮은 화면(가로 휴대폰)에서는 깬 뒤 쿠키를 숨기고 쪽지를 2단으로 */
@media (max-height: 560px) {
  .fc.opened .fc-stage { display: none; }
  .fc-types .chip { padding: 4px 10px; font-size: 12px; }
  .fc-slip { display: grid; grid-template-columns: minmax(0, 210px) minmax(0, 1fr); column-gap: 14px; row-gap: 6px; align-items: start; }
  .fc-fortune, .fc-actions { grid-column: 1 / -1; }
  .fc-end { grid-column: 2; }
  .fc-video { grid-row: span 3; max-width: none; }
  .fc-slip { padding: 10px 12px; }
  .fc-fortune { font-size: 14px; }
  .fc-actions { justify-content: flex-end; }
}
/* 좁은 휴대폰: 폭탄 표시를 위쪽 막대 바로 아래 띠로 (막대의 버튼과 겹치지 않게, 영상은 그만큼 아래로) */
@media (max-width: 600px) {
  .view-player { --bomb-h: 0px; }
  .view-player.has-bombs { --bomb-h: 34px; }
  .bomb-pill { top: calc(var(--top-h) + 6px); }
  .view-player.yt-live .bomb-pill { top: var(--top-h); left: 0; right: 0; transform: none; max-width: none; height: var(--bomb-h); border-radius: 0; justify-content: center; border: 0; border-bottom: 1px solid rgba(255, 120, 120, .3); background: #1d1016; box-shadow: none; }
  .view-player.yt-live .bomb-pill .bp-name, .view-player.yt-live .bomb-pill .bp-sep { display: inline; }
  .view-player.yt-live .bomb-pill .bp-sep { display: inline-block; }
  .view-player.yt-live.has-bombs .stage { top: calc(var(--top-h) + var(--bomb-h) + var(--pop-h, 0px)); }
  .view-player.yt-live.has-bombs .display-pop { top: calc(var(--top-h) + var(--bomb-h)); }
}
/* 넓은 화면: 친구 코너가 테이블 아래 가장자리를 넘지 않게 조금 작게 */
@media (min-width: 761px) and (min-height: 561px) {
  .bc-buddy { width: clamp(70px, 8.6vw, 118px); }
  .dbomb { width: clamp(62px, 6.8vw, 94px); }
  .buddy-corner { padding: clamp(6px, .8vw, 12px) clamp(10px, 1.2vw, 16px); }
}
