/* 마스터 탱커 AFK — 코믹 스티커
   하늘·바나나·정글 초록 위에 두꺼운 잉크 외곽선과 딱딱한 그림자. 만화 칸, 스티커, 말풍선
   제목 글꼴: 카페24 써라운드(사이트에 쓰는 글자만, OFL) / 본문: 기기 기본 한글 글꼴
   간격 4px 단위 */

@font-face {
  font-family: "Ssurround"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/display-subset.woff2") format("woff2");
}

:root {
  --sky: #8fdcff;
  --sky-dot: rgba(29, 26, 34, 0.08);
  --banana: #ffd43b;
  --leaf: #2fb36e;
  --ink: #1d1a22;
  --paper: #ffffff;
  --pink: #ff5f93;
  --muted: #55505f;

  --display: "Ssurround", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --line: 3px solid var(--ink);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0; background: var(--sky); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.65;
  word-break: keep-all; overflow-wrap: break-word; -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }

/* ── 상단: 떠 있는 스티커 두 장 ───────────── */
.top {
  position: fixed; z-index: 20; inset: 12px 12px auto;
  display: flex; justify-content: space-between; align-items: center; pointer-events: none;
}
.top > * { pointer-events: auto; }
.logo-chip { display: block; line-height: 0; transition: transform .2s var(--pop); }
.logo-chip:hover { transform: rotate(-3deg) scale(1.04); }
.logo-chip img { height: 48px; width: auto; }
.top .stores--bar { display: none; }
.menu { display: none; }

/* ── 공식 스토어 배지 ─────────────────────── */
.stores { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 12px; }
.store { position: relative; display: block; line-height: 0; border-radius: 10px; transition: transform .2s var(--pop); }
.store img { height: 48px; width: auto; }
.store[href]:hover { transform: translateY(-3px) rotate(-2deg); }
.store[href]:active { transform: scale(.96); }
.store__status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.store[aria-disabled="true"] img { opacity: .5; }
.store[aria-disabled="true"] .store__status { /* "출시 예정" 스티커 */
  width: auto; height: auto; overflow: visible; clip: auto;
  top: -14px; right: -10px; padding: 3px 8px; transform: rotate(6deg);
  background: var(--pink); color: #fff; border: 2px solid var(--ink); border-radius: 8px;
  font-size: 11px; font-weight: 800; line-height: 14px;
}

/* ── 만화 칸 ─────────────────────────────── */
.panel {
  position: relative; overflow: hidden; background: #2b6b5e;
  border: 4px solid var(--ink); border-radius: 24px; box-shadow: 6px 6px 0 var(--ink);
}
.panel img { width: 100%; height: 100%; object-fit: cover; }

/* ── 말풍선 ──────────────────────────────── */
.say {
  position: absolute; z-index: 2; padding: 8px 14px; white-space: nowrap;
  background: var(--paper); border: var(--line); border-radius: 20px; box-shadow: 3px 3px 0 var(--ink);
  font-family: var(--display); font-size: 17px; line-height: 1.2; color: var(--ink);
}
.say::after { /* 꼬리 */
  content: ""; position: absolute; left: 24px; bottom: -10px; width: 16px; height: 16px; background: var(--paper);
  border-right: var(--line); border-bottom: var(--line); transform: rotate(45deg) skew(8deg, 8deg);
}

/* ── 첫 화면 ─────────────────────────────── */
.hero { padding: 72px 12px 0; }
.hero__panel {
  aspect-ratio: 9 / 13; max-height: calc(100svh - 200px); min-height: 420px; width: 100%;
}
/* 그림과 말풍선을 한 층(.hero__scene)에 두어, 확대될 때 함께 움직이고
   말풍선은 원본 그림 좌표(탱커 머리 왼쪽)에 붙는다. 크기·위치는 main.js가 cover처럼 맞춘다 */
.hero__zoom { position: absolute; inset: 0; animation: zoom 14s var(--ease) both; }
.hero__scene {
  position: absolute; inset: 0;
  background: url("/img/hero-m.webp") center 20% / cover no-repeat;
}
.hero__scene.is-placed { inset: auto; background-size: 100% 100%; background-position: 0 0; }
.hero__panel::after { /* 제목이 놓일 아래쪽만 어둡게 */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(18, 48, 44, .7) 100%);
}
.hero__title { position: absolute; z-index: 1; left: 0; right: 0; bottom: 28px; text-align: center; }
.title { margin: 0; line-height: 0; }
.title img { width: min(86vw, 420px); height: auto; margin: 0 auto; animation: slap .6s var(--pop) .15s both; }
.hero__say { display: none; }
.is-placed .hero__say { /* 꼬리 끝이 기준점(--x, --y)에 닿도록 왼쪽에 놓는다 */
  display: block; left: var(--x); top: var(--y); translate: calc(-100% - 14px) -50%;
  transform-origin: 100% 50%; animation: pop .5s var(--pop) 1.05s both;
}
.is-placed .hero__say::after { /* 꼬리: 오른쪽을 가리킨다 */
  left: auto; right: -10px; bottom: auto; top: calc(50% - 8px); transform: rotate(-45deg) skew(8deg, 8deg);
}

.strip { /* 다운로드 띠 */
  margin: -4px 0 0; padding: 24px 16px 28px; text-align: center;
  background: var(--banana); border: 4px solid var(--ink); border-top: 0; border-radius: 0 0 24px 24px; box-shadow: 6px 6px 0 var(--ink);
}
.strip__line { font-family: var(--display); font-size: 19px; line-height: 1.3; margin-bottom: 16px; }

/* ── 구간 머리: 기울어진 스티커 제목 ───────── */
.head { text-align: center; margin: 0 auto 40px; max-width: 640px; }
.head h2 {
  display: inline-block; padding: 10px 20px; transform: rotate(-2deg);
  font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.15;
  background: var(--paper); border: 4px solid var(--ink); border-radius: 18px; box-shadow: 5px 5px 0 var(--ink);
}
.head p { margin-top: 20px; font-size: 16px; font-weight: 600; line-height: 1.6; }

/* ── 영웅 스티커 ─────────────────────────── */
.roster {
  padding: 88px 0 96px;
  background: radial-gradient(var(--sky-dot) 2px, transparent 2.5px) 0 0 / 18px 18px, var(--sky);
}
.stickers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 36px 16px; }
.sticker {
  position: relative; display: block; width: 100%; padding: 8px 8px 14px; cursor: pointer; text-align: center;
  background: var(--paper); border: var(--line); border-radius: 18px; box-shadow: 5px 5px 0 var(--ink);
  transform: rotate(var(--r)); transition: transform .25s var(--pop), box-shadow .25s var(--ease);
}
.sticker img { width: 100%; height: auto; aspect-ratio: 236 / 288; object-fit: cover; border: 2px solid var(--ink); border-radius: 12px; background: #6b3fd1; }
.sticker__role { display: block; margin-top: 10px; font-family: var(--display); font-weight: 400; font-size: 19px; line-height: 1.2; }
.sticker small { display: block; margin-top: 6px; font-size: 12px; font-weight: 600; line-height: 1.45; color: var(--muted); }
.sticker small i {
  display: inline-block; margin-right: 4px; padding: 0 6px; border-radius: 6px; font-style: normal; font-weight: 800;
  background: var(--banana); color: var(--ink); border: 2px solid var(--ink); line-height: 16px;
}
.sticker:hover, .sticker[aria-pressed="true"] { transform: rotate(0) translateY(-6px); box-shadow: 7px 9px 0 var(--ink); }
.sticker .say { top: -24px; left: 50%; transform: translateX(-50%) scale(0); transform-origin: 30% 100%; font-size: 15px; transition: transform .3s var(--pop); }
.sticker[aria-pressed="true"] .say, .sticker:hover .say { transform: translateX(-50%) scale(1); }
.stickers .sticker:nth-child(even) { margin-top: 20px; }
.roster.in .sticker { animation: stick .55s var(--pop) both; animation-delay: calc(var(--i) * 70ms); }
.roster__more { margin-top: 40px; text-align: center; font-family: var(--display); font-size: 19px; }

/* ── 특징: 크기가 다른 만화 칸 세 개 ────── */
.features, .screens, .cta { position: relative; }
.features::before, .screens::before, .cta::before { /* 검은 외곽선이 있는 톱니 */
  content: ""; position: absolute; left: 0; right: 0; top: -15px; height: 16px;
  background-repeat: repeat-x; background-size: 24px 16px;
}
.features::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='16'%3E%3Cpath d='M0 16 12 3l12 13Z' fill='%232fb36e'/%3E%3Cpath d='M0 16 12 3l12 13' fill='none' stroke='%231d1a22' stroke-width='3'/%3E%3C/svg%3E"); }
.screens::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='16'%3E%3Cpath d='M0 16 12 3l12 13Z' fill='%23ff5f93'/%3E%3Cpath d='M0 16 12 3l12 13' fill='none' stroke='%231d1a22' stroke-width='3'/%3E%3C/svg%3E"); }
.cta::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='16'%3E%3Cpath d='M0 16 12 3l12 13Z' fill='%23ffd43b'/%3E%3Cpath d='M0 16 12 3l12 13' fill='none' stroke='%231d1a22' stroke-width='3'/%3E%3C/svg%3E"); }
.features { padding: 88px 0 96px; background: var(--leaf); }
.features .head h2 { background: var(--banana); }
.features .head p { color: var(--ink); }
.comic { display: grid; gap: 20px; }
.feature { position: relative; display: grid; }
.feature .panel { aspect-ratio: 4 / 3; }
.feature--tall .panel { aspect-ratio: 4 / 3; }
.caption {
  position: relative; z-index: 1; margin: -28px 12px 0; padding: 12px 16px 14px;
  background: var(--banana); border: var(--line); border-radius: 14px; box-shadow: 3px 3px 0 var(--ink);
}
.caption h3 { font-family: var(--display); font-weight: 400; font-size: 21px; line-height: 1.25; }
.caption p { margin-top: 4px; font-size: 14px; font-weight: 600; line-height: 1.55; }
.caption a { font-weight: 800; text-underline-offset: 3px; }

/* 만화 효과음 */
.sfx {
  position: absolute; z-index: 2; top: 18px; left: 24px; transform: rotate(-12deg);
  font-family: var(--display); font-size: 34px; line-height: 1; color: var(--banana);
  -webkit-text-stroke: 7px var(--ink); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--ink);
}
.feature:not(.feature--tall) .sfx { left: auto; right: 24px; transform: rotate(10deg); }
.sfx--pink { color: var(--pink); }
.sfx--white { color: #fff; }
.features.in .sfx { animation: pop .45s var(--pop) both; }
.features.in .feature:nth-child(2) .sfx { animation-delay: .15s; }
.features.in .feature:nth-child(3) .sfx { animation-delay: .3s; }

/* ── 실제 게임 화면: 휴대폰 틀을 옆으로 넘긴다 ── */
.screens { padding: 88px 0 72px; background: var(--pink); }
.screens .head p { color: var(--ink); }
.shots {
  display: flex; gap: 20px; margin: 0; padding: 12px 20px 28px; list-style: none;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 20px; overscroll-behavior-x: contain;
  scrollbar-width: thin; scrollbar-color: var(--ink) transparent;
}
.shots:focus-visible { outline-offset: -3px; }
.shot { flex: 0 0 auto; width: min(58vw, 220px); scroll-snap-align: center; }
.shot:first-child { margin-left: auto; } /* 다 들어가면 가운데, 넘치면 왼쪽부터 */
.shot:last-child { margin-right: auto; }
.shot figure { margin: 0; transform: rotate(var(--r)); transition: transform .25s var(--pop); }
.shot figure:hover { transform: rotate(0) translateY(-6px); }
.shot__phone {
  padding: 6px; background: var(--ink); border: 4px solid var(--ink); border-radius: 30px; box-shadow: 6px 6px 0 rgba(29, 26, 34, .45);
}
.shot__phone img { width: 100%; height: auto; aspect-ratio: 480 / 1044; border-radius: 22px; background: #2b6b5e; }
.shot figcaption {
  width: fit-content; margin: 14px auto 0; padding: 4px 12px; transform: rotate(calc(var(--r) * -1.5));
  font-family: var(--display); font-size: 17px; line-height: 1.3;
  background: var(--banana); border: var(--line); border-radius: 10px; box-shadow: 3px 3px 0 var(--ink);
}
.screens.in .shot figure { animation: stick .55s var(--pop) both; animation-delay: calc(var(--i) * 70ms); }
.shots-nav { display: none; }
.shots-nav__prev, .shots-nav__next {
  width: 52px; height: 52px; padding: 0 0 4px; cursor: pointer;
  font-family: var(--display); font-size: 32px; line-height: 1;
  background: var(--paper); border: var(--line); border-radius: 50%; box-shadow: 3px 3px 0 var(--ink);
  transition: transform .2s var(--pop), box-shadow .2s var(--ease);
}
.shots-nav__prev:hover:enabled, .shots-nav__next:hover:enabled { transform: translateY(-2px) rotate(-6deg); box-shadow: 4px 5px 0 var(--ink); }
.shots-nav__prev:disabled, .shots-nav__next:disabled { opacity: .4; cursor: default; box-shadow: none; }

/* ── 마지막 다운로드 ─────────────────────── */
.cta { padding: 72px 0 104px; text-align: center; background: var(--banana); }
.cta h2 { font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1.15; }
.cta p { margin: 12px 0 32px; font-size: 16px; font-weight: 600; }
.mascot { position: relative; display: inline-block; margin: 0 0 28px; }
.mascot img {
  width: 88px; height: 88px; border-radius: 50%; object-fit: cover; background: var(--sky);
  border: 4px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); transition: transform .3s var(--pop);
}
.mascot:hover img { transform: rotate(-8deg) scale(1.05); }
.mascot { margin-top: 44px; }
.mascot .say { left: 50%; top: -52px; translate: -50% 0; font-size: 15px; }
.mascot .say::after { left: calc(50% - 8px); }
.cta.in .mascot img { animation: stick .5s var(--pop) both; }
.cta.in .mascot .say { animation: pop .45s var(--pop) .35s both; }

/* ── 푸터 ────────────────────────────────── */
.footer { padding: 40px 20px 48px; text-align: center; background: var(--ink); color: #b9b4c4; font-size: 14px; line-height: 20px; }
.footer__brand { font-family: var(--display); font-size: 20px; color: #fff; }
.footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 24px; margin-top: 12px; }
.footer nav a { padding: 8px 0; text-decoration: none; color: #e6e2ee; }
.footer nav a:hover { text-decoration: underline; }
.footer__legal { margin: 8px auto 0; max-width: 52em; font-size: 12px; line-height: 18px; color: #9a95a6; }
.biz:empty { display: none; }

/* ── 확률 페이지 · 404 ───────────────────── */
.sub .top { position: absolute; }
.prob { max-width: 880px; margin: 0 auto; padding: 96px 20px 80px; }
.prob h1 {
  display: inline-block; padding: 8px 18px; transform: rotate(-2deg);
  font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1.2;
  background: var(--paper); border: 4px solid var(--ink); border-radius: 16px; box-shadow: 5px 5px 0 var(--ink);
}
.notes {
  margin: 28px 0 8px; padding: 16px 20px; background: var(--banana);
  border: var(--line); border-radius: 14px; box-shadow: 3px 3px 0 var(--ink);
  font-size: 14px; font-weight: 600; line-height: 1.7;
}
.prob-table h2 { margin: 40px 0 12px; font-family: var(--display); font-weight: 400; font-size: 22px; }
.table-wrap {
  overflow-x: auto; margin-bottom: 16px; background: var(--paper);
  border: var(--line); border-radius: 14px; box-shadow: 4px 4px 0 var(--ink);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
caption { caption-side: top; text-align: left; padding: 10px 12px; background: var(--leaf); color: var(--ink); font-weight: 800; border-bottom: var(--line); }
th, td { padding: 8px 12px; text-align: left; white-space: nowrap; }
th:first-child, td:first-child { white-space: normal; width: 55%; } /* 이름 칸만 줄바꿈 → 좁은 화면에서도 확률 칸이 보이게 */
thead th { background: #eef8ff; font-size: 13px; font-weight: 800; border-bottom: 2px solid var(--ink); }
tbody tr + tr { border-top: 1px solid #e3e0e8; }
tbody tr:hover { background: #fff8d6; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.home-link {
  display: inline-block; margin-top: 28px; padding: 10px 20px; text-decoration: none; font-weight: 800;
  background: var(--banana); border: var(--line); border-radius: 12px; box-shadow: 3px 3px 0 var(--ink);
}
.prob .lead { margin-top: 20px; font-weight: 600; }

/* ── 움직임: 처음 한 번, 그리고 누를 때만 ─── */
@keyframes slap { from { opacity: 0; transform: scale(1.5) rotate(-10deg); } }
@keyframes pop { from { opacity: 0; transform: scale(.3); } }
@keyframes zoom { from { transform: scale(1.12); } }
@keyframes stick { from { opacity: 0; transform: rotate(calc(var(--r) * 4)) scale(1.35); } }

/* ── 720px 이상 ──────────────────────────── */
@media (min-width: 720px) {
  .wrap { padding: 0 32px; }
  .top { inset: 16px 24px auto; }
  .logo-chip img { height: 56px; }
  .menu { display: flex; gap: 8px; margin: 0 auto 0 12px; }
  .menu a {
    padding: 8px 12px; text-decoration: none; font-family: var(--display); font-size: 15px; line-height: 1; white-space: nowrap;
    background: var(--paper); border: var(--line); border-radius: 12px; box-shadow: 3px 3px 0 var(--ink);
    transition: transform .2s var(--pop), box-shadow .2s var(--ease);
  }
  .menu a:hover { transform: translateY(-2px) rotate(-2deg); box-shadow: 4px 5px 0 var(--ink); }
  .top .stores--bar .store img { height: 40px; border: var(--line); border-radius: 11px; box-shadow: 3px 3px 0 var(--ink); }
  .top .stores--bar .store[aria-disabled="true"] { display: none; } /* 상단에는 받을 수 있는 스토어만 */
  .hero { padding: 84px 24px 0; }
  .hero__panel { aspect-ratio: auto; height: min(calc(100svh - 230px), 640px); min-height: 460px; }
  .hero__scene { background-image: url("/img/hero.webp"); background-position: 62% 28%; }
  .hero__title { bottom: 40px; }
  .title img { width: 500px; }
  .hero__say { font-size: 22px; padding: 10px 18px; }
  .strip { margin: -4px 0 0; padding: 28px 24px 32px; }
  .strip__line { font-size: 22px; }
  .store img { height: 52px; }
  .head h2 { font-size: 44px; }
  .head p { font-size: 17px; }
  .stickers { grid-template-columns: repeat(3, 1fr); gap: 48px 28px; }
  .stickers .sticker:nth-child(even) { margin-top: 0; }
  .stickers .sticker:nth-child(3n+2) { margin-top: 28px; }
  .stickers .sticker:nth-child(3n) { margin-top: 10px; }
  .sfx { font-size: 48px; -webkit-text-stroke-width: 9px; text-shadow: 4px 4px 0 var(--ink); top: 18px; left: 22px; }
  .feature:not(.feature--tall) .sfx { right: 22px; }
  .mascot img { width: 112px; height: 112px; }
  .mascot { margin-top: 0; }
  .mascot .say { left: 96px; top: -22px; translate: none; font-size: 18px; }
  .mascot .say::after { left: 24px; }
  .sticker__role { font-size: 22px; }
  .sticker small { font-size: 13px; }
  .comic { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; gap: 28px; }
  .shots { gap: 32px; padding: 12px 32px 32px; scroll-padding: 0 32px; }
  .shot { width: 240px; }
  .shots-nav.is-scrollable { display: flex; justify-content: center; gap: 16px; margin-top: 4px; }
  .feature--tall { grid-row: span 2; }
  .feature--tall .panel { aspect-ratio: auto; height: 100%; min-height: 520px; }
  .feature--tall { grid-template-rows: 1fr auto; }
  .caption { margin: -36px 16px 0; padding: 14px 18px 16px; }
  .caption h3 { font-size: 24px; }
  .cta h2 { font-size: 56px; }
  .cta p { font-size: 18px; }
  .prob h1 { font-size: 36px; }
}

/* ── 1100px 이상 ─────────────────────────── */
@media (min-width: 1100px) {
  .hero__panel { height: min(calc(100svh - 240px), 700px); }
  .top .stores--bar { display: flex; gap: 8px; } /* 좁은 화면은 첫 화면 아래 띠의 배지로 충분 */
  .title img { width: 600px; }
  .stickers { grid-template-columns: repeat(6, 1fr); gap: 24px; }
  .stickers .sticker:nth-child(n) { margin-top: 0; }
  .stickers .sticker:nth-child(2) { margin-top: 32px; }
  .stickers .sticker:nth-child(3) { margin-top: 8px; }
  .stickers .sticker:nth-child(4) { margin-top: 40px; }
  .stickers .sticker:nth-child(5) { margin-top: 4px; }
  .stickers .sticker:nth-child(6) { margin-top: 24px; }
  .sfx { font-size: 56px; }
  .sticker__role { font-size: 20px; }
  .head h2 { font-size: 52px; }
  .comic { grid-template-columns: 1.15fr 1fr; }
  .cta h2 { font-size: 64px; }
}

/* ── 좁은 휴대폰: 배지 두 개씩 ────────────── */
@media (max-width: 719px) {
  .hero__say { font-size: 15px; padding: 6px 12px; }
  .store img { height: 42px; }
  .stores { gap: 16px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
