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

:root {
  --bg:#050505;
  --card:rgba(16,16,20,0.75);
  --card-hover:rgba(24,24,30,0.9);
  --border:rgba(255,255,255,0.07);
  --text:#ebe7e0;
  --muted:#8c8780;
  --accent:#c9a227;

  /* per-brand accents, used only for icon glow / badges */
  --ami-accent:#3ba3ff;
  --rata-accent:#a45bd6;
  --note-accent:#c9a227;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

html { background:var(--bg); overflow-x:hidden; max-width:100%; }

body {
  background:var(--bg); color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  min-height:100vh; overflow-x:hidden; position:relative; -webkit-font-smoothing:antialiased;
}

body::before {
  content:''; position:fixed; inset:0;
  background:
    radial-gradient(ellipse 90% 60% at 50% -25%, rgba(201,162,39,0.09), transparent 60%),
    radial-gradient(ellipse 60% 45% at 90% 105%, rgba(164,91,214,0.06), transparent),
    radial-gradient(ellipse 60% 45% at 5% 105%, rgba(59,163,255,0.05), transparent);
  pointer-events:none; z-index:0;
}

body::after {
  content:''; position:fixed; inset:0;
  background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity:0.025; pointer-events:none; z-index:0;
}

.container {
  position:relative; z-index:1; max-width:820px; margin:0 auto;
  padding:calc(28px + var(--safe-top)) calc(20px + var(--safe-right)) calc(48px + var(--safe-bottom)) calc(20px + var(--safe-left));
  min-height:100vh; display:flex; flex-direction:column;
}

/* header */
header { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:28px; flex-wrap:wrap; }

.brand { display:flex; flex-direction:column; gap:4px; min-width:0; }
.logo-note {
  font-family:Georgia,"Times New Roman",serif; font-size:2.4rem; font-weight:700;
  letter-spacing:0.12em; color:#f2eee6; text-shadow:0 0 40px rgba(255,255,255,0.12); line-height:1;
}
.tagline-note {
  font-size:0.85rem; font-weight:500; color:var(--accent); letter-spacing:0.015em;
  display:flex; align-items:center; gap:6px; text-shadow:0 0 12px rgba(201,162,39,0.55);
}
.tagline-note .apple { font-size:1rem; filter:drop-shadow(0 0 8px rgba(196,30,58,0.55)); }

/* контейнер для официальной кнопки TON Connect (виджет рисуется самим SDK) */
.wallet-slot { flex-shrink:0; }
.wallet-slot iframe, .wallet-slot button { border-radius:12px !important; }

/* profile card */
.profile-card {
  display:flex; align-items:center; gap:18px;
  padding:20px; margin-bottom:32px; border-radius:20px;
  background:linear-gradient(150deg, rgba(32,26,10,0.92), rgba(8,8,9,0.96));
  border:1px solid rgba(201,162,39,0.45);
  box-shadow:0 14px 40px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.04);
  position:relative; overflow:hidden;
}
.profile-card::before {
  content:''; position:absolute; inset:0; pointer-events:none;
  background:linear-gradient(115deg, transparent 38%, rgba(255,255,255,0.09) 50%, transparent 62%);
}
.profile-avatar {
  width:74px; height:74px; border-radius:50%; flex-shrink:0; position:relative;
  background:#050505; overflow:hidden;
  box-shadow:0 0 0 1px rgba(255,255,255,0.14), 0 0 0 5px rgba(201,162,39,0.08), 0 0 30px rgba(201,162,39,0.28);
}
.profile-avatar img { width:100%; height:100%; object-fit:cover; }
.profile-info { min-width:0; flex:1; position:relative; z-index:1; }
.profile-name-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.profile-name { font-size:1.3rem; font-weight:700; color:#f6f2ea; line-height:1.2; }
.verified-badge {
  display:inline-flex; align-items:center; gap:3px;
  padding:1px 7px; border-radius:20px;
  background:rgba(61,220,132,0.12); border:1px solid rgba(61,220,132,0.4);
  color:#3ddc84; font-size:0.62rem; font-weight:700; letter-spacing:0.04em; text-transform:uppercase;
}
.profile-handle { font-size:0.86rem; color:#cfcac0; margin-top:1px; }
.profile-wallet-address {
  font-size:0.8rem; color:var(--muted); margin-top:8px;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; letter-spacing:0.01em;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.profile-wallet-balance {
  font-size:1.05rem; font-weight:700; color:var(--accent); margin-top:6px;
  text-shadow:0 0 12px rgba(201,162,39,0.4);
}
.profile-wallet-balance:empty { display:none; }

/* intro line */
.intro { margin-bottom:28px; }
.intro-title {
  font-family:Georgia,"Times New Roman",serif; font-size:1.5rem; font-weight:700;
  letter-spacing:0.02em; color:#f2eee6; margin-bottom:6px;
}
.intro-desc { font-size:0.92rem; color:var(--muted); line-height:1.5; max-width:520px; }

/* section cards */
.sections { display:flex; flex-direction:column; gap:12px; flex:1; }

.section-card {
  display:flex; align-items:center; gap:16px;
  padding:18px 18px; background:var(--card); border:1px solid var(--border); border-radius:16px;
  backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px);
  position:relative; overflow:hidden; text-decoration:none; color:inherit;
  transition:background 0.22s ease, border-color 0.22s ease, transform 0.18s cubic-bezier(0.4,0,0.2,1);
  -webkit-tap-highlight-color:transparent;
  min-height:64px;
}
.section-card::before {
  content:''; position:absolute; left:0; top:0; bottom:0; width:3px;
  background:linear-gradient(180deg,transparent,var(--card-accent,var(--accent)),transparent);
  opacity:0; transition:opacity 0.22s;
}
.section-card:active {
  background:var(--card-hover); border-color:rgba(255,255,255,0.14);
  transform:scale(0.98) translateX(3px);
}
.section-card:active::before { opacity:1; }
@media (hover:hover) {
  .section-card:hover {
    background:var(--card-hover); border-color:rgba(255,255,255,0.14);
    transform:translateX(4px);
    box-shadow:0 10px 36px rgba(0,0,0,0.45);
  }
  .section-card:hover::before { opacity:1; }
}

.section-icon-wrap {
  width:52px; height:52px; border-radius:13px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center; overflow:hidden;
  background:#0c0c0f; position:relative;
  box-shadow:0 4px 18px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.04);
}
.section-icon-wrap img { width:100%; height:100%; object-fit:cover; }

.section-info { flex:1; min-width:0; }
.section-name-row { display:flex; align-items:center; gap:8px; margin-bottom:3px; }
.section-name { font-size:1.06rem; font-weight:700; color:#f0ece4; letter-spacing:-0.01em; }
.section-desc { font-size:0.85rem; color:var(--muted); line-height:1.4; }

.section-arrow { color:var(--muted); flex-shrink:0; font-size:1.2rem; font-weight:300; opacity:0.55; transition:transform 0.22s; }
.section-card:active .section-arrow { transform:translateX(3px); }

/* premium badge */
.premium-badge {
  display:inline-flex; align-items:center; gap:4px;
  padding:2px 8px 2px 6px; border-radius:20px;
  background:rgba(201,162,39,0.12); border:1px solid rgba(201,162,39,0.4);
  color:var(--accent); font-size:0.62rem; font-weight:700; letter-spacing:0.06em; text-transform:uppercase;
  flex-shrink:0;
}
.premium-badge svg { width:10px; height:10px; }

/* per-card accent tints */
.section-card.ami { --card-accent:var(--ami-accent); }
.section-card.ami .section-icon-wrap { box-shadow:0 4px 18px rgba(0,0,0,0.35), 0 0 0 1px rgba(59,163,255,0.12); }
.section-card.rata { --card-accent:var(--rata-accent); }
.section-card.rata .section-icon-wrap { box-shadow:0 4px 18px rgba(0,0,0,0.35), 0 0 0 1px rgba(164,91,214,0.14); }
.section-card.note { --card-accent:var(--note-accent); }
.section-card.note .section-icon-wrap { box-shadow:0 4px 18px rgba(0,0,0,0.35), 0 0 0 1px rgba(201,162,39,0.14); }

/* footer */
footer { margin-top:32px; display:flex; align-items:center; justify-content:center; }
.footer-note { font-size:0.72rem; color:var(--muted); letter-spacing:0.03em; text-align:center; }
.footer-note a { color:var(--accent); text-decoration:none; }

@media (max-width:420px) {
  .logo-note { font-size:1.9rem; }
  .intro-title { font-size:1.28rem; }
  .section-card { padding:15px 14px; gap:13px; }
  .section-icon-wrap { width:46px; height:46px; }
  .profile-card { padding:16px; gap:14px; }
  .profile-avatar { width:60px; height:60px; }
  .profile-name { font-size:1.15rem; }
}
