/* 짐서폿 공식 홈페이지 토큰 (gymss.co.kr :root) */
:root {
  --blue: #1667FF;
  --blue-deep: #0B4FD6;
  --blue-tint: #EAF1FF;
  --ink: #172238;
  --line: #DDE3EB;
  --mute: #8590A3;
  --navy: #0E1B33;
  --orange: #FF6A13;
  --orange-tint: #FFF1E8;
  --paper: #F4F6F9;
  --sub: #55627A;
  --white: #FFFFFF;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--white);
  color: var(--ink);
  font-family: Pretendard, "Noto Sans KR", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  letter-spacing: -0.01em;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

/* ---------- 1086 x 680 무대 (화면에 맞춰 비례 축소) ---------- */
.fit { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
.stage {
  position: relative;
  width: 1086px; height: 680px; flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 300px 1fr;
  gap: 40px;
  padding: 15px 24px;
  transform-origin: center center;
}

/* ---------- 왼쪽 ---------- */
.side { display: flex; flex-direction: column; min-width: 0; }
.left { padding-top: 12px; }
.brand .badge {
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  background: var(--blue-tint); color: var(--blue-deep);
  font-size: 13px; font-weight: 700;
}
.brand h1 { margin-top: 12px; font-size: 26px; line-height: 1.3; font-weight: 800; letter-spacing: -0.03em; color: var(--navy); }

.steps { list-style: none; margin-top: 22px; display: flex; flex-direction: column; gap: 6px; }
.steps button {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 12px; text-align: left;
  font-size: 15px; font-weight: 600; color: var(--sub);
  transition: background .2s, color .2s;
}
.steps button:hover { background: var(--paper); }
.steps .num {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--paper); color: var(--mute); font-size: 13px; font-weight: 800;
}
.steps li.done .num { background: var(--navy); color: var(--white); }
.steps li.done .num::before { content: "✓"; }
.steps li.done .num span { display: none; }
.steps li.on button { background: var(--blue-tint); color: var(--navy); font-weight: 800; }
.steps li.on .num { background: var(--blue); color: var(--white); }

.mission {
  margin-top: auto;
  padding: 18px 20px 20px; border-radius: 20px;
  background: var(--navy); color: var(--white);
  box-shadow: 0 20px 40px -24px rgba(14, 27, 51, .6);
}
.m-label { font-size: 13px; font-weight: 700; color: #8FB4FF; display: flex; align-items: center; gap: 6px; }
.m-label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #8FB4FF; animation: blink 1.4s infinite; }
.m-text { margin-top: 8px; font-size: 17px; line-height: 1.5; font-weight: 600; word-break: keep-all; }
.m-text b { color: #FFB27A; font-weight: 800; }
.m-actions { display: flex; gap: 8px; margin-top: 14px; }
.m-actions:empty { display: none; }
.m-actions button {
  padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 700;
  background: var(--white); color: var(--navy);
}
.m-actions button.ghost { background: rgba(255,255,255,.12); color: var(--white); }
@keyframes blink { 50% { opacity: .25; } }

/* ---------- 핸드폰 (공식 홈페이지 .shot 과 동일) ---------- */
.phone-wrap { position: relative; width: 300px; height: 650px; }
.phone-wrap > .shot {
  position: relative; width: 300px; height: 650px;
  border-radius: 46px; border: 9px solid var(--navy);
  overflow: hidden; background: var(--white);
  box-shadow: rgba(14, 27, 51, .45) 0 30px 60px -30px;
}
.scr { position: absolute; inset: 0; overflow: hidden; border-radius: 37px; background: #fff; }
/* 앱 화면: Figma 430x932 그대로, app.js 에서 zoom 으로 632px 높이에 맞춤 */
.app { position: absolute; top: 0; width: 430px; height: 932px; }
#view {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none; -ms-overflow-style: none;
}
#view::-webkit-scrollbar { display: none; }
#content { position: relative; width: 430px; }
#content.fade { animation: fadeIn .28s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* 터치 유도: 파란 링 (화면 요소 위에 겹침, Figma px 단위) */
.gs-ring, .ov > .gs-ring { position: absolute; pointer-events: none !important; z-index: 50; }
.gs-ring::after {
  content: ""; position: absolute; inset: -6px; border-radius: inherit;
  border: 4px solid var(--blue);
  animation: ring 1.3s ease-out infinite;
}
@keyframes ring {
  0% { opacity: 1; transform: scale(.96); box-shadow: 0 0 0 0 rgba(22, 103, 255, .45); }
  70% { opacity: .9; transform: scale(1.02); box-shadow: 0 0 0 14px rgba(22, 103, 255, 0); }
  100% { opacity: 0; transform: scale(1.04); }
}
/* 선택하기 버튼: Figma 두 상태(글자 white / #F37021) 번갈아 점멸 */
.gs-blink, .gs-blink * { animation: blinkWO .9s steps(1, end) infinite !important; }
@keyframes blinkWO { 0% { color: #fff; } 50% { color: #F37021; } }

/* 오버레이 (Alert / 고정 상태바) */
.ov { position: absolute; inset: 0; pointer-events: none; }
.ov > * { pointer-events: auto; }
.ov > .dim { position: absolute; inset: 0; background: rgba(0, 0, 0, .25); animation: fadeIn .2s ease; }
.ov > .alert { position: absolute; animation: pop .22s ease; }
.ov > .sbfix { position: absolute; left: 0; top: 0; width: 430px; height: 59px; overflow: hidden; pointer-events: none; }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }

.scroll-hint {
  position: absolute; right: -66px; bottom: 120px; width: 56px;
  font-size: 12px; font-weight: 700; line-height: 1.3; text-align: center; color: var(--blue-deep);
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
.scroll-hint::after { content: ""; display: block; width: 14px; height: 14px; margin: 8px auto 0; border-right: 3px solid var(--blue); border-bottom: 3px solid var(--blue); transform: rotate(45deg); animation: bounce 1s infinite; }
.scroll-hint.on { opacity: 1; }
@keyframes bounce { 50% { translate: 0 6px; } }

/* ---------- 오른쪽 ---------- */
.right { justify-content: center; }
.right .card {
  border-radius: 24px; background: var(--paper); padding: 26px 24px;
  animation: fadeIn .3s ease;
}
.right .card .eyebrow { font-size: 13px; font-weight: 800; color: var(--blue-deep); }
.right .card h2 { margin-top: 8px; font-size: 22px; line-height: 1.35; font-weight: 800; color: var(--navy); letter-spacing: -0.03em; word-break: keep-all; }
.right .card p { margin-top: 10px; font-size: 15px; line-height: 1.6; color: var(--sub); word-break: keep-all; }
.right .card ul { list-style: none; margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.right .card li { display: flex; gap: 10px; font-size: 15px; line-height: 1.45; color: var(--ink); font-weight: 600; word-break: keep-all; }
.right .card li::before { content: ""; flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.2l2.6 2.6L13 6.4' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/18px no-repeat; }

/* 입장 방법 — Figma '입장 방법'(673x788) 레이어 위치를 % 로 배치 */
.right .guide { padding: 20px; background: var(--white); border: 1px solid var(--line); box-shadow: 0 24px 48px -28px rgba(14, 27, 51, .35); }
.right .scan { position: relative; margin-top: 12px; aspect-ratio: 673 / 788; background: #fff; border-radius: 16px; overflow: hidden; container-type: inline-size; }
.right .scan .sc-gate { position: absolute; left: 0; top: 19.97%; width: 99.97%; }
.right .scan .sc-phone {
  position: absolute; left: 12.71%; top: 8.38%; width: 43.09%;
  mix-blend-mode: multiply; /* 핸드폰 이미지의 흰 배경을 지움 */
  transform: translate(-16%, -22%) rotate(-12deg); opacity: 0;
}
.right .scan.play .sc-phone { animation: phoneIn 2.1s cubic-bezier(.3, .7, .3, 1) forwards; }
@keyframes phoneIn {
  0%   { transform: translate(-16%, -22%) rotate(-12deg); opacity: 0; }
  18%  { transform: translate(-16%, -22%) rotate(-12deg); opacity: 1; }
  70%  { transform: translate(0, 0) rotate(0); opacity: 1; }
  80%  { transform: translate(2%, 4%) rotate(1deg); opacity: 1; }
  88%  { transform: translate(1%, 2%) rotate(0); opacity: 1; }
  100% { transform: translate(1%, 2%) rotate(0); opacity: 1; }
}
/* 출입기 파란 라이트 번쩍 */
.right .scan .sc-led {
  position: absolute; left: 12.5%; top: 49.5%; width: 34%; height: 9%;
  border-radius: 50%; background: radial-gradient(closest-side, rgba(80, 170, 255, .95), rgba(22, 103, 255, 0));
  mix-blend-mode: screen; opacity: 0;
}
.right .scan.play .sc-led { animation: led .5s ease-out 1.7s 3 both; }
@keyframes led { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }
/* 스캔 파동 (리더 위치) */
.right .scan .sc-wave {
  position: absolute; left: 46.8%; top: 43%; width: 8%; aspect-ratio: 1; margin: -4% 0 0 -4%;
  border-radius: 50%; border: 3px solid var(--blue); opacity: 0;
}
.right .scan.play .sc-wave { animation: wave 1s ease-out 1.65s 2 both; }
.right .scan.play .sc-wave.w2 { animation-delay: 1.95s; }
@keyframes wave { 0% { opacity: .9; transform: scale(.4); } 100% { opacity: 0; transform: scale(5); } }
/* 삐빅! 말풍선 */
.right .scan .sc-beep {
  position: absolute; left: 60%; top: 22%; padding: .35em .7em; border-radius: 999px;
  background: var(--blue); color: #fff; font-size: 7cqw; font-weight: 900; letter-spacing: -0.02em;
  opacity: 0; transform: scale(.4); box-shadow: 0 8px 18px -8px rgba(22, 103, 255, .8);
}
.right .scan.play .sc-beep { animation: beepPop .5s cubic-bezier(.3, 1.6, .5, 1) 1.7s both, shake .12s linear 1.75s 4; }
@keyframes beepPop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
@keyframes shake { 50% { translate: 2px -1px; } }
/* Figma 텍스트: Noto Sans KR Bold 34 / #191919, 가운데 x 336.5, y 683 */
.right .scan .sc-cap {
  position: absolute; left: 0; right: 0; top: 86.68%; margin: 0;
  font-family: "Noto Sans KR", sans-serif; font-weight: 700; font-size: 5.05cqw; line-height: normal;
  color: #191919; text-align: center; letter-spacing: 0;
}
.right .sc-status { margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--paper); text-align: center; font-size: 15px; font-weight: 700; color: var(--sub); transition: background .3s, color .3s; }
.right .guide.done .sc-status { background: var(--blue-tint); color: var(--blue-deep); }
.right .sc-status b { font-weight: 900; }

.right .finish h2 { font-size: 24px; }

/* ---------- 좁은 화면 (모바일) ---------- */
body.narrow { overflow: auto; }
body.narrow .fit { position: static; display: block; }
body.narrow .stage {
  width: 100%; height: auto; transform: none !important;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 16px;
}
body.narrow .side { width: 100%; max-width: 420px; }
body.narrow .left { padding-top: 0; }
body.narrow .brand h1 { display: none; }
body.narrow .steps { flex-direction: row; gap: 2px; margin-top: 10px; }
body.narrow .steps li { flex: 1; min-width: 0; }
body.narrow .steps button { flex-direction: column; gap: 4px; padding: 6px 0; font-size: 10.5px; letter-spacing: -0.04em; text-align: center; white-space: nowrap; }
body.narrow .mission { margin-top: 10px; padding: 12px 14px; border-radius: 16px; }
body.narrow .m-label { display: none; }
body.narrow .m-text { margin-top: 0; font-size: 14px; }
body.narrow .m-actions { margin-top: 10px; }
body.narrow .scroll-hint { display: none; }
body.narrow .phone-wrap { order: 2; }
body.narrow .right { order: 3; }
body.narrow .right.guide-on { order: 1; }
body.narrow .right .card { padding: 20px; }
