/* 몰래 둥지 — 8-bit 숲 테마 (포탈 --fc-* 토큰이 있으면 그 값을 씀) */
:root {
  --sn-ink: #2a1b2e;
  --sn-cream: #fff7e6;
  --sn-paper: #fdf1d8;
  --sn-wood: #a8703f;
  --sn-wood-d: #7a4a2a;
  --sn-leaf: #5fbf62;
  --sn-leaf-d: #3a8e4c;
  --sn-sky: #9fdcff;
  --sn-go: #ff8a2a;
  --sn-go-d: #d8611c;
  --sn-rare: #3ca7ff;
  --sn-legend: #ffc531;
  --sn-common: #b98a55;
  --sn-bad: #e8433f;
  --sn-night: #2b2350;
  --sn-cell: min(28vw, 116px);
  --sn-font: "Jua", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --sn-font-title: "Black Han Sans", "Jua", "Noto Sans KR", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sn-font);
  color: var(--sn-ink);
  background: #6cc56e;
  -webkit-tap-highlight-color: transparent;
}
.px { image-rendering: pixelated; image-rendering: crisp-edges; }
button { font-family: inherit; color: inherit; }
[hidden] { display: none !important; }

.sn-app {
  position: relative;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 12px calc(12px + env(safe-area-inset-bottom));
  background:
    radial-gradient(60px 26px at 18% 7%, rgba(255,255,255,.9) 60%, transparent 62%),
    radial-gradient(44px 20px at 82% 4%, rgba(255,255,255,.8) 60%, transparent 62%),
    repeating-linear-gradient(90deg, rgba(0,0,0,.035) 0 8px, transparent 8px 16px),
    linear-gradient(180deg, #bfe9ff 0%, var(--sn-sky) 16%, #9ed98f 30%, var(--sn-leaf) 55%, var(--sn-leaf-d) 100%);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* 상단 */
.sn-top { position: relative; display: flex; align-items: center; gap: 6px; height: 48px; padding-right: 42px; }
.sn-back { flex: none; font-size: 14px; font-weight: 400; color: var(--sn-ink); text-decoration: none; background: rgba(255,255,255,.6); border: 2px solid var(--sn-ink); border-radius: 8px; padding: 4px 8px; white-space: nowrap; }
.sn-title { flex: 1; min-width: 0; margin: 0; text-align: center; font-family: var(--sn-font-title); font-size: 20px; font-weight: 400; letter-spacing: 0; text-shadow: 0 2px 0 #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sn-icon-btn { flex: none; width: 36px; height: 36px; border: 2px solid var(--sn-ink); border-radius: 8px; background: rgba(255,255,255,.7); font-size: 16px; cursor: pointer; }
.sn-rank-btn { position: relative; }
.sn-rank-pts { position: absolute; right: -7px; bottom: -8px; min-width: 16px; padding: 0 3px; border: 1.5px solid #2a1b2e; border-radius: 8px; background: #ffd84a; color: #2a1b2e; font: 900 10px/13px "Noto Sans KR", system-ui, sans-serif; text-align: center; pointer-events: none; }
.sn-rank-pts:empty { display: none; }

/* 지갑 */
.sn-wallet {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--sn-cream); border: 3px solid var(--sn-ink); border-radius: 12px;
  box-shadow: 0 4px 0 var(--sn-ink); padding: 8px 12px; margin: 2px 0 12px;
}
.sn-coins { display: flex; align-items: center; gap: 8px; font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; }
.sn-coin-ico { width: 24px; height: 24px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3a8 0 20%, #ffd84a 21% 60%, #e9a62c 61%); border: 2px solid var(--sn-ink); display: inline-block; }
.sn-coins.bump b { animation: snBump .25s; }
.sn-rate { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-weight: 800; font-size: 14px; color: #2f7a35; font-variant-numeric: tabular-nums; }
.sn-boost-chip { font-size: 12px; background: var(--sn-legend); border: 2px solid var(--sn-ink); border-radius: 999px; padding: 0 6px; color: var(--sn-ink); }
.sn-boost-chip i { font-style: normal; }
@keyframes snBump { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* 둥지 칸 */
.sn-nest {
  display: grid; grid-template-columns: repeat(3, var(--sn-cell)); justify-content: center; gap: 8px;
  padding: 10px 6px 12px; margin-bottom: 12px;
  background: linear-gradient(180deg, rgba(122,74,42,.0) 0%, rgba(122,74,42,.22) 100%);
  border-radius: 14px;
}
.sn-cell {
  position: relative; width: var(--sn-cell); height: var(--sn-cell);
  border: 3px solid rgba(42,27,46,.85); border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,247,230,.85));
  box-shadow: 0 3px 0 rgba(42,27,46,.85);
  cursor: pointer; padding: 0; overflow: visible;
  display: flex; align-items: flex-end; justify-content: center;
  touch-action: manipulation;
}
.sn-cell:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(42,27,46,.85); }
.sn-cell .nest { position: absolute; left: 50%; bottom: 6px; width: 78%; transform: translateX(-50%); pointer-events: none; }
.sn-cell .pet { position: absolute; left: 50%; bottom: 14%; width: 62%; transform: translateX(-50%); animation: snBob 1.6s ease-in-out infinite; pointer-events: none; }
.sn-cell .pet.legend { filter: drop-shadow(0 0 4px #ffe27a) drop-shadow(0 0 2px #fff); }
.sn-cell .pet.rare { filter: drop-shadow(0 0 2px #bfe6ff); }
.sn-cell .egg { position: absolute; left: 50%; bottom: 17%; width: 44%; transform: translateX(-50%); pointer-events: none; }
.sn-cell .egg.wobble { animation: snWobble .9s ease-in-out infinite; }
.sn-cell .egg.ready { animation: snReady .55s ease-in-out infinite; }
.sn-cell .stars { position: absolute; top: 3px; left: 5px; font-size: 12px; color: var(--sn-legend); text-shadow: 0 1px 0 var(--sn-ink), 1px 0 0 var(--sn-ink), -1px 0 0 var(--sn-ink), 0 -1px 0 var(--sn-ink); letter-spacing: -2px; pointer-events: none; }
.sn-cell .badge { position: absolute; top: -8px; right: -6px; font-size: 11px; font-weight: 900; color: #fff; background: var(--sn-go); border: 2px solid var(--sn-ink); border-radius: 999px; padding: 1px 6px; animation: snPulse 1s infinite; pointer-events: none; white-space: nowrap; }
.sn-cell .timer { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 900; background: rgba(255,255,255,.85); border: 2px solid var(--sn-ink); border-radius: 999px; padding: 0 6px; font-variant-numeric: tabular-nums; pointer-events: none; white-space: nowrap; }
.sn-cell .timer.ready { background: var(--sn-legend); }
.sn-cell .ring { position: absolute; inset: 4px; border-radius: 9px; pointer-events: none; }
.sn-cell.empty { background: rgba(255,247,230,.35); border-style: dashed; box-shadow: none; cursor: default; }
.sn-cell.empty .label, .sn-cell.locked .label { position: absolute; top: 50%; left: 0; right: 0; transform: translateY(-50%); text-align: center; font-size: 12px; font-weight: 800; color: rgba(42,27,46,.6); pointer-events: none; }
.sn-cell.locked { background: rgba(42,27,46,.12); border-style: dashed; box-shadow: none; flex-direction: column; justify-content: center; }
.sn-cell.locked .label { color: var(--sn-ink); line-height: 1.35; }
.sn-cell.locked.can { background: rgba(255,216,74,.55); animation: snPulse 1.2s infinite; }
.sn-cell.sel { outline: 3px solid var(--sn-go); outline-offset: 2px; }
.sn-cell.mergeable { border-color: var(--sn-go); }
.sn-float { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); font-size: 13px; font-weight: 900; color: #2f7a35; text-shadow: 0 1px 0 #fff, 1px 0 0 #fff, -1px 0 0 #fff; pointer-events: none; animation: snFloat 1.1s ease-out forwards; white-space: nowrap; }
.sn-float.tap { color: var(--sn-go-d); font-size: 14px; }
@keyframes snBob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -4px); } }
@keyframes snWobble { 0%,100% { transform: translateX(-50%) rotate(0); } 25% { transform: translateX(-50%) rotate(-5deg); } 75% { transform: translateX(-50%) rotate(5deg); } }
@keyframes snReady { 0%,100% { transform: translateX(-50%) translateY(0) rotate(-6deg); } 50% { transform: translateX(-50%) translateY(-6px) rotate(6deg); } }
@keyframes snPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes snFloat { 0% { opacity: 0; transform: translate(-50%, 6px); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -26px); } }
.sn-cell.pop .pet, .sn-cell.pop .egg { animation: snPop .45s cubic-bezier(.2,1.6,.4,1); }
@keyframes snPop { 0% { transform: translateX(-50%) scale(.2); } 100% { transform: translateX(-50%) scale(1); } }

/* 표적 카드 */
.sn-target {
  background: var(--sn-paper); border: 3px solid var(--sn-ink); border-radius: 14px; box-shadow: 0 4px 0 var(--sn-ink);
  padding: 10px 12px 12px; margin-bottom: 12px;
}
.sn-target-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 800; color: #6b4a2a; }
.sn-tag { font-size: 12px; font-weight: 900; border: 2px solid var(--sn-ink); border-radius: 999px; padding: 1px 8px; background: #f0dcc0; color: var(--sn-ink); }
.sn-tag.rare { background: var(--sn-rare); color: #fff; }
.sn-tag.legend { background: var(--sn-legend); animation: snPulse 1s infinite; }
.sn-target-body { display: flex; align-items: center; gap: 12px; margin: 6px 0 10px; }
.sn-target-egg { width: 40px; height: auto; flex: none; animation: snTilt 1.6s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes snTilt { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
.sn-target-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sn-target-text b { font-size: 16px; }
.sn-target-text span { font-size: 12px; color: #6b4a2a; }
.sn-btn {
  width: 100%; border: 3px solid var(--sn-ink); border-radius: 12px; box-shadow: 0 5px 0 var(--sn-ink);
  font-size: 18px; font-weight: 900; padding: 12px 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  touch-action: manipulation;
}
.sn-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--sn-ink); }
.sn-btn small:empty { display: none; }
.sn-btn .lbl { white-space: nowrap; }
.sn-btn small { font-size: 14px; font-weight: 800; background: rgba(255,255,255,.35); border-radius: 999px; padding: 2px 8px; font-variant-numeric: tabular-nums; }
.sn-btn-go { background: var(--sn-go); color: #fff; text-shadow: 0 2px 0 var(--sn-go-d); }
.sn-btn-go.hot { animation: snPulse 1s infinite; }
.sn-btn-go[aria-disabled="true"] { background: #c9b7a3; text-shadow: none; color: var(--sn-ink); }
.sn-raid-why { margin-top: 8px; font-size: 12px; font-weight: 700; text-align: center; color: #6b4a2a; }
.sn-raid-why button { font: inherit; font-weight: 900; border: 2px solid var(--sn-ink); border-radius: 8px; background: #fff; padding: 2px 8px; margin-left: 4px; cursor: pointer; }

/* 하단 */
.sn-dock { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 6px; }
.sn-dock-btn {
  border: 3px solid var(--sn-ink); border-radius: 12px; background: var(--sn-cream); box-shadow: 0 4px 0 var(--sn-ink);
  padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; font-weight: 900; font-size: 15px;
  touch-action: manipulation;
}
.sn-dock-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--sn-ink); }
.sn-dock-btn small { font-size: 11px; font-weight: 700; color: #6b4a2a; font-variant-numeric: tabular-nums; }
.sn-dock-btn.can { background: #fff2b3; }
.sn-dock-ad { background: #e6f6ff; }

/* 잠입 화면 */
.sn-raid {
  position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center;
  background: radial-gradient(120% 80% at 50% 20%, #3b3270 0%, var(--sn-night) 55%, #15102b 100%);
  color: #fff; padding: calc(8px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.sn-raid.danger { box-shadow: inset 0 0 0 6px rgba(232,67,63,.85), inset 0 0 60px rgba(232,67,63,.6); }
.sn-raid-hud { width: 100%; max-width: 480px; }
.sn-raid-title { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 15px; height: 30px; }
.sn-raid-title img { width: 20px; }
.sn-raid-bars { display: grid; grid-template-columns: 1fr 72px; gap: 8px; margin: 4px 0 6px; }
.sn-bar { position: relative; height: 18px; border: 2px solid #fff; border-radius: 999px; background: rgba(255,255,255,.12); overflow: hidden; }
.sn-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; }
.sn-bar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 900; text-shadow: 0 1px 0 #000; }
.sn-bar-time i { background: linear-gradient(90deg, #5fd16a, #b6f07a); width: 100%; }
.sn-bar-time.low i { background: linear-gradient(90deg, #ff5a4e, #ff9a3c); }
.sn-bar-time.low { animation: snPulse .5s infinite; }
.sn-bar-sus i { background: linear-gradient(90deg, #ffd84a, #ff3b3b); }
.sn-progress { position: relative; height: 10px; border-radius: 999px; background: rgba(255,255,255,.15); margin: 0 18px 6px; }
.sn-progress i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 999px; background: #ffd84a; }
.sn-prog-egg, .sn-prog-home { position: absolute; top: 50%; transform: translateY(-50%); font-size: 14px; }
.sn-prog-egg { left: 50%; margin-left: -7px; }
.sn-prog-home { right: -18px; }
.sn-raid-canvas { width: 100%; max-width: 480px; aspect-ratio: 4 / 3; border: 3px solid #fff; border-radius: 12px; background: #1d1840; }
.sn-raid-hint { min-height: 34px; margin: 8px 0 4px; font-size: 20px; font-weight: 900; text-align: center; text-shadow: 0 2px 0 #000; }
.sn-raid-hint.go { color: #8ff58a; }
.sn-raid-hint.stop { color: #ffd84a; animation: snPulse .35s infinite; }
.sn-raid-hint.bad { color: #ff6b6b; }
.sn-hold {
  position: relative; flex: 1; width: 100%; max-width: 480px; min-height: 110px; margin-top: 4px;
  border: 3px dashed rgba(255,255,255,.5); border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: rgba(255,255,255,.06); cursor: pointer; touch-action: none;
}
.sn-hold b { font-size: 20px; }
.sn-hold small { font-size: 12px; opacity: .7; }
.sn-hold.on { background: rgba(143,245,138,.18); border-color: #8ff58a; border-style: solid; }
.sn-hold-ring { position: absolute; width: 74px; height: 74px; border-radius: 50%; border: 4px solid rgba(255,255,255,.35); top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none; opacity: 0; }
.sn-hold.tutorial .sn-hold-ring { opacity: 1; animation: snRing 1.2s infinite; }
@keyframes snRing { 0% { transform: translate(-50%, -50%) scale(.6); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; } }

/* 모달 */
.sn-modal { position: fixed; inset: 0; z-index: 50; background: rgba(21,16,43,.6); display: flex; align-items: flex-end; justify-content: center; padding: 12px; }
.sn-modal.center { align-items: center; }
.sn-sheet {
  width: 100%; max-width: 440px; background: var(--sn-cream); border: 3px solid var(--sn-ink); border-radius: 16px; box-shadow: 0 6px 0 var(--sn-ink);
  padding: 16px; text-align: center; animation: snUp .25s ease-out; max-height: 88vh; overflow: auto;
}
@keyframes snUp { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sn-sheet h3 { margin: 0 0 6px; font-size: 20px; font-weight: 900; }
.sn-sheet p { margin: 4px 0; font-size: 14px; line-height: 1.5; }
.sn-sheet .big { font-size: 28px; font-weight: 900; font-variant-numeric: tabular-nums; }
.sn-sheet .muted { color: #7a6250; font-size: 12px; }
.sn-sheet .sn-lost { color: #d6304a; font-weight: 900; }
.sn-sheet .row { display: flex; gap: 8px; margin-top: 12px; }
.sn-sheet .row > * { flex: 1; }
.sn-sheet .row > .wide { flex: 1.5; }
.sn-sheet .row .sn-btn small { font-size: 12px; padding: 1px 6px; }
.sn-sheet .sn-btn { font-size: 16px; padding: 10px 8px; }
.sn-btn-ad { background: #3ca7ff; color: #fff; text-shadow: 0 2px 0 #1f6fb3; }
.sn-btn-plain { background: #fff; }
.sn-btn-merge { background: var(--sn-legend); }
.sn-btn[disabled] { opacity: .45; pointer-events: none; }
.sn-pet-big { width: 112px; margin: 4px auto 2px; display: block; }
.sn-rel-pet { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 2px 0 8px; font-weight: 900; }
.sn-rel-pet img { width: 48px; }
.sn-rel-pet .st { color: #e9a62c; }
.sn-seg { display: flex; border: 2px solid #2a1b2e; border-radius: 10px; overflow: hidden; margin: 4px 0; }
.sn-seg button { flex: 1; min-height: 40px; border: 0; background: #fff; color: #2a1b2e; font: 900 14px/1.2 'Jua', 'Noto Sans KR', sans-serif; cursor: pointer; }
.sn-seg button + button { border-left: 2px solid #2a1b2e; }
.sn-seg button.on { background: #ffd84a; }
.sn-rel-opts .sn-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 64px; }
.sn-rel-opts .sn-btn small { display: block; font-size: 11px; line-height: 1.3; word-break: keep-all; }
.sn-rel-opts .sn-btn.sure { outline: 3px solid #d6304a; outline-offset: 1px; }
.sn-trade-tier { margin: 0; font: 900 18px/1.3 'Jua', 'Noto Sans KR', sans-serif; }
.sn-trade-tier.up { color: #e07a00; }
.sn-trade-tier.down { color: #7a6250; }
.sn-rar { display: inline-block; font-size: 12px; font-weight: 900; border: 2px solid var(--sn-ink); border-radius: 999px; padding: 0 8px; margin: 2px 0; }
.sn-rar.common { background: #f0dcc0; }
.sn-rar.rare { background: var(--sn-rare); color: #fff; }
.sn-rar.legend { background: var(--sn-legend); }

/* 부화 연출 */
.sn-hatch { position: relative; height: 170px; display: flex; align-items: center; justify-content: center; }
.sn-hatch .burst { position: absolute; width: 180px; height: 180px; border-radius: 50%; opacity: 0; }
.sn-hatch.go .burst { animation: snBurst .9s ease-out forwards; }
.sn-hatch .burst.common { background: radial-gradient(circle, #fff 0%, #ffe9b0 35%, transparent 70%); }
.sn-hatch .burst.rare { background: radial-gradient(circle, #fff 0%, #9fd8ff 35%, transparent 70%); }
.sn-hatch .burst.legend { background: conic-gradient(from 0deg, #ffd84a, #fff3a8, #ff7a2a, #ffd84a, #fff3a8, #ff7a2a, #ffd84a); mask: radial-gradient(circle, #000 30%, transparent 70%); -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%); }
.sn-hatch.go .burst.legend { animation: snBurst 1.4s ease-out forwards, snSpin 3s linear infinite; }
.sn-hatch .hegg { width: 72px; position: absolute; animation: snShake .12s linear infinite; }
.sn-hatch.go .hegg { animation: snVanish .25s forwards; }
.sn-hatch .hpet { width: 128px; position: absolute; transform: scale(0); }
.sn-hatch.go .hpet { animation: snRise .55s .2s cubic-bezier(.2,1.6,.4,1) forwards; }
.sn-new { display: inline-block; background: var(--sn-bad); color: #fff; font-weight: 900; font-size: 12px; border: 2px solid var(--sn-ink); border-radius: 999px; padding: 0 8px; transform: rotate(-6deg); margin-left: 4px; }
@keyframes snShake { 0% { transform: translateX(-2px) rotate(-4deg); } 50% { transform: translateX(2px) rotate(4deg); } 100% { transform: translateX(-2px) rotate(-4deg); } }
@keyframes snVanish { to { transform: scale(1.6); opacity: 0; } }
@keyframes snRise { to { transform: scale(1); } }
@keyframes snBurst { 0% { opacity: 0; transform: scale(.3); } 30% { opacity: 1; } 100% { opacity: .85; transform: scale(1.1); } }
@keyframes snSpin { to { rotate: 360deg; } }

/* 도감 */
.sn-dex { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.sn-dex-item { background: #fff; border: 2px solid var(--sn-ink); border-radius: 10px; padding: 6px 2px 4px; font-size: 11px; font-weight: 800; }
.sn-dex-item img { width: 48px; display: block; margin: 0 auto 2px; }
.sn-dex-item.legend { background: #fff6d0; }
.sn-dex-item.rare { background: #e6f4ff; }
.sn-dex-item.none { opacity: .7; }
.sn-dex-item .st { color: #e9a62c; letter-spacing: -2px; }

/* 결과 화면 */
.sn-result-egg { width: 72px; margin: 6px auto; display: block; animation: snHop .6s ease-in-out infinite; }
@keyframes snHop { 0%,100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-6px) rotate(6deg); } }
.sn-next { margin-top: 10px; background: #fff; border: 2px solid var(--sn-ink); border-radius: 10px; padding: 8px; font-size: 13px; font-weight: 800; display: flex; align-items: center; gap: 8px; text-align: left; }
.sn-next img { width: 26px; }

/* 토스트·광고 흉내 */
.sn-toast { position: fixed; left: 50%; top: 128px; transform: translateX(-50%); z-index: 70; background: var(--sn-ink); color: #fff; font-weight: 800; font-size: 14px; padding: 8px 14px; border-radius: 999px; max-width: 90vw; text-align: center; animation: snUp .2s; }
.sn-adsim { position: fixed; inset: 0; z-index: 90; background: #111; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-weight: 900; text-align: center; padding: 20px; }
.sn-adsim .n { font-size: 48px; }
.sn-adsim small { opacity: .7; font-weight: 600; }
.sn-adsim button { margin-top: 8px; border: 2px solid #fff; background: transparent; color: #fff; border-radius: 8px; padding: 6px 12px; font-weight: 800; cursor: pointer; }

.sn-fx { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.sn-fly { position: fixed; width: 40px; pointer-events: none; z-index: 61; transition: transform .7s cubic-bezier(.3,.1,.3,1), opacity .7s; }
.sn-confetti { position: fixed; width: 8px; height: 8px; pointer-events: none; z-index: 62; animation: snConf 1s ease-out forwards; }
@keyframes snConf { to { transform: translate(var(--dx), var(--dy)) rotate(540deg); opacity: 0; } }

.sn-finger { position: absolute; font-size: 30px; pointer-events: none; animation: snPoint 1s ease-in-out infinite; z-index: 5; filter: drop-shadow(0 2px 0 rgba(0,0,0,.35)); }
@keyframes snPoint { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-4px,-8px); } }

/* 설명 글 (SEO) */
.sn-article { max-width: 480px; margin: 0 auto; padding: 16px 16px 40px; background: var(--sn-leaf-d); color: #f3ffe9; font-size: 14px; line-height: 1.7; }
.sn-article h2 { font-size: 16px; margin: 0 0 6px; }
.sn-article ol { padding-left: 20px; margin: 0; }

@media (min-width: 520px) {
  .sn-app { border-left: 4px solid var(--sn-ink); border-right: 4px solid var(--sn-ink); }
}
@media (max-height: 700px) {
  :root { --sn-cell: min(25vw, 96px); }
  .sn-wallet { margin-bottom: 8px; }
  .sn-target-body { margin: 4px 0 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .sn-cell .pet, .sn-target-egg, .sn-cell .egg.wobble { animation: none; }
}

/* 공용 댓글을 게임 칸 폭에 맞춤 */
#fcsComments.fcsc { max-width: 480px; margin: 0 auto 24px; border-radius: 0 0 14px 14px; }


/* ---- 포탈 공용 요소와 함께 쓰기 ---- */
/* 헤더에 붙는 포탈 골드·프로필 */
.sn-top .gold-display { flex: none; display: inline-flex; align-items: center; gap: 3px; height: 30px; padding: 0 8px 0 4px; border: 2px solid var(--sn-ink); border-radius: 999px; background: rgba(255,255,255,.75); font-size: 13px; color: var(--sn-ink); font-variant-numeric: tabular-nums; }
.sn-top .gold-display svg { width: 18px; height: 18px; }
.sn-top .profile-menu--game { top: 6px; right: 0; }
.sn-top .profile-btn { width: 36px; height: 36px; }
/* 8-bit 테마의 공용 '누름' 효과 대신 게임 고유 눌림 */
[data-fc-theme="dark8bit"] .sn-app button:not(:disabled):active { transform: translateY(2px); box-shadow: 0 2px 0 var(--sn-ink); }
[data-fc-theme="dark8bit"] .sn-app .sn-btn:not(:disabled):active { transform: translateY(3px); box-shadow: 0 2px 0 var(--sn-ink); }
[data-fc-theme="dark8bit"] .sn-app .sn-cell:not(:disabled):active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(42,27,46,.85); }
[data-fc-theme="dark8bit"] .sn-app .sn-cell.empty:active,
[data-fc-theme="dark8bit"] .sn-app .sn-cell.locked:active { box-shadow: none; }
.sn-app, .sn-raid, .sn-modal, .sn-toast, .sn-adsim { font-family: var(--sn-font); }
.sn-sheet h3, .sn-raid-hint { font-family: var(--sn-font-title); font-weight: 400; letter-spacing: .3px; }
.sn-coins b, .sn-btn small, .sn-cell .timer, .sn-sheet .big { font-family: "Noto Sans KR", system-ui, sans-serif; font-weight: 900; }
/* 설명 글·광고는 게임 칸 폭에 */
.sn-article { font-family: "Noto Sans KR", sans-serif; }
.sn-article h2 { font-family: var(--sn-font-title); font-weight: 400; font-size: 18px; }
.sn-ad { max-width: 480px !important; }

/* ---------- 서버 둥지 · 펫 시장 (2026-11-29) ---------- */
.sn-grid.syncing, #nestGrid.syncing { opacity: .55; pointer-events: none; transition: opacity .2s; }
.sn-dock-btn { position: relative; }
.sn-dock-market { background: #fff0f6; }
.sn-mk-badge { display: inline-block; min-width: 16px; padding: 0 4px; border-radius: 8px; background: #d6304a; color: #fff; font: 900 10px/16px 'Noto Sans KR', sans-serif; text-align: center; }
.sn-mk-badge:empty { display: none; }
.sn-dock-btn .sn-mk-badge { position: absolute; top: -6px; right: -4px; border: 1.5px solid #2a1b2e; }
.sn-mk-sheet { max-height: 86vh; display: flex; flex-direction: column; }
.sn-mk-body { min-height: 120px; overflow: hidden; display: flex; flex-direction: column; }
.sn-mk-list { overflow-y: auto; max-height: 52vh; display: flex; flex-direction: column; gap: 6px; padding: 2px 2px 6px; -webkit-overflow-scrolling: touch; }
.sn-mk-tabs, .sn-mk-filter { margin: 6px 0; }
.sn-mk-filter button { min-height: 34px; font-size: 13px; }
.sn-mk-h { margin: 8px 0 2px; font: 900 13px/1.3 'Jua', 'Noto Sans KR', sans-serif; color: #6b4a2a; text-align: left; }
.sn-mk-item { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 8px; padding: 6px 8px; border: 2px solid #2a1b2e; border-radius: 10px; background: #fff; text-align: left; }
.sn-mk-item.rare { background: #eef7ff; }
.sn-mk-item.legend { background: #fff6d6; }
.sn-mk-item.done { opacity: .75; }
.sn-mk-item img { width: 44px; height: 44px; }
.sn-mk-info { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sn-mk-info b { font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.sn-mk-info .st { color: #e9a62c; }
.sn-mk-info .sn-rar { font-size: 10px; padding: 0 5px; vertical-align: 1px; }
.sn-mk-info small { font-size: 11px; color: #7a6250; word-break: keep-all; overflow-wrap: anywhere; }
.sn-mk-info small.want { color: #2a6bb0; font-weight: 700; }
.sn-mk-act { min-height: 40px; min-width: 76px; padding: 4px 8px; font-size: 12px; line-height: 1.2; word-break: keep-all; }
.sn-mk-act.sure, #slGo.sure { outline: 3px solid #d6304a; outline-offset: 1px; }
.sn-price { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 6px 0 2px; }
.sn-price input { width: 96px; min-height: 40px; border: 2px solid #2a1b2e; border-radius: 8px; text-align: center; font: 900 18px/1 'Noto Sans KR', sans-serif; }
.sn-price .sn-btn { min-width: 44px; min-height: 40px; padding: 0; font-size: 20px; }
.sn-select { width: 100%; min-height: 40px; margin: 6px 0; border: 2px solid #2a1b2e; border-radius: 8px; background: #fff; font: 700 14px 'Noto Sans KR', sans-serif; padding: 0 8px; }
@media (max-width: 380px) {
  .sn-dock { gap: 4px; }
  .sn-dock-btn small { font-size: 10px; }
}
