/* 루터 앱과 같은 색·글꼴 · 휴대폰 먼저 */
@font-face { font-family: "Jalnan2"; src: url("assets/fonts/Jalnan2.otf"); font-display: swap; }
@font-face { font-family: "Pretendard"; src: url("assets/fonts/Pretendard-Medium.ttf"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Pretendard"; src: url("assets/fonts/Pretendard-SemiBold.ttf"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Pretendard"; src: url("assets/fonts/Pretendard-ExtraBold.otf"); font-weight: 800; font-display: swap; }

:root {
  --primary: #F6482D;
  --bg: #33363F;
  --card: #3F4552;
  --line: #525866;
  --ink: #212530;
  --cream: #FFF6EF;
  --sub: #C9CDD6;
  --dim: #8B919E;
  --warm: #55393B;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  min-height: 100vh; min-height: 100dvh; font-family: Pretendard, -apple-system, "Apple SD Gothic Neo", sans-serif; font-weight: 500; color: #fff;
  background: linear-gradient(180deg, var(--bg) 30%, var(--warm) 100%); background-attachment: fixed; overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
svg { flex-shrink: 0; }
.page-glow { position: fixed; right: -40vw; top: -30vw; width: 110vw; height: 110vw; max-width: 900px; max-height: 900px; border-radius: 50%; background: radial-gradient(circle, rgba(246,72,45,.28), transparent 65%); pointer-events: none; z-index: -1; }

/* 폰 폭 한 줄 (컴퓨터에선 가운데 폰 폭) */
.phone {
  max-width: 480px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 8px) calc(env(safe-area-inset-right) + 18px) calc(env(safe-area-inset-bottom) + 24px) calc(env(safe-area-inset-left) + 18px);
}
header.nav { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { display: inline-flex; align-items: center; gap: .3em; }
.logo img { width: 1.35em; }
.logo b { font-family: Jalnan2; font-weight: normal; color: var(--primary); letter-spacing: -.02em; }
header.nav .logo { font-size: 24px; }
.team-chip { font-size: 13px; font-weight: 600; color: var(--sub); padding: 7px 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--sub); font-size: 15px; padding: 8px 4px; }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 18px; border-radius: 14px;
  font-size: 16px; font-weight: 600; background: var(--card); color: #fff; transition: transform .1s, background .15s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--primary); box-shadow: 0 10px 28px rgba(246,72,45,.35); }
.btn svg { width: 20px; height: 20px; }

/* 첫 화면 */
.hero { padding: 18px 0 26px; }
.hero h1 { font-family: Jalnan2; font-weight: normal; font-size: clamp(34px, 10vw, 44px); line-height: 1.18; letter-spacing: -.03em; }
.hero h1 em { font-style: normal; color: var(--primary); }
.hero p { margin-top: 12px; font-size: 16px; line-height: 1.6; color: var(--sub); }
.quick { margin-top: 20px; display: grid; }
.icon-btn { padding: 0; }

.kakao { display: block; margin: 4px 0 8px; padding: 12px 14px; border-radius: 12px; background: #FEE500; color: #191919; font-size: 14px; text-align: center; }

/* 팀원 하나 */
.member { margin-top: 22px; padding: 14px; border-radius: 26px; background: rgba(33,37,48,.55); border: 1px solid rgba(255,255,255,.06); }
.member-body { padding: 14px 4px 2px; }
.bio { font-size: 15px; line-height: 1.6; color: var(--sub); }
.acts { margin-top: 14px; display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 8px; }
.act {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 70px; border-radius: 16px;
  background: var(--card); font-size: 13px; font-weight: 600; color: var(--sub); transition: transform .1s;
}
.act svg { width: 24px; height: 24px; color: #fff; }
.act:active { transform: scale(.95); }
.act.primary { background: var(--primary); color: #fff; }
.plain { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.plain a { font-size: 15px; color: #fff; text-decoration: underline; text-decoration-color: rgba(255,255,255,.3); text-underline-offset: 3px; word-break: break-all; }
.plain i { font-style: normal; display: inline-block; min-width: 52px; font-size: 13px; color: var(--dim); text-decoration: none; }
.links { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.links a { display: inline-flex; align-items: center; gap: 6px; padding: 9px 13px; border-radius: 999px; background: var(--card); font-size: 14px; font-weight: 600; }
.links svg { width: 17px; height: 17px; }
.more { display: block; margin-top: 14px; font-size: 14px; color: var(--dim); text-align: right; }

/* 한 사람 페이지 */
.solo { margin-top: 6px; }
.hint { margin-top: 10px; text-align: center; font-size: 12px; color: var(--dim); }
.solo-head { margin-bottom: 12px; }
.role-chip { display: inline-block; font-size: 13px; font-weight: 600; padding: 6px 13px; border-radius: 999px; background: var(--primary); }
.solo-head h1 { margin-top: 10px; font-size: 38px; font-weight: 800; letter-spacing: -.04em; line-height: 1.05; }
.solo-head .en { margin-top: 4px; font-size: 15px; color: var(--dim); }
.chips { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { padding: 6px 11px; border-radius: 9px; background: var(--card); font-size: 13px; }
.row2 { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* 루터 다운로드 */
.app { margin-top: 32px; padding: 20px; border-radius: 24px; background: var(--card); }
.app-head { display: flex; align-items: center; gap: 14px; }
.app-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--cream); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.app-icon img { width: 40px; }
.app-head b { display: block; font-family: Jalnan2; font-weight: normal; font-size: 24px; color: var(--primary); }
.app-head span { display: block; margin-top: 3px; font-size: 14px; color: var(--sub); }
.stores { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.store { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; border-radius: 14px; background: var(--ink); font-weight: 600; font-size: 16px; }
.store:first-child { background: #fff; color: var(--ink); }
.store svg { width: 24px; height: 24px; }
.store small { display: block; font-size: 11px; font-weight: 500; opacity: .7; line-height: 1.1; }
.store span { line-height: 1.2; text-align: left; }
footer { padding: 28px 0 8px; font-size: 12px; color: var(--dim); text-align: center; }

/* ---------- 카드 ---------- */
.card { display: block; width: 100%; aspect-ratio: 1.75; perspective: 1200px; cursor: pointer; container-type: inline-size; user-select: none; -webkit-user-select: none; }
.card .inner {
  position: relative; width: 100%; height: 100%; transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(calc(var(--ry, 0deg) + var(--flip, 0deg)));
  transition: transform .6s cubic-bezier(.2,.8,.2,1);
}
.card.flipped { --flip: 180deg; }
.face {
  position: absolute; inset: 0; border-radius: 5cqw; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 3cqw 8cqw rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.06);
}
.face::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at var(--gx, 30%) var(--gy, 20%), rgba(255,255,255,.12), transparent 45%); pointer-events: none; }

.front { background: linear-gradient(135deg, #3F4552 0%, #33363F 55%, #55393B 100%); }
.front .glow { position: absolute; right: -18%; top: -40%; width: 75%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(246,72,45,.45), transparent 65%); }
.front .top { position: absolute; left: 6.5%; right: 6.5%; top: 8%; display: flex; justify-content: space-between; align-items: center; }
.front .logo { font-size: 5.4cqw; }
.front .team { font-size: 3cqw; font-weight: 600; color: var(--sub); padding: .6cqw 2cqw; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; }
.front .avatar.ruti { position: absolute; right: 2%; bottom: 4%; height: 70%; filter: drop-shadow(0 2cqw 3cqw rgba(0,0,0,.35)); }
.front .avatar.photo { position: absolute; right: 7%; bottom: 17%; width: 30%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; border: .8cqw solid var(--cream); }
.front .who { position: absolute; left: 6.5%; bottom: 13%; max-width: 58%; }
.front .role { display: inline-block; font-size: 3.1cqw; font-weight: 600; background: var(--primary); padding: .7cqw 2.2cqw; border-radius: 999px; }
.front .name { margin-top: 2cqw; font-size: 10cqw; font-weight: 800; letter-spacing: -.04em; line-height: 1.05; }
.front .name-en { margin-top: .8cqw; font-size: 3.6cqw; color: var(--dim); }
.front .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2.2%; background: var(--primary); }

.back { transform: rotateY(180deg); background: var(--cream); color: var(--ink); display: flex; align-items: center; gap: 6cqw; padding: 0 7%; }
.back .qr { flex: 0 0 34%; aspect-ratio: 1; background: #fff; border-radius: 3cqw; padding: 2cqw; box-shadow: 0 1cqw 3cqw rgba(0,0,0,.08); }
.back .qr svg { display: block; width: 100%; height: 100%; }
.back .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3cqw; }
.back .app b { display: block; font-family: Jalnan2; font-weight: normal; font-size: 9cqw; color: var(--primary); letter-spacing: -.03em; line-height: 1; }
.back .app span { display: block; margin-top: 1.4cqw; font-size: 3.2cqw; font-weight: 600; }
.back .rows { display: flex; flex-direction: column; gap: 1cqw; font-size: 3cqw; color: #4a4f5c; word-break: break-all; }
.back .rows i { font-style: normal; font-weight: 600; color: var(--primary); margin-right: 1.6cqw; }
.back .rows .dim { color: #8B919E; }
.back .scan { font-size: 2.6cqw; color: #8B919E; }

.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 28px); translate: -50% 20px; padding: 12px 20px; border-radius: 999px; background: #fff; color: var(--ink); font-weight: 600; font-size: 15px; opacity: 0; transition: opacity .2s, translate .2s; pointer-events: none; z-index: 50; }
.toast.show { opacity: 1; translate: -50% 0; }
.empty { padding: 120px 0; text-align: center; color: var(--sub); }

.rise { animation: rise .55s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .rise { animation: none; } .card .inner { transition: none; } }
