:root{
  --bg:#05050a;
  --text:rgba(255,255,255,.92);
  --muted:rgba(255,255,255,.55);
  --border:rgba(255,255,255,.12);
  --shadow: 0 28px 80px rgba(0,0,0,.65);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow:hidden;
}

.page{ height:100%; position:relative; isolation:isolate; }

#stars{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  z-index:0;
}

.page::before{
  content:"";
  position:absolute;
  inset:-30%;
  z-index:1;
  background:
    radial-gradient(60% 55% at 50% 55%, rgba(255,255,255,.06), rgba(0,0,0,0) 55%),
    radial-gradient(90% 70% at 50% 50%, rgba(0,0,0,0) 35%, rgba(0,0,0,.85) 78%),
    linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.75));
  filter: blur(10px);
  pointer-events:none;
}

.hero{
  position:relative;
  z-index:2;
  height:100%;
  display:grid;
  place-items:center;
  padding: 24px;
}

.hero__glass{
  width:min(980px, 92vw);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
  border:1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 44px 26px;
  position:relative;
}

.hero__glass::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius: inherit;
  background:
    radial-gradient(35% 0% at 15% 35%, rgba(255,255,255,.12), rgba(255,255,255,0) 60%),
    radial-gradient(30% 35% at 85% 25%, rgba(255,255,255,.10), rgba(255,255,255,0) 62%);
  pointer-events:none;
  opacity:.7;
}

.topline{
  display:flex;
  justify-content:center;
  margin-bottom: 10px;
}

.chip{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.82);
  font-size: 13px;
}

.dot{
  width:8px; height:8px; border-radius:50%;
  background: rgba(255,255,255,.75);
  box-shadow: 0 0 18px rgba(255,255,255,.35);
}

.hero__title{
  margin: 8px 0 6px 0;
  font-weight: 300;
  letter-spacing: .2px;
  text-align:center;
  font-size: clamp(22px, 2.7vw, 36px);
  text-shadow: 0 12px 40px rgba(0,0,0,.65);
  position:relative;
  z-index:1;
}

.hero__subtitle{
  margin:0 0 20px 0;
  text-align:center;
  color: var(--muted);
  line-height: 1.55;
  font-size: clamp(13px, 1.35vw, 16px);
  position:relative;
  z-index:1;
}

.info{
  width: min(720px, 100%);
  margin: 0 auto;
  position:relative;
  z-index:1;
  display:flex;
  flex-direction:column;
  gap: 12px;
}

.info__row{
  display:grid;
  grid-template-columns: 90px 1fr auto;
  gap: 10px;
  align-items:center;

  padding: 12px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
}

.k{
  color: rgba(255,255,255,.55);
  font-size: 12px;
}

.v{
  color: rgba(255,255,255,.92);
  font-size: 13.5px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.price{
  padding: 14px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}

.price__label{
  color: rgba(255,255,255,.70);
  font-size: 13px;
}

.price__value{
  font-weight: 900;
  font-size: 18px;
}

.actions{
  margin-top: 6px;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height: 46px;
  padding: 0 26px;
  border-radius: 999px;
  cursor:pointer;

  color: rgba(255,255,255,.92);
  font-weight: 600;
  font-size: 14px;

  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.07));
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 18px 40px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.12);

  transition: transform .15s ease, border-color .2s ease, background .2s ease;
  text-decoration:none;
}

.btn:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.22);
  background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.08));
}
.btn:active{ transform: translateY(0) scale(.99); }

.btn--full{
  width: 100%;
  text-align:center;
}

.miniBtn{
  height: 34px;
  padding: 0 12px;
  border-radius: 12px;
  cursor:pointer;

  color: rgba(255,255,255,.9);
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.12);
}

.note{
  margin-top: 10px;
  color: rgba(255,255,255,.45);
  font-size: 12px;
  line-height: 1.45;
}

/* ===== Bottom sheet ===== */
.sheet{
  position:absolute;
  left:0; right:0; bottom:0;
  z-index:3;
  display:none;

  transform: translateY(110%);
  transition: transform .22s ease;
  padding: 10px 16px 18px 16px;
}

.sheet--open{ display:block; transform: translateY(0); }

.sheet::before{
  content:"";
  position:absolute;
  inset: 0;
  background: rgba(0,0,0,.28);
  border-top: 1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -28px 80px rgba(0,0,0,.65);
}

.sheet > *{ position:relative; z-index:1; }

.sheet__handle{
  width: 52px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  margin: 6px auto 10px auto;
}

.sheet__header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  padding: 6px 6px 10px 6px;
}

.sheet__title{
  font-size: 16px;
  font-weight: 700;
}

.sheet__sub{
  color: rgba(255,255,255,.55);
  font-size: 12.5px;
  margin-top: 2px;
}

.closeBtn{
  width: 36px;
  height: 36px;
  border-radius: 12px;
  cursor:pointer;

  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  color: rgba(255,255,255,.9);
}

.cards{
  display:grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
  padding: 0 6px 8px 6px;
}

.card{
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  padding: 14px;
}

.card__title{
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 10px;
}

.paybox .mono{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,.20);
  border: 1px solid rgba(255,255,255,.10);
  font-size: 13px;
  overflow:hidden;
}

.paybox .mono span{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.steps{
  display:flex;
  flex-direction:column;
  gap: 10px;
  margin-bottom: 12px;
}

.step{
  color: rgba(255,255,255,.82);
  font-size: 13px;
  line-height: 1.35;
  display:flex;
  gap: 10px;
  align-items:flex-start;
}

.num{
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  display:grid;
  place-items:center;
  font-weight: 800;
  font-size: 12px;
  color: rgba(255,255,255,.9);
}

@media (max-width: 820px){
  .cards{ grid-template-columns: 1fr; }
  .info__row{ grid-template-columns: 90px 1fr; }
  .info__row .miniBtn{ grid-column: 1 / -1; justify-self: start; }
}
.info__row--two{grid-template-columns: 90px 1fr;}
.mono--wrap{display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap;}
@media (max-width: 640px){
  .mono--wrap{align-items:flex-start;}
}

/* ===== Mobile optimization v2 ===== */
html{ min-height:100%; -webkit-text-size-adjust:100%; text-size-adjust:100%; }
body{ min-height:100%; overflow-x:hidden; }
button,a{ -webkit-tap-highlight-color:transparent; touch-action:manipulation; }
#stars{ position:fixed; }
.page{ min-height:100svh; min-height:100dvh; }

@media (max-width: 820px){
  body{ overflow-y:auto; }
  .page{ height:auto; min-height:100svh; min-height:100dvh; }
  .hero{
    height:auto;
    min-height:100svh;
    min-height:100dvh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:calc(16px + env(safe-area-inset-top)) 12px calc(16px + env(safe-area-inset-bottom));
  }
  .hero__glass{ width:100%; padding:30px 15px; border-radius:16px; }
  .hero__title{ font-size:clamp(24px,7.5vw,32px); line-height:1.12; }
  .hero__subtitle{ font-size:14px; line-height:1.45; margin-bottom:18px; }
  .info{ width:100%; gap:10px; }
  .info__row,.info__row--two{ grid-template-columns:76px minmax(0,1fr); gap:8px; }
  .info__row .v{ min-width:0; white-space:normal; overflow:visible; text-overflow:clip; overflow-wrap:anywhere; word-break:break-word; }
  .price{ padding:12px; }
  .price__label{ line-height:1.3; }
  .btn--full{ min-height:48px; height:auto; padding:12px 16px; line-height:1.2; }
  .sheet{
    position:fixed;
    max-height:90dvh;
    overflow-y:auto;
    overscroll-behavior:contain;
    padding:10px 10px calc(12px + env(safe-area-inset-bottom));
  }
  .sheet__sub{ overflow-wrap:anywhere; word-break:break-word; }
  .cards{ grid-template-columns:1fr; padding-left:2px; padding-right:2px; }
  .card{ padding:12px; }
  .paybox .mono{ min-width:0; align-items:flex-start; }
  .paybox .mono span{
    min-width:0;
    white-space:normal;
    overflow:visible;
    text-overflow:clip;
    overflow-wrap:anywhere;
    word-break:break-word;
  }
  .mono--wrap{ flex-direction:column; align-items:stretch; }
  .mono--wrap .miniBtn{ width:100%; min-height:42px; }
  .step{ line-height:1.4; }
  .num{ flex:0 0 22px; }
}

@media (max-width: 430px){
  .hero{ padding-left:10px; padding-right:10px; }
  .hero__glass{ padding:26px 13px; }
  .price{ flex-direction:column; align-items:flex-start; gap:6px; }
  .price__value{ font-size:20px; }
  .info__row,.info__row--two{ grid-template-columns:1fr; gap:4px; }
}

@media (max-height: 520px) and (orientation: landscape){
  .hero{ align-items:flex-start; }
  .sheet{ max-height:95dvh; }
}

/* ===== Unified project: centered payment modal ===== */
.sheet{
  position:fixed;
  inset:0;
  z-index:50;
  display:none;
  transform:none;
  padding:20px;
  overflow:auto;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,.62);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}
.sheet--open{ display:flex; transform:none; }
.sheet::before{ display:none; }
.sheet > .modal{
  position:relative;
  z-index:1;
  width:min(760px,100%);
  max-height:min(88dvh,760px);
  overflow:auto;
  overscroll-behavior:contain;
  padding:14px 14px 16px;
  border-radius:20px;
  background:linear-gradient(180deg,rgba(28,28,30,.98),rgba(15,15,17,.98));
  border:1px solid rgba(255,255,255,.13);
  box-shadow:0 30px 90px rgba(0,0,0,.78), inset 0 1px 0 rgba(255,255,255,.06);
}
.sheet__handle{ display:none; }
.card--wallet{ grid-column:1 / -1; }
.walletAddresses{
  margin-top:10px;
  padding:10px 12px;
  border-radius:12px;
  background:rgba(0,0,0,.20);
  border:1px solid rgba(255,255,255,.10);
  font-size:12px;
  line-height:1.55;
  overflow-wrap:anywhere;
  word-break:break-word;
}
body.modal-open{ overflow:hidden; }

@media (max-width:820px){
  .sheet{ padding:calc(10px + env(safe-area-inset-top)) 10px calc(10px + env(safe-area-inset-bottom)); }
  .sheet > .modal{ width:100%; max-height:92dvh; border-radius:18px; padding:12px; }
}


/* ===== Production payment + mobile layout fixes ===== */
html, body { width:100%; max-width:100%; }
body { overflow-x:hidden; }
.page { width:100%; max-width:100vw; }
.cards { grid-template-columns:1fr; }
.card--wallet, .card--instructions { grid-column:auto; min-width:0; }
.btn:disabled, .miniBtn:disabled { opacity:.45; cursor:not-allowed; transform:none; }
.sheet > .modal { min-width:0; }
.sheet__header > div { min-width:0; }
.walletAddresses { max-width:100%; }

@media (max-width:820px){
  html, body { height:auto; min-height:100%; }
  body { overflow-y:auto; }
  .page { height:auto; min-height:100svh; min-height:100dvh; }
  .hero {
    min-height:100svh; min-height:100dvh; height:auto;
    align-items:flex-start;
    padding:calc(14px + env(safe-area-inset-top)) 10px calc(18px + env(safe-area-inset-bottom));
  }
  .hero__glass { width:100%; max-width:100%; padding:26px 13px; margin:auto 0; }
  .sheet {
    width:100vw; max-width:100vw;
    min-height:100svh; min-height:100dvh;
    padding:calc(8px + env(safe-area-inset-top)) 8px calc(8px + env(safe-area-inset-bottom));
    align-items:flex-start; overflow:hidden;
  }
  .sheet > .modal {
    width:100%; max-width:100%;
    max-height:calc(100svh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height:calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow-y:auto; overflow-x:hidden; -webkit-overflow-scrolling:touch; padding:12px;
  }
  .sheet__header {
    position:sticky; top:-12px; z-index:4;
    margin:-12px -12px 8px; padding:12px 12px 10px;
    background:rgba(20,20,22,.96);
    backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);
  }
  .cards { padding:0; gap:10px; }
  .card { width:100%; min-width:0; padding:12px; }
  .walletAddresses { font-size:11.5px; }
  .step { font-size:14px; }
}
@media (max-width:380px){
  .hero__glass { padding:22px 11px; }
  .sheet > .modal { border-radius:15px; padding:10px; }
  .sheet__header { top:-10px; margin:-10px -10px 8px; padding:10px; }
  .card { padding:11px; }
}

/* ===== Payment interaction hotfix V4 ===== */
#btnPay, #btnPaid, #btnConnectWallet {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(255,255,255,.08);
}
#paidHint {
  min-height: 18px;
}
