/* Minimal "Wrapped-like" aesthetic (no external deps) */
:root{
  --bg0:#0b0d14;
  --bg1:#131a2a;
  --txt:#eef2ff;
  --muted:#a8b0c6;
  --card:rgba(255,255,255,.06);
  --card2:rgba(255,255,255,.10);
  --stroke:rgba(255,255,255,.12);
  --shadow: 0 12px 40px rgba(0,0,0,.45);
  --radius: 24px;
}
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color:var(--txt);
  background:
    radial-gradient(1200px 800px at 10% 0%, #2b3a86 0%, transparent 55%),
    radial-gradient(900px 700px at 85% 15%, #7a2f6a 0%, transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow:hidden;
}
#app{ height:100%; display:flex; flex-direction:column; }
.topbar{ padding:16px 18px; display:flex; align-items:center; justify-content:space-between; }
.brand{ letter-spacing:.18em; font-weight:800; font-size:13px; }
.muted{ color:var(--muted); font-weight:700; letter-spacing:.12em; }
.controls{ display:flex; gap:10px; }
.btn{
  appearance:none; border:1px solid var(--stroke);
  background:linear-gradient(180deg, var(--card2), var(--card));
  color:var(--txt);
  padding:10px 12px; border-radius:14px;
  cursor:pointer; box-shadow: var(--shadow); user-select:none;
}
.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(0px); opacity:.9; }
.stage{ flex:1; display:flex; align-items:center; justify-content:center; padding: 14px 18px 10px; }
.slide{
  width:min(980px, 96vw); height:min(560px, 74vh);
  border:1px solid var(--stroke); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
  box-shadow: var(--shadow); position:relative; overflow:hidden;
}
.inner{ height:100%; padding: 26px 26px 18px; display:flex; flex-direction:column; gap:18px; }
.h1{
  font-size: clamp(34px, 5vw, 58px); line-height:1.0; margin:0;
  font-weight:900; letter-spacing:-.03em;
}
.h2{ font-size: clamp(18px, 2.3vw, 22px); margin:0; color:var(--muted); font-weight:700; }
.big{ font-size: clamp(28px, 4vw, 44px); font-weight:900; letter-spacing:-.02em; }
.grid{ display:grid; grid-template-columns: 1.2fr .8fr; gap:14px; flex:1; }
.card{ border:1px solid var(--stroke); background: rgba(0,0,0,.18); border-radius: 18px; padding: 16px; overflow:hidden; }
.list{ margin:8px 0 0; padding:0; list-style:none; }
.list li{
  display:flex; justify-content:space-between; gap:12px;
  padding:10px 0; border-bottom:1px dashed rgba(255,255,255,.14);
}
.list li:last-child{ border-bottom:none; }
.rank{
  width:28px; height:28px; border-radius:10px;
  display:inline-flex; align-items:center; justify-content:center;
  background: rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.12);
  font-weight:900;
}
.name{ font-weight:800; }
.sub{ color:var(--muted); font-size:13px; margin-top:3px; }
.flex{ display:flex; gap:10px; align-items:center; }
.small{ font-size:13px; color:var(--muted); }
.pill{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 10px; border-radius:999px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  font-weight:800;
}
.footer{ padding: 10px 18px 16px; display:flex; justify-content:space-between; align-items:center; gap:14px; }
.progress{ display:flex; gap:8px; align-items:center; }
.dot{ width:10px; height:10px; border-radius:999px; border:1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.10); }
.dot.active{ width:22px; background: rgba(255,255,255,.75); }
.kbd{ display:flex; gap:8px; align-items:center; color:var(--muted); font-weight:700; font-size:13px; }
.chip{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New";
  font-size:12px; padding:3px 7px; border-radius:8px;
  border:1px solid rgba(255,255,255,.18); background: rgba(0,0,0,.24);
}
.loading{ height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; }
.spinner{
  width:34px; height:34px; border-radius:999px;
  border:3px solid rgba(255,255,255,.20);
  border-top-color: rgba(255,255,255,.85);
  animation: spin 1s linear infinite;
}
.loadingText{ font-weight:900; }
.loadingSub{ color:var(--muted); font-size:13px; }
@keyframes spin { to { transform: rotate(360deg); } }
canvas{ width:100%; height:100%; }
textarea:focus{ outline:none; }


/* Animated background blobs */
.bg{
  position:fixed;
  inset:-40vh -20vw;
  z-index:-1;
  filter: blur(22px);
  opacity:.9;
}
.blob{
  position:absolute;
  width: 55vmax;
  height: 55vmax;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.55), rgba(255,255,255,0) 55%);
  mix-blend-mode: overlay;
  animation: drift 18s ease-in-out infinite;
}
.blob.b1{ left: -5vmax; top: -10vmax; transform: rotate(12deg); }
.blob.b2{ right:-12vmax; top: 8vmax; width:45vmax; height:45vmax; animation-duration: 22s; }
.blob.b3{ left: 22vmax; bottom:-20vmax; width:48vmax; height:48vmax; animation-duration: 26s; }

@keyframes drift{
  0%{ transform: translate3d(0,0,0) scale(1) rotate(0deg); opacity:.85; }
  50%{ transform: translate3d(6vmax,-4vmax,0) scale(1.12) rotate(10deg); opacity:.95; }
  100%{ transform: translate3d(0,0,0) scale(1) rotate(0deg); opacity:.85; }
}

/* Slide transitions */
.slide{
  will-change: transform, opacity;
}
.slide.fadeOut{ opacity:0; transform: translateY(10px) scale(.99); transition: 260ms ease; }
.slide.fadeIn{ opacity:1; transform: translateY(0) scale(1); transition: 320ms ease; }

.card{
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.18)),
    radial-gradient(700px 280px at 30% 0%, rgba(255,255,255,.10), rgba(255,255,255,0) 60%);
}

/* Big poster style for hero */
.poster{
  height:100%;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:14px;
}
.poster .mega{
  font-size: clamp(56px, 8vw, 92px);
  line-height: .92;
  margin:0;
  font-weight: 950;
  letter-spacing: -0.04em;
}
.poster .tagline{
  color: rgba(255,255,255,.82);
  font-weight: 800;
  letter-spacing: .04em;
}

/* Heatmap */
.heatmap{
  display:grid;
  grid-template-columns: repeat(17, 1fr);
  gap:6px;
  align-items:stretch;
}
.hmcell{
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  position: relative;
}
.hmcell.l1{ background: rgba(255,255,255,.10); }
.hmcell.l2{ background: rgba(255,255,255,.18); }
.hmcell.l3{ background: rgba(255,255,255,.28); }
.hmcell.l4{ background: rgba(255,255,255,.40); }

.hmlegend{
  display:flex;
  align-items:center;
  gap:8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.hmlegend .sw{ width:14px; height:14px; border-radius:5px; border:1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05); }
.hmlegend .sw.l1{ background: rgba(255,255,255,.10); }
.hmlegend .sw.l2{ background: rgba(255,255,255,.18); }
.hmlegend .sw.l3{ background: rgba(255,255,255,.28); }
.hmlegend .sw.l4{ background: rgba(255,255,255,.40); }

/* Radial donut */
.donutWrap{
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
}
.donutWrap canvas{
  max-width: 100%;
  max-height: 100%;
}

/* Confetti */
.confetti{
  pointer-events:none;
  position:absolute;
  inset:0;
  overflow:hidden;
}
.confetti i{
  position:absolute;
  width:10px; height:16px;
  border-radius:3px;
  background: rgba(255,255,255,.85);
  opacity:.0;
  animation: conf 1.9s ease forwards;
}
@keyframes conf{
  0%{ transform: translateY(-10vh) rotate(0deg); opacity:0; }
  10%{ opacity:.9; }
  100%{ transform: translateY(115vh) rotate(320deg); opacity:0; }
}
