/* =========================================================
   동네게임 — 현실 공간 기반 미션 게임 / 모바일 웹
   라이트 모드 · 넉넉한 여백의 흰 카드 · 블롭 크루 캐릭터
   ========================================================= */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard-dynamic-subset.css');
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@600;700;800&display=swap');

:root {
  color-scheme: light;

  /* 표면 */
  --page: #F3F4F7;
  --paper: #FFFFFF;
  --wash: #F4F5F8;
  --wash-2: #ECEEF2;

  /* 글자 */
  --ink: #16181D;
  --ink-2: #4A505C;
  --muted: #6E7582;
  --faint: #A6ACB6;
  --line: #E6E8ED;
  --line-2: #F0F1F4;

  /* 브랜드 · 상태 */
  --brand: #2F5BEA;
  --brand-wash: #EEF2FE;
  --danger: #D92D20;
  --danger-wash: #FEF0EE;
  --good: #0E8A5F;
  --good-wash: #E9F8F1;
  --warn: #B26A00;
  --warn-wash: #FFF6E0;
  --sun: #FFCF33;

  /* 예전 토큰 이름 호환 (화면 코드의 인라인 스타일) */
  --bg: var(--page);
  --deep: var(--paper);
  --surface: var(--paper);
  --surface-2: var(--wash);
  --surface-3: var(--wash-2);
  --line-soft: var(--line-2);
  --text: var(--ink);
  --text-2: var(--ink-2);
  --lime: var(--brand);
  --coral: var(--danger);
  --gold: var(--warn);
  --mint: #0E9384;
  --blue: var(--brand);

  --r-sm: 12px;
  --r: 20px;
  --r-lg: 24px;
  --pill: 999px;

  --shadow-sm: 0 1px 2px rgba(22, 24, 29, .04);
  --shadow: 0 1px 2px rgba(22, 24, 29, .04), 0 8px 24px rgba(22, 24, 29, .06);
  --shadow-lg: 0 4px 12px rgba(22, 24, 29, .06), 0 20px 48px rgba(22, 24, 29, .10);

  --sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
          'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  --num: 'Outfit', 'Pretendard Variable', Pretendard, system-ui, sans-serif;
  --mono: var(--num);

  --gutter: 20px;
  --shell-w: 480px;
  --nav-h: 72px;
  --ease: cubic-bezier(.2, .8, .25, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
body { display: flex; align-items: center; justify-content: center; }

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid rgba(47, 91, 234, .45); outline-offset: 2px; border-radius: 10px; }

/* ── 앱 셸 ─────────────────────────────────────── */
#shell {
  position: relative;
  width: 100%; max-width: var(--shell-w);
  height: 100dvh;
  background: var(--page);
  overflow: hidden;
  display: flex; flex-direction: column;
}

/* 가입·로그인 화면은 페이지 전체를 흰색으로 — 넓은 화면에서 가운데 기둥처럼 보이지 않게 */
body[data-screen="welcome"], body[data-screen="welcome"] #shell,
body[data-screen="login"], body[data-screen="login"] #shell,
body[data-screen="terms"], body[data-screen="terms"] #shell,
body[data-screen="signup"], body[data-screen="signup"] #shell,
body[data-screen="profile"], body[data-screen="profile"] #shell { background: var(--paper); }
body[data-screen="terms"] .topbar, body[data-screen="signup"] .topbar, body[data-screen="profile"] .topbar { background: rgba(255, 255, 255, .96); }

#view {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--nav-h) + 28px);
  scrollbar-width: none;
}
#view::-webkit-scrollbar { display: none; }
#view.no-nav { padding-bottom: 28px; }

.wrap { padding: 0 var(--gutter); }

/* ── 타이포 ────────────────────────────────────── */
.eyebrow { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: -.005em; }
h1.title { font-size: 26px; font-weight: 800; letter-spacing: -.035em; line-height: 1.32; margin: 4px 0 0; }
h2.sec { font-size: 20px; font-weight: 800; letter-spacing: -.03em; margin: 0; }
.sub { color: var(--muted); font-size: 14px; margin: 6px 0 0; line-height: 1.55; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 36px 0 14px; }
.sec-head .more { font-size: 14px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 2px; min-height: 44px; }

/* ── 상단바 ────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 14px var(--gutter) 12px;
  background: rgba(243, 244, 247, .96);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.topbar .grow { flex: 1; min-width: 0; }
.topbar .eyebrow { font-size: 12px; }
.iconbtn {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  background: var(--paper); box-shadow: var(--shadow-sm); border: 1px solid var(--line);
  color: var(--ink); font-size: 18px;
  transition: background .15s ease;
}
.iconbtn:active { background: var(--wash); }
.iconbtn .avatar { width: 34px; height: 34px; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  background: var(--sun); color: var(--ink);
  display: grid; place-items: center;
  font-family: var(--num); font-weight: 800; font-size: 14px; letter-spacing: -.02em;
}
.brand-name { font-family: var(--num); font-weight: 800; font-size: 20px; letter-spacing: -.02em; line-height: 1; }
.brand-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ── 카드 ──────────────────────────────────────── */
.card {
  background: var(--paper);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card.flat { background: var(--wash); box-shadow: none; }
.card + .card { margin-top: 12px; }

.row { display: flex; align-items: center; gap: 12px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.mt { margin-top: 16px; }
.mt-lg { margin-top: 32px; }

/* ── 버튼 ──────────────────────────────────────── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 56px; padding: 0 22px; border-radius: 18px;
  font-weight: 700; font-size: 16px; letter-spacing: -.02em;
  background: var(--wash); color: var(--ink);
  transition: background .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn:active { background: var(--wash-2); }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:active { background: #2C2F37; }
.btn.danger { background: var(--danger-wash); color: var(--danger); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.sm {
  width: auto; min-height: 44px; padding: 0 16px; border-radius: var(--pill);
  font-size: 14px; background: var(--paper); border: 1px solid var(--line);
}
.btn.sm.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn[disabled] { opacity: .35; pointer-events: none; }

/* ── 칩 / 태그 ─────────────────────────────────── */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  min-height: 44px; padding: 0 16px; border-radius: var(--pill);
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--paper); border: 1px solid var(--line);
  font-size: 14px; font-weight: 600; color: var(--ink-2);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.on span { color: rgba(255, 255, 255, .7) !important; }
.chip:active { background: var(--wash); }
.chip.on:active { background: #2C2F37; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600;
  padding: 4px 9px; border-radius: var(--pill);
  background: var(--wash); color: var(--ink-2);
}
.tag-cat::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--tc); }
.tag.lime { background: var(--brand-wash); color: var(--brand); }
.tag.coral { background: var(--danger-wash); color: var(--danger); }
.tag.blue { background: var(--brand-wash); color: var(--brand); }
.tag.gold { background: var(--warn-wash); color: var(--warn); }
.tag.mint { background: #E6F6F4; color: #0E7066; }

/* ── 세그먼트 ──────────────────────────────────── */
.seg { display: flex; gap: 4px; padding: 4px; background: var(--wash-2); border-radius: 16px; }
.seg button {
  flex: 1; min-height: 42px; border-radius: 12px;
  font-size: 14px; font-weight: 600; color: var(--muted);
  transition: background .15s ease, color .15s ease;
}
.seg button.on { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ── 블롭 캐릭터 · 아이콘 ─────────────────────── */
.blob { display: block; flex: none; overflow: visible; }
.ico { display: block; flex: none; }
.av-lg { flex: none; }

/* ── 홈 ────────────────────────────────────────── */
.greet { padding: 8px var(--gutter) 20px; }
.greet h1 { font-size: 26px; font-weight: 800; letter-spacing: -.035em; line-height: 1.35; margin: 0; }
.greet h1 em { font-style: normal; color: var(--brand); }

.zone { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--paper); box-shadow: var(--shadow); }
.zone canvas { display: block; width: 100%; height: 220px; }
.zone-badge {
  position: absolute; top: 14px; left: 14px;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; color: var(--ink);
  background: rgba(255, 255, 255, .92); padding: 7px 12px; border-radius: var(--pill);
  box-shadow: var(--shadow-sm);
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #12B76A;
  box-shadow: 0 0 0 0 rgba(18, 183, 106, .5); animation: pulse 2s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(18, 183, 106, 0); } 100% { box-shadow: 0 0 0 0 rgba(18, 183, 106, 0); } }
.zone-overlay { display: flex; align-items: center; gap: 12px; padding: 16px 18px 18px; }
.zone-overlay .ico { color: var(--brand); }
.zone-actions { display: flex; gap: 8px; padding: 0 18px 18px; }
.zone-actions .btn.sm { flex: 1; }
.zone-loc { font-weight: 800; font-size: 17px; letter-spacing: -.02em; }

/* 서비스 소개 롤링 배너 */
.banner { position: relative; }
.banner-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--r-lg); scrollbar-width: none; box-shadow: var(--shadow); }
.banner-track::-webkit-scrollbar { display: none; }
.banner-slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; min-height: 188px; padding: 22px 22px 24px; color: #fff; background: var(--bc); overflow: hidden; }
.banner-slide .k { font-size: 13px; font-weight: 700; opacity: .9; }
.banner-slide .t { font-size: 24px; font-weight: 800; letter-spacing: -.035em; line-height: 1.3; margin-top: 6px; }
.banner-slide .d { font-size: 14px; margin-top: 10px; opacity: .92; padding-right: 100px; line-height: 1.5; }
.banner-slide .blob { position: absolute; right: -4px; bottom: -12px; }
.banner-ctrl { position: absolute; top: 14px; right: 14px; display: flex; align-items: center; gap: 6px; }
.banner-count { font-size: 12px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .28); padding: 6px 10px; border-radius: var(--pill); }
.banner-play { position: relative; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .28); color: #fff; }
.banner-play::after { content: ''; position: absolute; inset: -8px; }
.zone-meta { font-size: 13px; color: var(--muted); }

/* 게임 시작하기 — 메인의 대표 버튼 */
.start-btn { margin-top: 16px; min-height: 60px; font-size: 17px; border-radius: 18px; gap: 6px; }

/* 팀전 · 모르는 사람 */
.chip[disabled] { opacity: .35; pointer-events: none; }
.kind { display: inline-block; white-space: nowrap; margin-left: 6px; font-size: 11px; font-weight: 700; color: #0E7066; background: #E6F6F4; padding: 2px 7px; border-radius: var(--pill); }
.pchip.fade-in { animation-fill-mode: both; }
.teams { display: grid; gap: 10px; }
.team-box { border-radius: 18px; padding: 12px 12px 14px; background: var(--tw); box-shadow: inset 4px 0 0 var(--tc); }
.team-name { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; color: var(--tc); margin: 0 0 10px 6px; }
.team-name span { font-size: 12px; font-weight: 600; color: var(--muted); }
.tdot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.pl.team { background: var(--tw); padding-left: 12px; }
.pl.team .nm { color: var(--tc); font-weight: 800; }
.pl.team.me { box-shadow: inset 0 0 0 1.5px var(--tc); }
.team-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 20px; background: var(--paper); box-shadow: var(--shadow-sm), inset 4px 0 0 var(--tc); }
.team-row.me { background: var(--tw); }
.team-row .rk { width: 24px; text-align: center; font: 800 16px/1 var(--num); color: var(--tc); }
.team-row .nm { flex: 1; min-width: 0; font-size: 16px; font-weight: 800; color: var(--ink); }
.team-row .mem { display: block; margin-top: 4px; font-size: 12px; font-weight: 500; color: var(--muted); }
.team-row .sc { font-size: 17px; font-weight: 800; }

/* 내 게임 */
.my-live { box-shadow: inset 0 0 0 2px var(--brand), var(--shadow); }
.lcard .role { display: block; margin-top: 8px; }
.lcard > .ico { color: var(--faint); }
.rkc {
  width: 44px; height: 44px; border-radius: 14px; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--wash); color: var(--ink-2); font: 800 17px/1 var(--num);
}
.rkc small { font: 600 10px/1 var(--sans); margin-top: 3px; color: var(--muted); }
.rkc.gold { background: var(--sun); color: var(--ink); }
.rkc.gold small { color: var(--ink-2); }
.my-empty { padding: 26px 20px; }

/* 게임 방식 2열 카드 */
.gcard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gcard {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; text-align: left;
  min-height: 156px; padding: 18px 18px 16px; border-radius: var(--r-lg);
  background: var(--paper); box-shadow: var(--shadow); overflow: hidden;
  transition: box-shadow .15s ease, background .15s ease;
}
.gcard:active { background: var(--wash); }
.gcard .t { font-size: 18px; font-weight: 800; letter-spacing: -.03em; }
.gcard .d { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.45; padding-right: 40px; }
.gcard .blob { position: absolute; right: 12px; bottom: 12px; }

/* 가로 스크롤 컬러 카드 */
.feat-rail { display: flex; gap: 12px; overflow-x: auto; margin: 0 calc(var(--gutter) * -1); padding: 4px var(--gutter) 8px; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: none; }
.feat-rail::-webkit-scrollbar { display: none; }
.feat {
  position: relative; flex: 0 0 76%; scroll-snap-align: start;
  min-height: 188px; padding: 20px; border-radius: var(--r-lg); overflow: hidden; color: #fff;
  background: var(--fc, var(--brand));
}
.feat .k { font-size: 13px; font-weight: 600; opacity: .9; }
.feat .t { font-size: 21px; font-weight: 800; letter-spacing: -.03em; margin-top: 2px; }
.feat .d { font-size: 14px; margin-top: 6px; opacity: .92; }
.feat .d b { font-family: var(--num); font-weight: 700; }
.feat .btn.sm { position: absolute; left: 20px; bottom: 18px; background: #fff; color: var(--ink); border-color: #fff; }
.feat .blob { position: absolute; right: -8px; bottom: -12px; }

/* 리스트 카드 */
.lcard { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--paper); box-shadow: var(--shadow); width: 100%; text-align: left; }
.lcard + .lcard { margin-top: 12px; }
.lcard .t { flex: 1; min-width: 0; }
.lcard .n { display: block; font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.lcard .dsc { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.lcard .rk { font-family: var(--num); font-weight: 800; font-size: 15px; color: var(--faint); width: 16px; }

/* ── 미션 카드 ─────────────────────────────────── */
.mission {
  position: relative; display: flex; gap: 14px; align-items: center;
  background: var(--paper); border-radius: var(--r-lg);
  padding: 16px 16px 16px 18px; box-shadow: var(--shadow);
  transition: background .15s ease, opacity .15s ease;
}
.mission::before { content: none; }
.mission[data-act]:active { background: var(--wash); }
.mission.done { background: #F6FAF8; box-shadow: var(--shadow-sm); }
.mission.done .m-name { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.mission.locked { opacity: .55; }
.m-idx {
  width: 28px; flex: none; align-self: flex-start; padding-top: 2px;
  font-family: var(--num); font-size: 15px; font-weight: 800; color: var(--faint);
}
.m-blob { position: relative; flex: none; align-self: flex-start; }
.m-blob i {
  position: absolute; left: -4px; top: -4px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: var(--pill); background: var(--ink); color: #fff;
  font: 800 11px/20px var(--num); font-style: normal; text-align: center;
}
.m-body { flex: 1; min-width: 0; }
.m-phase { font-size: 12px; font-weight: 700; color: var(--muted); }
.m-name { font-size: 16px; font-weight: 700; margin-top: 2px; letter-spacing: -.025em; line-height: 1.4; }
.m-en { font-family: var(--num); font-size: 11px; font-weight: 600; color: var(--faint); letter-spacing: .04em; margin-top: 2px; }
.m-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.m-right { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 8px; flex: none; }
.m-pts { font-family: var(--num); font-size: 15px; font-weight: 700; color: var(--ink-2); }
.m-check {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--line); font-size: 14px; font-weight: 800; color: transparent;
}
.mission.done .m-check { background: #12B76A; border-color: #12B76A; color: #fff; }

/* ── 플레이 헤더(타이머) ──────────────────────── */
.play-head {
  position: sticky; top: 0; z-index: 20;
  margin: 0 0 16px; padding: 16px var(--gutter) 14px;
  background: var(--paper); border-radius: 0 0 28px 28px; box-shadow: var(--shadow);
}
.play-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.play-top .iconbtn { width: 40px; height: 40px; }
.play-leave-hint { font-size: 12px; color: var(--faint); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.play-top .grow { min-width: 0; }
.play-title { font-size: 15px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── 게임 만들기 — 설정마다 흰 박스로 묶는다 ───── */
.create-form { padding-top: 4px; }
.cbox { margin-top: 12px; padding: 18px 18px 20px; background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.cbox:first-child { margin-top: 0; }
.cbox-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cbox-title { display: block; margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.cbox-val { min-width: 0; font-size: 14px; font-weight: 700; color: var(--brand); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cbox-val.count { color: var(--faint); font-family: var(--num); font-weight: 600; }
.cbox-sub { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.cbox-label { margin: 18px 0 10px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.cbox-label span { font-weight: 500; color: var(--muted); }
.cbox .input { min-height: 52px; background: var(--wash); border-color: transparent; }
.cbox .input:focus { background: var(--paper); border-color: var(--brand); }
.cbox .zone { box-shadow: none; border: 1px solid var(--line); border-radius: 18px; }
.radius-chips .chip { font-family: var(--num); font-weight: 700; letter-spacing: .01em; }
.radius-chips .chip[data-act="radius-other"] { font-family: inherit; letter-spacing: 0; }
.radius-custom { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.rc-field { position: relative; flex: 1; min-width: 0; }
.rc-field .input { padding-right: 44px; font-family: var(--num); font-weight: 700; -moz-appearance: textfield; }
.rc-field .input::-webkit-outer-spin-button, .rc-field .input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rc-unit { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-weight: 700; color: var(--muted); pointer-events: none; }
.radius-custom .btn.sm { min-height: 52px; padding: 0 22px; border-radius: 16px; }
.cbox .notice { margin-top: 14px; }
.cbox .picked-box { margin-top: 14px; padding: 14px; }
.cbox .picked-box .li { background: var(--paper); }
/* ── 게임 종류별 옵션 묶음 ─────────────────────── */
.opt-group {
  margin-top: 12px; padding: 14px 10px 10px; border-radius: 30px;
  background: var(--brand-wash); border: 1.5px solid rgba(47, 91, 234, .45);   /* 옵션 영역 경계선 */
}
.opt-group.is-bingo { background: #EEF8DF; border-color: rgba(63, 143, 18, .5); }
.opt-group .cbox { box-shadow: var(--shadow-sm); }
.opt-group .opt-head + .cbox { margin-top: 12px; }
.opt-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 8px; }
.opt-badge { padding: 6px 12px; border-radius: var(--pill); background: var(--brand); color: #fff; font-size: 13px; font-weight: 800; letter-spacing: -.01em; }
.opt-group.is-bingo .opt-badge { background: #3F8F12; }
.opt-desc { font-size: 13px; color: var(--ink-2); }

/* ── 게임 종류 선택 ────────────────────────────── */
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.type-card {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0;
  padding: 12px 8px; border-radius: 18px; text-align: center;
  background: var(--wash); border: 2px solid transparent; color: var(--muted); font: inherit;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.type-card.on { background: var(--paper); border-color: var(--ink); color: var(--ink); }
.type-ico { display: grid; place-items: center; height: 28px; margin-bottom: 4px; }
.type-ico svg { display: block; }
.type-name { font-size: 15px; font-weight: 800; letter-spacing: -.02em; color: var(--ink-2); }
.type-card.on .type-name { color: var(--ink); }
.type-desc { font-size: 12px; line-height: 1.4; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* 빙고판 크기 */
.size-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.size-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 4px;
  border-radius: 16px; background: var(--wash); border: 2px solid transparent; color: inherit; font: inherit;
}
.size-card.on { background: var(--paper); border-color: var(--ink); }
.size-mini { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 2px; width: 38px; height: 38px; }
.size-mini i { border-radius: 2px; background: var(--line); }
.size-card.on .size-mini i { background: #9FD86B; }
.size-mini i.free { background: var(--sun) !important; }
.size-name { font-size: 14px; font-weight: 700; color: var(--muted); }
.size-card.on .size-name { color: var(--ink); }

/* ── 빙고판 ────────────────────────────────────── */
.bingo-card { padding: 16px 14px 14px; background: var(--paper); border-radius: 28px; box-shadow: var(--shadow); text-align: center; }
.bingo-top { display: flex; justify-content: center; margin-bottom: 12px; }
.bingo-pill { padding: 7px 14px; border-radius: var(--pill); background: #C9EE7A; color: #1E3A0A; font: 800 13px/1 var(--num); }
.bingo-board { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 8px; }
.bingo-board.n6 { gap: 5px; }
.bt {
  position: relative; aspect-ratio: 1 / 1; min-width: 0; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 4px;
  border-radius: 16px; background: var(--wash); color: inherit; font: inherit;
  box-shadow: inset 0 -2px 0 rgba(22, 24, 29, .05);
  transition: transform .12s ease, background .15s ease;
}
.bingo-board.n6 .bt { border-radius: 11px; }
button.bt:active { transform: scale(.95); }
.bt .e { font-size: 26px; line-height: 1; }
.bingo-board.n3 .e { font-size: 46px; }
.bingo-board.n4 .e { font-size: 32px; }
.bingo-board.n6 .e { font-size: 22px; }
.bt .k { max-width: 100%; font-size: 11px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bingo-board.n3 .k { font-size: 13px; }
.bingo-board.n6 .k { display: none; }
.bt.locked .e { font: 800 20px/1 var(--num); color: var(--faint); }
.bt.on { background: #E3F7CF; }
.bt.on:not(.free)::after {
  content: '✓'; position: absolute; top: 4px; right: 4px; width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center; background: #1F9D55; color: #fff; font-size: 10px; font-weight: 800;
}
.bt.free { background: #C9EE7A; }
.bt.free .k { display: block; color: #1E3A0A; font-family: var(--num); font-weight: 800; }
.bt.line { box-shadow: inset 0 0 0 3px #1F9D55; }
.bt .ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bt .ph ~ .e { position: absolute; left: 4px; bottom: 4px; font-size: 16px !important; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .4)); }
.bt .ph ~ .k { display: none; }
.bt .cnt {
  position: absolute; left: 4px; top: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: rgba(22, 24, 29, .72); color: #fff; font: 700 10px/16px var(--num);
}
.bt .by {
  position: absolute; right: 4px; bottom: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--tc); color: #fff; font-size: 10px; font-weight: 800; line-height: 18px; white-space: nowrap;
}
.bingo-board.n6 .bt .by { min-width: 14px; height: 14px; padding: 0 3px; font-size: 8px; line-height: 14px; }
.bingo-rule { margin: 12px 0 2px; font-size: 13px; color: var(--ink-2); }
.bingo-word { color: #3F8F12; font-family: var(--num); font-weight: 800; }
.tag.bingo { background: #EAF8D2; color: #3B6E10; }
.bingo-target { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.bingo-target .e { font-size: 54px; line-height: 1; }
.bingo-pop .bingo-shout { font: 900 56px/1 var(--num); color: #3F8F12; letter-spacing: .01em; }
@media (prefers-reduced-motion: no-preference) { .bingo-pop .bingo-shout { animation: pop .5s cubic-bezier(.2, 1.4, .4, 1); } }
.album .ph-e { font-size: 34px; }

/* 게임 만들기 버튼 — 스크롤해도 화면 아래에 붙어 있다 */
body[data-screen="create"] #view.no-nav { padding-bottom: 0; }
.sticky-cta {
  position: sticky; bottom: 0; z-index: 30;
  margin-top: 8px; padding: 18px var(--gutter) calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(243, 244, 247, 0), var(--page) 34%);
}
.cta-btn { flex-direction: column; gap: 2px; min-height: 64px; border-radius: 18px; box-shadow: 0 10px 24px rgba(22, 24, 29, .22); }
.cta-main { display: inline-flex; align-items: center; gap: 6px; font-size: 17px; }
.cta-sub { max-width: 100%; font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, .72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body[data-screen="create"] .toast { bottom: calc(104px + env(safe-area-inset-bottom)); }
.live-pill {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 6px 10px; border-radius: var(--pill); background: #FFECEE; color: var(--danger);
  font: 800 12px/1 var(--num); letter-spacing: .04em;
}
.live-pill.off { background: var(--wash); color: var(--muted); font-family: var(--sans); letter-spacing: 0; }
.timer { display: flex; align-items: baseline; gap: 8px; }
.timer .t { font-family: var(--num); font-size: 44px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }
.timer.warn .t { color: var(--danger); }
@media (prefers-reduced-motion: no-preference) { .timer.warn .t { animation: blink 1s steps(2, start) infinite; } }
@keyframes blink { 50% { opacity: .5; } }
.tbar { height: 8px; border-radius: var(--pill); background: var(--wash-2); margin-top: 12px; overflow: hidden; }
.tbar > i { display: block; height: 100%; background: var(--brand); border-radius: var(--pill); transition: width 1s linear; }
.tbar.warn > i { background: var(--danger); }
#myScore { color: var(--brand) !important; font-family: var(--num); }

.livebar { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0; scrollbar-width: none; }
.livebar::-webkit-scrollbar { display: none; }
.pl { flex: none; display: flex; align-items: center; gap: 7px; background: var(--wash); border-radius: var(--pill); padding: 5px 12px 5px 5px; }
.pl.me { background: var(--brand-wash); }
.pl .av .avatar { width: 26px; height: 26px; }
.pl .nm { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.pl .sc { font-family: var(--num); font-size: 13px; font-weight: 700; }

.pl .done-tag { font-size: 11px; font-weight: 700; color: #0B8A5E; }

/* ── 게임 완료 · 랭킹 집계 · 확정 ─────────────── */
.complete-box { margin-top: 18px; padding: 18px; background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.cb-label { font-size: 15px; font-weight: 700; color: var(--ink-2); }
.cb-label b { color: var(--ink); font-size: 17px; }
.cb-bar { height: 8px; margin-top: 12px; border-radius: var(--pill); background: var(--wash-2); overflow: hidden; }
.cb-bar > i { display: block; height: 100%; border-radius: var(--pill); background: #12B76A; transition: width .4s ease; }
.complete-btn { height: 58px; background: var(--ink); color: #fff; }
.complete-btn:not([disabled]) { box-shadow: 0 10px 24px rgba(22, 24, 29, .22); }
.finish-card {
  margin: 18px 0 10px; padding: 26px 20px 20px; text-align: center;
  background: var(--paper); border-radius: 28px; box-shadow: var(--shadow);
}
.finish-card.is-final { box-shadow: inset 0 0 0 2px var(--sun), var(--shadow); }
.finish-card .blob { display: block; margin: 0 auto; }
.finish-title { margin-top: 10px; font-size: 21px; font-weight: 800; letter-spacing: -.03em; }
.finish-left { display: inline-block; margin-top: 14px; padding: 8px 14px; border-radius: var(--pill); background: var(--wash); font-size: 15px; font-weight: 700; }
.tally-dots { display: flex; justify-content: center; gap: 8px; height: 56px; align-items: center; }
.tally-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--brand); opacity: .35; }
@media (prefers-reduced-motion: no-preference) {
  .tally-dots i { animation: tdot 1s ease-in-out infinite; }
  .tally-dots i:nth-child(2) { animation-delay: .15s; }
  .tally-dots i:nth-child(3) { animation-delay: .3s; }
}
@keyframes tdot { 40% { opacity: 1; transform: translateY(-8px); } }
.final-stamp {
  display: inline-flex; align-items: center; gap: 5px; margin: 10px auto 2px;
  padding: 5px 10px; border-radius: var(--pill); background: var(--wash);
  font-size: 12px; font-weight: 600; color: var(--ink-2);
}
.kind.done { background: #E9F8F1; color: #0B8A5E; }

/* 내 게임 — 확정된 결과 카드 */
button.lcard { width: 100%; text-align: left; font: inherit; color: inherit; }
.lcard.fresh { box-shadow: inset 0 0 0 2px var(--sun), var(--shadow); }
.lcard .view-go { display: inline-flex; align-items: center; gap: 2px; flex: none; font-size: 13px; font-weight: 700; color: var(--brand); white-space: nowrap; }
.my-live .n .live-dot { margin-right: 6px; vertical-align: middle; }
button.li { width: 100%; text-align: left; font: inherit; color: inherit; }

/* 만든 게임 슬롯 */
.slot-meter {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 12px; padding: 12px 16px; border-radius: 18px; background: var(--paper); box-shadow: var(--shadow-sm);
}
.slot-meter .sm-label { font-size: 14px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.slot-meter .sm-label b { color: var(--ink); font-size: 16px; }
.slot-meter .slots { display: inline-flex; gap: 4px; }
.slot-meter .slots i { width: 22px; height: 8px; border-radius: var(--pill); background: var(--wash-2); }
.slot-meter .slots i.on { background: var(--brand); }
.slot-meter .sm-hint { margin-left: auto; font-size: 12px; color: var(--muted); }
.lcard + .lcard, .slot-meter + .lcard { margin-top: 10px; }
.gc-acts { display: flex; flex-direction: column; gap: 6px; flex: none; align-items: stretch; }
.gc-acts .btn.ghost { color: var(--muted); height: 32px; }
.gc-sub { display: flex; justify-content: center; gap: 2px; }
.gc-link { min-height: 32px; padding: 0 8px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.gc-link:active { background: var(--wash); }
.gc-link[data-act="edit-game"] { color: var(--brand); }
.mg-list { gap: 10px; }
.mg-list > .lcard + .lcard { margin-top: 0; }
.seg .seg-n { font-family: var(--num); font-weight: 700; opacity: .6; margin-left: 2px; }

/* 내 게임 — 진행 중 · 진행 예정 · 완료 구분 */
.gstate-seg { margin-bottom: 10px; }
.gstate-seg button, .seg-four button { white-space: nowrap; }
.seg-four button { font-size: 13px; padding: 0 2px; }
.gs-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; vertical-align: 1px; }
.gs-dot.live { background: var(--danger); }
.gs-dot.wait { background: #E0A100; }
.gs-dot.done { background: var(--good); }
.gstate-list > .lcard + .lcard, .gstate-list > .lcard + .more-link { margin-top: 10px; }
.my-empty.sm { padding: 20px 16px; }
.more-link {
  display: block; width: 100%; margin-top: 10px; padding: 13px; border-radius: 16px;
  background: var(--paper); box-shadow: var(--shadow-sm); font-size: 14px; font-weight: 700; color: var(--ink-2);
}
.tag.st-live { background: var(--danger-wash); color: var(--danger); }
.tag.st-wait { background: var(--warn-wash); color: var(--warn); }
.tag.st-done { background: var(--good-wash); color: var(--good); }
.sheet .lcard { box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }

/* 결과 상세 내역 */
.info-list { padding: 6px 16px; }
.info-row { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.info-row:last-child { border-bottom: 0; }
.info-row .k { width: 76px; flex: none; color: var(--muted); }
.info-row .v { flex: 1; min-width: 0; font-weight: 600; color: var(--ink); }
.md-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--paper); border-radius: 20px; box-shadow: var(--shadow-sm); }
.md-row .m-blob .blob, .md-row .m-blob svg { width: 40px; height: 40px; }
.md-body { flex: 1; min-width: 0; }
.md-name { font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.md-sub { margin-top: 3px; font-size: 12px; color: var(--muted); }
.md-bar { height: 5px; margin-top: 7px; border-radius: var(--pill); background: var(--wash-2); overflow: hidden; }
.md-bar > i { display: block; height: 100%; background: var(--brand); border-radius: var(--pill); }
.md-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.md-right b { font-size: 15px; }
.pd-table { padding: 4px 14px; }
.pd-row { display: grid; grid-template-columns: 1fr 44px 40px 60px; gap: 6px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.pd-row:last-child { border-bottom: 0; }
.pd-row > span:not(.pd-name) { text-align: right; }
.pd-head { font-size: 12px; color: var(--muted); padding: 8px 0; }
.pd-row.pd-head > span:first-child { text-align: left; }
.pd-row.me { color: var(--brand); }
.pd-name { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-name b { width: 16px; color: var(--muted); }
.pd-sc { font-weight: 800; }

/* 다른 탭에서 게임방으로 돌아가기 */
.game-dock {
  position: absolute; left: 12px; right: 12px; z-index: 39;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 10px);
  display: flex; align-items: center; gap: 10px; min-height: 52px;
  padding: 8px 14px; border-radius: 18px; text-align: left;
  background: var(--ink); color: #fff; box-shadow: var(--shadow-lg);
  font: inherit;
}
.game-dock .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.game-dock b { font-size: 14px; }
.game-dock .dsc { font-size: 12px; color: rgba(255, 255, 255, .72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-dock .go { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 700; color: var(--sun); white-space: nowrap; }
body:has(#gameDock) #view { padding-bottom: calc(var(--nav-h) + 90px); }
body:has(#gameDock) .toast { bottom: calc(var(--nav-h) + 84px); }

/* ── 시트 / 모달 ───────────────────────────────── */
.sheet-bg {
  position: absolute; inset: 0; z-index: 60;
  background: rgba(22, 24, 29, .42);
  display: flex; align-items: flex-end;
  animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0 } }
.sheet {
  width: 100%; background: var(--paper); border-radius: 28px 28px 0 0;
  padding: 10px 22px calc(24px + env(safe-area-inset-bottom));
  max-height: 88%; overflow-y: auto;
  animation: up .32s var(--ease);
}
@keyframes up { from { transform: translateY(100%); } }
.sheet .grab { width: 40px; height: 5px; border-radius: var(--pill); background: var(--wash-2); margin: 4px auto 20px; }
.sheet h2.sec { font-size: 21px; }

.toast {
  position: absolute; left: 50%; bottom: calc(var(--nav-h) + 22px); z-index: 90;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  background: rgba(40, 43, 51, .96); color: #fff;
  padding: 13px 18px; border-radius: 16px; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toastin .3s var(--ease);
  max-width: 88%; width: max-content; text-align: center;
}
.toast .avatar { width: 22px; height: 22px; }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ── 점수 팝업 ─────────────────────────────────── */
.scorepop { position: absolute; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(22, 24, 29, .45); animation: fade .15s ease; }
.scorepop .inner { width: 82%; padding: 28px 24px 22px; text-align: center; background: var(--paper); border-radius: 28px; box-shadow: var(--shadow-lg); animation: pop .4s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
.scorepop .big { font-family: var(--num); font-size: 64px; font-weight: 800; color: var(--brand); letter-spacing: -.03em; line-height: 1; margin-top: 6px; }
.scorepop .lines { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; text-align: left; background: var(--wash); border-radius: 16px; padding: 14px 16px; }
.scorepop .ln { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); }
.scorepop .ln b { font-family: var(--num); color: var(--ink); }
.scorepop .tag.lime { background: var(--brand); color: #fff; }

/* ── 인증(카메라) ──────────────────────────────── */
.shot {
  width: 100%; aspect-ratio: 4/3; border-radius: 20px; overflow: hidden;
  background: var(--wash); border: 2px dashed var(--line);
  display: grid; place-items: center; color: var(--muted); font-size: 14px; position: relative;
}
.shot img { width: 100%; height: 100%; object-fit: cover; }
.scanline { position: absolute; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--brand), transparent); animation: scan 1.1s ease-in-out infinite; }
@keyframes scan { 0%, 100% { top: 6% } 50% { top: 94% } }

/* ── 결과 ──────────────────────────────────────── */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin-top: 18px; }
.pod { flex: 1; text-align: center; }
.pod .av { display: flex; justify-content: center; }
.pod .nm { font-size: 13px; font-weight: 700; margin-top: 6px; }
.pod .sc { font-family: var(--num); font-size: 13px; color: var(--muted); }
.pod .bar { margin-top: 10px; border-radius: 16px 16px 6px 6px; background: var(--wash); display: grid; place-items: center; font-family: var(--num); font-weight: 800; font-size: 18px; color: var(--ink-2); }
.pod.p1 .bar { height: 88px; background: var(--sun); color: var(--ink); }
.pod.p2 .bar { height: 64px; }
.pod.p3 .bar { height: 48px; }

.rank-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 20px; background: var(--paper); box-shadow: var(--shadow-sm); }
.rank-row.me { background: var(--brand-wash); box-shadow: inset 0 0 0 1.5px rgba(47, 91, 234, .35); }
.rank-row .rk { width: 24px; font-family: var(--num); font-weight: 800; color: var(--faint); font-size: 15px; text-align: center; }
.rank-row .av .avatar { width: 36px; height: 36px; }
.rank-row .nm { flex: 1; font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.rank-row .sc { font-family: var(--num); font-weight: 700; font-size: 15px; }

.album { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.album img, .album .ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 16px; background: var(--paper); display: grid; place-items: center; box-shadow: var(--shadow-sm); }

/* ── 통계 그리드 ───────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--paper); border-radius: 20px; padding: 16px 10px; text-align: center; box-shadow: var(--shadow-sm); }
.stat .v { font-family: var(--num); font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.stat .k { font-size: 12px; color: var(--muted); margin-top: 2px; font-weight: 600; }

/* ── 리스트 아이템 ─────────────────────────────── */
.li { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 14px 16px; background: var(--paper); border-radius: 20px; box-shadow: var(--shadow-sm); color: var(--ink); }
.li + .li { margin-top: 10px; }
button.li:active, a.li:active { background: var(--wash); }
.li .ic { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: var(--wash); color: var(--ink-2); flex: none; font-size: 18px; }
.li .ic .avatar, .li .ic .blob { width: 36px; height: 36px; }
.li .t { flex: 1; min-width: 0; }
.li .t .n { display: block; font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.li .t .d { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.li .r { font-family: var(--num); font-size: 15px; color: var(--ink-2); font-weight: 700; display: flex; align-items: center; }
.li .r .ico { color: var(--faint); }

/* ── 폼 ────────────────────────────────────────── */
.field { margin-top: 18px; }
.field label { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 56px; background: var(--paper); border: 1.5px solid var(--line);
  border-radius: 16px; padding: 14px 16px; font-size: 16px; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: var(--faint); }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(47, 91, 234, .12); }
textarea.input { resize: none; min-height: 96px; line-height: 1.55; }
.input-ico { position: relative; }
.input-ico > .ico { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-ico > .input { padding-left: 48px; }

/* 아바타 고르기 */
.avpick { width: 60px; height: 60px; border-radius: 20px; display: grid; place-items: center; background: var(--paper); border: 2px solid var(--line); transition: border-color .15s ease, background .15s ease; }
.avpick.on { border-color: var(--ink); background: var(--wash); }
.avpick .avatar { width: 44px; height: 44px; }
.pchip { padding-left: 5px; }
.pchip .avatar { width: 30px; height: 30px; }

/* ── 하단 네비 ─────────────────────────────────── */
#nav {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding: 0 8px env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(16px);
  border-radius: 28px 28px 0 0; box-shadow: 0 -6px 24px rgba(22, 24, 29, .06);
}
#nav[hidden] { display: none; }
#nav button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--faint); font-size: 12px; font-weight: 600;
  transition: color .15s ease;
}
#nav button.on { color: var(--ink); font-weight: 700; }

/* ── 유틸 ──────────────────────────────────────── */
.hr { height: 1px; background: var(--line); margin: 24px 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grow { flex: 1; }
.notice { font-size: 13px; color: var(--muted); line-height: 1.65; background: var(--wash-2); border-radius: 16px; padding: 14px 16px; }
.notice b { color: var(--ink-2); }
.fade-in { animation: fadeup .3s var(--ease); }
@keyframes fadeup { from { opacity: 0; transform: translateY(6px); } }
.spin { display: inline-block; animation: sp 1s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

.sharecard-wrap { border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); }
.sharecard-wrap canvas { display: block; width: 100%; }

/* ── 회원가입 · 로그인 ─────────────────────────── */
.auth-wrap { position: relative; min-height: 100%; display: flex; flex-direction: column; padding: 28px var(--gutter) 24px; background: var(--paper); }
.auth-close { position: absolute; top: 14px; right: 16px; z-index: 2; box-shadow: none; }
.blob.mx { margin: 0 auto; }
.auth-hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding-top: 12px; }
.auth-hero h1.title { font-size: 28px; }
.auth-hero .sub { font-size: 15px; }
.auth-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; }

.crew { position: relative; width: 300px; max-width: 86%; height: 220px; margin: 0 auto 28px; }
.crew-m { position: absolute; }
@media (prefers-reduced-motion: no-preference) {
  .crew-m { animation: bob 3.6s ease-in-out infinite; animation-delay: calc(var(--d) * -.7s); }
}
@keyframes bob { 50% { transform: translateY(-7px) rotate(-2deg); } }

.sbtn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 56px; border-radius: 18px; border: 1.5px solid transparent;
  font-weight: 700; font-size: 16px; letter-spacing: -.02em;
  transition: filter .15s ease;
}
.sbtn:active { filter: brightness(.95); }
.sbtn svg { width: 20px; height: 20px; flex: none; }
.sbtn.naver { background: #03C75A; color: #fff; }
.sbtn.naver svg { width: 15px; height: 15px; }
.sbtn.apple { background: #000; color: #fff; }
.sbtn.google { background: #fff; color: #1f1f1f; border-color: #DADCE0; }
.sbtn.email { background: var(--wash); color: var(--ink); }
#googleSlot { min-height: 56px; display: flex; justify-content: center; }
#googleSlot > .sbtn { flex: 1; }

.link { color: var(--brand); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.auth-alt { text-align: center; font-size: 14px; color: var(--muted); margin-top: 6px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 24px 0 14px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.sicons { display: flex; flex-direction: column; gap: 10px; }
.sicon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; border: 1px solid transparent; flex: none; }
.sicon svg { width: 20px; height: 20px; }
.sicon.naver { background: #03C75A; color: #fff; } .sicon.naver svg { width: 16px; height: 16px; }
.sicon.apple { background: #000; color: #fff; }
.sicon.google { background: #fff; border-color: #DADCE0; }
.sicon.email { background: var(--wash); color: var(--ink); }
.obtn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px;
  border-radius: 18px; background: var(--paper); border: 1.5px solid var(--line);
  font-size: 15px; font-weight: 700; color: var(--ink); transition: background .15s ease;
}
.obtn:active { background: var(--wash); }
.obtn svg { width: 19px; height: 19px; }
.obtn.naver svg { color: #03C75A; width: 15px; height: 15px; }

/* 로그인 — 위는 파스텔 무대, 아래는 흰 카드 */
.login-stage { position: relative; height: 250px; background: linear-gradient(180deg, #E7F0FF 0%, #F1ECFF 100%); overflow: hidden; }
.login-stage .back { position: absolute; top: 14px; left: 16px; z-index: 2; }
.login-stage .crew { position: absolute; inset: 20px 0 0; width: 100%; max-width: none; height: 230px; margin: 0; }
.bubble { position: absolute; left: 50%; top: 96px; z-index: 2; transform: translateX(-50%) rotate(-6deg); background: var(--ink); color: #fff; font-weight: 800; font-size: 15px; padding: 9px 16px; border-radius: 20px; }
.login-card { position: relative; margin-top: -32px; background: var(--paper); border-radius: 32px 32px 0 0; padding: 30px var(--gutter) 28px; min-height: calc(100% - 218px); }
.login-card h1 { font-size: 24px; font-weight: 800; letter-spacing: -.035em; text-align: center; margin: 0; }
.login-card .sub { text-align: center; }

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; min-height: 44px; }
.check input, .agree input, .agree-all input { width: 22px; height: 22px; accent-color: var(--ink); flex: none; }
.agree-all { display: flex; align-items: center; gap: 12px; margin-top: 28px; padding: 18px; border-radius: 20px; background: var(--wash); font-size: 16px; cursor: pointer; }
.agree { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line-2); font-size: 15px; min-height: 56px; }
.agree label { flex: 1; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.req { font-size: 12px; font-weight: 700; color: var(--brand); flex: none; }
.req.opt { color: var(--muted); }

.form-err { color: var(--danger); font-size: 14px; min-height: 22px; margin: 12px 0 6px; line-height: 1.5; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 72px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 13px; font-weight: 600; color: var(--muted); min-width: 56px; min-height: 44px; }
.pw-rules { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.pw-rules span::before { content: '○ '; }
.pw-rules .ok { color: var(--good); font-weight: 600; }
.pw-rules .ok::before { content: '✓ '; }

.demo-head { display: flex; align-items: center; gap: 12px; }
.demo-head b { font-size: 18px; }
.login-chip svg { width: 15px; height: 15px; }
.chip.on.login-chip svg { color: #fff; }
.doc { font-size: 14px; line-height: 1.8; color: var(--ink-2); white-space: pre-line; max-height: 52vh; overflow-y: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
