:root {
  --ink: #16121A;
  --muted: #6E6873;
  --faint: #A8A1AB;
  --line: #ECE9EE;
  --soft: #F5F3F6;
  --accent: #E5484D;
  --accent-soft: #FDEDED;
  --good: #1F9D6B;
  --good-soft: #E8F6EF;
  --mid: #C98400;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: #fff; color: var(--ink); font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
.wrap { max-width: 480px; margin: 0 auto; padding: 0 20px; }
.center { text-align: center; }

.top { display: flex; justify-content: center; padding: 22px 20px 0; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; color: var(--ink); text-decoration: none; }
.logo-mark { width: 24px; height: 24px; border-radius: 7px; background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 24s-7-4.3-7-9.2A3.9 3.9 0 0 1 16 12.6a3.9 3.9 0 0 1 7 2.2C23 19.7 16 24 16 24z' fill='%23E5484D'/%3E%3C/svg%3E") center/100% no-repeat; }

/* landing */
#landing { padding-top: 44px; text-align: center; }
h1 { font-size: clamp(32px, 8vw, 42px); line-height: 1.1; letter-spacing: -.03em; font-weight: 700; }
.lead { color: var(--muted); font-size: 17px; margin: 12px auto 28px; max-width: 400px; }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slot { position: relative; aspect-ratio: 4/5; border-radius: 14px; overflow: hidden; background: var(--soft); border: 0; display: grid; place-items: center; cursor: pointer; color: var(--faint); font-size: 26px; font-weight: 300; padding: 0; transition: background .15s, color .15s; }
.slot:hover { background: #EEEAF0; color: var(--ink); }
.slot.filled { cursor: default; }
.slot img { width: 100%; height: 100%; object-fit: cover; }
.slot .x { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(22, 18, 26, .65); color: #fff; font-size: 15px; line-height: 1; cursor: pointer; }
.hint { color: var(--muted); font-size: 13.5px; margin: 10px 0 22px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--soft); border-radius: 12px; padding: 3px; gap: 3px; margin-top: 8px; }
.seg button { border: 0; background: transparent; padding: 10px 6px; border-radius: 9px; font: 500 14.5px var(--sans); color: var(--muted); cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(22, 18, 26, .12); }
.link-btn { background: none; border: 0; color: var(--ink); font: 500 14.5px var(--sans); margin-top: 18px; cursor: pointer; padding: 4px; }
.link-btn span { color: var(--faint); font-weight: 400; }
textarea { width: 100%; margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 16px; color: var(--ink); resize: vertical; outline: none; }
textarea:focus { border-color: var(--ink); }

.btn { display: block; width: 100%; margin-top: 20px; padding: 16px 18px; border: 0; border-radius: 14px; background: var(--ink); color: #fff; font: 600 16px var(--sans); cursor: pointer; text-align: center; text-decoration: none; transition: opacity .15s, transform .1s; }
.btn:hover { opacity: .9; }
.btn:active { transform: scale(.99); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.small { width: auto; display: inline-block; padding: 8px 14px; font-size: 13.5px; margin-top: 12px; border-radius: 10px; }
.fine { color: var(--faint); font-size: 12.5px; margin-top: 12px; line-height: 1.6; }
.error { color: var(--accent); font-size: 14px; margin-top: 12px; }

/* loading */
#loading { padding: 70px 0; }
.deck { height: 300px; display: grid; place-items: center; }
.deck-card { width: 230px; height: 280px; border-radius: 22px; background: #fff; border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(22, 18, 26, .08); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; text-align: center; }
.ld-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; font-size: 26px; font-weight: 600; margin-bottom: 14px; }
.ld-name { font-weight: 600; font-size: 18px; }
.ld-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.flip-r { animation: swr 2.6s ease-in-out; }
.flip-l { animation: swl 2.6s ease-in-out; }
@keyframes swr { 0%, 62% { transform: none; opacity: 1 } 92% { transform: translateX(160px) rotate(12deg); opacity: 0 } 100% { opacity: 0 } }
@keyframes swl { 0%, 62% { transform: none; opacity: 1 } 92% { transform: translateX(-160px) rotate(-12deg); opacity: 0 } 100% { opacity: 0 } }

/* result */
#result { padding: 32px 0 20px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.score { text-align: center; padding: 28px 20px 22px; }
.ring { --p: .5; width: 136px; height: 136px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; position: relative; background: conic-gradient(var(--ring, var(--accent)) calc(var(--p) * 360deg), var(--soft) 0); }
.ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #fff; }
.ring span { position: relative; font-size: 48px; font-weight: 700; letter-spacing: -.03em; }
.ring small { font-size: 16px; font-weight: 500; color: var(--muted); }
.score.good .ring { --ring: var(--good); }
.score.mid .ring { --ring: var(--mid); }
.score-label { color: var(--muted); font-size: 14px; margin-top: 12px; }
.headline { font-size: 20px; font-weight: 600; line-height: 1.35; letter-spacing: -.01em; margin-top: 14px; }
.res-h { font-size: 19px; font-weight: 700; letter-spacing: -.01em; margin: 34px 0 12px; }
.swipers, .photos, .rewrites, .upgrades, .fixes { display: grid; gap: 8px; }
.swiper { border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: grid; grid-template-columns: 36px 1fr; gap: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 14px; background: var(--soft); color: var(--muted); }
.swiper.r .avatar { background: var(--good-soft); color: var(--good); }
.swiper.l .avatar { background: var(--accent-soft); color: var(--accent); }
.who { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.who b { font-size: 15px; }
.type { color: var(--muted); font-size: 13px; }
.swiper p { margin-top: 6px; font-size: 15px; }
.pill { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.swiper.r .pill, .photo.lead .pill { background: var(--good-soft); color: var(--good); }
.swiper.l .pill, .photo.cut .pill { background: var(--accent-soft); color: var(--accent); }
.swiper.locked p { filter: blur(5px); user-select: none; color: var(--faint); }
.unlock { margin-top: 24px; border: 1.5px solid var(--ink); padding: 22px; text-align: center; }
.unlock h2 { font-size: 21px; letter-spacing: -.01em; }
.unlock .price { font-size: 40px; font-weight: 700; letter-spacing: -.03em; margin: 6px 0 14px; }
.unlock .price span { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; text-align: left; font-size: 15px; }
.ticks li { display: flex; gap: 10px; }
.ticks li::before { content: ""; width: 18px; height: 18px; margin-top: 2px; flex: none; border-radius: 50%; background: var(--good-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.5l2.5 2.5L14 7.5' stroke='%231F9D6B' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100%; }
.secure { color: var(--faint); font-size: 12.5px; margin-top: 10px; }
.fixes { counter-reset: fx; list-style: none; padding: 0; margin: 0; }
.fixes li { counter-increment: fx; border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px 13px 50px; position: relative; font-size: 15px; }
.fixes li::before { content: counter(fx); position: absolute; left: 14px; top: 13px; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; display: grid; place-items: center; }
.photo { display: grid; grid-template-columns: 84px 1fr; gap: 14px; border: 1px solid var(--line); border-radius: 14px; padding: 10px; align-items: start; }
.photo img, .noimg { width: 84px; height: 105px; object-fit: cover; border-radius: 10px; background: var(--soft); }
.photo p { margin-top: 6px; font-size: 14px; color: var(--muted); }
.photo.cut img { filter: grayscale(.6); opacity: .8; }
.rw-q { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.before { color: var(--faint); text-decoration: line-through; margin-top: 6px; font-size: 14px; }
.after { margin-top: 6px; }
.ba { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ba figure { margin: 0; }
.ba img, .spinner { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 12px; background: var(--soft); display: block; }
.spinner { display: grid; place-items: center; color: var(--muted); font-size: 14px; padding: 10px; text-align: center; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .55 } }
figcaption { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.up p { margin-top: 10px; font-size: 15px; }
.again { text-align: center; margin-top: 30px; }
.again a { color: var(--ink); font-weight: 600; font-size: 15px; }

.foot { max-width: 480px; margin: 48px auto 0; padding: 20px 20px calc(28px + env(safe-area-inset-bottom)); text-align: center; font-size: 13px; }
.foot a { color: var(--faint); }
.legal { text-align: left; color: var(--muted); display: grid; gap: 10px; margin-top: 14px; }
.seg-label { text-align: left; font-size: 13px; font-weight: 500; color: var(--muted); margin: 14px 0 0 2px; }
.hint + .seg-label { margin-top: 0; }

.visually-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
label.slot { cursor: pointer; }
.slot.loading { background: var(--soft); }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--ink); animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.add-many { margin-top: 10px; padding: 12px; font-size: 15px; }
.badge { display: inline-block; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 4px 10px; border-radius: 99px; margin-bottom: 10px; }
.unlock .pitch { color: var(--muted); font-size: 15px; margin: 8px auto 16px; max-width: 360px; }
.ex { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ex figure { margin: 0; position: relative; }
.ex img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 12px; display: block; }
.ex figcaption { position: absolute; left: 8px; top: 8px; background: rgba(255,255,255,.92); color: var(--ink); font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; margin: 0; }
.ex-cap { color: var(--faint); font-size: 12.5px; margin-top: 6px; }
.mine { margin-top: 16px; }
.mine p { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.mine-row { display: flex; gap: 8px; justify-content: center; }
.mine-img { position: relative; width: 72px; height: 90px; border-radius: 10px; overflow: hidden; }
.mine-img img { width: 100%; height: 100%; object-fit: cover; }
.mine-img span { position: absolute; right: 4px; bottom: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; display: grid; place-items: center; }
.also { text-align: left; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.also h3 { font-size: 14px; color: var(--muted); font-weight: 600; margin: 0 0 10px; }
.price-row { display: flex; align-items: center; gap: 14px; justify-content: center; margin-top: 20px; }
.price-row .price { margin: 0; }
.price-note { text-align: left; font-size: 13px; color: var(--muted); line-height: 1.4; }
.price-note span { color: var(--faint); font-size: 12px; }
.btn.accent { background: var(--accent); }

.potential { margin-top: 12px; display: inline-block; background: var(--good-soft); color: var(--good); font-size: 14px; padding: 6px 12px; border-radius: 99px; }
.potential b { font-weight: 700; }
.jump { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 2px 0 16px; }
.jump div { display: flex; flex-direction: column; align-items: center; }
.jump span { font-size: 34px; font-weight: 700; letter-spacing: -.03em; color: var(--muted); line-height: 1; }
.jump .to span { color: var(--good); }
.jump small { font-size: 12px; color: var(--muted); margin-top: 4px; }
.jump i { font-style: normal; font-size: 24px; color: var(--faint); }
.why { font-size: 14px; color: var(--muted); margin-top: 18px; text-align: left; }
.spinner.static { animation: none; }

.case { margin-top: 56px; padding-top: 36px; border-top: 1px solid var(--line); text-align: center; }
.case-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.case h2 { font-size: 30px; letter-spacing: -.02em; margin: 6px 0 8px; }
.case-sub { color: var(--muted); font-size: 15px; margin-bottom: 22px; }
.case-row { border: 1px solid var(--line); border-radius: 18px; padding: 14px; text-align: left; }
.case-row.case-after { border: 1.5px solid var(--good); box-shadow: 0 10px 30px rgba(31,157,107,.10); }
.case-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.case-head b { font-size: 15px; }
.case-score { font-weight: 700; font-size: 14px; padding: 4px 10px; border-radius: 99px; }
.case-score.low { background: var(--accent-soft); color: var(--accent); }
.case-score.good { background: var(--good-soft); color: var(--good); }
.case-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.case-photos img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 10px; display: block; background: var(--soft); }
.case-row.case-before .case-photos img { filter: saturate(.9); }
.case-bio { margin-top: 10px; background: var(--soft); border-radius: 12px; padding: 10px 12px; font-size: 14.5px; }
.case-bio span { display: block; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
.case-notes { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; font-size: 13.5px; }
.case-notes li::before { margin-right: 8px; font-weight: 700; }
.case-notes.bad li::before { content: "✕"; color: var(--accent); }
.case-notes.good li::before { content: "✓"; color: var(--good); }
.case-arrow { font-size: 22px; color: var(--faint); margin: 8px 0; }
.case .btn { margin-top: 22px; }
.case-foot { color: var(--faint); font-size: 12px; margin-top: 10px; }
.case-tag { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--soft); padding: 3px 8px; border-radius: 99px; text-transform: uppercase; letter-spacing: .04em; }

.peek-wrap { margin: 4px 0 6px; text-align: center; }
.peek-wrap .btn { margin-top: 0; }
.peek-sub { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.unlock.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(229,72,77,.55); } 40% { box-shadow: 0 0 0 10px rgba(229,72,77,.18); } 100% { box-shadow: 0 0 0 0 rgba(229,72,77,0); } }

.small-link { font-size: 13px; color: var(--muted); margin-top: 8px; text-decoration: underline; }
.code-row { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.code-row input { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font: inherit; font-size: 16px; width: 170px; text-transform: uppercase; }
.code-row .btn { margin-top: 0; }

.summary { display: grid; gap: 14px; }
.sum-block h3 { font-size: 14px; margin: 0 0 6px; }
.sum { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 14.5px; }
.sum li { display: flex; gap: 8px; }
.sum.pro li::before { content: "✓"; color: var(--good); font-weight: 700; }
.sum.con li::before { content: "✕"; color: var(--accent); font-weight: 700; }
