:root {
  /* desktop background (changes with theme) */
  --desk: #9fd0ff;
  --desk-2: #d6ecff;
  --desk-deep: #6aa8ff;
  --dot: rgba(255, 255, 255, .55);

  /* window palette */
  --c-blue: #1b3cf5;
  --c-violet: #6d4aff;
  --c-pink: #ff3d9a;
  --c-teal: #0a9c84;
  --c-orange: #ff6a2b;
  --c-mint: #6dffcf;
  --c-green: #12a150;

  --ink: #0a0f3d;
  --paper: #f6f3ea;
  --paper-2: #e9e5d8;
  --cyan: #8ef3ff;
  --white: #ffffff;
  --display: "Jersey 10", "Silkscreen", monospace;
  --pixel: "Silkscreen", monospace;
  --term: "VT323", ui-monospace, monospace;
  --shadow: 6px 6px 0 var(--ink);
}
[data-theme="midnight"] {
  --foot: #fff; --word: rgba(255,255,255,.14);
  --desk: #0b0f33; --desk-2: #23206b; --desk-deep: #02030d; --dot: rgba(142, 243, 255, .14);
}
[data-theme="bubblegum"] {
  --foot: #fff; --word: rgba(255,255,255,.3);
  --desk: #ff5fae; --desk-2: #ff9bd0; --desk-deep: #c42a7c; --dot: rgba(255, 255, 255, .25);
  --c-pink: #1b3cf5;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh; overflow-x: hidden;
  font-family: var(--term); font-size: 20px; line-height: 1.25; color: var(--ink);
  background-color: var(--desk);
  background-image:
    radial-gradient(var(--dot) 1px, transparent 1.2px),
    radial-gradient(ellipse 80% 60% at 50% -10%, var(--desk-2), transparent 70%),
    radial-gradient(ellipse 90% 60% at 50% 115%, var(--desk-deep), transparent 70%);
  background-size: 8px 8px, 100% 100%, 100% 100%;
  background-attachment: fixed;
  transition: background-color .4s;
  -webkit-font-smoothing: none;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.blink { animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ── Atmosphere ── */
.stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.star { position: absolute; width: 3px; height: 3px; background: #fff; animation: twinkle var(--d, 3s) steps(3) infinite; animation-delay: var(--dl, 0s); }
.star.big { width: 3px; height: 3px; box-shadow: 3px 0 #fff, -3px 0 #fff, 0 3px #fff, 0 -3px #fff; }
@keyframes twinkle { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }
.bigword {
  position: fixed; left: 50%; bottom: -4vw; transform: translateX(-50%); z-index: 0; pointer-events: none;
  font-family: var(--display); font-size: 30vw; line-height: 1; white-space: nowrap; letter-spacing: .02em;
  color: transparent; -webkit-text-stroke: 2px var(--word, rgba(255,255,255,.5));
}
.crt {
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,20,.10) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 60%, rgba(0,0,40,.4) 100%);
  animation: flicker 6s infinite;
}
@keyframes flicker { 0%, 97%, 100% { opacity: 1; } 98% { opacity: .85; } 99% { opacity: .95; } }

/* ── Boot ── */
.boot {
  position: fixed; inset: 0; z-index: 100; background: #020414; color: var(--cyan);
  padding: 32px; font-family: var(--term); font-size: 22px; cursor: pointer;
  transition: opacity .5s, visibility 0s .5s;
}
.boot pre { font: inherit; white-space: pre-wrap; text-shadow: 0 0 8px rgba(142,243,255,.6); }
.boot.done { opacity: 0; visibility: hidden; }

/* ── Menu bar + ticker ── */
.menubar {
  position: sticky; top: 0; z-index: 50; height: 36px; display: flex; align-items: center; gap: 18px;
  padding: 0 16px; background: var(--paper); border-bottom: 2px solid var(--ink);
  font-family: var(--pixel); font-size: 12px; text-transform: uppercase;
}
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--c-blue); padding: 4px 8px; margin-left: -8px; }
.logo:hover { background: var(--c-blue); color: var(--white); }
.menubar nav { display: flex; gap: 2px; }
.menubar nav a { padding: 4px 10px; }
.menubar nav a:hover { background: var(--c-blue); color: var(--white); }
.themes { margin-left: auto; display: flex; gap: 6px; }
.themes button { width: 16px; height: 16px; border: 2px solid var(--ink); }
.themes [data-theme="sky"] { background: #9fd0ff; }
.themes [data-theme="midnight"] { background: #0b0f33; }
.themes [data-theme="bubblegum"] { background: #ff5fae; }
.themes button:hover { transform: translateY(-2px); }
.themes button.on { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.ticker { position: relative; z-index: 2; overflow: hidden; background: var(--ink); color: var(--cyan); border-bottom: 2px solid var(--ink); height: 28px; display: flex; align-items: center; }
.ticker-track { display: inline-flex; white-space: nowrap; animation: marquee 40s linear infinite; font-size: 20px; }
.ticker-track span { padding-right: 40px; }
.ticker-track span:nth-child(3n+2) { color: #ff9ad0; } .ticker-track span:nth-child(3n) { color: var(--c-mint); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ── Desktop + windows ── */
.desktop {
  position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 44px 24px 24px;
  display: grid; gap: 30px; grid-template-columns: repeat(12, 1fr); align-items: start;
}
.win {
  position: relative; display: flex; flex-direction: column;
  background: var(--paper); border: 2px solid var(--ink); box-shadow: var(--shadow);
  animation: pop .45s steps(5) both;
}
.win:nth-child(2) { animation-delay: .08s; } .win:nth-child(3) { animation-delay: .16s; }
.win:nth-child(4) { animation-delay: .24s; } .win:nth-child(5) { animation-delay: .32s; }
@keyframes pop { from { opacity: 0; transform: scale(.85); } }
.win.dragging { box-shadow: 12px 12px 0 var(--ink); cursor: grabbing; }
.win.dragging iframe { pointer-events: none; }

.titlebar {
  position: relative; height: 28px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: var(--tb, var(--c-blue)); color: var(--white); border-bottom: 2px solid var(--ink);
  font-family: var(--pixel); font-size: 12px; text-transform: lowercase; cursor: grab; user-select: none; touch-action: none;
}
.titlebar::before {
  content: ""; position: absolute; left: 34px; right: 34px; top: 8px; bottom: 8px;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,.55) 0 1px, transparent 1px 3px);
}
.titlebar span { position: relative; background: var(--tb, var(--c-blue)); padding: 0 10px; }
.close { position: absolute; left: 8px; width: 16px; height: 16px; background: var(--paper); border: 2px solid var(--ink); }
.close:hover { background: var(--c-mint); }
.win.shaded > :not(.titlebar):not(.sticker) { display: none; }

.win-body { padding: 18px; flex: 1; }
.win-body.dark { background: var(--ink); color: var(--paper); }
.tag { font-family: var(--pixel); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; opacity: .7; }

/* Stickers */
.sticker { position: absolute; z-index: 5; pointer-events: none; font-family: var(--display); line-height: 1; }
.sticker.burst {
  right: -22px; top: -26px; width: 92px; height: 92px; display: grid; place-items: center;
  background: var(--c-pink); color: var(--white); font-size: 34px; rotate: 12deg;
  filter: drop-shadow(3px 3px 0 var(--ink)); animation: wobble 3s ease-in-out infinite;
}
@keyframes wobble { 50% { rotate: 4deg; scale: 1.06; } }
.sticker.pill {
  padding: 6px 14px 4px; font-size: 22px; background: var(--sc); color: var(--st, var(--white));
  border: 2px solid var(--ink); border-radius: 999px; box-shadow: 3px 3px 0 var(--ink); white-space: nowrap;
}

/* about */
.about { grid-column: span 5; }
.about .win-body { display: flex; flex-direction: column; gap: 18px; }
.pfp {
  position: relative; width: 150px; aspect-ratio: 1; border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--c-pink);
  background: linear-gradient(135deg, var(--c-blue), var(--c-violet)); display: grid; place-items: center;
  cursor: pointer; transition: transform .6s cubic-bezier(.3,1.5,.5,1);
}
.pfp img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: contrast(1.1) saturate(1.1); transition: filter .2s; }
.pfp:hover img { filter: contrast(1.3) saturate(1.4) hue-rotate(-10deg); }
.pfp-fallback { font-family: var(--display); font-size: 110px; color: var(--white); line-height: 1; text-shadow: 4px 4px 0 var(--ink); }
.pfp-scan { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(10,15,61,.18) 0 1px, transparent 1px 3px); }
.pfp.roll { transform: rotate(720deg) scale(1.1); }
.bubble {
  position: absolute; left: calc(100% + 16px); top: 10px; white-space: nowrap; padding: 6px 10px; z-index: 4;
  background: var(--white); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); font-size: 20px;
  opacity: 0; transform: scale(.6); transform-origin: left center; transition: .2s steps(3); pointer-events: none;
}
.bubble::before { content: ""; position: absolute; left: -9px; top: 10px; width: 12px; height: 12px; background: var(--white); border-left: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); }
.bubble.show { opacity: 1; transform: none; }

.about h1 {
  position: relative; font-family: var(--display); font-weight: 400; font-size: clamp(88px, 11vw, 140px); line-height: .8;
  color: var(--c-blue); text-shadow: 3px 3px 0 var(--c-pink), 6px 6px 0 var(--ink); letter-spacing: .01em; margin-top: 6px;
}
.tagline { margin-top: 14px; font-size: 22px; max-width: 30ch; }
.statusline {
  display: flex; justify-content: space-between; gap: 10px; padding: 8px 14px; border-top: 2px solid var(--ink);
  background: var(--paper-2); font-family: var(--pixel); font-size: 11px; text-transform: uppercase;
}
.led { display: inline-block; width: 8px; height: 8px; background: #2bff88; box-shadow: 0 0 6px #2bff88; margin-right: 4px; animation: blink 1.6s steps(2) infinite; }

/* Name glitch (easter egg) */
.about h1.glitch { animation: jitter .12s steps(2) 10; }
.about h1.glitch::before, .about h1.glitch::after {
  content: attr(data-text); position: absolute; inset: 0; text-shadow: none;
}
.about h1.glitch::before { color: var(--c-pink); transform: translate(-6px, 0); clip-path: inset(10% 0 55% 0); animation: slice 0.3s steps(2) infinite; }
.about h1.glitch::after { color: var(--cyan); transform: translate(6px, 0); clip-path: inset(55% 0 5% 0); animation: slice 0.25s steps(2) infinite reverse; }
@keyframes jitter { 50% { transform: translate(3px, -2px) skewX(-6deg); } }
@keyframes slice { 0% { clip-path: inset(10% 0 60% 0); } 50% { clip-path: inset(50% 0 20% 0); } 100% { clip-path: inset(30% 0 40% 0); } }

/* player */
.player { grid-column: span 7; }
.player .win-body { display: flex; flex-direction: column; gap: 16px; }
.deck { display: flex; gap: 18px; align-items: center; }
.cd {
  position: relative; width: 96px; height: 96px; border-radius: 50%; flex-shrink: 0; padding: 0;
  background: #0a0a0c; box-shadow: 0 8px 18px -4px rgba(0,0,0,.8), 0 0 0 1px #000;
}
/* the vinyl itself: grooves + label, this part spins */
.cd-disc {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 33%, rgba(0,0,0,.9) 33.5% 35%, transparent 35.5% 93%, #1c1c20 94% 96%, transparent 96.5%),
    repeating-radial-gradient(circle, #0c0c0e 0 1px, #19191c 1.4px 1.8px, #0a0a0b 2.2px 3px);
  animation: spin 1.8s linear infinite; animation-play-state: paused;
}
.cd-disc::before { /* centre label */
  content: ""; position: absolute; inset: 34%; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #ff79bb, #e0267c 60%, #a3155a);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.35), inset 0 0 0 4px rgba(255,255,255,.08);
}
.cd-disc::after { /* print on the label, so you can see it turn */
  content: ""; position: absolute; left: 50%; top: 39%; width: 13%; height: 2px; transform: translateX(-50%);
  background: rgba(255,255,255,.8); box-shadow: 0 4px 0 rgba(255,255,255,.45), 0 15px 0 rgba(255,255,255,.35);
}
/* light reflections stay still while the record spins */
.cd::before, .cd::after { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; z-index: 2; }
.cd::before {
  background: conic-gradient(from 25deg, transparent 0 6%, rgba(255,255,255,.16) 11%, transparent 17% 50%, rgba(255,255,255,.11) 61%, transparent 67%);
  mask: radial-gradient(circle, transparent 0 35%, #000 36%); -webkit-mask: radial-gradient(circle, transparent 0 35%, #000 36%);
}
.cd::after { box-shadow: inset 0 0 0 1px rgba(255,255,255,.07), inset 0 0 10px rgba(0,0,0,.9); }
.cd-hole {
  position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px; border-radius: 50%; z-index: 3;
  background: var(--ink); box-shadow: inset 0 1px 2px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.15);
}
.player.playing .cd-disc, .player.dj .cd-disc { animation-play-state: running; }
.cd:active { scale: .96; }
@keyframes spin { to { transform: rotate(360deg); } }
.lcd {
  flex: 1; height: 96px; padding: 10px 14px; display: flex; flex-direction: column; justify-content: space-between;
  background: #0d2a2e; border: 2px solid var(--paper); color: var(--cyan); text-shadow: 0 0 6px rgba(142,243,255,.7);
  font-size: 24px; box-shadow: inset 0 0 20px rgba(0,0,0,.6); overflow: hidden; white-space: nowrap;
}
.eq { display: flex; align-items: flex-end; gap: 4px; height: 36px; }
.eq i { flex: 1; background: var(--cyan); box-shadow: 0 0 6px var(--cyan); height: 100%; transform-origin: bottom; animation: eq .9s steps(6) infinite alternate; }
@keyframes eq { from { transform: scaleY(.15); } to { transform: scaleY(1); } }
.embed { border: 2px solid var(--paper); min-height: 152px; background: #000; }
.embed iframe { display: block; width: 100%; border: 0; }
/* DJ mode (easter egg) */
.player.dj .cd-disc { animation-duration: .35s; }
.player.dj .lcd { color: #ff9ad0; text-shadow: 0 0 8px #ff3d9a; }
.player.dj .eq i { animation-duration: .25s !important; }
.player.dj .eq i:nth-child(4n+1) { background: var(--c-pink); box-shadow: 0 0 6px var(--c-pink); }
.player.dj .eq i:nth-child(4n+2) { background: var(--c-mint); box-shadow: 0 0 6px var(--c-mint); }
.player.dj .eq i:nth-child(4n+3) { background: #b69bff; box-shadow: 0 0 6px #b69bff; }

/* instagram */
.insta { grid-column: span 6; transition: transform .1s; }
.insta-body {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background:
    radial-gradient(circle at 0% 100%, rgba(255,106,43,.22), transparent 55%),
    radial-gradient(circle at 100% 0%, rgba(109,74,255,.22), transparent 55%),
    var(--paper);
}
.cam {
  width: 72px; height: 72px; padding: 10px; flex-shrink: 0; color: var(--white);
  background: linear-gradient(45deg, #ff6a2b, #ff3d9a 50%, #6d4aff); border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
}
.insta-text { flex: 1; min-width: 150px; }
.insta-text strong { display: block; font-family: var(--display); font-weight: 400; font-size: 52px; line-height: .9; color: var(--ink); margin-top: 4px; }
.btn {
  display: inline-block; padding: 8px 14px; background: var(--c-pink); color: var(--white); border: 2px solid var(--ink);
  font-family: var(--pixel); font-size: 12px; box-shadow: 3px 3px 0 var(--ink);
}
.insta:hover .btn { background: var(--ink); }
.insta:hover .cam { animation: jitter .15s steps(2) 3; }
.insta:active { transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--ink); }

/* sys */
.sys { grid-column: 7 / span 6; grid-row: span 2; align-self: stretch; }
.desktop { grid-auto-flow: row dense; }
.sys dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; }
.sys dt { font-family: var(--pixel); font-size: 11px; opacity: .7; }
.sys dd { font-size: 21px; }
.sys .hint { cursor: help; color: var(--c-violet); }
.bar { display: block; height: 14px; border: 2px solid var(--ink); padding: 1px; }
.bar i { display: block; height: 100%; width: calc(var(--v) * 100%); background: repeating-linear-gradient(90deg, var(--c-teal) 0 6px, transparent 6px 8px); }

/* photos */
.photos { grid-column: span 12; }
.toolbar {
  display: flex; justify-content: space-between; padding: 6px 14px; border-bottom: 2px solid var(--ink);
  background: var(--paper-2); font-family: var(--pixel); font-size: 11px; text-transform: uppercase;
}
.photos .win-body { padding-top: 26px; }
.gallery { columns: 4 220px; column-gap: 20px; }
.tile {
  break-inside: avoid; margin-bottom: 20px; padding: 8px 8px 0; background: var(--white); border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink); cursor: zoom-in; transition: transform .12s steps(2);
}
.tile:nth-child(3n+1) { transform: rotate(-1.2deg); } .tile:nth-child(3n+2) { transform: rotate(.8deg); }
.tile:hover { transform: rotate(0) translate(-2px, -2px); box-shadow: 6px 6px 0 var(--c-orange); }
.tile img { width: 100%; display: block; border: 2px solid var(--ink); }
.tile figcaption { padding: 6px 2px 8px; font-size: 19px; min-height: 12px; }
.tile.empty { cursor: default; display: flex; flex-direction: column; padding: 8px; }
.tile.empty .ph {
  flex: 1; display: grid; place-items: center; text-align: center; padding: 12px; border: 2px solid var(--ink);
  font-family: var(--pixel); font-size: 11px; color: var(--white); text-transform: uppercase;
  background-image: radial-gradient(rgba(255,255,255,.25) 1px, transparent 1.2px); background-size: 6px 6px;
}
.tile.empty span.cap { padding: 6px 2px 0; font-size: 19px; }

.foot { position: relative; z-index: 1; text-align: center; padding: 30px 16px 50px; color: var(--foot, var(--ink)); font-family: var(--pixel); font-size: 11px; line-height: 2; }
.foot-hint { opacity: .55; }

/* Lightbox + dialogs */
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(10,15,61,.7); display: grid; place-items: center; padding: 20px; }
.lightbox[hidden] { display: none; }
.lb-win { max-width: min(1000px, 100%); max-height: 100%; animation: pop .25s steps(4); }
.lightbox .titlebar { cursor: default; }
.lb-body { padding: 12px; background: var(--white); text-align: center; }
.lb-body img { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; border: 2px solid var(--ink); }
.lb-body figcaption { margin-top: 8px; }
.lb-nav { display: flex; justify-content: space-between; border-top: 2px solid var(--ink); }
.lb-nav button { flex: 1; padding: 8px; font-family: var(--pixel); font-size: 12px; }
.lb-nav button + button { border-left: 2px solid var(--ink); }
.lb-nav button:hover { background: var(--c-blue); color: var(--white); }
.dialog { width: min(440px, 100%); animation: pop .25s steps(4); }
.dialog-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.dialog-head svg { border: 2px solid var(--ink); }
.dialog-head strong { display: block; font-family: var(--display); font-weight: 400; font-size: 40px; line-height: .9; }
.dialog p { margin-bottom: 10px; }
.hints { list-style: none; display: grid; gap: 4px; padding: 10px 12px; background: var(--paper-2); border: 2px solid var(--ink); }
.hints li::before { content: "▸ "; color: var(--c-violet); }
.hints li.found { color: var(--c-teal); text-decoration: line-through; }

/* Toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 95; display: flex; flex-direction: column; gap: 12px; align-items: flex-end; pointer-events: none; }
.toast { width: min(300px, calc(100vw - 32px)); animation: pop .3s steps(4) both; }
.toast .titlebar { cursor: default; }
.toast .win-body { padding: 12px 14px; }
.toast strong { display: block; font-family: var(--display); font-weight: 400; font-size: 30px; line-height: .9; color: var(--tb); }
.toast.out { animation: out .3s steps(3) forwards; }
@keyframes out { to { opacity: 0; transform: translateY(10px); } }

/* Confetti + sparkles */
.confetti { position: fixed; top: -12px; z-index: 96; width: 10px; height: 10px; pointer-events: none; animation: fall var(--t) linear forwards; }
@keyframes fall { to { transform: translate(var(--x), 110vh) rotate(var(--r)); } }
.spark { position: fixed; z-index: 96; width: 4px; height: 4px; pointer-events: none; background: var(--c); box-shadow: 4px 0 var(--c), -4px 0 var(--c), 0 4px var(--c), 0 -4px var(--c); animation: spark .7s steps(5) forwards; }
@keyframes spark { to { transform: translate(var(--x), var(--y)) scale(.2); opacity: 0; } }

/* Party mode (Konami) */
body.party .desktop, body.party .bigword, body.party .stars { animation: hue 3s linear infinite; }
body.party .win { animation: bob 1s ease-in-out infinite alternate; }
body.party .win:nth-child(even) { animation-delay: -.5s; }
@keyframes hue { to { filter: hue-rotate(360deg); } }
@keyframes bob { from { transform: translateY(-4px) rotate(-.6deg); } to { transform: translateY(4px) rotate(.6deg); } }

/* Screen glitch (2033) */
body.zap .desktop { animation: zap .6s steps(4); }
@keyframes zap { 0% { filter: invert(1); transform: translateX(-8px); } 50% { filter: invert(0) hue-rotate(90deg); transform: translateX(8px) skewX(4deg); } 100% { filter: none; transform: none; } }

/* Screensaver */
.saver { position: fixed; inset: 0; z-index: 99; background: #000; cursor: none; animation: fadein .6s; }
@keyframes fadein { from { opacity: 0; } }
.saver-logo { position: absolute; left: 0; top: 0; font-family: var(--display); font-size: 64px; line-height: 1; white-space: nowrap; }
.saver-tip { position: absolute; left: 0; right: 0; bottom: 24px; text-align: center; color: #555; font-family: var(--pixel); font-size: 11px; }

@media (max-width: 920px) {
  .about, .player, .photos { grid-column: span 12; }
  .insta, .sys { grid-column: span 6; }
}
@media (max-width: 600px) {
  .desktop { padding: 34px 16px 24px; gap: 26px; }
  .win { box-shadow: 4px 4px 0 var(--ink); }
  .insta, .sys { grid-column: span 12; }
  .menubar { gap: 12px; }
  .menubar nav { display: none; }
  .pfp { width: 120px; }
  .sticker.burst { right: -8px; top: -22px; width: 76px; height: 76px; font-size: 28px; }
  .sticker.pill { right: 8px !important; font-size: 19px; }
  .deck .cd { width: 72px; height: 72px; }
  .lcd { height: 72px; font-size: 20px; }
  .eq { height: 24px; }
  .insta-text strong { font-size: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}

/* ── Anonymous messages ── */
.anon { grid-column: span 12; }
.anon-body { display: grid; grid-template-columns: 1fr 1.3fr; gap: 28px; align-items: start; }
.anon-intro h2 { font-family: var(--display); font-weight: 400; font-size: clamp(48px, 6vw, 72px); line-height: .85; margin-top: 8px; color: var(--ink); }
.anon-intro h2 em { font-style: normal; color: var(--c-orange); text-shadow: 3px 3px 0 var(--ink); }
.anon-intro p { margin-top: 12px; font-size: 22px; max-width: 28ch; }
.anon-form textarea {
  width: 100%; resize: vertical; min-height: 130px; padding: 12px 14px; font: inherit; font-size: 22px; color: var(--ink);
  background: var(--white); border: 2px solid var(--ink); box-shadow: inset 3px 3px 0 rgba(10,15,61,.12); outline: none;
  background-image: repeating-linear-gradient(transparent 0 27px, rgba(27,60,245,.12) 27px 28px); background-attachment: local; line-height: 28px;
}
.anon-form textarea:focus { box-shadow: inset 3px 3px 0 rgba(10,15,61,.12), 4px 4px 0 var(--c-orange); }
.honey { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.anon-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.vibes { display: flex; gap: 6px; }
.vibes input { position: absolute; opacity: 0; pointer-events: none; }
.vibes span {
  display: grid; place-items: center; min-width: 40px; height: 34px; padding: 0 8px; cursor: pointer;
  border: 2px solid var(--ink); background: var(--paper); font-size: 20px; transition: transform .1s;
}
.vibes span:hover { transform: translateY(-2px); }
.vibes input:checked + span { background: var(--c-orange); color: var(--white); box-shadow: 2px 2px 0 var(--ink); }
.vibes input:focus-visible + span { outline: 2px solid var(--c-violet); outline-offset: 2px; }
.anon-count { margin-left: auto; font-family: var(--pixel); font-size: 11px; opacity: .6; }
.btn.send { background: var(--c-orange); cursor: pointer; }
.btn.send:hover { background: var(--ink); }
.btn.send:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.send:disabled { opacity: .5; }
.anon-status { min-height: 20px; margin-top: 10px; font-family: var(--pixel); font-size: 11px; }
.anon-status > span { display: none; }
.anon-form[data-state="sending"] [data-s="sending"],
.anon-form[data-state="sent"] [data-s="sent"],
.anon-form[data-state="error"] [data-s="error"],
.anon-form[data-state="wait"] [data-s="wait"] { display: inline; }
[data-s="sent"] { color: var(--c-teal); } [data-s="error"], [data-s="wait"] { color: #d6286a; }
@media (max-width: 760px) { .anon-body { grid-template-columns: 1fr; gap: 16px; } }

/* ── Spotify profile ── */
.spoty { grid-column: 1 / span 6; transition: transform .1s; }
.spoty-body {
  background:
    radial-gradient(circle at 0% 100%, rgba(18,161,80,.22), transparent 55%),
    radial-gradient(circle at 100% 0%, rgba(109,255,207,.25), transparent 55%),
    var(--paper);
}
.spoty-icon { background: linear-gradient(45deg, #0b7a3b, #12a150 50%, #3ee08a); }
.spoty .btn { background: var(--c-green); }
.spoty:hover .btn { background: var(--ink); }
.spoty:hover .spoty-icon { animation: jitter .15s steps(2) 3; }
.spoty:active { transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--ink); }
.insta { grid-column: 1 / span 6; }
@media (max-width: 600px) {
  .insta, .spoty, .sys { grid-column: 1 / -1 !important; grid-row: auto; }
}

/* ── Falling music notes ── */
.rain { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.note {
  position: absolute; top: -90px; line-height: 0;
  filter: drop-shadow(2px 0 0 var(--ink)) drop-shadow(-2px 0 0 var(--ink)) drop-shadow(0 2px 0 var(--ink)) drop-shadow(0 -2px 0 var(--ink)) drop-shadow(3px 3px 0 var(--ink));
  animation: rain var(--dur) linear forwards; will-change: transform;
}
.note svg { display: block; }
.note.piano { filter: drop-shadow(3px 3px 0 var(--ink)); }
@keyframes rain {
  0% { transform: translate(0, 0) rotate(var(--r0)) scale(.4); opacity: 0; }
  6% { opacity: 1; transform: translate(0, 4vh) rotate(var(--r0)) scale(1); }
  50% { transform: translate(var(--sway), 55vh) rotate(0deg); }
  88% { opacity: 1; }
  100% { transform: translate(calc(var(--sway) * -.6), calc(100vh + 140px)) rotate(var(--r1)); opacity: 0; }
}
.lcd-row { display: flex; align-items: center; gap: 8px; }
.rain-toggle {
  margin-left: auto; padding: 3px 8px; border: 1px solid currentColor; font-family: var(--pixel); font-size: 10px;
  color: var(--cyan); text-shadow: none; flex-shrink: 0;
}
.rain-toggle:hover { background: var(--cyan); color: var(--ink); }
.rain-toggle.off { opacity: .5; }

/* ── Carousels (Core Memories) ── */
.gallery { columns: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 30px 26px; align-items: start; }
.gallery .tile { margin-bottom: 0; }
.tile.carousel { padding: 8px 8px 0; cursor: zoom-in; }
.tile.many { box-shadow: 5px 5px 0 #fff, 7px 7px 0 var(--ink), 11px 11px 0 #fff, 13px 13px 0 var(--ink); }
.tile.many:hover { box-shadow: 5px 5px 0 #fff, 7px 7px 0 var(--ink), 11px 11px 0 #fff, 13px 13px 0 var(--c-orange); }
.slide-frame { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border: 2px solid var(--ink); background: var(--ink); touch-action: pan-y; user-select: none; }
.tile.carousel .slide-frame img { width: 100%; height: 100%; object-fit: cover; border: 0; display: block; }
.slide-frame img.swap { animation: swap .25s steps(4); }
@keyframes swap { from { opacity: .2; transform: scale(1.04); } }
.c-btn {
  position: absolute; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; z-index: 2;
  background: var(--paper); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink);
  font-size: 13px; color: var(--ink); opacity: 0; transition: opacity .15s;
}
.c-prev { left: 8px; } .c-next { right: 8px; }
.c-btn:hover { background: var(--c-orange); color: #fff; }
.c-btn:active { transform: translateY(-50%) translate(2px, 2px); box-shadow: none; }
.tile:hover .c-btn, .c-btn:focus-visible { opacity: 1; }
@media (hover: none) { .c-btn { opacity: .9; } }
.c-count {
  position: absolute; top: 8px; right: 8px; z-index: 2; padding: 3px 6px 2px;
  background: var(--ink); color: #fff; font-family: var(--pixel); font-size: 10px;
}
.c-dots { display: flex; justify-content: center; align-items: center; gap: 4px; padding-top: 8px; }
.c-dots i { width: 7px; height: 7px; border: 1px solid var(--ink); background: var(--paper-2); }
.c-dots i.on { background: var(--c-orange); }
.c-dots b { font-family: var(--pixel); font-size: 10px; line-height: 1; }
.tile.carousel figcaption { padding: 6px 2px 10px; font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Equalizer + play arrow rest when nothing is playing (DJ mode overrides) */
.player:not(.playing):not(.dj) .eq i { animation: none; transform: scaleY(.08); opacity: .55; transition: transform .4s steps(4), opacity .4s; }
.player:not(.playing):not(.dj) .lcd-row .blink { animation: none; opacity: .4; }

/* ── trivia.exe ── */
.trivia { grid-column: span 12; }
.trivia-body { min-height: 300px; }
.tv-intro h2, .tv-end h2 { font-family: var(--display); font-weight: 400; font-size: clamp(44px, 6vw, 72px); line-height: .85; margin-top: 8px; color: var(--ink); }
.tv-intro h2 em { font-style: normal; color: var(--c-pink); text-shadow: 3px 3px 0 var(--ink); }
.tv-intro p, .tv-end p { margin-top: 12px; font-size: 22px; max-width: 46ch; }
.tv-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 20px; }
.trivia .btn { cursor: pointer; font: inherit; font-family: var(--pixel); font-size: 13px; box-shadow: 3px 3px 0 var(--ink); }
.trivia .btn:hover { background: var(--ink); }
.trivia .btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.tv-share { background: var(--c-blue) !important; }
.tv-share:hover { background: var(--ink) !important; }
.tv-best { font-family: var(--pixel); font-size: 11px; opacity: .7; }
.tv-top { display: flex; align-items: center; gap: 14px; }
.tv-progress { flex: 1; display: flex; gap: 4px; }
.tv-progress i { flex: 1; height: 10px; border: 2px solid var(--ink); background: var(--paper-2); }
.tv-progress i.done { background: var(--c-pink); }
.tv-progress i.now { background: repeating-linear-gradient(90deg, var(--c-blue) 0 4px, transparent 4px 6px); }
.tv-score { opacity: 1; color: var(--c-pink); white-space: nowrap; }
.tv-q { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 4.4vw, 52px); line-height: .95; margin: 22px 0 18px; color: var(--ink); }
.tv-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tv-opt {
  display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; cursor: pointer;
  background: var(--white); color: var(--ink); border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
  font: inherit; font-size: 22px; transition: transform .08s, box-shadow .08s, background .15s;
}
.tv-opt b { flex: none; display: grid; place-items: center; width: 30px; height: 30px; font-family: var(--pixel); font-size: 12px; background: var(--ink); color: var(--white); }
.tv-opt:not(:disabled):hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--c-pink); }
.tv-opt:not(:disabled):active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.tv-opt:focus-visible { outline: 3px solid var(--c-violet); outline-offset: 2px; }
.tv-opt:disabled { cursor: default; opacity: .55; }
.tv-opt.right { background: var(--c-mint); opacity: 1; }
.tv-opt.right b { background: var(--c-teal); }
.tv-opt.wrong { background: var(--c-pink); color: var(--white); opacity: 1; animation: tv-shake .35s; }
@keyframes tv-shake { 25% { translate: -6px 0; } 75% { translate: 6px 0; } }
.tv-verdict { min-height: 24px; margin-top: 16px; font-family: var(--pixel); font-size: 13px; }
.tv-verdict.ok { color: var(--c-teal); } .tv-verdict.no { color: var(--c-pink); }
.tv-end { text-align: center; }
.tv-end p { margin-left: auto; margin-right: auto; }
.tv-end .tv-row { justify-content: center; }
.tv-big { font-family: var(--display); font-size: clamp(90px, 14vw, 160px); line-height: .85; margin-top: 6px; color: var(--ink); }
.tv-big span { color: var(--c-pink); text-shadow: 5px 5px 0 var(--ink); }
.tv-rank { color: var(--c-blue) !important; }
.tv-pb { font-family: var(--pixel); font-size: 13px !important; color: var(--c-violet); animation: blink 1s steps(2) infinite; }
@media (max-width: 600px) { .tv-opts { grid-template-columns: 1fr; } .tv-top .tv-progress { display: none; } .tv-top { justify-content: space-between; } }
.tv-opt.picked { background: var(--c-blue); color: var(--white); opacity: 1; transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.tv-opt.picked b { background: var(--white); color: var(--c-blue); }
.tv-send { margin: 26px auto 0; max-width: 480px; text-align: left; padding: 16px; background: var(--white); border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--c-pink); }
.tv-note { margin: 0 0 12px !important; font-size: 20px !important; max-width: none !important; }
.tv-send label { display: block; font: 11px var(--pixel); text-transform: uppercase; opacity: .7; }
.tv-send-row { display: flex; gap: 10px; margin-top: 6px; }
.tv-send input { flex: 1; min-width: 0; padding: 10px 12px; font: 24px var(--term); color: var(--ink); background: var(--paper); border: 2px solid var(--ink); outline: none; }
.tv-send input:focus { box-shadow: 4px 4px 0 var(--c-blue); }
.tv-send input:disabled { opacity: .6; }
.tv-send-btn { flex: none; }
.tv-send-status { min-height: 16px; margin: 10px 0 0 !important; font: 11px var(--pixel) !important; text-align: left; }
.tv-send-status.ok { color: var(--c-teal); } .tv-send-status.err { color: #e0213a; }
@media (max-width: 480px) { .tv-send-row { flex-direction: column; } }
