:root {
  --accent: #FFFC00;
  --accent-2: #FFE600;
  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
  --on-accent: #000;
  --link: #0fadff;
  --bg: #ffffff;
  --text: #121212;
  --muted: #7a7a7a;
  --line: #ececec;
  --card: #f3f3f5;
  --verified: #2f8cff;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  height: 100vh; height: 100dvh; overflow: hidden;
}
img { display: block; max-width: 100%; }
button { font: inherit; border: 0; background: none; cursor: pointer; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.app {
  max-width: 480px; margin: 0 auto; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom);
  filter: blur(6px); transition: filter .5s; }
body.unlocked .app { filter: none; }

.locker {
  position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(0,0,0,.65); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden; transition: opacity .4s, visibility .4s;
}
body.locked .locker { opacity: 1; visibility: visible; transition: none; }
body.unlocked .locker { opacity: 0; visibility: hidden; }
.locker-card {
  width: 100%; max-width: 340px; background: #fff; color: #000; border-radius: 22px;
  padding: 24px 20px 22px; box-shadow: 0 12px 40px rgba(0,0,0,.35);
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
}
.locker-icon { width: 64px; height: 64px; animation: wiggle 2.4s infinite; }
@keyframes wiggle { 0%,80%,100% { transform: rotate(0); } 85% { transform: rotate(-12deg); } 90% { transform: rotate(12deg); } 95% { transform: rotate(-6deg); } }
.locker-title { font-size: 20px; font-weight: 800; }
.locker-text { font-size: 14px; color: rgba(0,0,0,.6); line-height: 1.4; }
.locker-btn {
  width: 100%; height: 50px; border-radius: 14px; background: var(--accent); color: #000;
  font-weight: 800; font-size: 16px; margin-top: 4px; animation: pulse 1.8s infinite;
}
.locker-btn:active { transform: scale(.97); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,220,0,.7); } 50% { box-shadow: 0 0 0 10px rgba(255,220,0,0); } }
.spinner {
  display: none; width: 34px; height: 34px; border-radius: 50%;
  border: 4px solid #eee; border-top-color: var(--accent); animation: spin .8s linear infinite;
}
.spinner.show { display: inline-block; }
.spinner-sm { display: inline-block; width: 14px; height: 14px; border-width: 2px; vertical-align: -2px; margin-right: 6px; }
.offers { width: 100%; display: grid; gap: 8px; }
.offers a {
  display: block; padding: 13px 14px; border-radius: 12px; background: var(--accent); color: #000;
  font-weight: 700; font-size: 14px; text-align: center; animation: popIn .35s both;
}
.offers a:nth-child(2) { animation-delay: .08s; }
.offers a:nth-child(3) { animation-delay: .16s; }
.offers a:active { background: var(--accent-2); }
.locker-check { display: none; font-size: 12px; color: rgba(0,0,0,.55); }
.locker-check.show { display: block; }
.locker-check::after { content: ""; animation: dots 1.2s steps(4) infinite; }

.loader {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  transition: opacity .4s, visibility .4s;
}
body.loaded .loader { opacity: 0; visibility: hidden; transition: none; }
.loader-card {
  width: 100%; max-width: 340px; background: #fff; color: #000; border-radius: 22px;
  padding: 24px 20px 22px; box-shadow: 0 12px 40px rgba(0,0,0,.25);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  animation: popIn .4s cubic-bezier(.2,.9,.3,1.3);
  transition: transform .35s, opacity .35s;
}

@keyframes popIn { from { transform: scale(.7); opacity: 0; } }
.loader-pct { font-weight: 800; font-size: 13px; color: #000; }
.found.loader-card { animation: foundPop .5s cubic-bezier(.2,.9,.3,1.6); }
@keyframes foundPop { 40% { transform: scale(1.06); } }
.loader-step::after { content: ""; animation: dots 1.2s steps(4) infinite; }
.found .loader-step::after { content: none; animation: none; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.loader-avatar { position: relative; width: 104px; height: 104px; margin-bottom: 6px; }
.loader-pfp { position: absolute; inset: 8px; width: 88px; height: 88px; border-radius: 50%; stroke: none; }
.loader-ring { position: absolute; inset: 0; width: 104px; height: 104px; animation: spin 1.1s linear infinite; }
.loader-ring circle { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 200 300; }
@keyframes spin { to { transform: rotate(360deg); } }
.loader-check {
  position: absolute; right: 2px; bottom: 2px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: #2ecc71; color: #fff; font-weight: 900; font-size: 16px;
  border: 3px solid #fff; transform: scale(0); transition: transform .3s cubic-bezier(.2,.9,.3,1.5);
}
.found .loader-check { transform: scale(1); }
.found .loader-ring { animation: none; }
.found .loader-ring circle { stroke: #2ecc71; stroke-dasharray: none; }
.loader-title { font-weight: 800; font-size: 19px; }
.found .loader-title { color: #1fa85a; }
.loader-step { color: rgba(0,0,0,.6); font-size: 14px; min-height: 18px; }
.loader-bar { width: 220px; height: 6px; border-radius: 6px; background: #eee; overflow: hidden; margin-top: 6px; }
.loader-bar i {
  display: block; height: 100%; width: 0; transition: width .25s;
  background: repeating-linear-gradient(45deg, var(--accent) 0 8px, #ffd800 8px 16px);
  background-size: 22px 22px; animation: stripes .6s linear infinite;
  box-shadow: 0 0 10px rgba(255,220,0,.8);
}
@keyframes stripes { to { background-position: 22px 0; } }
.found .loader-bar i { background: #2ecc71; }

.tile img { opacity: 0; transition: opacity .4s; }
.tile:not(.skeleton) img { opacity: 1; }
.skeleton { background: linear-gradient(90deg, #e9e9e9 25%, #f6f6f6 50%, #e9e9e9 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.hero { text-align: center; padding: 24px 16px 14px; flex-shrink: 0; }
.avatar-ring {
  position: relative; width: 100px; height: 100px; margin: 0 auto; border-radius: 50%;
  padding: 4px; background: var(--grad);
}
.avatar { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 4px solid #fff; background: #ddd; }
.online { position: absolute; right: 6px; bottom: 6px; width: 18px; height: 18px; border-radius: 50%; background: #2ecc71; border: 3px solid #fff; }
.name { font-size: 22px; font-weight: 800; margin-top: 8px; }
.verified {
  display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--verified); color: #fff; font-size: 11px; vertical-align: 3px;
}
.handle { color: var(--muted); font-size: 14px; margin-top: 2px; }
.bio { font-size: 14px; line-height: 1.4; margin: 6px auto 0; max-width: 340px; }

.highlights { display: flex; justify-content: center; gap: 14px; padding: 0 16px 12px; flex-shrink: 0; }
.hl { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; }
.hl-ring { width: 54px; height: 54px; border-radius: 50%; padding: 3px; background: var(--grad); }
.hl-ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #ddd; border: 2px solid #fff; }

.section { border-top: 1px solid var(--line); padding-top: 10px; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.section-title { font-size: 15px; font-weight: 800; padding: 0 16px 8px; display: flex; align-items: center; gap: 6px; }
.section-title span { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--card); padding: 2px 8px; border-radius: 999px; }

.grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); gap: 3px; padding: 0 3px; }
.tile { position: relative; overflow: hidden; background: #ddd; border-radius: 6px; min-height: 0; }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; }
.tile-badge {
  position: absolute; left: 6px; bottom: 6px; display: flex; align-items: center; gap: 3px;
  color: #fff; font-size: 12px; font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.tile-badge svg { width: 14px; height: 14px; stroke-width: 2.6; }
.tile-type { position: absolute; top: 6px; right: 6px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.tile-type svg { width: 16px; height: 16px; fill: #fff; stroke: none; }

.ph {
  width: 100%; height: 100%; display: grid; place-items: center;
  color: rgba(255,255,255,.9); font-size: 12px; font-weight: 700; text-align: center;
}

.cta {
  flex-shrink: 0; margin: 10px 16px 0; height: 52px; border-radius: 16px;
  display: grid; place-items: center; background: #000; color: var(--accent);
  font-weight: 800; font-size: 16px; box-shadow: 0 8px 22px rgba(0,0,0,.25);
  animation: pulse 2s infinite;
}
.cta:active { transform: scale(.97); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(0,0,0,.35); } 50% { box-shadow: 0 0 0 8px rgba(0,0,0,0); } }

.footer { flex-shrink: 0; padding: 8px 16px; text-align: center; font-size: 10px; color: var(--muted); line-height: 1.4; }

.icon-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; }
.viewer { position: fixed; inset: 0; z-index: 50; background: #000; color: #fff; display: none; flex-direction: column; }
.viewer.open { display: flex; }
.viewer-bars { display: flex; gap: 4px; padding: 10px 10px 0; position: absolute; top: 0; left: 0; right: 0; z-index: 3; }
.viewer-bars span { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.35); overflow: hidden; }
.viewer-bars span i { display: block; height: 100%; width: 0; background: #fff; }
.viewer-head { position: absolute; top: 20px; left: 12px; right: 12px; z-index: 3; display: flex; align-items: center; gap: 10px; }
.viewer-head small { display: block; opacity: .7; font-size: 12px; }
.viewer-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #444; }
.viewer-close { margin-left: auto; background: rgba(255,255,255,.15); color: #fff; }
.viewer-media { flex: 1; display: grid; place-items: center; overflow: hidden; }
.viewer-media img, .viewer-media video, .viewer-media .ph { width: 100%; height: 100%; max-width: 480px; object-fit: cover; }
.viewer-tap { position: absolute; top: 80px; bottom: 90px; width: 40%; z-index: 2; }
.viewer-tap.prev { left: 0; }
.viewer-tap.next { right: 0; width: 60%; }
.viewer-cta {
  position: absolute; bottom: max(24px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  z-index: 3; padding: 12px 26px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 800;
  animation: bob 1.4s infinite;
}
@keyframes bob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -6px); } }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); opacity: 0;
  background: #222; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px;
  transition: .25s; z-index: 60; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
