:root {
  --bg-a: #1a0420;
  --bg-b: #4a0c5c;
  --bg-c: #9c1f63;
  --bg-d: #ff7f4f;
  --ink: #fff;
  --ink-soft: rgba(255, 255, 255, 0.76);
  --panel: rgba(22, 6, 30, 0.58);
  --panel-line: rgba(255, 255, 255, 0.15);
  --green: #3ddc84;
  --amber: #ffb347;

  --f-head: "Sora", "Trebuchet MS", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --r-lg: 24px;
  --r-md: 16px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1000px 700px at 90% 105%, rgba(255, 127, 79, 0.5), transparent 62%),
    radial-gradient(800px 600px at 0% 5%, rgba(200, 120, 255, 0.4), transparent 58%),
    linear-gradient(170deg, var(--bg-a) 0%, var(--bg-b) 38%, var(--bg-c) 74%, var(--bg-d) 100%);
  background-attachment: fixed;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- background ---------- */
.glow {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.5;
  pointer-events: none;
}
.glow-a {
  width: 340px; height: 340px;
  top: -110px; right: -100px;
  background: #c04cff;
  animation: drift 16s ease-in-out infinite;
}
.glow-b {
  width: 400px; height: 400px;
  bottom: -150px; left: -130px;
  background: #ff6a45;
  animation: drift 20s ease-in-out -5s infinite reverse;
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(-18px, 26px) scale(1.05); }
}
.noise {
  position: fixed;
  inset: 0;
  z-index: 1;
  opacity: 0.045;
  mix-blend-mode: overlay;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23g)' opacity='0.55'/></svg>");
}

/* ---------- page ---------- */
.page {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 368px;
  margin: 0 auto;
  padding: 16px 16px max(18px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100dvh;
}

/* ---------- profile ---------- */
.profile {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--r-lg);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.48), 0 6px 20px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(16px) saturate(135%);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
  animation: up 550ms cubic-bezier(.2, .8, .2, 1) both;
}

.avatar {
  position: relative;
  margin: 0;
  aspect-ratio: 5 / 4;
  background: #1c0428;
}
.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}
.avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(22, 6, 30, 0.85) 100%);
  pointer-events: none;
}

.profile-info {
  position: relative;
  margin-top: -44px;
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.name {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--f-head);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}
.badge {
  width: 21px;
  height: 21px;
  flex: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
}

.tagline {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--ink-soft);
}

.meta {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.live i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.7); }
  70%  { box-shadow: 0 0 0 9px rgba(61, 220, 132, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); }
}

.icons { display: flex; gap: 8px; }
.icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 180ms ease, filter 220ms ease;
  -webkit-tap-highlight-color: transparent;
}
.icon svg { width: 17px; height: 17px; }
.icon:hover { transform: translateY(-2px); filter: brightness(1.1); }
.icon-fb { background: linear-gradient(160deg, #3b86ff, #1460d0); }
.icon-tw { background: linear-gradient(160deg, #b07cff, #6a3fb0); }

/* ---------- countdown ---------- */
.countdown {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: var(--r-md);
  background: linear-gradient(90deg, rgba(255, 64, 112, 0.22), rgba(255, 179, 71, 0.22));
  border: 1px solid rgba(255, 190, 120, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.countdown::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
  animation: blink 1.5s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: 0.3; } }
.countdown-label {
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.countdown-value {
  font-family: var(--f-mono);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fff3e6;
}

/* ---------- links ---------- */
.links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 15px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--r-md);
  color: #fff;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  transition: transform 200ms cubic-bezier(.2, .8, .2, 1), filter 300ms ease;
}
.link::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.16) 100%);
}
.link > * { position: relative; z-index: 2; }
.link:hover { transform: translateY(-1px); filter: brightness(1.06); }
.link:active { transform: scale(0.985); }
.link:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.sheen {
  position: absolute;
  z-index: 1;
  top: -60%;
  left: -70%;
  width: 40%;
  height: 220%;
  transform: skewX(-18deg);
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  pointer-events: none;
  animation: sweep 5s ease-in-out infinite;
}
@keyframes sweep {
  0%, 60%, 100% { left: -70%; }
  80%           { left: 130%; }
}

.link-text { flex: 1; min-width: 0; }
.link-text strong,
.link-text small {
  display: block;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.7), 0 1px 1px rgba(0, 0, 0, 0.5);
}
.link-text strong {
  font-family: var(--f-head);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.25;
}
.link-text small {
  margin-top: 3px;
  font-size: 11.5px;
  opacity: 0.92;
}

.link-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
}
.link-icon svg { width: 19px; height: 19px; }

.tag {
  flex: none;
  padding: 5px 10px;
  border-radius: 8px;
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.tag-white { background: #fff; color: #3a2fc0; }
.tag-green { background: var(--green); color: #063a26; }

.arrow { flex: none; width: 16px; height: 16px; opacity: 0.75; }

.link-main {
  padding: 17px 16px;
  background: linear-gradient(170deg, #3fd0ff 0%, #5a4dff 100%);
  box-shadow: 0 14px 30px rgba(80, 100, 255, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.link-free {
  background: linear-gradient(170deg, #3442c0 0%, #18185e 100%);
  box-shadow: 0 10px 24px rgba(30, 36, 130, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.link-ig {
  background:
    linear-gradient(95deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1) 60%, transparent),
    radial-gradient(circle at 25% 110%, #feda75 0%, #fa7e1e 25%, #d62976 55%, #962fbf 78%, #4f5bd5 100%);
  box-shadow: 0 12px 28px rgba(214, 41, 118, 0.44), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}
.link-alt {
  padding: 12px 14px;
  border-color: rgba(205, 185, 255, 0.45);
  background: linear-gradient(170deg, #9466ff 0%, #5226c0 100%);
  box-shadow: 0 9px 22px rgba(110, 64, 220, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.36);
}
.link-alt .link-icon { width: 28px; height: 28px; }
.link-alt .link-icon svg { width: 16px; height: 16px; }
.link-alt strong { font-size: 13px; }
.link-alt small { font-size: 10.5px; margin-top: 2px; }

/* ---------- "open in browser" tip (mobile) ---------- */
.tip {
  position: fixed;
  z-index: 5;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 12px 11px;
  border-radius: 14px;
  color: #fff;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(0, 0, 0, 0.3)),
    radial-gradient(120% 120% at 100% 0%, rgba(255, 179, 71, 0.38), rgba(24, 6, 34, 0.62) 60%);
  border: 1px solid rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: halo 2.2s ease-in-out infinite;
}
.tip-arrow {
  display: inline-flex;
  width: 30px;
  height: 30px;
  transform: rotate(45deg);
  animation: nudge 1.4s ease-in-out infinite;
}
.tip-arrow svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 7px rgba(255, 179, 71, 0.95)) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}
.tip-text {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  text-shadow: 0 0 10px rgba(255, 179, 71, 0.65), 0 1px 2px rgba(0, 0, 0, 0.75);
}
.tip-text b { font-size: 14px; font-weight: 800; }
@keyframes halo {
  0%, 100% { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 22px rgba(255, 179, 71, 0.3); }
  50%      { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 34px rgba(255, 179, 71, 0.55); }
}
@keyframes nudge {
  0%, 100% { transform: rotate(45deg) translate(0, 0); }
  50%      { transform: rotate(45deg) translate(0, -5px); }
}

@keyframes up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- desktop ---------- */
@media (min-width: 720px) {
  .tip { display: none; }
  .page {
    max-width: 390px;
    padding: 30px 24px;
    gap: 16px;
    justify-content: center;
  }
  .name { font-size: 27px; }
  .badge { width: 23px; height: 23px; }
  .tagline { font-size: 15px; }
  .link-text strong { font-size: 15px; }
  .link-alt strong { font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
