:root {
  --black: #0a0505;
  --deep: #120808;
  --card: rgba(18, 8, 8, 0.92);
  --text: #f0e6e6;
  --muted: rgba(240, 230, 230, 0.52);
  --line: rgba(196, 30, 58, 0.28);
  --crimson: #c41e3a;
  --blood: #8b0000;
  --neon: #ff1744;
  --blood-text: #ff2a4a;
  --blood-dark: #6b0010;
  --blood-smear: rgba(139, 0, 0, 0.55);
  --err: #ff5252;
  --glow: rgba(255, 23, 68, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

@font-face {
  font-family: 'DSJapanCyr';
  src: url('/fonts/dsjapancyr.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

html, body {
  min-height: 100%;
  background: var(--black);
  color: var(--text);
  font-family: 'DSJapanCyr', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(196, 30, 58, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 40% 30% at 85% 15%, rgba(139, 0, 0, 0.12) 0%, transparent 50%),
    linear-gradient(180deg, #050303 0%, var(--deep) 45%, #1a0808 100%);
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.04) 2px,
    rgba(0, 0, 0, 0.04) 4px
  );
}

.moon {
  position: absolute;
  top: 6%;
  right: 10%;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff5f0, #ffd4cc 40%, rgba(196, 30, 58, 0.5) 100%);
  box-shadow: 0 0 50px rgba(196, 30, 58, 0.35);
  opacity: 0.7;
}

.torii {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, 95vw);
  height: 140px;
  opacity: 0.08;
}

.torii::before,
.torii::after {
  content: '';
  position: absolute;
  background: var(--crimson);
}

.torii::before {
  top: 0;
  left: 0;
  right: 0;
  height: 12px;
  box-shadow: 0 24px 0 var(--crimson);
}

.torii::after {
  bottom: 0;
  left: 18%;
  width: 10px;
  height: 100%;
  box-shadow: calc(min(480px, 95vw) * 0.64) 0 0 var(--crimson);
}

.petals { position: absolute; inset: 0; }

.petal {
  position: absolute;
  top: -16px;
  background: radial-gradient(ellipse, #ff6b8a 0%, var(--crimson) 60%, var(--blood) 100%);
  border-radius: 150% 0 150% 0;
  opacity: 0;
  animation: petal-fall linear infinite;
}

@keyframes petal-fall {
  0% { opacity: 0; transform: translateY(0) rotate(0deg); }
  10% { opacity: 0.85; }
  100% { opacity: 0; transform: translateY(110vh) rotate(720deg) translateX(60px); }
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 400px;
  margin: 0 auto;
  padding: 3rem 1.5rem 3.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

@font-face {
  font-family: 'Maximage Gimbadong';
  src: url('/fonts/maximage-gimbadong.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

.brand {
  flex: 1;
  min-width: 0;
  max-width: calc(100% - 4.25rem);
}

.brand-logo {
  margin: 0;
  line-height: 1;
  overflow: hidden;
}

.logo-mark {
  display: inline-block;
  max-width: 100%;
  text-decoration: none;
  position: relative;
}

.logo-text {
  display: block;
  position: relative;
  font-family: 'Maximage Gimbadong', serif;
  font-size: clamp(1.25rem, 5vw, 1.75rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1;
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  color: #e01030;
  text-shadow:
    0 0 12px rgba(255, 23, 68, 0.65),
    0 0 24px rgba(139, 0, 0, 0.35),
    0 1px 0 #3a0008,
    0 0 1px rgba(255, 80, 100, 0.5);
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.logo-mark:hover .logo-text {
  color: #ff1744;
  text-shadow:
    0 0 28px rgba(255, 23, 68, 0.95),
    0 0 48px rgba(139, 0, 0, 0.55),
    0 2px 0 #3a0008;
  filter: none;
}

.logo-mark::before {
  content: '';
  position: absolute;
  left: -4%;
  right: -4%;
  bottom: -0.1rem;
  height: 45%;
  background: radial-gradient(ellipse at 50% 100%, rgba(196, 30, 58, 0.14) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

/* blood-red accent labels */
.tagline,
label,
.copy-label,
section h2,
.page-title,
.quote-live-note {
  color: var(--blood-text);
  text-shadow:
    0 0 10px rgba(255, 23, 68, 0.35),
    0 1px 0 var(--blood-dark);
}

.tagline {
  margin-top: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lang {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.lang-btn {
  border: 1px solid transparent;
  background: none;
  color: var(--muted);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
}

.lang-btn:hover { color: var(--text); border-color: var(--line); }
.lang-btn.active {
  color: var(--neon);
  border-color: rgba(255, 23, 68, 0.4);
}

.spa-hero {
  margin-bottom: 2.25rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.spa-hero.hidden { display: none !important; }

.spa-motto {
  margin: 0 0 1.1rem;
  padding: 0.1rem 0 0.1rem 0.95rem;
  border-left: 2px solid rgba(196, 30, 58, 0.45);
  quotes: none;
}

.spa-motto-line {
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0.04em;
  color: rgba(240, 230, 230, 0.58);
}

.spa-motto-line--accent {
  margin-top: 0.2rem;
  color: rgba(240, 230, 230, 0.82);
  text-shadow: 0 0 18px rgba(196, 30, 58, 0.12);
}

.spa-motto-line--coda {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: rgba(240, 230, 230, 0.5);
  letter-spacing: 0.05em;
}

.spa-sub {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.65;
}

.panel { padding: 0; }

.field { margin-bottom: 1.75rem; }

label {
  display: block;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

input {
  width: 100%;
  padding: 0.55rem 0;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  font-size: 1.0625rem;
  font-weight: 400;
  color: var(--text);
  background: transparent;
}

input::placeholder { color: rgba(240, 230, 230, 0.25); }
input:focus {
  outline: none;
  border-bottom-color: var(--neon);
  box-shadow: 0 1px 0 var(--neon);
}
input.invalid { border-bottom-color: var(--err); }

.payout-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.payout-tab {
  border: 1px solid var(--line);
  background: rgba(196, 30, 58, 0.06);
  color: var(--muted);
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.payout-tab:hover:not(:disabled) {
  border-color: rgba(255, 23, 68, 0.45);
  color: var(--text);
}

.payout-tab.active {
  color: #fff;
  border-color: var(--neon);
  background: rgba(196, 30, 58, 0.2);
  box-shadow: 0 0 16px rgba(255, 23, 68, 0.2);
}

.payout-tab:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.amount-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

.amount-row input { flex: 1; min-width: 0; }

.limit-btn {
  flex-shrink: 0;
  padding: 0.35rem 0;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.limit-btn:hover { color: var(--neon); }

.amount-hint {
  font-size: 0.6875rem;
  color: var(--muted);
  margin-top: 0.45rem;
  min-height: 1rem;
}

.amount-hint.err { color: var(--err); }

.quote {
  font-size: 0.8125rem;
  color: var(--muted);
  padding: 1.15rem;
  border: 1px solid var(--line);
  background: var(--card);
  margin: 0 0 1.75rem;
  min-height: 3.5rem;
}

.quote .val {
  color: #fff;
  font-weight: 600;
  text-shadow: 0 0 12px var(--glow);
}

.quote .fiat { font-size: 0.6875rem; color: var(--muted); margin-top: 0.2rem; }

button.submit {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--neon);
  border-radius: 0;
  background: linear-gradient(135deg, var(--crimson) 0%, var(--blood) 100%);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(255, 23, 68, 0.25);
  transition: opacity 0.15s, box-shadow 0.15s;
}

button.submit:hover {
  box-shadow: 0 0 32px rgba(255, 23, 68, 0.45);
}

button.submit:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  box-shadow: none;
}

.alert {
  font-size: 0.8125rem;
  color: var(--err);
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 82, 82, 0.35);
  background: rgba(255, 82, 82, 0.08);
}

.hidden { display: none !important; }

.order-panel { display: none; }
.order-panel.visible { display: block; }

.order-head {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.order-id {
  font-size: 0.6875rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-top: 0.35rem;
  font-variant-numeric: tabular-nums;
}

.progress-bar {
  height: 2px;
  background: var(--line);
  margin-bottom: 1.5rem;
}

.progress-bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blood), var(--neon));
  box-shadow: 0 0 8px var(--glow);
  transition: width 0.4s ease;
}

.timeline { list-style: none; margin: 0 0 1.5rem; padding: 0; }

.timeline li {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: 0 0.85rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}

.timeline li:last-child { border-bottom: none; }

.tl-dot {
  font-size: 0.625rem;
  color: var(--line);
  padding-top: 0.15rem;
}

.timeline li.done .tl-dot,
.timeline li.active .tl-dot { color: var(--neon); }
.timeline li.failed .tl-dot { color: var(--err); }

.tl-label { font-size: 0.8125rem; font-weight: 500; }
.tl-hint { font-size: 0.6875rem; color: var(--muted); margin-top: 0.15rem; }
.timeline li.pending .tl-label { color: var(--muted); font-weight: 400; }
.timeline li.active .tl-label { font-weight: 600; color: #fff; }

.status-msg { font-size: 0.8125rem; margin-bottom: 1.25rem; line-height: 1.45; }
.status-msg.err { color: var(--err); }
.status-msg.ok { color: var(--neon); }

.badge {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--neon);
}

.badge.done { color: var(--muted); }
.badge.err { color: var(--err); }

.order-section.deposit-card {
  padding: 1.25rem;
  border: 1px solid rgba(255, 23, 68, 0.45);
  background: var(--card);
  box-shadow: 0 0 30px rgba(255, 23, 68, 0.12);
}

.deposit-kicker {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--neon);
  margin-bottom: 1.25rem;
}

.copy-field + .copy-field {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.copy-label {
  display: block;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

.copy-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.copy-row-stack { flex-direction: column; align-items: stretch; }

.copy-value {
  flex: 1;
  min-width: 0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
}

.copy-value.amount-line {
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 0.35rem;
  white-space: nowrap;
}

.amount-num { font-variant-numeric: tabular-nums; }
.amount-unit { font-size: 0.8125rem; color: var(--muted); }
.amount-prefix { font-size: 0.9375rem; color: var(--muted); }

.copy-value.mono,
.mono {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.55;
  word-break: break-all;
}

.addr-display {
  font-family: ui-monospace, monospace;
  font-size: 0.8125rem;
  line-height: 1.65;
  word-break: break-all;
}

.addr-edge {
  font-weight: 600;
  color: var(--neon);
  background: rgba(196, 30, 58, 0.25);
  padding: 0.05em 0.15em;
}

.addr-mid { color: var(--muted); }

.qr-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.qr-wrap img {
  display: block;
  width: 180px;
  height: 180px;
  padding: 8px;
  background: #fff;
  image-rendering: pixelated;
}

.copy-btn {
  flex-shrink: 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  background: rgba(196, 30, 58, 0.1);
  color: var(--text);
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.copy-btn:hover { border-color: var(--neon); color: var(--neon); }

.copy-btn.copied {
  border-color: var(--neon);
  background: var(--crimson);
  color: #fff;
}

.copy-meta {
  font-size: 0.6875rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.quote-live-note {
  line-height: 1.45;
}

.deposit-note {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.6875rem;
  color: var(--muted);
  line-height: 1.5;
}

.order-section.receive-card { margin-top: 1.5rem; }

.link-btn {
  display: block;
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.9rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.link-btn:hover { border-color: var(--neon); color: var(--neon); }

.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.footnote {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.625rem;
  color: var(--muted);
  line-height: 1.6;
  letter-spacing: 0.04em;
}

.footnote a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footnote a:hover { color: var(--neon); }

/* subpages */
.page-title {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
}

.lead {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 2rem;
  line-height: 1.6;
}

section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

section:last-of-type { border-bottom: none; }

section h2 {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

section p, section li { font-size: 0.8125rem; }
section p + p { margin-top: 0.65rem; }
section ul, section ol { margin-top: 0.5rem; padding-left: 1.1rem; }
section li + li { margin-top: 0.4rem; }

.flow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1.25rem 0 0.5rem;
}

.flow-node {
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--line);
  color: var(--neon);
}

.flow-line {
  width: 1rem;
  height: 1px;
  background: var(--line);
}

.flow-caption {
  font-size: 0.6875rem;
  color: var(--muted);
  text-align: center;
  margin-top: 0.45rem;
}

.fee-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8125rem;
  padding: 0.45rem 0;
  border-top: 1px solid var(--line);
}

.fee-row:first-child { border-top: none; }
.fee-row span:last-child { text-align: right; color: var(--muted); }

.note { font-size: 0.6875rem; color: var(--muted); margin-top: 0.75rem; }

.back {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.6875rem;
  color: var(--muted);
  text-decoration: none;
}

.back:hover { color: var(--neon); }

.slug-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.slug-row:focus-within { border-bottom-color: var(--neon); }
.slug-row span { color: var(--muted); padding: 0.55rem 0; }
.slug-row input { border: none; padding-left: 0; }

.avail { font-size: 0.6875rem; margin-top: 0.35rem; }
.avail.ok { color: var(--neon); }
.avail.bad { color: var(--err); }

.hint { font-size: 0.6875rem; color: var(--muted); margin-top: 0.35rem; }

.link-box {
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  word-break: break-all;
  margin-bottom: 0.85rem;
  color: var(--neon);
}

.ok-block {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.ok-block h2 {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
}

@media (max-width: 480px) {
  .moon { width: 40px; height: 40px; top: 4%; right: 6%; }
  .wrap { padding-top: 2.25rem; }
}
