/* =========================================================
   AI 스타일 변환 스튜디오 — photo booth UI
   mobile first (390px) · PC centered
   ========================================================= */

/* ---------- tokens ---------- */
:root {
  --ink: #1e1730;
  --ink-soft: #4b4160;
  --muted: #7c728f;
  --line: rgba(30, 23, 48, .10);
  --line-strong: rgba(30, 23, 48, .18);
  --card: rgba(255, 255, 255, .86);
  --card-solid: #ffffff;
  --pink: #ff4d8d;
  --pink-soft: #ffe3ee;
  --violet: #7c5cff;
  --violet-soft: #ece7ff;
  --mint: #21d4bd;
  --mint-soft: #ddfff8;
  --lime: #c9f45e;
  --sun: #ffc94d;
  --sky: #62b0ff;
  --shadow-sm: 0 4px 14px rgba(45, 25, 80, .08);
  --shadow: 0 14px 38px rgba(45, 25, 80, .12);
  --shadow-lg: 0 26px 60px rgba(45, 25, 80, .18);
  --r-lg: 26px;
  --r-md: 18px;
  --r-sm: 13px;
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, -apple-system, sans-serif;
  --font-display: "Jua", var(--font);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 620px at 14% -8%, #ffe6f1 0%, rgba(255, 230, 241, 0) 62%),
    radial-gradient(900px 560px at 96% 4%, #e6e9ff 0%, rgba(230, 233, 255, 0) 60%),
    radial-gradient(820px 620px at 50% 108%, #dcfff7 0%, rgba(220, 255, 247, 0) 58%),
    #fbf7ff;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* floating decorations */
.bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg i {
  position: absolute; display: block; border-radius: 50%; filter: blur(26px); opacity: .5;
  animation: float 13s ease-in-out infinite;
}
.bg i:nth-child(1) { width: 190px; height: 190px; background: #ffb3d1; top: 8%; left: -70px; }
.bg i:nth-child(2) { width: 150px; height: 150px; background: #b9c6ff; top: 42%; right: -60px; animation-delay: -4s; }
.bg i:nth-child(3) { width: 130px; height: 130px; background: #9cf5e3; bottom: 12%; left: 8%; animation-delay: -8s; }
@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(0, -18px, 0) scale(1.06); }
}

/* ---------- layout ---------- */
.app {
  position: relative; z-index: 1;
  width: 100%; max-width: 480px;
  margin: 0 auto; padding: 0 15px 44px;
}
@media (min-width: 780px) {
  .app { max-width: 520px; padding-bottom: 60px; }
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 9px;
  margin: 0 -15px 12px; padding: 11px 15px;
  background: rgba(251, 247, 255, .82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(30, 23, 48, .06);
}
.brand {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--font-display); font-size: 16px; letter-spacing: -.2px;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.brand .mark {
  width: 27px; height: 27px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--pink), var(--violet));
  box-shadow: 0 5px 12px rgba(124, 92, 255, .32); font-size: 14px;
}
.brand em { font-style: normal; color: var(--pink); }
.sp { flex: 1; }
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800; letter-spacing: -.2px;
  background: var(--mint-soft); color: #0a8574; border: 1px solid rgba(33, 212, 189, .35);
  white-space: nowrap;
}
.pill.lock { background: var(--violet-soft); color: #5b3fd6; border-color: rgba(124, 92, 255, .30); }
.pill.open { background: var(--mint-soft); color: #0a8574; }

/* ---------- hero ---------- */
.hero { padding: 6px 2px 15px; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; margin-bottom: 9px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line);
  font-size: 10.5px; font-weight: 800; color: var(--muted); letter-spacing: -.1px;
  box-shadow: var(--shadow-sm);
}
.hero h1 {
  margin: 0 0 8px; font-family: var(--font-display); font-weight: 400;
  font-size: 27px; line-height: 1.28; letter-spacing: -.8px;
}
.hero h1 span {
  background: linear-gradient(105deg, var(--pink) 10%, var(--violet) 62%, var(--sky) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { margin: 0; font-size: 12.5px; line-height: 1.62; font-weight: 700; color: var(--ink-soft); }
.hero .facts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.fact {
  font-size: 10.5px; font-weight: 800; color: var(--ink-soft);
  background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 4px 8px;
}

/* ---------- battle banner ---------- */
.battle-banner {
  position: relative; margin: 0 0 14px; padding: 14px 14px 13px;
  border-radius: var(--r-lg); color: #fff;
  background: linear-gradient(135deg, #3c2b8f 0%, #7c5cff 55%, #ff4d8d 130%);
  box-shadow: 0 16px 34px rgba(86, 54, 190, .32);
  overflow: hidden;
}
.battle-banner::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(115deg, rgba(255, 255, 255, .08) 0 12px, rgba(255, 255, 255, 0) 12px 26px);
  pointer-events: none;
}
.battle-banner .bb-top { display: flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 900; letter-spacing: .4px; opacity: .92; }
.battle-banner h3 { margin: 5px 0 4px; font-family: var(--font-display); font-weight: 400; font-size: 18.5px; line-height: 1.35; letter-spacing: -.4px; }
.battle-banner p { margin: 0; font-size: 11.5px; font-weight: 700; line-height: 1.55; opacity: .9; }
.battle-banner .bb-actions { display: flex; gap: 7px; margin-top: 11px; }
.battle-banner .bb-actions button { flex: 1; }
.battle-banner .bb-style {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 8px;
  padding: 4px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 900;
  background: rgba(255, 255, 255, .17); border: 1px solid rgba(255, 255, 255, .28);
}

/* ---------- card ---------- */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 15px;
  margin-bottom: 13px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.card.tight { padding: 13px; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; }
.step {
  flex: 0 0 auto; display: grid; place-items: center;
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 8px;
  background: linear-gradient(140deg, var(--pink), var(--violet));
  color: #fff; font-size: 10.5px; font-weight: 900; letter-spacing: -.2px;
  box-shadow: 0 4px 10px rgba(255, 77, 141, .3);
}
.card-head h2 { margin: 0; font-size: 14.5px; font-weight: 900; letter-spacing: -.4px; }
.card-head .sub { margin-left: auto; font-size: 10.5px; font-weight: 800; color: var(--muted); }
.card-head .sub b { color: var(--pink); }

/* ---------- source picker ---------- */
.picker { display: grid; grid-template-columns: 1fr 1fr 1.15fr; gap: 8px; }
.pick {
  position: relative; padding: 0; border: 2px solid transparent; border-radius: 15px;
  background: #fff; overflow: hidden; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.pick img, .pick .thumb-fallback { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #f1e9ff; }
.pick .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 5px;
  font-size: 9.5px; font-weight: 900; color: #fff; text-align: center; letter-spacing: -.2px;
  background: linear-gradient(to top, rgba(20, 10, 40, .72), rgba(20, 10, 40, 0));
}
.pick:hover { transform: translateY(-2px); }
.pick.active { border-color: var(--pink); box-shadow: 0 8px 20px rgba(255, 77, 141, .26); }
.pick.upload {
  display: grid; place-items: center; gap: 4px;
  background: repeating-linear-gradient(135deg, #fff 0 9px, #fdf2f8 9px 18px);
  border: 2px dashed rgba(255, 77, 141, .45);
  color: var(--pink);
}
.pick.upload .u-ico { font-size: 21px; line-height: 1; }
.pick.upload .u-txt { font-size: 10.5px; font-weight: 900; letter-spacing: -.2px; }
.pick.upload .u-sub { font-size: 8.5px; font-weight: 800; color: #c07b98; }
.pick.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- photo booth stage ---------- */
.stage-wrap { position: relative; }
.stage {
  position: relative; border-radius: 20px; overflow: hidden;
  background: linear-gradient(160deg, #2a2044, #120c22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 18px 34px rgba(24, 12, 48, .28);
  aspect-ratio: 4 / 4;
  display: grid; place-items: center;
}
.stage canvas { display: block; width: 100%; height: 100%; object-fit: contain; transition: filter .25s ease; }
.stage.locked canvas { filter: blur(1.1px) saturate(1.04); }
.stage.idle canvas { display: none; }
.stage .empty {
  position: absolute; inset: 0; display: grid; place-items: center; gap: 8px;
  color: #cfc6ea; text-align: center; font-size: 11.5px; font-weight: 800; line-height: 1.6;
  padding: 20px;
}
.stage .empty .big { font-size: 34px; }
.stage.idle .empty { display: grid; }
.stage:not(.idle) .empty { display: none; }

/* watermark tiled as DOM so it is crisp and never saves into the file */
.wm {
  position: absolute; inset: 0; display: none; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='120'%3E%3Ctext x='6' y='30' font-family='sans-serif' font-size='13' font-weight='bold' fill='rgba(255,255,255,0.55)'%3EAI STUDIO%3C/text%3E%3Ctext x='20' y='80' font-family='sans-serif' font-size='13' font-weight='bold' fill='rgba(255,255,255,0.42)'%3E990%EC%9B%90%3C/text%3E%3C/svg%3E");
  background-repeat: repeat; mix-blend-mode: overlay; opacity: .78;
}
.stage.locked .wm { display: block; }
.stage.locked::after {
  content: "🔒 무료 미리보기 · 워터마크";
  position: absolute; right: 9px; bottom: 9px; z-index: 3;
  padding: 5px 9px; border-radius: 999px;
  background: rgba(12, 6, 24, .62); border: 1px solid rgba(255, 255, 255, .24);
  color: #fff; font-size: 9.5px; font-weight: 900; letter-spacing: -.2px;
  backdrop-filter: blur(6px);
}

.stage-badge {
  position: absolute; left: 10px; top: 10px; z-index: 3;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .94); color: var(--ink);
  font-size: 10.5px; font-weight: 900; letter-spacing: -.2px;
  box-shadow: 0 6px 16px rgba(10, 4, 26, .28);
}
.stage-loading {
  position: absolute; inset: 0; z-index: 4; display: none; place-items: center;
  background: rgba(14, 8, 28, .46); color: #fff; font-size: 11.5px; font-weight: 900;
  backdrop-filter: blur(2px);
}
.stage-loading.on { display: grid; }
.stage-loading .spin {
  width: 26px; height: 26px; margin: 0 auto 8px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.stage-tools { display: flex; gap: 6px; margin-top: 9px; }
.stage-tools button { flex: 1; }

/* ---------- style rail ---------- */
.rail-head { display: flex; align-items: baseline; gap: 7px; margin: 2px 0 8px; }
.rail-head h3 { margin: 0; font-size: 12.5px; font-weight: 900; letter-spacing: -.3px; }
.rail-head span { font-size: 10px; font-weight: 800; color: var(--muted); }
.rail {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px;
}
.chip {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 3px 7px; border-radius: 14px; cursor: pointer;
  background: #fff; border: 2px solid rgba(30, 23, 48, .07);
  box-shadow: 0 3px 10px rgba(45, 25, 80, .06);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.chip .emoji { font-size: 19px; line-height: 1.1; }
.chip .nm { font-size: 9.5px; font-weight: 900; letter-spacing: -.35px; color: var(--ink-soft); text-align: center; line-height: 1.25; }
.chip:hover { transform: translateY(-2px); }
.chip:active { transform: scale(.97); }
.chip.active {
  border-color: var(--accent, var(--pink)); background: var(--accent-soft, var(--pink-soft));
  box-shadow: 0 8px 18px var(--accent-glow, rgba(255, 77, 141, .24));
}
.chip.active .nm { color: var(--ink); }
.chip.active::after {
  content: ""; position: absolute; inset: -2px; border-radius: 14px;
  border: 2px solid var(--accent, var(--pink)); opacity: .55; animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse { 0% { transform: scale(1); opacity: .5; } 100% { transform: scale(1.09); opacity: 0; } }

/* ---------- roulette ---------- */
.roulette {
  position: relative; width: 100%; margin-top: 10px; padding: 12px 14px;
  display: flex; align-items: center; gap: 11px;
  border: 0; border-radius: 18px; cursor: pointer; overflow: hidden;
  background: linear-gradient(135deg, #1f1240 0%, #4b2a8c 48%, #ff4d8d 140%);
  color: #fff; box-shadow: 0 14px 30px rgba(72, 36, 160, .34);
  transition: transform .15s ease, box-shadow .15s ease;
}
.roulette:hover { transform: translateY(-2px); box-shadow: 0 18px 36px rgba(72, 36, 160, .4); }
.roulette:active { transform: scale(.985); }
.roulette::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(70deg, rgba(255, 255, 255, .1) 0 8px, rgba(255, 255, 255, 0) 8px 20px);
  opacity: .8;
}
.roulette .rt-ico { font-size: 24px; line-height: 1; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .35)); }
.roulette .rt-body { position: relative; text-align: left; flex: 1; }
.roulette .rt-title { font-family: var(--font-display); font-size: 15.5px; letter-spacing: -.3px; }
.roulette .rt-sub { font-size: 10px; font-weight: 800; opacity: .8; margin-top: 1px; letter-spacing: -.2px; }
.roulette .rt-go {
  position: relative; flex: 0 0 auto; padding: 7px 11px; border-radius: 999px;
  background: #fff; color: #3a1f7a; font-size: 11px; font-weight: 900; letter-spacing: -.2px;
}
.roulette.spinning .rt-ico { animation: shake .28s linear infinite; }
@keyframes shake { 0%, 100% { transform: rotate(-9deg); } 50% { transform: rotate(9deg); } }

/* slot machine overlay inside stage */
.slot {
  position: absolute; inset: 0; z-index: 5; display: none;
  place-items: center; text-align: center; padding: 18px;
  background: radial-gradient(circle at 50% 40%, rgba(60, 26, 120, .92), rgba(10, 4, 24, .96));
  color: #fff;
}
.slot.on { display: grid; }
.slot .slot-lamp {
  display: flex; gap: 5px; justify-content: center; margin-bottom: 12px;
}
.slot .slot-lamp i {
  width: 7px; height: 7px; border-radius: 50%; background: #ffd76a; opacity: .45;
  animation: lamp 1s ease-in-out infinite;
}
.slot .slot-lamp i:nth-child(2) { animation-delay: .15s; }
.slot .slot-lamp i:nth-child(3) { animation-delay: .3s; }
.slot .slot-lamp i:nth-child(4) { animation-delay: .45s; }
.slot .slot-lamp i:nth-child(5) { animation-delay: .6s; }
@keyframes lamp { 0%, 100% { opacity: .3; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.15); } }
.slot .slot-window {
  min-width: 176px; padding: 12px 14px; border-radius: 16px;
  background: rgba(255, 255, 255, .1); border: 2px solid rgba(255, 255, 255, .28);
  box-shadow: inset 0 0 24px rgba(255, 255, 255, .16);
}
.slot .slot-emoji { font-size: 40px; line-height: 1.1; }
.slot .slot-name { font-family: var(--font-display); font-size: 17px; margin-top: 4px; letter-spacing: -.3px; }
.slot .slot-hint { margin-top: 11px; font-size: 11px; font-weight: 800; opacity: .82; letter-spacing: -.2px; }
.slot .slot-hint b { color: var(--lime); }

/* ---------- score ---------- */
.score-card {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, #fff 0%, #fff7fb 55%, #f4f0ff 100%);
  border: 1px solid rgba(124, 92, 255, .16);
}
.score-top { display: flex; align-items: center; gap: 12px; }
.dial { position: relative; width: 92px; height: 92px; flex: 0 0 auto; }
.dial svg { transform: rotate(-90deg); width: 92px; height: 92px; }
.dial .num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 27px; letter-spacing: -1px; color: var(--ink);
}
.dial .num small { font-family: var(--font); font-size: 10px; font-weight: 900; color: var(--muted); margin-left: 1px; }
.score-meta { flex: 1; min-width: 0; }
.grade-row { display: flex; align-items: center; gap: 6px; }
.grade {
  display: inline-grid; place-items: center; width: 25px; height: 25px; border-radius: 9px;
  font-family: var(--font-display); font-size: 15px; color: #fff;
  background: linear-gradient(140deg, #ffb03a, #ff5d8f); box-shadow: 0 5px 12px rgba(255, 120, 120, .35);
}
.grade.s { background: linear-gradient(140deg, #ffd166, #ff5d8f 60%, #7c5cff); }
.grade.a { background: linear-gradient(140deg, #8f7bff, #62b0ff); }
.grade.b { background: linear-gradient(140deg, #5fd6c0, #62b0ff); }
.score-meta .st-name { font-size: 13.5px; font-weight: 900; letter-spacing: -.4px; }
.score-meta .st-sub { font-size: 10px; font-weight: 800; color: var(--muted); margin-top: 1px; letter-spacing: -.2px; }
.meme {
  margin-top: 11px; padding: 11px 12px; border-radius: 14px;
  background: #fff; border: 1.5px dashed rgba(124, 92, 255, .3);
  font-size: 12px; font-weight: 800; line-height: 1.6; color: var(--ink-soft);
  letter-spacing: -.2px;
}
.meme b { color: var(--pink); }
.bar { height: 8px; border-radius: 99px; background: rgba(30, 23, 48, .08); overflow: hidden; margin-top: 9px; }
.bar > i {
  display: block; height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, var(--pink), var(--violet), var(--sky));
  transition: width .7s cubic-bezier(.2, .8, .2, 1);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 14px; border: 0; border-radius: 14px; cursor: pointer;
  font-family: var(--font); font-size: 12px; font-weight: 900; letter-spacing: -.2px;
  background: #fff; color: var(--ink); box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  transition: transform .14s ease, box-shadow .14s ease, opacity .14s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--pink), #ff7a5c);
  color: #fff; border-color: transparent; box-shadow: 0 10px 22px rgba(255, 77, 141, .34);
}
.btn-violet {
  background: linear-gradient(135deg, #6f4bff, #a06bff); color: #fff; border-color: transparent;
  box-shadow: 0 10px 22px rgba(124, 92, 255, .32);
}
.btn-kakao { background: #fee500; color: #3a1d1d; border-color: transparent; box-shadow: 0 8px 18px rgba(254, 229, 0, .35); }
.btn-ghost { background: rgba(255, 255, 255, .7); }
.btn-sm { padding: 8px 11px; font-size: 11px; border-radius: 11px; }
.btn-block { width: 100%; }

.share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 11px; }
.share-row .btn { font-size: 11.5px; padding: 10px 8px; }
.share-row .btn.wide { grid-column: 1 / -1; }

/* ---------- paywall ---------- */
.paywall { background: linear-gradient(160deg, #1d1338 0%, #2c1a58 55%, #43206b 100%); color: #fff; border: 0; overflow: hidden; }
.paywall::before {
  content: ""; position: absolute; width: 210px; height: 210px; right: -70px; top: -80px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 77, 141, .55), rgba(255, 77, 141, 0) 70%);
}
.paywall::after {
  content: ""; position: absolute; width: 190px; height: 190px; left: -70px; bottom: -90px; border-radius: 50%;
  background: radial-gradient(circle, rgba(98, 176, 255, .5), rgba(98, 176, 255, 0) 70%);
}
.paywall .pw-head { position: relative; display: flex; align-items: center; gap: 8px; }
.paywall .pw-head .lock-ico { font-size: 19px; }
.paywall { position: relative; }
.paywall .pw-head h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 16.5px; letter-spacing: -.2px; }
.paywall .price { position: relative; display: flex; align-items: baseline; gap: 7px; margin: 9px 0 2px; }
.paywall .price .won { font-family: var(--font-display); font-size: 30px; letter-spacing: -.8px; }
.paywall .price .strike { font-size: 11px; font-weight: 800; color: rgba(255, 255, 255, .45); text-decoration: line-through; }
.paywall .price .once { margin-left: auto; font-size: 10px; font-weight: 900; padding: 4px 8px; border-radius: 999px; background: rgba(201, 244, 94, .18); color: var(--lime); border: 1px solid rgba(201, 244, 94, .3); }
.paywall ul { position: relative; list-style: none; margin: 11px 0 13px; padding: 0; display: grid; gap: 6px; }
.paywall li { display: flex; align-items: flex-start; gap: 7px; font-size: 11.5px; font-weight: 700; line-height: 1.5; color: rgba(255, 255, 255, .88); }
.paywall li .ck { flex: 0 0 auto; color: var(--lime); font-size: 11px; margin-top: 1px; }
.paywall li.free .ck { color: var(--lime); }
.paywall li.paid .ck { color: #ffb3d1; }
.paywall .note { position: relative; font-size: 10px; font-weight: 700; color: rgba(255, 255, 255, .52); line-height: 1.55; margin-top: 9px; }
.paywall.unlocked { background: linear-gradient(160deg, #062e2a 0%, #0b4f45 60%, #0d7d68 100%); }
.paywall.unlocked .pw-head .lock-ico::after { content: ""; }

/* ---------- sheets ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(16, 8, 32, .5);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .22s ease; padding: 0;
}
.sheet-backdrop.on { opacity: 1; pointer-events: auto; }
.sheet {
  width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto;
  background: #fff; border-radius: 26px 26px 0 0; padding: 8px 16px 22px;
  transform: translateY(24px); transition: transform .26s cubic-bezier(.2, .8, .2, 1);
  box-shadow: 0 -18px 50px rgba(20, 8, 40, .3);
  -webkit-overflow-scrolling: touch;
}
.sheet-backdrop.on .sheet { transform: translateY(0); }
.sheet .grab { width: 38px; height: 4px; border-radius: 99px; background: rgba(30, 23, 48, .16); margin: 6px auto 12px; }
.sheet h2 { margin: 0 0 3px; font-family: var(--font-display); font-weight: 400; font-size: 19px; letter-spacing: -.4px; }
.sheet .sh-sub { margin: 0 0 13px; font-size: 11.5px; font-weight: 700; color: var(--muted); line-height: 1.55; }
.sheet .x {
  position: absolute; right: 14px; top: 14px; width: 30px; height: 30px; border-radius: 50%;
  border: 0; background: rgba(30, 23, 48, .06); color: var(--ink-soft); font-size: 15px; cursor: pointer;
}
.sheet-card { border-radius: 18px; border: 1px solid var(--line); padding: 13px; margin-bottom: 9px; }

.pay-row { display: grid; gap: 7px; margin: 12px 0; }
.pay-opt {
  display: flex; align-items: center; gap: 9px; padding: 11px 12px; cursor: pointer;
  border-radius: 13px; border: 2px solid rgba(30, 23, 48, .09); background: #fff;
  transition: border-color .15s ease, background .15s ease;
}
.pay-opt .pay-ico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; font-weight: 900; color: #fff; }
.pay-opt .pay-name { font-size: 12px; font-weight: 900; }
.pay-opt .pay-sub { font-size: 9.5px; font-weight: 800; color: var(--muted); }
.pay-opt .radio { margin-left: auto; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(30, 23, 48, .2); }
.pay-opt.on { border-color: var(--violet); background: #f7f4ff; }
.pay-opt.on .radio { border-color: var(--violet); background: radial-gradient(circle, var(--violet) 0 45%, transparent 46%); }

.pg-notice {
  display: none; margin-top: 10px; padding: 12px; border-radius: 14px;
  background: #fff6f0; border: 1.5px dashed rgba(255, 122, 92, .5);
  font-size: 11px; font-weight: 700; line-height: 1.6; color: #8a3c22;
}
.pg-notice.on { display: block; }
.pg-notice b { color: #d64b21; }

/* story card preview */
.story-wrap { display: grid; place-items: center; padding: 4px 0 10px; }
.story-wrap canvas {
  width: 212px; height: 377px; border-radius: 16px;
  box-shadow: 0 18px 34px rgba(30, 12, 60, .3), 0 0 0 6px #fff;
}

/* battle result */
.vs-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin: 6px 0 12px; }
.vs-side { text-align: center; }
.vs-side .who { font-size: 11px; font-weight: 900; color: var(--muted); letter-spacing: -.2px; }
.vs-side .pts { font-family: var(--font-display); font-size: 30px; letter-spacing: -1px; line-height: 1.1; }
.vs-side .st { font-size: 9.5px; font-weight: 800; color: var(--muted); margin-top: 1px; }
.vs-side.win .pts { color: var(--pink); }
.vs-side.win .who { color: var(--pink); }
.vs-mid { font-family: var(--font-display); font-size: 15px; color: var(--muted); }
.vs-verdict {
  text-align: center; padding: 13px; border-radius: 16px; margin-bottom: 11px;
  background: linear-gradient(140deg, #fff2f8, #f0ecff);
  font-family: var(--font-display); font-size: 19px; letter-spacing: -.4px;
}
.vs-verdict .sub { display: block; font-family: var(--font); font-size: 10.5px; font-weight: 800; color: var(--muted); margin-top: 3px; letter-spacing: -.2px; }
.vs-bar { display: grid; gap: 6px; margin-bottom: 12px; }
.vs-bar .row { display: flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 900; }
.vs-bar .row .nm { width: 52px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-bar .row .track { flex: 1; height: 9px; border-radius: 99px; background: rgba(30, 23, 48, .07); overflow: hidden; }
.vs-bar .row .track i { display: block; height: 100%; border-radius: 99px; }
.vs-bar .row.me .track i { background: linear-gradient(90deg, var(--pink), #ff9a5c); }
.vs-bar .row.them .track i { background: linear-gradient(90deg, #8f7bff, #62b0ff); }

/* score pop animation */
@keyframes pop { 0% { transform: scale(.72); opacity: .2; } 60% { transform: scale(1.06); } 100% { transform: scale(1); opacity: 1; } }
.pop { animation: pop .42s cubic-bezier(.2, .9, .2, 1) both; }

/* confetti */
.confetti { position: fixed; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; width: 7px; height: 12px; border-radius: 2px; animation: fall 1.5s ease-in forwards; }
@keyframes fall {
  0% { transform: translateY(-10vh) rotate(0); opacity: 1; }
  100% { transform: translateY(105vh) rotate(620deg); opacity: .1; }
}

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 90; transform: translate(-50%, 20px);
  padding: 11px 16px; border-radius: 999px;
  background: rgba(20, 10, 36, .92); color: #fff;
  font-size: 11.5px; font-weight: 900; letter-spacing: -.2px;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
  box-shadow: 0 14px 30px rgba(10, 4, 22, .34); max-width: 88vw; text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* footer */
.foot { padding: 6px 4px 0; text-align: center; font-size: 10px; font-weight: 700; color: var(--muted); line-height: 1.7; }
.foot a { color: var(--ink-soft); font-weight: 900; text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.foot .adnote { margin-top: 5px; font-size: 9px; opacity: .8; }

/* nickname row */
.nick-row { display: flex; align-items: center; gap: 7px; margin-top: 11px; }
.nick-row label { font-size: 10.5px; font-weight: 900; color: var(--muted); white-space: nowrap; }
.nick-row input {
  flex: 1; min-width: 0; padding: 8px 10px; border-radius: 10px;
  border: 1.5px solid var(--line); background: #fff;
  font-size: 11.5px; font-weight: 800; color: var(--ink); font-family: var(--font);
}
.nick-row input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(124, 92, 255, .12); }
.nick-hint { font-size: 9px; font-weight: 800; color: var(--muted); white-space: nowrap; }

/* tiny helpers */
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
