@font-face { font-family: 'Forum'; src: url('/fonts/forum-latin.woff2') format('woff2'); font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Forum'; src: url('/fonts/forum-cyrillic.woff2') format('woff2'); font-display: swap; unicode-range: U+0400-04FF; }
@font-face { font-family: 'Golos'; font-weight: 400; src: url('/fonts/golos-latin-400.woff2') format('woff2'); font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Golos'; font-weight: 400; src: url('/fonts/golos-cyrillic-400.woff2') format('woff2'); font-display: swap; unicode-range: U+0400-04FF; }
@font-face { font-family: 'Golos'; font-weight: 600; src: url('/fonts/golos-latin-600.woff2') format('woff2'); font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Golos'; font-weight: 600; src: url('/fonts/golos-cyrillic-600.woff2') format('woff2'); font-display: swap; unicode-range: U+0400-04FF; }

:root {
  color-scheme: dark;
  --bg: #070605;
  --panel: #120e09;
  --panel-2: #1b150d;
  --line: rgba(226, 179, 74, .34);
  --line-soft: rgba(226, 179, 74, .16);
  --gold-1: #fff0b3;
  --gold-2: #e8bc58;
  --gold-3: #a8781f;
  --text: #f6edd9;
  --muted: #b3a486;
  --danger: #ff9a86;
  --ok: #7fdcb2;
  --gold-text: linear-gradient(176deg, #fff6cf 8%, #f0c965 42%, #b98724 62%, #f6d981 88%);
  --gold-fill: linear-gradient(170deg, #fff0b3 0%, #e8bc58 42%, #b98724 100%);
  --serif: 'Forum', 'Times New Roman', serif;
  --sans: 'Golos', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
a { color: var(--gold-2); }
:focus-visible { outline: 2px solid var(--gold-1); outline-offset: 2px; }

#app {
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

.demo-bar {
  padding: 7px var(--gutter);
  background: #4b2a0b;
  color: var(--gold-1);
  font-size: 13px;
  text-align: center;
}

/* Главный экран */
.hero { position: relative; height: 252px; overflow: hidden; }
.hero img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 0;
  -webkit-mask-image: linear-gradient(#000 52%, transparent 98%);
  mask-image: linear-gradient(#000 52%, transparent 98%);
}
.hero-text {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-align: center;
}
.wordmark, .gold-title {
  font-family: var(--serif);
  background: var(--gold-text);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.wordmark {
  font-size: 58px; line-height: 1; letter-spacing: .07em; padding-left: .07em;
  filter: drop-shadow(0 2px 0 #4f3409) drop-shadow(0 6px 18px rgba(0, 0, 0, .9));
}
.plaque {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--serif); font-size: 18px; letter-spacing: .03em; color: var(--gold-1);
}
.plaque::before, .plaque::after { content: ''; width: 44px; height: 1px; }
.plaque::before { background: linear-gradient(90deg, transparent, var(--gold-2)); }
.plaque::after { background: linear-gradient(90deg, var(--gold-2), transparent); }

.page { padding: 0 var(--gutter); }
.page > * + * { margin-top: 14px; }

/* Мраморные панели с двойной золотой рамкой, как постамент на обложках */
.panel {
  position: relative;
  padding: 16px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(165deg, #1d160c 0%, #120e09 45%, #0b0805 100%);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .65);
  --c: var(--gold-2);
}
.panel::before {
  content: ''; position: absolute; inset: -1px; pointer-events: none;
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / 18px 1px, linear-gradient(var(--c), var(--c)) 0 0 / 1px 18px,
    linear-gradient(var(--c), var(--c)) 100% 0 / 18px 1px, linear-gradient(var(--c), var(--c)) 100% 0 / 1px 18px,
    linear-gradient(var(--c), var(--c)) 0 100% / 18px 1px, linear-gradient(var(--c), var(--c)) 0 100% / 1px 18px,
    linear-gradient(var(--c), var(--c)) 100% 100% / 18px 1px, linear-gradient(var(--c), var(--c)) 100% 100% / 1px 18px;
  background-repeat: no-repeat;
}
.panel > * { position: relative; }
.exchange { margin-top: 16px; }

.field-label { display: block; margin-bottom: 4px; color: var(--gold-2); font-family: var(--serif); font-size: 16px; }
.amount-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--line);
}
.amount-row:focus-within { border-bottom-color: var(--gold-1); box-shadow: 0 1px 0 var(--gold-1); }
.amount-row input {
  flex: 1; width: 0; min-width: 0;
  padding: 7px 0;
  border: 0; outline: 0; background: none;
  font-family: var(--sans); font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.amount-row input::placeholder { color: #6f6450; }

.amount-row > span { flex: none; display: block; }
.cur-pill {
  flex: none;
  display: flex; align-items: center; gap: 7px;
  padding: 6px 8px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: var(--panel-2);
  text-align: left;
}
.cur-pill:hover { border-color: var(--gold-2); }
.cur-pill b { display: block; font-weight: 600; font-size: 14px; line-height: 1.15; }
.cur-pill small { display: block; color: var(--muted); font-size: 11px; line-height: 1.2; white-space: nowrap; }
.cur-pill .chev { width: 10px; height: 10px; flex: none; color: var(--gold-2); }

.coin { flex: none; display: block; }

.swap-wrap { display: flex; justify-content: flex-end; margin: 10px 0 2px; position: relative; z-index: 1; }
.swap {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 1px solid #fff0b3;
  border-radius: 50%;
  background: var(--gold-fill);
  color: #2c1f06;
  box-shadow: inset 0 0 0 3px rgba(84, 56, 10, .42), 0 3px 12px rgba(0, 0, 0, .7);
  transition: transform .25s ease;
}
.swap svg { width: 20px; height: 20px; }
.swap:hover:not([aria-disabled='true']) { transform: rotate(180deg); }
.swap[aria-disabled='true'] { opacity: .55; }

.calc-meta { margin-top: 12px; font-size: 13px; color: var(--muted); display: grid; gap: 3px; }
.calc-meta div { display: flex; justify-content: space-between; gap: 12px; }
.calc-meta span:last-child { color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.calc-error { margin-top: 8px; color: var(--danger); font-size: 13px; min-height: 19px; }
.calc-error:empty { display: none; }

.btn {
  display: block; width: 100%;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 1px;
  font-weight: 600; font-size: 16px; text-align: center; text-decoration: none;
}
.btn-gold {
  position: relative; overflow: hidden;
  border-color: #fff0b3;
  background: var(--gold-fill);
  color: #241804;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -2px 0 rgba(84, 56, 10, .5), 0 6px 20px rgba(232, 188, 88, .22);
}
.btn-gold:active:not(:disabled) { transform: translateY(1px); }
.btn-gold:disabled { filter: grayscale(.85) brightness(.5); cursor: not-allowed; box-shadow: none; }
@media (prefers-reduced-motion: no-preference) {
  .btn-gold:not(:disabled)::after {
    content: ''; position: absolute; top: 0; bottom: 0; left: -40%; width: 26%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .6), transparent);
    animation: sheen 5s ease-in-out infinite;
  }
  @keyframes sheen { 0%, 72% { left: -40%; } 100% { left: 130%; } }
}
.btn-line { border-color: var(--line); background: rgba(0, 0, 0, .35); color: var(--gold-1); }
.btn-text { background: none; color: var(--muted); font-weight: 400; font-size: 14px; padding: 10px; }
.btn-danger { border-color: rgba(255, 154, 134, .5); background: none; color: var(--danger); font-weight: 400; font-size: 14px; padding: 10px; }
.mt { margin-top: 14px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-row:has(> :only-child) { grid-template-columns: 1fr; }
.btn-row .btn { font-size: 14px; padding: 11px 8px; font-weight: 400; }

.notice-link {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--gold-2); border-radius: 1px;
  background: var(--panel-2);
  color: var(--gold-1); text-align: left;
}

/* Шаги */
.section-title { font-family: var(--serif); font-size: 21px; font-weight: 400; color: var(--gold-1); margin-bottom: 10px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps li { display: grid; grid-template-columns: 34px 1fr; align-items: baseline; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
.steps li:last-child { padding-bottom: 0; border-bottom: 0; }
.steps .num { font-family: var(--serif); font-size: 20px; color: var(--gold-2); }
.steps b { font-weight: 400; }

/* Внутренние экраны */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px var(--gutter) 12px;
}
.topbar h1 { font-family: var(--serif); font-size: 26px; font-weight: 400; line-height: 1.15; color: var(--gold-1); }
.back {
  flex: none; width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 1px; background: none; color: var(--gold-2);
}
.back svg { width: 16px; height: 16px; }

.pair {
  display: grid; grid-template-columns: 1fr 22px 1fr; align-items: center; gap: 6px;
}
.pair-side { min-width: 0; }
.pair-side small { display: block; color: var(--muted); font-size: 12px; }
.pair-side .val { font-weight: 600; font-size: 17px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pair-side .cur { color: var(--muted); font-size: 13px; }
.pair-side:last-child { text-align: right; }
.pair-arrow { color: var(--gold-2); width: 18px; height: 18px; }

.form-field + .form-field { margin-top: 12px; }
.input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line-soft); border-radius: 1px;
  background: rgba(0, 0, 0, .52);
  font-size: 16px;
  outline: 0;
}
.input:focus { border-color: var(--gold-2); }
.input::placeholder { color: #6f6450; }
.input.mono { font-family: ui-monospace, Consolas, monospace; font-size: 14px; }
.hint { margin-top: 6px; color: var(--muted); font-size: 13px; }
.form-error { margin-top: 10px; color: var(--danger); font-size: 14px; }
.form-error:empty { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { padding: 5px 10px; border: 1px solid var(--line-soft); border-radius: 999px; background: none; font-size: 13px; color: var(--muted); }
.chip[aria-pressed='true'] { border-color: var(--gold-2); color: var(--gold-1); }

.rows { display: grid; gap: 10px; }
.row small { display: block; color: var(--muted); font-size: 13px; }
.row .v { overflow-wrap: anywhere; }
.row .v.big { font-size: 19px; font-weight: 600; }
.row .v.mono { font-family: ui-monospace, Consolas, monospace; font-size: 14px; }

.copy-box {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft); border-radius: 1px;
  background: rgba(0, 0, 0, .52);
}
.copy-box + .copy-box, .row + .copy-box { margin-top: 10px; }
.copy-box small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 1px; }
.copy-box .v { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.copy-box .v.big { font-size: 21px; font-weight: 600; color: var(--gold-1); }
.copy-box .v.mono { font-family: ui-monospace, Consolas, monospace; font-size: 14px; }
.copy { padding: 7px 11px; border: 1px solid var(--line); border-radius: 1px; background: var(--panel-2); color: var(--gold-1); font-size: 13px; }

.warn {
  padding: 10px 12px;
  border-left: 3px solid var(--gold-2);
  background: rgba(232, 188, 88, .1);
  font-size: 14px;
}
.warn b { color: var(--gold-1); font-weight: 600; }

.timer-line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; color: var(--muted); font-size: 14px; }
.timer { font-family: var(--serif); font-size: 26px; color: var(--gold-1); font-variant-numeric: tabular-nums; }

.qr { width: 212px; margin: 12px auto 0; padding: 6px; background: #fff; border-radius: 4px; }
.qr svg, .qr img { display: block; width: 100%; height: auto; }

.status-head { text-align: center; padding: 8px 0 4px; }
.status-head img { width: 112px; height: 112px; display: block; margin: 0 auto 8px; filter: drop-shadow(0 0 18px rgba(232, 188, 88, .4)); }
.status-head h2 { font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.15; }
.status-head p { margin-top: 6px; color: var(--muted); }

.track { list-style: none; margin: 0; padding: 0; }
.track li { position: relative; padding: 0 0 14px 26px; color: var(--muted); }
.track li:last-child { padding-bottom: 0; }
.track li::before {
  content: ''; position: absolute; left: 3px; top: 5px;
  width: 11px; height: 11px;
  border: 1px solid var(--gold-3); background: var(--bg);
  transform: rotate(45deg);
}
.track li:not(:last-child)::after { content: ''; position: absolute; left: 8px; top: 18px; bottom: -2px; width: 1px; background: var(--line); }
.track li.done { color: var(--text); }
.track li.done::before { background: var(--gold-2); border-color: var(--gold-1); }
.track li.now { color: var(--gold-1); font-weight: 600; }
.track li.now::before { border-color: var(--gold-1); box-shadow: 0 0 10px var(--gold-2); }

.order-card {
  display: block; width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-soft); border-radius: 1px;
  background: var(--panel);
  text-align: left;
}
.order-card + .order-card { margin-top: 8px; }
.order-card:hover { border-color: var(--line); }
.order-top { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 13px; }
.order-main { margin-top: 3px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.badge { color: var(--gold-1); }
.badge.good { color: var(--ok); }
.badge.bad { color: var(--danger); }
.empty { padding: 26px 8px; text-align: center; color: var(--muted); }

/* Выбор валюты */
.sheet {
  width: 100%; max-width: 480px; max-height: 86dvh;
  margin: auto auto 0;
  padding: 0;
  border: 1px solid var(--line); border-bottom: 0;
  border-radius: 14px 14px 0 0;
  background: var(--panel);
  color: var(--text);
}
.sheet::backdrop { background: rgba(0, 0, 0, .72); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; }
.sheet-head h2 { font-family: var(--serif); font-weight: 400; font-size: 23px; color: var(--gold-1); }
.sheet-close { width: 34px; height: 34px; border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; }
.sheet-list { padding: 0 8px calc(14px + env(safe-area-inset-bottom)); }
.sheet-group { padding: 10px 8px 4px; color: var(--muted); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.sheet-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 9px 8px;
  border: 0; border-radius: 1px;
  background: none; text-align: left;
}
.sheet-item:hover, .sheet-item:focus-visible { background: var(--panel-2); }
.sheet-item[aria-current='true'] { background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.sheet-item:disabled { opacity: .45; cursor: not-allowed; }
.sheet-item b { display: block; font-weight: 600; }
.sheet-item small { display: block; color: var(--muted); font-size: 13px; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 10;
  max-width: calc(100vw - 32px);
  padding: 9px 16px;
  border: 1px solid var(--gold-2); border-radius: 1px;
  background: #000; color: var(--gold-1); font-size: 14px;
  transform: translate(-50%, 10px); opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.loading { padding: 80px 16px; text-align: center; color: var(--muted); }
.footer-note { color: var(--muted); font-size: 12px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
