:root {
  --bg: #0e1016;
  --outer: #07080c;
  --card: #171a22;
  --ink: #f6f7fb;
  --muted: #a7adba;
  --faint: #7d8494;
  --line: rgba(255, 255, 255, 0.08);
  --pink: #ff007a;
  --pink-2: #fc72ff;
  --danger: #ff8b98;
  --sans: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "PingFang SC", "Hiragino Sans", "Noto Sans SC", "Noto Sans JP", "Noto Sans KR", "Noto Naskh Arabic", "Noto Sans Thai", "Noto Sans Devanagari", sans-serif;
  --mono: "Cascadia Mono", "Segoe UI Mono", ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(90% 50% at 50% -10%, rgba(255, 0, 122, 0.28), transparent 60%),
    var(--outer);
  line-height: 1.45;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button, a, input, select, textarea { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--pink-2); outline-offset: 2px; }
[hidden] { display: none !important; }

.app {
  width: min(100%, 480px);
  min-height: 100dvh;
  margin: 0 auto;
  background:
    radial-gradient(80% 32% at 90% 0%, rgba(252, 114, 255, 0.16), transparent 55%),
    var(--bg);
}

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: rgba(14, 16, 22, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { width: 36px; height: 36px; flex: none; }
.brand strong { display: block; font-size: 16px; letter-spacing: -0.03em; }
.brand small { display: block; color: var(--muted); font-size: 12px; font-weight: 650; }
.lang-btn {
  max-width: 46%;
  min-height: 40px;
  padding: 0 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: var(--card);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hero { padding: 18px 16px 0; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 0, 122, 0.12);
  color: #ffd0e6;
  font-size: 12px;
  font-weight: 800;
}
.hero h1 {
  margin: 12px 0 0;
  font-size: 40px;
  line-height: 1.04;
  letter-spacing: -0.045em;
  font-weight: 750;
}
.hero h1 .grad {
  display: block;
  background: linear-gradient(100deg, #fff 10%, #ffd0e8 38%, #ff007a 78%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.panel {
  margin-top: 4px;
  padding: 16px 16px 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #141a22;
}
.copy { margin: 12px 0 0; color: #c9ced8; font-size: 14px; line-height: 1.65; }
.panel .steps { margin-top: 8px; }

.block { padding: 26px 16px 0; }
.sec-title { margin: 0; font-size: 20px; letter-spacing: -0.03em; }
.sec-sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

.field { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; margin-top: 12px; }
.chips { max-width: 100%; }
.block, .hero, .top, .card { min-width: 0; max-width: 100%; }
.lbl { display: block; margin-bottom: 6px; color: #d5d8e2; font-size: 13px; font-weight: 700; }
.req::after { content: " *"; color: var(--pink); }
input, select, textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: #0e1016;
  font-size: 16px;
}
textarea { min-height: 88px; resize: vertical; }
select {
  width: 0;
  min-width: 100%;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 7l5 6 5-6' fill='none' stroke='%23c8cdd8' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-inline-end: 40px;
}
[dir="rtl"] select { background-position: left 14px center; }
input.bad, select.bad, textarea.bad { border-color: var(--danger); }
.plats.bad { outline: 1px solid var(--danger); border-radius: 16px; }
#market, #ladder, #platforms, #apply, #viewsInput { scroll-margin-top: 76px; }
.warn, .err { margin: 6px 0 0; font-size: 12px; line-height: 1.4; }
.warn { color: var(--faint); }
.err { color: var(--danger); }
.err:empty { display: none; }
.text-btn {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: #ff8ac4;
  font-size: 13px;
  font-weight: 800;
  min-height: 32px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: var(--card);
}
.chip.is-on { border-color: var(--pink); background: var(--pink); color: white; }

.steps { margin-top: 4px; }
.step { display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding: 10px 0; }
.num {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ff007a;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}
.step h3 { margin: 2px 0 0; font-size: 16px; }
.step p { margin: 4px 0 0; color: #b7bdc9; font-size: 14px; line-height: 1.55; }

.ticket {
  position: relative;
  margin-top: 14px;
  padding: 16px;
  padding-inline-start: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 0, 122, 0.18), rgba(255, 0, 122, 0) 46%),
    var(--card);
  overflow: hidden;
}
.ticket::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline-start: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--pink-2), var(--pink));
}
.kicker { margin: 0; color: #ffb3d4; font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.payline { display: flex; align-items: flex-end; gap: 8px; margin-top: 4px; }
.payline strong {
  font-size: 56px;
  line-height: 0.9;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
.payline span { margin-bottom: 6px; color: #ffb3d4; font-weight: 800; }
.dots { display: flex; gap: 6px; margin: 14px 0 8px; }
.dots i { width: 28px; height: 6px; border-radius: 99px; background: #2c3140; display: block; }
.dots i.on { background: linear-gradient(90deg, var(--pink), var(--pink-2)); }
.note { margin: 0; color: var(--muted); font-size: 13px; }

.ladder { margin-top: 8px; }
.tier {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  text-align: start;
}
.tier span { color: var(--muted); font-size: 14px; }
.tier strong { display: flex; align-items: center; gap: 6px; font-size: 16px; font-variant-numeric: tabular-nums; }
.tier.is-on { border-color: rgba(255, 0, 122, 0.7); background: rgba(255, 0, 122, 0.12); }
.tier.is-on span, .tier.is-on strong { color: white; }
.max {
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border: 1px solid rgba(255, 0, 122, 0.45);
  border-radius: 999px;
  color: #ff8ac4;
}

.plats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.plat {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  text-align: start;
}
.plat i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 8px;
  background: #262a36;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
}
.plat.is-on { border-color: rgba(255, 0, 122, 0.75); background: rgba(255, 0, 122, 0.12); }

.sample {
  margin: 12px 0 0;
  padding: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: #12141c;
  white-space: pre-wrap;
  font: inherit;
  line-height: 1.55;
}
.linkrow { margin: 10px 0 0; font-size: 14px; }
a { color: #ff8ac4; }

.rules { margin: 12px 0 0; padding-inline-start: 18px; }
.rules li { margin: 8px 0; color: #d7dae4; font-size: 14px; }
.rules li::marker { color: var(--pink); }

.card {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
}
.summary {
  margin: 12px 0 0;
  padding: 12px;
  border-radius: 14px;
  background: #0e1016;
  font-size: 14px;
}
.segs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.segs button {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: #0e1016;
  font-weight: 800;
}
.segs button.is-on { border-color: var(--pink); background: rgba(255, 0, 122, 0.16); }

.btn-primary, .btn-ghost {
  min-height: 48px;
  border-radius: 14px;
  font-weight: 800;
}
.btn-primary {
  width: 100%;
  border: 0;
  background: linear-gradient(180deg, #ff4aa2, #ff007a);
  color: white;
  box-shadow: 0 10px 24px rgba(255, 0, 122, 0.25);
}
.btn-primary:active { transform: scale(0.99); }
.btn-ghost {
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
}
.btn-ghost.wide { width: 100%; }
.row-btns { display: grid; gap: 8px; margin-top: 12px; }
.form-actions { margin-top: 16px; }

.receipt {
  margin: 12px 0 0;
  padding: 12px;
  border-radius: 12px;
  background: #0e1016;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
}
.success h3 { margin: 0; font-size: 22px; }
.success p { color: var(--muted); }

.rec {
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}
.rec-top { display: flex; justify-content: space-between; gap: 8px; }
.rec-top b { color: #ff8ac4; white-space: nowrap; }
.meta { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.addr { margin: 2px 0 0; color: var(--faint); font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.rec-actions { display: flex; gap: 8px; margin-top: 10px; }
.empty { margin: 8px 0 0; color: var(--muted); }

footer {
  padding: 22px 16px calc(108px + env(safe-area-inset-bottom));
  color: var(--faint);
  font-size: 12px;
}
footer p { margin: 0; }
#footerContact { margin-top: 8px; }

.dock {
  position: fixed;
  z-index: 6;
  left: 50%;
  bottom: 0;
  width: min(100%, 480px);
  transform: translateX(-50%);
  background: rgba(14, 16, 22, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.dock-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
}
.dock-inner span { display: block; color: var(--faint); font-size: 12px; }
.dock-inner strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.dock .btn-primary { width: auto; min-width: 112px; min-height: 46px; padding: 0 16px; box-shadow: none; }

.sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.56);
}
.sheet-card {
  width: min(100%, 480px);
  max-height: min(78dvh, 640px);
  display: flex;
  flex-direction: column;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  background: #141821;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head h2 { margin: 0; font-size: 18px; }
.sheet-card input { margin: 12px 0; }
.lang-list { overflow: auto; }
.lang-item {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: start;
}
.lang-item.is-on { background: rgba(255, 0, 122, 0.14); }

.toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  width: max-content;
  max-width: calc(100% - 32px);
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: 999px;
  background: white;
  color: #141821;
  font-weight: 800;
}

@media (max-width: 360px) {
  .hero h1 { font-size: 34px; }
  .payline strong { font-size: 46px; }
}
@media (hover: hover) {
  .tier:hover, .plat:hover, .chip:hover, .lang-item:hover { background: #212533; }
  .chip.is-on:hover, .plat.is-on:hover, .tier.is-on:hover { background: rgba(255, 0, 122, 0.2); }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
