:root {
  --bg: #070505;
  --gold: #d4b46a;
  --gold-deep: #b08a3c;
  --gold-soft: #f0e2c0;
  --wine: #6b1d2a;
  --text: #f6efe4;
  --muted: rgba(246, 239, 228, 0.62);
  --line: rgba(212, 180, 106, 0.28);
  --glass: rgba(12, 8, 8, 0.78);
  --sheet: rgba(16, 10, 11, 0.88);
  --danger: #e8b4b4;
  --radius: 28px;
  --tap: 48px;
  --font: "Outfit", "PingFang SC", "Noto Sans SC", sans-serif;
  --serif: "Cormorant Garamond", "Songti SC", serif;
  --safe-b: max(18px, env(safe-area-inset-bottom));
  --safe-t: max(12px, env(safe-area-inset-top));
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: #000;
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
}

body {
  display: flex;
  align-items: stretch;
  justify-content: center;
}

#app {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  isolation: isolate;
}

@media (min-width: 480px) {
  body {
    align-items: center;
    min-height: 100dvh;
    background:
      radial-gradient(ellipse at 50% 20%, #1a1010 0%, #000 55%);
  }
  #app {
    width: 390px;
    height: min(844px, calc(100dvh - 32px));
    border-radius: 36px;
    border: 1px solid rgba(212, 180, 106, 0.18);
    box-shadow:
      0 40px 80px rgba(0, 0, 0, 0.55),
      inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  }
}

.stage,
.stage video,
.kb-layer,
.mask,
.grain {
  position: absolute;
  inset: 0;
}

.stage { z-index: 0; }

.kb-layer img {
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  object-fit: cover;
  opacity: 0;
  animation: ken 36s infinite;
  filter: saturate(0.9) contrast(1.05);
}

.kb-layer img:nth-child(1) { animation-delay: 0s; }
.kb-layer img:nth-child(2) { animation-delay: 12s; }
.kb-layer img:nth-child(3) { animation-delay: 24s; }

@keyframes ken {
  0% { opacity: 0; transform: scale(1.05) translate3d(0, 0, 0); }
  6% { opacity: 1; }
  30% { opacity: 1; transform: scale(1.16) translate3d(-2%, 1%, 0); }
  36% { opacity: 0; }
  100% { opacity: 0; }
}

#bgVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.1s ease;
}

#bgVideo.is-on { opacity: 0.72; }

.mask {
  background:
    linear-gradient(180deg, rgba(7, 5, 5, 0.35) 0%, rgba(7, 5, 5, 0.18) 28%, rgba(7, 5, 5, 0.55) 62%, rgba(7, 5, 5, 0.92) 100%),
    radial-gradient(ellipse at 50% 120%, rgba(107, 29, 42, 0.35), transparent 55%);
  pointer-events: none;
}

.grain {
  opacity: 0.07;
  mix-blend-mode: overlay;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.brand-lockup {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  top: 18%;
  text-align: center;
  padding: 0 28px;
  opacity: 0;
  transform: translateY(12px);
  animation: rise 1.1s 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  pointer-events: none;
}

.brand-lockup.is-up {
  top: calc(var(--safe-t) + 14px);
  animation: none;
  opacity: 1;
  transform: none;
  transition: top 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.brand-lockup.is-up .brand-tag,
.brand-lockup.is-up .brand-kicker { display: none; }

.brand-lockup.is-up .brand-name {
  font-size: 22px;
  letter-spacing: 0.42em;
}

.brand-lockup.is-up .brand-rule { width: 36px; margin: 6px auto 0; }

.brand-kicker {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 400;
}

.brand-name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 44px;
  letter-spacing: 0.38em;
  text-indent: 0.38em;
  line-height: 1;
}

.brand-rule {
  display: block;
  width: 52px;
  height: 1px;
  margin: 16px auto 14px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.brand-tag {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--gold-soft);
  letter-spacing: 0.04em;
}

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.sheet-backdrop.is-on {
  opacity: 1;
  pointer-events: auto;
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  max-height: min(86%, 720px);
  padding: 10px 22px calc(var(--safe-b) + 12px);
  border-radius: var(--radius) var(--radius) 0 0;
  background:
    linear-gradient(180deg, rgba(36, 24, 22, 0.92), rgba(12, 8, 9, 0.94));
  border: 1px solid var(--line);
  border-bottom: 0;
  box-shadow:
    0 -24px 80px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(28px) saturate(1.25);
  -webkit-backdrop-filter: blur(28px) saturate(1.25);
  transform: translateY(110%);
  transition: transform 0.55s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sheet.is-on { transform: translateY(0); }

.sheet[hidden],
.sheet-backdrop[hidden] { display: block !important; }

.handle {
  width: 42px;
  height: 4px;
  border-radius: 99px;
  background: rgba(240, 226, 192, 0.28);
  margin: 4px auto 14px;
  flex: none;
}

.step-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 18px;
}

.step-dots span {
  width: 18px;
  height: 3px;
  border-radius: 99px;
  background: rgba(246, 239, 228, 0.16);
}

.step-dots span.on {
  background: var(--gold);
}

.sheet h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-align: center;
}

.lede {
  margin: 0 auto 8px;
  max-width: 34em;
  text-align: center;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.65;
  font-weight: 300;
}

.fee-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 14px auto 22px;
  padding: 8px 14px;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--gold-soft);
  font-size: 12px;
  letter-spacing: 0.04em;
  background: rgba(212, 180, 106, 0.08);
}

.fee-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9ad7a4;
  box-shadow: 0 0 8px #9ad7a4;
}

.sheet-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex: none;
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
  min-height: var(--tap);
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0 18px;
  transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

.btn:active { transform: scale(0.98); }

.btn-gold {
  flex: 1;
  color: #1a1208;
  background: linear-gradient(180deg, #f0e2c0 0%, #d4b46a 48%, #b08a3c 100%);
  box-shadow:
    0 10px 28px rgba(176, 138, 60, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn-gold:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.btn-ghost {
  min-width: 84px;
  color: var(--gold-soft);
  background: transparent;
  border: 1px solid var(--line);
}

.choice-grid {
  display: grid;
  gap: 10px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 12px 16px;
  border-radius: 18px;
  border: 1px solid rgba(246, 239, 228, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.choice.is-on {
  border-color: var(--gold);
  background: rgba(212, 180, 106, 0.1);
  box-shadow: inset 0 0 0 1px rgba(212, 180, 106, 0.2);
}

.choice .ico {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(212, 180, 106, 0.1);
  color: var(--gold);
  flex: none;
}

.choice b {
  display: block;
  font-weight: 500;
  font-size: 16px;
}

.choice small {
  color: var(--muted);
  font-size: 12px;
}

.search {
  position: relative;
  margin-bottom: 10px;
}

.search input,
.field input {
  width: 100%;
  height: 50px;
  border: 1px solid rgba(246, 239, 228, 0.12);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  padding: 0 16px;
  outline: none;
}

.search input:focus,
.field input:focus {
  border-color: var(--gold);
}

.list {
  max-height: 42vh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 16px;
  overscroll-behavior: contain;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.row.is-on {
  background: rgba(212, 180, 106, 0.1);
  color: var(--gold-soft);
}

.flag { font-size: 20px; line-height: 1; width: 28px; text-align: center; }

.wheel-wrap {
  position: relative;
  height: 220px;
  overflow: hidden;
  margin: 6px 0 8px;
}

.wheel-wrap::before,
.wheel-wrap::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 72px;
  z-index: 1;
  pointer-events: none;
}

.wheel-wrap::before {
  top: 0;
  background: linear-gradient(180deg, rgba(16, 10, 11, 0.96), transparent);
}

.wheel-wrap::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(16, 10, 11, 0.96), transparent);
}

.wheel-hl {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 50%;
  height: 48px;
  margin-top: -24px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(212, 180, 106, 0.08);
  pointer-events: none;
}

.wheel {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}

.wheel::-webkit-scrollbar { display: none; }

.wheel-pad { height: 86px; flex: none; }

.wheel-item {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  font-family: var(--serif);
  font-size: 22px;
  color: rgba(246, 239, 228, 0.35);
}

.wheel-item.is-on {
  color: var(--gold-soft);
  font-size: 30px;
}

.age-unit {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.field { margin-top: 8px; }

.hint {
  margin: 8px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.lang-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: flex-start;
  margin-top: 16px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.lang-row::-webkit-scrollbar { display: none; }

.lang-chip { flex: none; }

.lang-chip {
  border: 1px solid rgba(246, 239, 228, 0.12);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.lang-chip.is-on {
  color: var(--gold-soft);
  border-color: var(--gold);
}

.match-panel {
  display: grid;
  place-items: center;
  padding: 18px 8px 8px;
  text-align: center;
}

.ring {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  border: 1px solid rgba(212, 180, 106, 0.25);
  display: grid;
  place-items: center;
  position: relative;
  margin-bottom: 18px;
}

.ring::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid transparent;
  border-top-color: var(--gold);
  border-right-color: var(--gold);
  animation: spin 1.1s linear infinite;
}

.ring .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 16px var(--gold);
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-mark {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 8px auto 16px;
  border: 1px solid var(--line);
  color: var(--gold);
  font-family: var(--serif);
  font-size: 28px;
}

.geo-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--gold-soft);
  font-size: 13px;
}

.plus18 {
  margin: 12px 0 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(246, 239, 228, 0.38);
}

[dir="rtl"] .brand-name { letter-spacing: 0.2em; text-indent: 0; }
[dir="rtl"] .btn { letter-spacing: 0.06em; }

@media (prefers-reduced-motion: reduce) {
  .kb-layer img, .brand-lockup, .sheet, .ring::before { animation: none; }
  .sheet { transition: none; }
}
