:root {
  --ink: #171326;
  --paper: #f7f4ed;
  --paper-deep: #ece7dc;
  --purple: #7c52ff;
  --purple-dark: #4d2ed8;
  --acid: #dfff4f;
  --pink: #ff7ec3;
  --muted: #716c7c;
  --line: rgba(23, 19, 38, .13);
  --shadow: 0 24px 70px rgba(30, 20, 60, .16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Noto Sans SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-x: none;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.noise {
  position: fixed; inset: 0; pointer-events: none; z-index: 99; opacity: .18; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
}
.shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }

.topbar {
  height: 78px; padding: 0 max(24px, calc((100vw - 1180px) / 2)); display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line); background: rgba(247,244,237,.86); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 30;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; letter-spacing: -.04em; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; color: white; background: var(--ink); border-radius: 50% 50% 44% 56%; transform: rotate(-6deg); font-size: 14px; }
nav { display: flex; align-items: center; gap: 30px; font-size: 13px; font-weight: 700; }
nav a { opacity: .66; transition: .2s; }
nav a:hover { opacity: 1; }
.mini-button { border: 1px solid var(--ink); background: transparent; border-radius: 999px; padding: 8px 12px; font-size: 12px; font-weight: 700; cursor: pointer; }
.mini-button span { display: inline-grid; place-items: center; min-width: 19px; height: 19px; margin-left: 4px; border-radius: 20px; background: var(--ink); color: white; }

.hero { min-height: 680px; display: grid; grid-template-columns: .96fr 1.04fr; align-items: center; gap: 40px; padding-top: 70px; padding-bottom: 90px; }
.eyebrow, .section-index { display: flex; align-items: center; gap: 8px; text-transform: uppercase; font-size: 11px; font-weight: 800; letter-spacing: .14em; color: var(--purple-dark); }
.eyebrow span { width: 8px; height: 8px; border-radius: 50%; background: var(--acid); border: 2px solid var(--ink); }
.hero h1 { margin: 20px 0 22px; font-size: clamp(52px, 6.2vw, 90px); line-height: .99; letter-spacing: -.08em; font-weight: 900; }
.hero h1 em { font-style: normal; color: var(--purple); position: relative; }
.hero h1 em::after { content: ""; position: absolute; height: 9px; left: 2px; right: 0; bottom: -3px; background: var(--acid); z-index: -1; transform: rotate(-1.5deg); }
.mobile-break { display: none; }
.hero-copy > p { max-width: 500px; line-height: 1.9; color: var(--muted); font-size: 15px; }
.hero-actions { display: flex; gap: 20px; align-items: center; margin-top: 34px; }
.primary-button, .secondary-button, .buy-button { border: 0; cursor: pointer; font-weight: 800; transition: transform .2s, box-shadow .2s, background .2s; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 20px; min-height: 52px; padding: 0 23px; color: white; background: var(--ink); border-radius: 14px; box-shadow: 6px 6px 0 var(--purple); }
.primary-button:hover { transform: translate(-2px,-2px); box-shadow: 9px 9px 0 var(--purple); }
.primary-button span { color: var(--acid); }
.text-button { border: 0; border-bottom: 1px solid currentColor; background: transparent; padding: 6px 0; font-weight: 700; font-size: 13px; cursor: pointer; }
.trust-row { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 28px; font-size: 11px; color: var(--muted); }

.hero-visual { min-height: 540px; position: relative; display: grid; place-items: center; isolation: isolate; }
.hero-visual::before { content: ""; position: absolute; width: 430px; height: 430px; border-radius: 50%; background: var(--purple); filter: saturate(.9); z-index: -3; }
.hero-visual::after { content: ""; position: absolute; width: 330px; height: 330px; border-radius: 50%; border: 1px dashed rgba(255,255,255,.6); z-index: -2; animation: spin 24s linear infinite; }
.orbit { position: absolute; border: 1px solid var(--ink); border-radius: 50%; z-index: -2; }
.orbit-one { width: 505px; height: 230px; transform: rotate(-20deg); }
.orbit-two { width: 480px; height: 190px; transform: rotate(35deg); border-style: dashed; opacity: .45; }
@keyframes spin { to { transform: rotate(360deg); } }
.idol-card { position: absolute; width: 258px; height: 388px; padding: 16px; background: #fffdf7; border: 1px solid var(--ink); border-radius: 18px; box-shadow: 12px 16px 0 rgba(23,19,38,.9); overflow: hidden; }
.card-main { z-index: 3; transform: rotate(3deg); }
.card-back-one { transform: translate(-120px, 25px) rotate(-16deg) scale(.86); z-index: 1; background: #ffd5e9; box-shadow: none; }
.card-back-two { transform: translate(125px, 35px) rotate(17deg) scale(.86); z-index: 2; background: #d6e5ff; box-shadow: none; }
.card-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: 900; }
.card-label small { font-size: 7px; letter-spacing: .1em; }
.portrait { height: 283px; border-radius: 10px; display: grid; place-items: center; overflow: hidden; position: relative; }
.portrait::before, .portrait::after { content: ""; position: absolute; border-radius: 50% 50% 42% 42%; }
.portrait::before { width: 134px; height: 175px; top: 44px; background: linear-gradient(150deg, #261a3e 0 52%, #7c52ff 53%); box-shadow: 0 22px 0 35px rgba(255,255,255,.35); }
.portrait::after { width: 77px; height: 96px; top: 70px; background: #ffd7c6; border-radius: 46% 46% 50% 50%; }
.portrait span { position: relative; z-index: 4; margin-top: 132px; padding: 5px 8px; background: var(--acid); border: 1px solid var(--ink); font-weight: 900; font-size: 11px; transform: rotate(-4deg); }
.portrait-lune { background: radial-gradient(circle at 32% 24%, #ffc6e5 0 10%, transparent 11%), linear-gradient(145deg,#ffc1df,#8f65ff 64%,#261a3e); }
.portrait-mira { background: linear-gradient(145deg,#ffe370,#ff7dbf); }
.portrait-sora { background: linear-gradient(145deg,#d5f6ff,#6797ff); }
.portrait-mira::before { background: linear-gradient(150deg, #562943 0 52%, #ff7dbf 53%); }
.portrait-sora::before { background: linear-gradient(150deg, #152b5a 0 52%, #6db5ff 53%); }
.signature { position: absolute; right: 19px; bottom: 49px; z-index: 8; font: italic 700 22px cursive; color: var(--purple-dark); transform: rotate(-8deg); }
.card-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; font-size: 10px; }
.card-bottom span { font-size: 6px; letter-spacing: .13em; }
.floating-pill { position: absolute; z-index: 10; padding: 10px 14px; background: white; border: 1px solid var(--ink); border-radius: 999px; box-shadow: 4px 5px 0 var(--ink); font-size: 11px; }
.pill-one { left: 8px; top: 85px; transform: rotate(-6deg); }
.pill-two { right: -1px; bottom: 65px; }
.live-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; background: #41d994; border-radius: 50%; box-shadow: 0 0 0 4px rgba(65,217,148,.18); }

.ticker { overflow: hidden; padding: 14px 0; border-block: 1px solid var(--ink); background: var(--acid); font-size: 12px; font-weight: 900; white-space: nowrap; }
.ticker div { width: max-content; animation: ticker 23s linear infinite; }
.ticker span { margin: 0 24px; }
@keyframes ticker { to { transform: translateX(-35%); } }

.calculator-section { padding: 110px 0 120px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 48px; }
.section-heading h2 { margin: 10px 0 0; font-size: clamp(35px,5vw,60px); line-height: 1; letter-spacing: -.06em; }
.section-heading > p { max-width: 430px; color: var(--muted); line-height: 1.8; font-size: 13px; }
.lab-grid { display: grid; grid-template-columns: .92fr 1.08fr; border: 1px solid var(--ink); border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); }
.control-panel { padding: 38px; background: #fffdf8; border-right: 1px solid var(--ink); }
.field-group { display: grid; gap: 10px; margin-bottom: 23px; }
.field-group label, .range-label label { font-size: 12px; font-weight: 800; }
.field-group > input, .number-input { height: 48px; border: 1px solid var(--line); background: var(--paper); border-radius: 10px; transition: border .2s, box-shadow .2s; }
.field-group > input { padding: 0 14px; width: 100%; outline: none; }
.field-group > input:focus, .number-input:focus-within { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(124,82,255,.1); }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.number-input { display: flex; align-items: center; padding: 0 13px; }
.number-input input { width: 100%; border: 0; outline: 0; background: transparent; font-weight: 800; }
.number-input span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.number-input.prefix { gap: 8px; }
.hint { width: 16px; height: 16px; padding: 0; border: 1px solid var(--muted); background: transparent; border-radius: 50%; color: var(--muted); font-size: 9px; cursor: help; position: relative; }
.hint:hover::after { content: attr(data-tip); position: absolute; left: -20px; bottom: 24px; width: 220px; padding: 9px 11px; color: white; background: var(--ink); border-radius: 8px; font-size: 10px; font-weight: 400; line-height: 1.5; text-align: left; z-index: 20; }
.range-field { padding: 7px 0 24px; }
.range-label { display: flex; justify-content: space-between; align-items: center; }
.range-label output { color: var(--purple-dark); font-size: 23px; font-weight: 900; }
input[type=range] { width: 100%; height: 5px; margin: 21px 0 8px; appearance: none; border-radius: 8px; background: linear-gradient(90deg,var(--purple) 0 5.5%,#ddd6e8 5.5%); }
input[type=range]::-webkit-slider-thumb { appearance: none; width: 20px; height: 20px; border: 3px solid white; border-radius: 50%; background: var(--purple); box-shadow: 0 0 0 1px var(--ink); cursor: grab; }
.range-ticks { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.budget-toggle { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 17px; margin-bottom: 20px; background: #f2eeff; border: 1px solid rgba(124,82,255,.22); border-radius: 12px; }
.budget-toggle div { display: grid; gap: 4px; }
.budget-toggle b { font-size: 12px; }
.budget-toggle small { color: var(--muted); font-size: 9px; }
.switch input { display: none; }
.switch span { display: block; width: 42px; height: 24px; padding: 3px; border-radius: 99px; background: #bdb8c8; cursor: pointer; transition: .2s; }
.switch span::after { content: ""; display: block; width: 18px; height: 18px; border-radius: 50%; background: white; transition: .2s; }
.switch input:checked + span { background: var(--purple); }
.switch input:checked + span::after { transform: translateX(18px); }
.budget-field.is-hidden { display: none; }

.result-panel { padding: 38px; background: var(--ink); color: white; }
.result-topline { display: flex; justify-content: space-between; align-items: center; font-size: 10px; letter-spacing: .12em; color: rgba(255,255,255,.55); text-transform: uppercase; }
.result-topline button { padding: 7px 10px; border: 1px solid rgba(255,255,255,.28); border-radius: 8px; background: transparent; color: white; font-size: 10px; cursor: pointer; }
.probability-wrap { display: grid; grid-template-columns: 190px 1fr; align-items: center; gap: 24px; margin: 34px 0; }
.probability-ring { --p: 1.65; width: 186px; height: 186px; padding: 11px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--acid) calc(var(--p) * 1%), rgba(255,255,255,.1) 0); }
.probability-ring::before { content: ""; grid-area: 1/1; width: 100%; height: 100%; border-radius: 50%; background: var(--ink); }
.probability-ring > div { grid-area: 1/1; z-index: 1; text-align: center; }
.probability-ring strong { font-size: 50px; line-height: 1; letter-spacing: -.06em; }
.probability-ring > div > span { color: var(--acid); font-size: 17px; }
.probability-ring small { display: block; margin-top: 6px; color: rgba(255,255,255,.5); font-size: 9px; }
.risk-badge { display: inline-block; padding: 5px 8px; border-radius: 6px; background: rgba(255,255,255,.1); color: var(--acid); font-size: 9px; font-weight: 800; }
.risk-badge.medium { color: #ffd36a; }
.risk-badge.high { color: #91f4ca; }
.probability-copy h3 { margin: 12px 0 9px; font-size: 21px; line-height: 1.35; }
.probability-copy p { margin: 0; color: rgba(255,255,255,.55); font-size: 11px; line-height: 1.7; }
.metric-grid { display: grid; grid-template-columns: repeat(3,1fr); padding: 19px 0; border-block: 1px solid rgba(255,255,255,.13); }
.metric-grid div { display: grid; gap: 5px; padding: 0 17px; border-right: 1px solid rgba(255,255,255,.13); }
.metric-grid div:first-child { padding-left: 0; }
.metric-grid div:last-child { border: 0; }
.metric-grid span, .metric-grid small { color: rgba(255,255,255,.45); font-size: 9px; }
.metric-grid strong { font-size: 18px; }
.metric-grid small.over { color: #ff8e9c; }
.compare-box { padding: 17px; margin: 22px 0; border-radius: 12px; background: rgba(255,255,255,.06); }
.compare-head { display: flex; justify-content: space-between; font-size: 11px; }
.compare-head span { color: var(--acid); }
.compare-track { height: 7px; margin: 15px 0 10px; background: rgba(255,255,255,.1); border-radius: 9px; position: relative; overflow: hidden; }
.compare-track span { position: absolute; inset-block: 0; left: 0; border-radius: 9px; transition: width .3s; }
#nextBar { background: rgba(223,255,79,.25); }
#currentBar { background: var(--acid); z-index: 1; }
.compare-box p { margin: 0; color: rgba(255,255,255,.48); font-size: 9px; line-height: 1.7; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.result-actions .primary-button { min-height: 48px; background: var(--acid); color: var(--ink); box-shadow: none; }
.result-actions .primary-button span { color: var(--purple-dark); }
.secondary-button { min-height: 48px; padding: 0 20px; border: 1px solid rgba(255,255,255,.25); border-radius: 14px; color: white; background: transparent; }
.secondary-button:hover { background: rgba(255,255,255,.08); }
.fine-print { text-align: center; color: rgba(255,255,255,.32); font-size: 8px; }

.how-section { padding: 0 0 120px; }
.section-heading.compact { margin-bottom: 36px; }
.steps { display: grid; grid-template-columns: repeat(3,1fr); border: 1px solid var(--ink); border-radius: 20px; overflow: hidden; }
.steps article { min-height: 250px; padding: 28px; border-right: 1px solid var(--ink); position: relative; background: #fffdf8; }
.steps article:last-child { border: 0; }
.steps article > span { position: absolute; right: 18px; top: 14px; color: rgba(23,19,38,.2); font-size: 11px; font-weight: 800; }
.step-icon { width: 50px; height: 50px; display: grid; place-items: center; margin-bottom: 45px; border: 1px solid var(--ink); border-radius: 50%; background: var(--acid); box-shadow: 4px 4px 0 var(--ink); font-size: 18px; font-weight: 900; }
.steps article:nth-child(2) .step-icon { background: var(--pink); }
.steps article:nth-child(3) .step-icon { background: #b7d6ff; }
.steps h3 { margin: 0 0 10px; font-size: 18px; }
.steps p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.8; }

.products-section { padding: 105px 0 120px; background: var(--purple); color: white; }
.section-heading.inverse .section-index { color: var(--acid); }
.section-heading.inverse > p { color: rgba(255,255,255,.67); }
.product-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 15px; align-items: stretch; }
.product-card { min-height: 430px; padding: 28px; display: flex; flex-direction: column; position: relative; border: 1px solid rgba(255,255,255,.5); border-radius: 18px; background: rgba(25,18,52,.23); }
.product-card.featured { color: var(--ink); background: var(--acid); border-color: var(--ink); box-shadow: 10px 10px 0 var(--ink); transform: translateY(-9px); }
.product-tag { position: absolute; right: 16px; top: 15px; padding: 5px 8px; border: 1px solid var(--ink); border-radius: 999px; font-size: 8px; font-weight: 800; }
.product-number { font-size: 9px; letter-spacing: .14em; opacity: .7; }
.product-card h3 { margin: 25px 0 12px; font-size: 26px; letter-spacing: -.04em; }
.product-card > p { min-height: 70px; font-size: 11px; line-height: 1.8; opacity: .7; }
.product-card ul { list-style: none; margin: 12px 0 30px; padding: 0; }
.product-card li { padding: 8px 0; border-bottom: 1px solid currentColor; font-size: 10px; opacity: .75; }
.product-card li::before { content: "✓"; margin-right: 8px; }
.product-bottom { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-top: auto; }
.product-bottom strong { font-size: 27px; }
.product-bottom small { font-size: 9px; opacity: .6; }
.buy-button { padding: 11px 14px; border: 1px solid currentColor; border-radius: 9px; background: transparent; color: inherit; font-size: 10px; }
.featured .buy-button { color: white; background: var(--ink); }

footer { padding: 55px 0; background: var(--ink); color: white; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 45px; }
.footer-grid > div { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.footer-grid p, .footer-grid a, .footer-grid span { font-size: 10px; color: rgba(255,255,255,.55); }
.footer-grid .brand > span:last-child { color: white; font-size: 15px; }
.footer-grid .brand-mark { background: var(--acid); color: var(--ink); }

.modal { width: min(500px, calc(100% - 32px)); padding: 35px; border: 1px solid var(--ink); border-radius: 20px; background: #fffdf8; box-shadow: 12px 12px 0 var(--ink); color: var(--ink); }
.modal::backdrop { background: rgba(18,13,35,.72); backdrop-filter: blur(7px); }
.modal-close { position: absolute; right: 16px; top: 13px; border: 0; background: transparent; font-size: 26px; cursor: pointer; }
.modal h2 { margin: 10px 0; font-size: 31px; letter-spacing: -.05em; }
.modal > p { color: var(--muted); font-size: 12px; line-height: 1.7; }
.sim-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 25px 0 10px; }
.sim-state.hidden { display: none; }
.album-stack { width: 92px; height: 110px; margin-bottom: 25px; position: relative; }
.album-stack span { position: absolute; inset: 0; border: 1px solid var(--ink); border-radius: 10px; background: var(--purple); animation: shuffle .7s infinite alternate; }
.album-stack span:nth-child(2) { background: var(--pink); animation-delay: -.2s; }
.album-stack span:nth-child(3) { background: var(--acid); animation-delay: -.4s; }
@keyframes shuffle { to { transform: translate(15px,-8px) rotate(8deg); } }
.sim-symbol { width: 78px; height: 78px; display: grid; place-items: center; margin-bottom: 25px; border: 1px solid var(--ink); border-radius: 50%; background: var(--acid); box-shadow: 6px 6px 0 var(--ink); font-size: 34px; }
.share-modal { width: min(570px, calc(100% - 32px)); }
.share-modal canvas { width: min(100%, 360px); display: block; margin: 22px auto; border-radius: 12px; box-shadow: var(--shadow); }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions .secondary-button { color: var(--ink); border-color: var(--line); }
.checkout-note { display: grid; gap: 7px; margin: 22px 0; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); font-size: 11px; }
.checkout-note span { color: var(--muted); line-height: 1.7; }
.checkout-modal .primary-button { width: 100%; margin-bottom: 16px; }
.checkout-modal .primary-button.disabled { opacity: .45; pointer-events: none; box-shadow: none; }
.checkout-modal > small { display: block; color: var(--muted); font-size: 9px; line-height: 1.6; }
.history-list { display: grid; gap: 10px; max-height: 360px; overflow: auto; margin: 20px 0; }
.history-item { display: grid; grid-template-columns: 1fr auto; gap: 7px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; }
.history-item b { font-size: 12px; }
.history-item span, .history-item small { color: var(--muted); font-size: 9px; }
.history-item strong { grid-row: 1 / 3; grid-column: 2; align-self: center; color: var(--purple-dark); font-size: 20px; }
.empty-history { padding: 50px 20px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; color: var(--muted); font-size: 11px; }
.danger { color: #bc3151; }
.toast { position: fixed; left: 50%; bottom: 30px; z-index: 100; padding: 11px 16px; border-radius: 9px; background: var(--ink); color: white; font-size: 11px; opacity: 0; transform: translate(-50%,12px); transition: .25s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 70px; }
  .hero-copy { text-align: center; }
  .hero-copy > p { margin-inline: auto; }
  .hero-actions, .trust-row { justify-content: center; }
  .hero-visual { min-height: 520px; }
  .lab-grid { grid-template-columns: 1fr; }
  .control-panel { border-right: 0; border-bottom: 1px solid var(--ink); }
  .product-grid { grid-template-columns: 1fr; gap: 22px; }
  .product-card.featured { transform: none; }
  .shell { width: min(100% - 32px,1180px); }
}

@media (max-width: 640px) {
  .shell { width: min(100% - 26px,1180px); }
  .topbar { height: auto; min-height: calc(66px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(14px,env(safe-area-inset-right)) 0 max(14px,env(safe-area-inset-left)); }
  .topbar nav a { display: none; }
  .topbar nav { gap: 0; flex-shrink: 0; }
  .topbar .mini-button { white-space: nowrap; padding: 7px 9px; font-size: 10px; }
  .brand { font-size: 13px; flex-shrink: 0; }
  .brand-mark { width: 31px; height: 31px; }
  .hero { min-height: auto; padding: 55px 0 65px; }
  .hero-copy { min-width: 0; }
  .hero h1 { font-size: clamp(43px, 12.3vw, 51px); overflow-wrap: anywhere; }
  .hero h1 em { display: inline-block; }
  .mobile-break { display: block; }
  .hero-actions { flex-direction: column; }
  .hero-visual { min-height: 455px; transform: scale(.82); margin: -28px -35px; }
  .pill-one { left: -5px; }
  .pill-two { right: -5px; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 20px; }
  .calculator-section { padding: 80px 0; }
  .control-panel, .result-panel { padding: 24px 18px; }
  .two-fields { grid-template-columns: 1fr; gap: 0; }
  .probability-wrap { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .metric-grid { grid-template-columns: 1fr; gap: 14px; }
  .metric-grid div, .metric-grid div:first-child { padding: 0; border-right: 0; }
  .result-actions { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .steps article { border-right: 0; border-bottom: 1px solid var(--ink); }
  .footer-grid { grid-template-columns: 1fr; }
  .modal { padding: 29px 20px; }
}

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

/* Reverse fansign game */
.hidden { display: none !important; }
.game-lobby-grid { grid-template-columns: .9fr 1.1fr; }
.lobby-block { margin-bottom: 25px; }
.block-label { display: block; margin-bottom: 11px; font-size: 12px; font-weight: 800; }
.persona-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.persona-option { min-height: 86px; padding: 13px; display: grid; grid-template-columns: 32px 1fr; grid-template-rows: 1fr 1fr; align-items: center; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); cursor: pointer; transition: .2s; }
.persona-option > span { grid-row: 1 / 3; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: white; }
.persona-option b { font-size: 11px; }
.persona-option small { color: var(--muted); font-size: 8px; }
.persona-option.selected { border-color: var(--purple); background: #eee9ff; box-shadow: 0 0 0 2px rgba(124,82,255,.12); }
.signature-style-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; }
.signature-style { min-height: 48px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--muted); font: italic 700 15px cursive; cursor: pointer; }
.signature-style.selected { border-color: var(--ink); background: var(--acid); color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.game-note { margin-top: 7px; }
.original-seal { padding: 5px 7px; border: 1px solid var(--purple); color: var(--purple-dark); border-radius: 4px; font-size: 7px; font-weight: 900; letter-spacing: .12em; transform: rotate(-4deg); }
.lobby-start { width: 100%; margin-top: 2px; }
.lobby-preview { display: flex; flex-direction: column; }
.event-poster { min-height: 225px; margin: 25px 0; padding: 28px; position: relative; overflow: hidden; border: 1px solid rgba(255,255,255,.25); border-radius: 17px; background: linear-gradient(135deg,#f39dcc 0 42%,#7450ef 42% 100%); }
.event-poster::before { content:""; position:absolute; width:220px; height:220px; right:-60px; top:-75px; border: 1px solid rgba(255,255,255,.55); border-radius:50%; box-shadow: 0 0 0 34px rgba(255,255,255,.08),0 0 0 68px rgba(255,255,255,.06); }
.poster-copy { height: 100%; display: flex; flex-direction: column; align-items: flex-start; position: relative; z-index: 3; }
.poster-copy small { font-size: 8px; letter-spacing: .16em; }
.poster-copy strong { max-width: 58%; margin: auto 0 6px; font-size: 43px; line-height: .9; letter-spacing: -.06em; word-break: break-all; }
.poster-copy span { font-size: 8px; letter-spacing: .13em; }
.poster-face { position: absolute; right: 20px; bottom: -30px; width: 180px; height: 220px; background: rgba(255,255,255,.12); transform: rotate(6deg); }
.poster-face::before { top: 25px; }
.poster-face::after { top: 52px; }
.poster-face span { margin-top: 95px; }
.poster-stamp { position: absolute; right: 16px; top: 13px; z-index: 5; padding: 7px 10px; border: 2px solid var(--acid); color: var(--acid); border-radius: 5px; text-align: center; font-size: 9px; font-weight: 900; line-height: 1.1; transform: rotate(9deg); }
.queue-title { display: flex; justify-content: space-between; align-items: center; margin: 0 0 10px; }
.queue-title b { font-size: 12px; }
.queue-title span { color: rgba(255,255,255,.42); font-size: 8px; }
.queue-list { display: grid; gap: 7px; }
.queue-person { min-height: 48px; display: grid; grid-template-columns: 24px 34px 1fr 8px; align-items: center; gap: 9px; padding: 6px 10px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; background: rgba(255,255,255,.04); }
.queue-person > span { color: rgba(255,255,255,.35); font-size: 9px; }
.queue-avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg,var(--guest),rgba(255,255,255,.15)); color: var(--ink); font-weight: 900; font-size: 11px; }
.queue-person > div:nth-child(3) { display: grid; gap: 1px; }
.queue-person b { font-size: 10px; }
.queue-person small { color: rgba(255,255,255,.4); font-size: 7px; }
.queue-person > i { width: 6px; height: 6px; border-radius: 50%; background: var(--guest); }
.lobby-metrics { margin-top: auto; padding-top: 21px; }
.lobby-metrics strong { font-size: 13px; }

.guest-collection { display: grid; grid-template-columns: repeat(4,1fr); gap: 13px; }
.collection-card { min-height: 315px; padding: 13px 13px 22px; border: 1px solid var(--ink); border-radius: 16px; background: #fffdf8; position: relative; overflow: hidden; transition: transform .2s,box-shadow .2s; }
.collection-card.unlocked:hover { transform: translateY(-5px); box-shadow: 7px 8px 0 var(--ink); }
.collection-portrait { height: 205px; margin-bottom: 17px; background: linear-gradient(145deg,var(--guest),#7652e5); }
.collection-card > small { color: var(--purple-dark); font-size: 7px; letter-spacing: .1em; }
.collection-card h3 { margin: 7px 0 4px; font-size: 18px; }
.collection-card p { margin: 0; color: var(--muted); font-size: 9px; }
.collection-card.locked { background: #e8e4dc; }
.collection-card.locked .collection-portrait { background: #cbc5ce; filter: grayscale(1); }
.collection-card.locked .collection-portrait::before { background: #615c68; }
.collection-card.locked .collection-portrait::after { background: #aaa4ad; }

.game-modal { width: min(1080px,calc(100% - 28px)); height: min(780px,calc(100% - 28px)); padding: 0; overflow: hidden; border: 1px solid var(--ink); border-radius: 21px; background: var(--paper); color: var(--ink); box-shadow: 14px 16px 0 rgba(15,10,32,.85); }
.game-modal::backdrop { background: rgba(18,13,35,.82); backdrop-filter: blur(10px); }
.game-topbar { height: 68px; padding: 0 22px; display: grid; grid-template-columns: 1fr 240px 1fr; align-items: center; border-bottom: 1px solid var(--ink); background: #fffdf8; }
.game-brand { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.game-brand .brand-mark { width: 28px; height: 28px; }
.round-indicator { display: grid; gap: 6px; text-align: center; font-size: 9px; font-weight: 800; }
.round-track { height: 4px; overflow: hidden; border-radius: 9px; background: var(--paper-deep); }
.round-track i { display: block; height: 100%; background: var(--purple); transition: width .3s; }
.game-exit { justify-self: end; border: 0; background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }
.game-statbar { height: 55px; padding: 0 24px; display: flex; align-items: center; gap: 30px; background: var(--ink); color: white; }
.game-statbar > div { display: flex; align-items: center; gap: 8px; }
.game-statbar span { color: rgba(255,255,255,.55); font-size: 9px; }
.game-statbar b { color: var(--acid); font-size: 15px; }
.game-statbar .timer { min-width: 190px; margin-left: auto; position: relative; }
.timer i { position: absolute; left: 0; right: 0; height: 3px; bottom: -9px; background: var(--pink); transition: width 1s linear; }
.game-body { height: calc(100% - 123px); display: grid; grid-template-columns: 38% 62%; }
.guest-profile-panel { padding: 27px; display: grid; grid-template-rows: 1fr auto auto; position: relative; overflow: hidden; color: white; background: var(--purple); }
.guest-profile-panel::before { content:""; position:absolute; width:360px; height:360px; border: 1px solid rgba(255,255,255,.3); border-radius:50%; left:-120px; top:-130px; box-shadow: 0 0 0 50px rgba(255,255,255,.05),0 0 0 100px rgba(255,255,255,.04); }
.guest-polaroid { width: 235px; height: 335px; margin: 5px auto 10px; padding: 12px 12px 48px; position: relative; z-index: 2; border: 1px solid var(--ink); border-radius: 13px; background: #fffdf8; box-shadow: 9px 11px 0 var(--ink); transform: rotate(-3deg); }
.guest-polaroid .portrait { height: 100%; background: linear-gradient(145deg,var(--guest),#7254d9); }
.guest-signature { position: absolute; right: 20px; bottom: 15px; color: var(--purple-dark); font: italic 700 18px cursive; transform: rotate(-5deg); }
.guest-meta { position: relative; z-index: 2; }
.guest-meta span { font-size: 7px; letter-spacing: .13em; opacity: .7; }
.guest-meta h2 { margin: 5px 0 2px; font-size: 30px; }
.guest-meta p { margin: 0; font-size: 10px; opacity: .68; }
.mini-queue { display: flex; gap: 8px; margin-top: 18px; position: relative; z-index: 2; }
.mini-queue span { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; font-size: 8px; }
.mini-queue span.current { background: var(--acid); color: var(--ink); border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.mini-queue span.done { background: rgba(255,255,255,.25); }
.encounter-panel { padding: 30px 38px; overflow-y: auto; background: #fffdf8; }
.encounter-panel, .game-end { -webkit-overflow-scrolling: touch; }
.arrival-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; }
.speech-card { margin: 20px 0; padding: 22px; border: 1px solid var(--line); border-left: 5px solid var(--purple); border-radius: 12px; background: var(--paper); }
.speech-card small { color: var(--purple-dark); font-size: 8px; font-weight: 800; }
.speech-card p { margin: 9px 0 0; font-size: 16px; font-weight: 700; line-height: 1.65; }
.encounter-panel > h3 { margin: 20px 0 13px; font-size: 13px; }
.choice-list { display: grid; gap: 9px; }
.choice-list button { min-height: 48px; padding: 8px 13px; display: grid; grid-template-columns: 31px 1fr auto; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; background: white; text-align: left; font-size: 11px; font-weight: 700; cursor: pointer; transition: .17s; }
.choice-list button:hover { border-color: var(--purple); background: #f1edff; transform: translateX(4px); }
.choice-list button > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; background: var(--paper); color: var(--purple-dark); font-size: 9px; }
.choice-list button i { color: var(--purple); font-style: normal; }
.reaction-box { min-height: 80px; margin: 15px 0; padding: 14px; display: flex; align-items: center; gap: 14px; border: 1px solid #c8baf6; border-radius: 12px; background: #f1edff; }
.reaction-box > span { width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--ink); border-radius: 50%; background: var(--acid); box-shadow: 3px 3px 0 var(--ink); font-size: 19px; }
.reaction-box div { display: grid; gap: 4px; }
.reaction-box b { font-size: 11px; }
.reaction-box p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.signing-area { padding-top: 6px; }
.signing-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.signing-head > div { display: grid; gap: 3px; }
.signing-head b { font-size: 10px; }
.signing-head small { color: var(--muted); font-size: 8px; }
.signing-head button { border: 0; background: transparent; color: var(--purple-dark); font-size: 9px; cursor: pointer; }
#signCanvas { width: 100%; height: 120px; display: block; border: 1px solid var(--ink); border-radius: 11px; background: #fffdf8; touch-action: none; cursor: crosshair; }
.signing-area .primary-button { width: 100%; min-height: 44px; margin-top: 10px; box-shadow: 4px 4px 0 var(--purple); }
.game-end { height: calc(100% - 68px); padding: 38px; display: flex; flex-direction: column; align-items: center; text-align: center; overflow-y: auto; background: radial-gradient(circle at 50% 15%,#f1ebff,transparent 36%),#fffdf8; }
.end-grade { width: 105px; height: 105px; display: grid; place-items: center; margin: 16px 0 5px; border: 1px solid var(--ink); border-radius: 50%; background: var(--acid); box-shadow: 8px 8px 0 var(--ink); font-size: 57px; font-weight: 900; }
.game-end h2 { margin: 15px 0 8px; font-size: 35px; letter-spacing: -.06em; }
.game-end > p { max-width: 620px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.8; }
.end-stats { width: min(520px,100%); display: grid; grid-template-columns: repeat(3,1fr); margin: 20px 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.end-stats div { padding: 12px; display: grid; gap: 3px; border-right: 1px solid var(--line); }
.end-stats div:last-child { border: 0; }
.end-stats span { color: var(--muted); font-size: 8px; }
.end-stats b { font-size: 19px; }
.visitor-strip { display: flex; justify-content: center; margin-bottom: 20px; }
.visitor-strip .portrait { width: 64px; height: 78px; margin-left: -7px; border: 3px solid white; box-shadow: 0 2px 7px rgba(0,0,0,.15); }
.visitor-strip .portrait:first-child { margin-left: 0; }
.visitor-strip .portrait::before { width: 40px; height: 52px; top: 10px; box-shadow: none; }
.visitor-strip .portrait::after { width: 24px; height: 31px; top: 18px; }
.visitor-strip .portrait span { margin-top: 35px; padding: 2px 3px; font-size: 6px; }
.end-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 13px; }
.end-actions .secondary-button { color: var(--ink); border-color: var(--line); }

@media (max-width: 900px) {
  .game-lobby-grid { grid-template-columns: 1fr; }
  .guest-collection { grid-template-columns: 1fr 1fr; }
  .game-modal { height: calc(100% - 16px); width: calc(100% - 16px); }
  .game-body { grid-template-columns: 34% 66%; }
  .guest-polaroid { width: 190px; height: 280px; }
}

@media (max-width: 640px) {
  .persona-grid { grid-template-columns: 1fr 1fr; }
  .hero-visual { width: 100%; margin: -28px 0; overflow: clip; }
  .persona-option { min-height: 76px; padding: 10px; }
  .event-poster { min-height: 205px; }
  .poster-copy strong { font-size: 36px; }
  .guest-collection { grid-template-columns: 1fr 1fr; gap: 8px; }
  .collection-card { min-height: 255px; padding: 9px 9px 16px; }
  .collection-portrait { height: 158px; }
  .game-modal { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; border: 0; border-radius: 0; }
  .game-topbar { height: calc(58px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(12px,env(safe-area-inset-right)) 0 max(12px,env(safe-area-inset-left)); grid-template-columns: 1fr 110px auto; }
  .game-brand b { max-width: 110px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 9px; }
  .game-brand .brand-mark { width: 24px; height: 24px; }
  .game-statbar { height: 47px; padding: 0 10px; gap: 13px; }
  .game-statbar span { font-size: 7px; }
  .game-statbar b { font-size: 12px; }
  .game-statbar .timer { min-width: 68px; }
  .game-statbar .timer span { display: none; }
  .game-body { height: calc(100% - 105px - env(safe-area-inset-top)); grid-template-columns: 1fr; grid-template-rows: 215px minmax(0,1fr); }
  .guest-profile-panel { padding: 13px; grid-template-columns: 125px 1fr; grid-template-rows: 1fr auto; }
  .guest-polaroid { width: 116px; height: 166px; margin: 0; padding: 7px 7px 27px; box-shadow: 5px 6px 0 var(--ink); }
  .guest-polaroid .portrait::before { width: 75px; height: 98px; top: 22px; box-shadow: none; }
  .guest-polaroid .portrait::after { width: 43px; height: 54px; top: 38px; }
  .guest-polaroid .portrait span { margin-top: 74px; padding: 3px 5px; font-size: 7px; }
  .guest-signature { right: 10px; bottom: 7px; font-size: 11px; }
  .guest-meta { align-self: center; padding-left: 14px; }
  .guest-meta h2 { font-size: 25px; }
  .mini-queue { grid-column: 1 / 3; margin: 7px 0 0; }
  .encounter-panel { padding: 18px max(14px,env(safe-area-inset-right)) calc(30px + env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left)); }
  .speech-card { margin: 12px 0; padding: 15px; }
  .speech-card p { font-size: 13px; }
  .choice-list button { min-height: 47px; font-size: 10px; }
  #signCanvas { height: 105px; }
  .game-end { height: calc(100% - 58px - env(safe-area-inset-top)); padding: 24px max(16px,env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left)); }
  .game-end h2 { font-size: 29px; }
  .end-actions { grid-template-columns: 1fr; width: 100%; }
}

/* Thai GL / BL roster and local custom uploads */
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-option { min-height: 78px; padding: 11px; display: grid; grid-template-columns: 46px 1fr; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); text-align: left; cursor: pointer; transition: .2s; }
.mode-option > span { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--ink); border-radius: 50%; background: white; font-size: 11px; font-weight: 900; }
.mode-option > div { display: grid; gap: 4px; }
.mode-option b { font-size: 10px; }
.mode-option small { color: var(--muted); font-size: 7px; line-height: 1.5; }
.mode-option.selected { border-color: var(--purple); background: #eee9ff; box-shadow: 0 0 0 2px rgba(124,82,255,.12); }
.mode-option.selected > span { color: var(--ink); background: var(--acid); box-shadow: 3px 3px 0 var(--ink); }
.collection-actions { display: flex; align-items: center; gap: 12px; }
.collection-tabs { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #fffdf8; }
.collection-tabs button { padding: 8px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 9px; font-weight: 800; cursor: pointer; }
.collection-tabs button.selected { color: white; background: var(--ink); }
.secondary-dark-button { min-height: 38px; padding: 0 13px; border: 1px solid var(--ink); border-radius: 9px; background: var(--acid); font-size: 9px; font-weight: 800; cursor: pointer; box-shadow: 3px 3px 0 var(--ink); }
.source-disclaimer { margin: -24px 0 30px; padding: 12px 14px; border-left: 3px solid var(--purple); background: #eee9ff; color: var(--muted); font-size: 9px; line-height: 1.7; }
.source-disclaimer strong { display: block; margin-top: 4px; color: var(--purple-dark); font-size: 8px; }
.real-person-card { min-height: 348px; }
.delete-custom { position: absolute; right: 8px; top: 8px; z-index: 12; width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid var(--ink); border-radius: 50%; background: #fffdf8; font-size: 15px; cursor: pointer; }
.real-person-card .collection-portrait { position: relative; background-size: cover; background-position: center top; }
.real-person-card .collection-portrait > i { position: absolute; right: 8px; top: 8px; z-index: 8; padding: 4px 6px; border: 1px solid var(--ink); border-radius: 999px; background: var(--acid); color: var(--ink); font-size: 6px; font-style: normal; font-weight: 900; }
.real-person-card > em { display: block; margin-top: 10px; color: #9a94a2; font-size: 6px; font-style: normal; line-height: 1.5; }
.real-person-card > em a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.real-portrait.has-photo::before, .real-portrait.has-photo::after { display: none; }
.real-portrait.has-photo > span { display: none; }
.guest-polaroid .real-portrait.has-photo { background-size: cover; background-position: center top; }
.guest-meta > a { display: block; margin-top: 7px; color: rgba(255,255,255,.58); font-size: 6px; line-height: 1.5; text-decoration: underline; }
.custom-actor-modal { width: min(600px,calc(100% - 26px)); }
.custom-actor-modal form { margin-top: 24px; }
.custom-actor-modal select, .custom-actor-modal textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); outline: none; }
.custom-actor-modal select { height: 48px; padding: 0 12px; }
.custom-actor-modal textarea { min-height: 86px; padding: 12px; resize: vertical; }
.custom-actor-modal input[type=file] { height: auto; padding: 11px; }
.custom-actor-modal .field-group > small { color: var(--muted); font-size: 8px; line-height: 1.6; }
.custom-actor-modal .primary-button { width: 100%; }

@media (max-width: 640px) {
  .mode-grid { grid-template-columns: 1fr; }
  .mode-option { min-height: 66px; }
  .collection-actions { align-items: stretch; flex-direction: column; margin-top: 18px; }
  .collection-tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .source-disclaimer { margin-top: -18px; }
  .real-person-card { min-height: 278px; }
  .real-person-card > em { display: none; }
  .custom-actor-modal .two-fields { grid-template-columns: 1fr; }
}

@media (pointer: coarse) {
  button, .primary-button, .secondary-button, .buy-button, .mini-button { min-height: 44px; }
  input, select { min-height: 44px; }
  .choice-list button { min-height: 52px; }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .topbar { padding-left: max(20px,env(safe-area-inset-left)); padding-right: max(20px,env(safe-area-inset-right)); }
  nav { gap: 16px; }
  .calculator-section { padding-top: 90px; }
  .guest-collection { grid-template-columns: repeat(3,1fr); }
  .game-modal { width: calc(100% - 20px); height: calc(100vh - 20px); height: calc(100dvh - 20px); }
}
