:root{
  --bg0: #0b0c10;
  --bg1: #0f1220;
  --line: rgba(255,255,255,.10);
  --glass: rgba(255,255,255,.06);
  --shadow: 0 24px 60px rgba(0,0,0,.45);
}

*{ box-sizing: border-box; }
html,body{ height: 100%; }
body{
  margin: 0;
  font-family: Manrope, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 800px at 25% -10%, rgba(120,119,255,.35), transparent 60%),
              radial-gradient(900px 600px at 80% 15%, rgba(45,212,191,.22), transparent 62%),
              radial-gradient(1000px 700px at 50% 110%, rgba(244,114,182,.18), transparent 58%),
              linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow-x: hidden;
}

.bg{ position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.bg__grad{
  position: absolute; inset: -20%;
  background: conic-gradient(from 180deg at 50% 50%,
      rgba(120,119,255,.28), rgba(45,212,191,.22), rgba(244,114,182,.18), rgba(120,119,255,.28));
  filter: blur(40px) saturate(130%);
  animation: spin 18s linear infinite;
  opacity: .75;
}
.bg__grid{
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(closest-side, rgba(0,0,0,.65), transparent 75%);
  opacity: .35;
}
.bg__noise{
  position: absolute; inset: 0;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="140" height="140"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.85" numOctaves="2" stitchTiles="stitch"/></filter><rect width="140" height="140" filter="url(%23n)" opacity="0.25"/></svg>');
  opacity: .12;
  mix-blend-mode: overlay;
}

@keyframes spin{ to{ transform: rotate(360deg); } }

.screen{
  position: relative;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.frame{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.28);
}

.meme{
  position:absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 700ms ease, transform 900ms cubic-bezier(.2,.8,.2,1);
  filter: saturate(1.08) contrast(1.02);
  background: #000;
}

.meme.is-visible{
  opacity: 1;
  transform: scale(1.0);
}

.shine{
  position:absolute; inset: -40%;
  background: radial-gradient(closest-side, rgba(255,255,255,.10), transparent 72%);
  transform: translate3d(0,0,0);
  opacity: .0;
  transition: opacity .35s ease;
}

.overlay{
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.tabs{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.22);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.tab{
  appearance: none;
  border: 0;
  padding: 8px 10px;
  border-radius: 999px;
  background: transparent;
  color: rgba(255,255,255,.72);
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}

.tab:hover{ transform: translateY(-1px); color: rgba(255,255,255,.92); }
.tab.is-active{
  background: rgba(255,255,255,.10);
  color: rgba(255,255,255,.94);
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .bg__grad{ animation: none; }
}
