:root {
  --bg: #262833;
  --panel: #323644;
  --tile: #646c7e;
  --text: #f4f5f9;
  --muted: #8b92a5;
  --h0: 20;
  --h1: 48;
  --accent: hsl(var(--h0) 78% 60%);
  --accent2: hsl(var(--h1) 78% 60%);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;     /* 꾹 눌러 복사/메뉴 방지 */
}
input { -webkit-user-select: text; user-select: text; }
img, svg, canvas { -webkit-user-drag: none; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Fredoka", "LineSans", -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
}

button { font-family: inherit; font-size: inherit; font-weight: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* ---------- screens ---------- */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.03);
  transition: opacity .4s ease, transform .4s ease, visibility 0s .4s;
}
.screen.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition: opacity .4s ease, transform .4s ease;
}
/* the game screen lets touches fall through to the canvas */
#screen-game, #screen-game.active,
#screen-water, #screen-water.active,
#screen-bubble, #screen-bubble.active,
#screen-slime, #screen-slime.active,
#screen-connect, #screen-connect.active { pointer-events: none; }
#screen-game button, #screen-game .win-sheet.show,
#screen-water button, #screen-water .win-sheet.show, #screen-water canvas,
#screen-bubble button, #screen-bubble .win-sheet.show, #screen-bubble canvas,
#screen-slime button, #screen-slime .win-sheet.show, #screen-slime canvas,
#screen-connect button, #screen-connect .win-sheet.show, #screen-connect canvas { pointer-events: auto; }

/* ---------- HUD ---------- */
.hud {
  width: min(100%, 520px);
  padding: max(env(safe-area-inset-top), 14px) 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}
.hud h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: .02em;
}
.hud-count { width: 64px; text-align: right; color: var(--muted); font-weight: 700; font-size: 15px; }
.icon-btn {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  color: #fff;
  transition: transform .15s ease;
}
.icon-btn svg { width: 34px; height: 34px; }
.icon-btn:active { transform: scale(.82); }
.icon-btn.spin svg { animation: spin .5s cubic-bezier(.3,1.4,.5,1); }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(-360deg); } }

#btn-restart svg { color: #8b92a5; }

.progress {
  position: relative;
  width: min(calc(100% - 56px), 464px);
  height: 30px;
  border-radius: 9px;
  background: #4d5466;
  overflow: hidden;
  margin-top: 6px;
  display: grid; place-items: center;
}
.progress-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 10%;
  border-radius: 9px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .35s cubic-bezier(.3,1.3,.5,1);
}
.progress span { position: relative; font-size: 22px; font-weight: 600; letter-spacing: .04em; text-shadow: 0 1px 3px rgba(0,0,0,.35); }

/* ---------- hint ---------- */
.hint-btn {
  position: absolute;
  bottom: max(env(safe-area-inset-bottom), 0px);
  margin-bottom: 34px;
  width: 92px; height: 76px;
  border-radius: 20px;
  background: linear-gradient(#f0b94a, #e3a93a);
  box-shadow: 0 6px 0 #b9812a, 0 14px 24px rgba(0,0,0,.3);
  display: grid; place-items: center;
  transition: transform .12s ease, box-shadow .12s ease, opacity .2s;
}
.hint-btn svg { width: 46px; height: 46px; margin-top: -4px; }
.hint-btn:active { transform: translateY(5px); box-shadow: 0 1px 0 #b9812a, 0 6px 12px rgba(0,0,0,.3); }
.hint-btn.empty { filter: grayscale(.8); opacity: .7; }
.hint-btn.nope { animation: nope .4s; }
.hint-btn.hide { opacity: 0; transform: translateY(30px); pointer-events: none !important; }
@keyframes nope { 20%,60% { transform: translateX(-7px); } 40%,80% { transform: translateX(7px); } }
.badge {
  position: absolute; top: -12px; right: -14px;
  min-width: 34px; height: 34px; padding: 0 8px;
  border-radius: 17px;
  background: #fff; color: #2c3150;
  font-weight: 800; font-size: 21px;
  display: grid; place-items: center;
  box-shadow: 0 3px 8px rgba(0,0,0,.35);
}
.badge.bump { animation: bump .4s cubic-bezier(.3,1.8,.5,1); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.5); } 100% { transform: scale(1); } }

/* ---------- win sheet ---------- */
.win-sheet {
  position: absolute;
  bottom: 0;
  width: min(100%, 520px);
  padding: 22px 24px calc(max(env(safe-area-inset-bottom), 0px) + 26px);
  border-radius: 34px 34px 0 0;
  background: linear-gradient(#3a3f52, #313546);
  box-shadow: 0 -16px 40px rgba(0,0,0,.35);
  text-align: center;
  transform: translateY(110%);
  transition: transform .55s cubic-bezier(.2,1.2,.4,1);
  pointer-events: none;
}
.win-sheet.show { transform: none; }
.win-title {
  font-size: 40px; font-weight: 900; letter-spacing: .08em;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.win-sub { color: var(--muted); font-weight: 700; letter-spacing: .12em; margin-top: 2px; }
.win-actions { display: flex; gap: 14px; justify-content: center; margin-top: 16px; }
.round-btn {
  width: 64px; height: 64px; border-radius: 20px;
  background: #4a5063; display: grid; place-items: center; color: #fff;
  box-shadow: 0 5px 0 #383d4e;
  transition: transform .12s, box-shadow .12s;
}
.round-btn svg { width: 30px; height: 30px; }
.round-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #383d4e; }

/* ---------- big buttons ---------- */
.big-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 220px; height: 84px; padding: 0 36px;
  border-radius: 26px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 7px 0 hsl(var(--h0) 60% 38%), 0 18px 30px rgba(0,0,0,.35);
  transition: transform .12s, box-shadow .12s;
  position: relative; overflow: hidden;
}
.big-btn::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  animation: shine 3.2s ease-in-out infinite;
}
@keyframes shine { 0%, 55% { left: -60%; } 100% { left: 130%; } }
.big-btn:active { transform: translateY(6px); box-shadow: 0 1px 0 hsl(var(--h0) 60% 38%), 0 6px 12px rgba(0,0,0,.35); }
.big-btn-main { font-size: 30px; font-weight: 900; letter-spacing: .14em; text-shadow: 0 2px 4px rgba(0,0,0,.22); }
.big-btn-sub-unused { font-size: 13px; font-weight: 800; letter-spacing: .2em; opacity: .85; margin-top: 1px; }
.big-btn.small { height: 64px; min-width: 190px; border-radius: 20px; box-shadow: 0 5px 0 hsl(var(--h0) 60% 38%); }
.big-btn.small .big-btn-main { font-size: 24px; }


/* ---------- home ---------- */
#screen-home { justify-content: center; }
.home-top { width: 100%; display: flex; flex-direction: column; align-items: center; margin-bottom: 64px; }
.home-bottom { width: 100%; display: flex; flex-direction: column; align-items: center; }

.title {
  margin: 0; display: flex;
  font-size: 92px; line-height: 1; font-weight: 700; letter-spacing: .02em;
}
.title span {
  display: inline-block;
  background: linear-gradient(180deg, hsl(var(--h0) 85% 70%), hsl(var(--h1) 80% 58%));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 0 rgba(0,0,0,.22));
  opacity: 0; transform: translateY(-30px) scale(.6);
  animation: letterIn .7s cubic-bezier(.3,1.7,.5,1) forwards, bob 3.4s ease-in-out infinite;
  animation-delay: calc(var(--d) * 110ms + .1s), calc(var(--d) * 220ms + 1s);
}
@keyframes letterIn { to { opacity: 1; transform: none; } }
@keyframes bob { 0%,100% { translate: 0 0; } 50% { translate: 0 -6px; } }

.title-line { width: 190px; height: 20px; margin-top: 6px; overflow: visible; }
.title-line path {
  fill: none; stroke: url(#tl); stroke-width: 7; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: drawLine 3.6s ease-in-out 1s infinite;
}
.title-line circle { fill: #fff2e4; animation: dot 3.6s ease-in-out 1s infinite; offset-path: none; }
@keyframes drawLine { 0% { stroke-dashoffset: 1; } 45%, 80% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -1; } }
@keyframes dot { 0%,100% { opacity: .9; transform: scale(1); } 50% { opacity: 1; transform: scale(1.25); } }
.title-line circle { transform-box: fill-box; transform-origin: center; }


.home-row { display: flex; gap: 14px; margin-top: 26px; }
.pill-btn {
  height: 54px; padding: 0 26px;
  display: flex; align-items: center; gap: 10px;
  border-radius: 18px;
  background: #343949; color: #c9cedb;
  font-weight: 700; letter-spacing: .14em; font-size: 15px;
  box-shadow: 0 4px 0 #2b2f3c;
  transition: transform .12s, box-shadow .12s;
}
.pill-btn svg { width: 22px; height: 22px; }
.pill-btn.round { width: 54px; padding: 0; justify-content: center; }
.pill-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #2b2f3c; }
.pill-btn .ic-off { display: none; }
.pill-btn.muted .ic-on { display: none; }
.pill-btn.muted .ic-off { display: block; }

@media (max-height: 700px) {
  .home-top { margin-bottom: 36px; }
  .title { font-size: 66px; }
  }

/* ---------- level select ---------- */
#screen-levels .hud { flex: none; }
.levels-scroll {
  width: min(100%, 520px);
  flex: 1; overflow-y: auto;
  padding: 10px 22px 40px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.levels-scroll::-webkit-scrollbar { display: none; }
.levels-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.lv {
  aspect-ratio: 1; border-radius: 20px;
  background: #4a5163;
  font-size: 26px; font-weight: 800; color: #dfe2ea;
  display: grid; place-items: center; position: relative;
  box-shadow: 0 5px 0 #383d4e;
  opacity: 0; transform: translateY(14px) scale(.9);
  animation: lvIn .45s cubic-bezier(.3,1.4,.5,1) forwards;
  animation-delay: calc(min(var(--i), 24) * 22ms);
  transition: filter .15s;
}
@keyframes lvIn { to { opacity: 1; transform: none; } }
.lv:active:not(:disabled) { filter: brightness(1.15); transform: translateY(4px) !important; box-shadow: 0 1px 0 #383d4e; }
.lv.done { background: hsl(var(--h) 70% 58%); color: #fff; box-shadow: 0 5px 0 hsl(var(--h) 55% 38%); }
.lv.current { background: #fff; color: #2c3150; box-shadow: 0 5px 0 #aab0c0; animation: lvIn .45s cubic-bezier(.3,1.4,.5,1) forwards, pulse 1.8s ease-in-out infinite .6s; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }
.lv.locked { opacity: .35 !important; cursor: default; }
.lv svg { width: 26px; height: 26px; }
.lv .tick { position: absolute; right: 7px; bottom: 6px; width: 16px; height: 16px; opacity: .9; }

@media (max-height: 640px) {
  .hud { height: 70px; }
  .big-btn { height: 72px; }
}

/* 아이콘만 있는 버튼 */
.big-btn.small { min-width: 150px; }
.big-btn.small svg { width: 34px; height: 34px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
.big-btn.small .ic-grid { display: none; }
.big-btn.small.to-stages .ic-next { display: none; }
.big-btn.small.to-stages .ic-grid { display: block; }
.badge.full { background: linear-gradient(135deg, #fff, #ffe9a8); box-shadow: 0 0 0 3px rgba(255,255,255,.35), 0 3px 8px rgba(0,0,0,.35); }

/* ---------- 헤더 아이콘 / 단계 그리드(자동 열 수) ---------- */
.hud-icon { display: grid; place-items: center; color: #fff; }
.hud-icon svg { width: 36px; height: 36px; }
.levels-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }

/* ========== 가로 화면 ========== */
@media (min-aspect-ratio: 1/1) {
  .hud { width: 100%; max-width: 900px; padding: max(env(safe-area-inset-top), 8px) 24px 0; height: 64px; }
  .hud h2 { font-size: 26px; }
  .progress { width: min(60%, 520px); height: 26px; margin-top: 0; }
  .progress span { font-size: 18px; }

  /* 힌트: 오른쪽 가운데 */
  .hint-btn { left: auto; right: max(env(safe-area-inset-right), 28px); bottom: auto; top: calc(50% - 38px); margin: 0; align-self: flex-start; }
  .hint-btn.hide { transform: translateX(30px); }

  /* 클리어 패널: 오른쪽에서 슬라이드 */
  .win-sheet {
    left: auto; right: 18px; bottom: auto; top: 50%;
    width: 210px; border-radius: 30px; padding: 20px 16px 22px;
    transform: translate(130%, -50%);
  }
  .win-sheet.show { transform: translate(0, -50%); }
  .win-title { font-size: 34px; }
  .win-actions { gap: 10px; }
  .big-btn.small { min-width: 96px; padding: 0 20px; }

  .home-top { margin-bottom: min(64px, 7vh); }
  .title { font-size: min(92px, 18vh); }
  .big-btn { height: min(84px, 16vh); }

  .levels-scroll { width: min(100%, 900px); padding-bottom: 24px; }
}

@media (min-aspect-ratio: 1/1) and (max-height: 450px) {
  .hud { height: 52px; }
  .hud h2 { font-size: 22px; }
  .icon-btn { width: 44px; height: 44px; }
  .icon-btn svg { width: 28px; height: 28px; }
  .progress { height: 22px; }
  .progress span { font-size: 15px; }
  .hint-btn { width: 80px; height: 66px; top: calc(50% - 33px); }
  .hint-btn svg { width: 38px; height: 38px; }
  .win-sheet { width: 190px; padding: 14px 14px 16px; }
  .win-title { font-size: 28px; }
  .round-btn { width: 52px; height: 52px; }
  .big-btn.small { height: 52px; }
}

/* ---------- HUD 좌/우 그룹 (제목이 항상 가운데) ---------- */
.hud { display: grid; grid-template-columns: 1fr auto 1fr; }
.hud-left { justify-self: start; display: flex; }
.hud-right { justify-self: end; display: flex; }
.hud-left .icon-btn { width: 46px; }

/* ---------- 설정 팝업 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 20;
  display: grid; place-items: center;
  background: rgba(14,16,24,.62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden; transition: opacity .25s, visibility 0s .25s;
}
.modal.show { opacity: 1; visibility: visible; transition: opacity .25s; }
.modal-card {
  position: relative; width: min(84vw, 320px);
  padding: 30px 26px 30px; border-radius: 30px;
  background: linear-gradient(#3a3f52, #313546);
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
  display: flex; flex-direction: column; align-items: center; gap: 22px;
  transform: scale(.85) translateY(20px); transition: transform .35s cubic-bezier(.3,1.5,.5,1);
}
.modal.show .modal-card { transform: none; }
.modal-icon { color: #c9cedb; } .modal-icon svg { width: 44px; height: 44px; display: block; }
.modal-x { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; display: grid; place-items: center; color: #8b92a5; }
.modal-x svg { width: 22px; height: 22px; } .modal-x:active { transform: scale(.85); }
.setting-row { display: flex; align-items: center; gap: 18px; padding: 14px 20px; border-radius: 22px; background: #2c303d; }
.setting-row svg { width: 34px; height: 34px; color: #fff; }
.setting-row .ic-off { display: none; }
.setting-row.muted .ic-on { display: none; } .setting-row.muted .ic-off { display: block; color: #8b92a5; }
.switch { width: 74px; height: 42px; border-radius: 21px; background: #555c70; position: relative; transition: background .25s; }
.switch .knob { position: absolute; top: 4px; left: 4px; width: 34px; height: 34px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); transition: transform .3s cubic-bezier(.3,1.6,.5,1); }
.switch.on { background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.switch.on .knob { transform: translateX(32px); }

/* ================= 새 화면들 ================= */
.hud { position: relative; z-index: 2; }
.progress { z-index: 2; }
.win-sheet { z-index: 3; }
.hud-right .icon-btn { width: 46px; }

/* 별도 캔버스 게임 (슬라임 / Connect) */
.game-canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 0; touch-action: none; }

/* ? 버튼 (정답 연하게 보기) */
#btn-peek { color: #ffd98a; }
#btn-peek.peeking { opacity: .35; pointer-events: none !important; animation: breathe 1s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .6; } }

/* ----- 게임 선택 카드 ----- */
#screen-select .hud h2 { width: 1px; }
.cards {
  flex: 1; width: min(88%, 440px);
  display: flex; flex-direction: column; justify-content: center; gap: 18px;
  padding-bottom: 70px;
}
.card {
  --c1: #ff8a4d; --c2: #ffc542; --sh: #b9632a;
  height: min(150px, 20vh); border-radius: 30px; padding: 0 28px;
  display: flex; align-items: center; gap: 22px;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 7px 0 var(--sh), 0 18px 30px rgba(0,0,0,.32);
  color: #fff; font-size: 28px; font-weight: 700; letter-spacing: .14em; text-align: left;
  text-shadow: 0 2px 4px rgba(0,0,0,.25);
  opacity: 0; transform: translateY(30px) scale(.94);
  animation: cardIn .6s cubic-bezier(.3,1.5,.5,1) forwards; animation-delay: calc(var(--i) * 110ms + .15s);
  transition: filter .15s;
}
.card svg { width: 84px; height: 84px; flex: none; filter: drop-shadow(0 3px 3px rgba(0,0,0,.25)); }
.card:active { filter: brightness(1.1); transform: translateY(5px) !important; box-shadow: 0 2px 0 var(--sh), 0 8px 14px rgba(0,0,0,.3); }
.card-slime { --c1: #35d28a; --c2: #3fd6d0; --sh: #1d8f67; }
.card-connect { --c1: #6f7bff; --c2: #c084fc; --sh: #4048b8; }
@keyframes cardIn { to { opacity: 1; transform: none; } }

/* ----- 슬라임 HUD ----- */
.score-box { text-align: center; line-height: 1; }
.score { font-size: 46px; font-weight: 700; letter-spacing: .02em; text-shadow: 0 3px 0 rgba(0,0,0,.25); }
.score.pop { animation: scorePop .35s cubic-bezier(.3,1.8,.5,1); }
@keyframes scorePop { 0% { transform: scale(1); } 40% { transform: scale(1.22); } 100% { transform: scale(1); } }
.best { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 4px; color: #ffd98a; font-size: 16px; font-weight: 600; }
.best svg { width: 16px; height: 16px; }
.over-sheet .over-score { font-size: 52px; }
.new-badge { display: none; justify-content: center; color: #ffd23f; margin-top: 2px; }
.new-badge svg { width: 30px; height: 30px; animation: bob 1.6s ease-in-out infinite; }
.over-sheet.new .new-badge { display: flex; }

/* ----- 설정: Admin Code ----- */
.admin-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 4px 16px; border-radius: 20px;
  background: #2c303d; border: 2px solid transparent; color: #8b92a5;
  transition: border-color .25s, background .25s;
}
.admin-row svg { width: 26px; height: 26px; flex: none; }
.admin-row input {
  flex: 1; min-width: 0; height: 46px; border: 0; outline: 0; background: transparent;
  color: #fff; font: inherit; font-size: 17px; letter-spacing: .12em;
}
.admin-row input::placeholder { color: #6c7385; letter-spacing: .04em; }
.admin-ok { display: none; color: #5de39a; }
.admin-ok svg { width: 26px; height: 26px; }
.admin-row.ok { border-color: #5de39a; background: rgba(93,227,154,.12); }
.admin-row.ok .admin-ok { display: block; animation: bump .5s cubic-bezier(.3,1.8,.5,1); }
.admin-row.ok input::placeholder { color: #5de39a; }

/* ----- 정답 보기 팝업 ----- */
.answer-card { width: auto; max-width: 92vw; padding: 34px 22px 22px; gap: 0; }
#answer-canvas { display: block; }

/* ----- 가로 화면: 새 화면 ----- */
@media (min-aspect-ratio: 1/1) {
  .cards { flex-direction: row; width: min(92%, 900px); padding-bottom: 24px; align-items: center; }
  .card { flex: 1; flex-direction: column; justify-content: center; height: min(250px, 58vh); gap: 10px; padding: 0 12px; font-size: 22px; }
  .card svg { width: min(84px, 16vh); height: min(84px, 16vh); }
  .score { font-size: 38px; }
  .win-sheet.over-sheet { width: 210px; }
}


/* ================= 전체 스타일 개편 (말랑 젤리 테마) ================= */
:root { --gloss: linear-gradient(rgba(255,255,255,.38), rgba(255,255,255,0)); }

/* --- 홈: 젤리 글자 로고 --- */
#screen-home .home-top { margin-bottom: min(60px, 7vh); }
.jelly-title { margin: 0; display: flex; gap: min(10px, 2.4vw); }
.jl {
  --c: #5fdc8c; --cd: #1f9d62; --glow: rgba(95,220,140,.5);
  position: relative;
  width: min(66px, 15.5vw, 17vh); height: min(66px, 15.5vw, 17vh);
  display: grid; place-items: center;
  font-size: min(46px, 11vw, 12vh); font-weight: 700; color: #fff; line-height: 1;
  border-radius: 48% 52% 46% 54% / 56% 46% 54% 44%;
  background: radial-gradient(circle at 30% 26%, rgba(255,255,255,.72), var(--c) 52%, var(--cd) 118%);
  box-shadow: inset 0 -7px 14px rgba(0,0,0,.2), inset 0 3px 6px rgba(255,255,255,.35), 0 12px 24px rgba(0,0,0,.32), 0 0 30px var(--glow);
  text-shadow: 0 2px 6px rgba(0,0,0,.35);
  opacity: 0; transform: translateY(-34px) scale(.5);
  animation: jlIn .8s cubic-bezier(.3,1.9,.5,1) forwards, jlJig 3.4s ease-in-out infinite;
  animation-delay: calc(var(--d) * 120ms + .15s), calc(var(--d) * 340ms + 1.1s);
}
.jl::before {
  content: ""; position: absolute; left: 15%; top: 11%; width: 36%; height: 19%;
  border-radius: 50%; background: rgba(255,255,255,.75); transform: rotate(-28deg);
}
.jl::after {
  content: ""; position: absolute; left: 22%; right: 22%; bottom: 8%; height: 11%;
  border-radius: 50%; background: rgba(255,255,255,.2);
}
.j2 { --c: #35d0c6; --cd: #128f8b; --glow: rgba(53,208,198,.5); border-radius: 54% 46% 52% 48% / 46% 56% 44% 54%; }
.j3 { --c: #4aa8ff; --cd: #2168cf; --glow: rgba(74,168,255,.5); border-radius: 46% 54% 50% 50% / 52% 48% 56% 44%; }
.j4 { --c: #bb7cff; --cd: #8340d3; --glow: rgba(187,124,255,.5); border-radius: 52% 48% 56% 44% / 48% 54% 46% 52%; }
.j5 { --c: #ff6fb5; --cd: #ce3a80; --glow: rgba(255,111,181,.5); border-radius: 50% 50% 44% 56% / 54% 46% 54% 46%; }
@keyframes jlIn { to { opacity: 1; transform: none; } }
@keyframes jlJig { 0%,100% { scale: 1 1; } 25% { scale: 1.07 .93; } 50% { scale: .95 1.06; } 75% { scale: 1.04 .96; } }

/* --- 유리 광택 버튼 / 카드 / 단계 --- */
.big-btn::before, .card::before {
  content: ""; position: absolute; left: 7%; right: 7%; top: 5%; height: 40%;
  border-radius: 999px; background: var(--gloss); pointer-events: none;
}
.card { position: relative; overflow: hidden; }
#btn-play { min-width: min(250px, 64vw); height: min(92px, 16vh); }
#btn-play .big-btn-main { font-size: 34px; }
.pill-btn.round { width: 58px; height: 58px; border-radius: 20px; background: linear-gradient(#3b4054, #323648); box-shadow: 0 5px 0 #262a38, 0 10px 18px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.12); }
.pill-btn.round svg { width: 26px; height: 26px; }
.lv { position: relative; overflow: hidden; }
.lv::before { content: ""; position: absolute; left: 8%; right: 8%; top: 4%; height: 38%; border-radius: 999px; background: linear-gradient(rgba(255,255,255,.2), rgba(255,255,255,0)); pointer-events: none; }
.icon-btn svg { filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); }
.win-sheet { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.modal-card { border: 1px solid rgba(255,255,255,.08); }
.progress { box-shadow: inset 0 2px 5px rgba(0,0,0,.28); }
.progress-fill { box-shadow: 0 0 14px hsl(var(--h0) 80% 60% / .5); }
.progress-fill::after { content: ""; position: absolute; left: 6px; right: 6px; top: 3px; height: 35%; border-radius: 99px; background: rgba(255,255,255,.28); }
.hint-btn::before { content: ""; position: absolute; left: 9%; right: 9%; top: 6%; height: 40%; border-radius: 999px; background: var(--gloss); pointer-events: none; }
.hint-btn { overflow: visible; }

@media (min-aspect-ratio: 1/1) {
  #screen-home .home-top { margin-bottom: min(40px, 6vh); }
  #btn-play { height: min(84px, 17vh); }
}

/* ---------- PC 전용 젤리 커서 ---------- */
#jelly-cursor { position: fixed; left: 0; top: 0; width: 48px; height: 48px; z-index: 9999; pointer-events: none; opacity: 0; transition: opacity .15s; will-change: transform; }
body.has-cursor, body.has-cursor * { cursor: none !important; }
body.has-cursor input, body.has-cursor .modal, body.has-cursor .modal * { cursor: auto !important; }

/* ----- 단계 선택 팝업 ----- */
.pick-card { width: min(86vw, 340px); gap: 14px; padding-top: 44px; }
.pick-card .card { width: 100%; height: 96px; padding: 0 22px; font-size: 22px; opacity: 1; transform: none; animation: none; }
.pick-card .card svg { width: 62px; height: 62px; }
@media (min-aspect-ratio: 1/1) { .pick-card .card { flex-direction: row; height: 80px; } .pick-card .card svg { width: 52px; height: 52px; } }

/* ----- 카드 5개 ----- */
.cards { overflow-y: auto; padding-top: 6px; }
.cards .card { height: clamp(78px, 11.4vh, 118px); flex: none; }
.cards .card svg { width: min(70px, 9.5vh); height: min(70px, 9.5vh); }
.card-water { --c1: #3d9bff; --c2: #38d6e6; --sh: #1f6fb0; }
.card-bubble { --c1: #ff6fb5; --c2: #ffb36b; --sh: #b8467e; }
@media (min-aspect-ratio: 1/1) {
  .cards .card { flex: 1; height: min(250px, 58vh); font-size: 16px; letter-spacing: .08em; }
  .cards .card svg { width: min(64px, 15vh); height: min(64px, 15vh); }
}
.pick-card .card { flex: none; }
