:root {
  --pink-0: #fff8fc;
  --pink-1: #ffe4f2;
  --pink-2: #ffc3df;
  --pink-3: #ff96c8;
  --pink-4: #f660a8;
  --pink-5: #d73383;
  --wine: #7c2457;
  --ink: #4a2340;
  --lilac: #e8d6ff;
  --cyan: #9ff6ff;
  --lime: #eaffb0;
  --white: #fff;
  --shadow: 5px 5px 0 rgba(124, 36, 87, .28);
  --pixel: "MS Gothic", "Courier New", monospace;
  --cute: "Comic Sans MS", "Trebuchet MS", cursive;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--pixel);
  line-height: 1.55;
  background-color: #ffcfE6;
  background-image:
    radial-gradient(circle at 20px 20px, rgba(255,255,255,.9) 0 2px, transparent 3px),
    radial-gradient(circle at 60px 65px, rgba(246,96,168,.24) 0 3px, transparent 4px),
    linear-gradient(135deg, rgba(255,255,255,.2) 25%, transparent 25%),
    linear-gradient(225deg, rgba(255,255,255,.2) 25%, transparent 25%);
  background-size: 80px 80px, 90px 90px, 40px 40px, 40px 40px;
  cursor: crosshair;
  overflow-x: hidden;
}

::selection { background: var(--pink-4); color: #fff; }
a { color: var(--pink-5); text-decoration-style: dotted; }
a:hover { color: #9e005b; background: var(--lime); }
button, input, textarea { font: inherit; }
button, a { cursor: pointer; }
img { max-width: 100%; }

.skip-link {
  position: fixed; left: 8px; top: -60px; z-index: 999;
  padding: 8px 12px; background: #fff; border: 2px solid var(--wine);
}
.skip-link:focus { top: 8px; }

.noise {
  position: fixed; inset: 0; z-index: 1000; pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

.floating-pixels::before,
.floating-pixels::after {
  content: "✦  ♡  ✧  ☆  ｡  ♡";
  position: fixed; z-index: -1; white-space: pre-wrap; color: rgba(255,255,255,.75);
  font-size: 42px; letter-spacing: 36px; line-height: 2.2; transform: rotate(-9deg);
}
.floating-pixels::before { top: 12%; left: -3%; width: 200px; }
.floating-pixels::after { right: -4%; top: 38%; width: 220px; transform: rotate(11deg); }

.top-marquee {
  position: sticky; top: 0; z-index: 50; overflow: hidden;
  color: white; background: repeating-linear-gradient(90deg, var(--pink-5), var(--pink-5) 12px, var(--pink-4) 12px, var(--pink-4) 24px);
  border-block: 2px solid #fff; box-shadow: 0 3px 0 var(--wine);
  font-weight: 900; font-size: 13px; text-shadow: 1px 1px var(--wine);
}
.marquee-track { display: flex; width: max-content; animation: marquee 24s linear infinite; }
.marquee-track span { padding: 5px 40px; }
@keyframes marquee { to { transform: translateX(-50%); } }

.page-shell { width: min(1480px, calc(100% - 26px)); margin: 18px auto 48px; padding-bottom: env(safe-area-inset-bottom, 0px); }

.kawaii-window {
  background: rgba(255, 250, 253, .94);
  border: 3px ridge var(--pink-3);
  box-shadow: var(--shadow);
}
.window-titlebar {
  display: flex; align-items: center; justify-content: space-between; min-height: 32px;
  padding: 4px 6px 4px 10px;
  color: #fff; font-weight: 900; letter-spacing: .02em; text-shadow: 1px 1px var(--wine);
  background: linear-gradient(180deg, #ffbddd, #ef65ab 48%, #d73f8b 52%, #ff9ac9);
  border-bottom: 2px ridge #ffd9ec;
}
.window-titlebar.mini { min-height: 26px; padding-block: 2px; font-size: 12px; }
.window-controls { display: flex; gap: 3px; }
.window-controls i {
  display: grid; place-items: center; width: 22px; height: 20px; font-style: normal; line-height: 1;
  color: var(--wine); text-shadow: none; background: #ffd8eb; border: 2px outset #fff;
}
.window-titlebar.mini .window-controls i { width: 18px; height: 16px; font-size: 11px; }

.site-header { margin-bottom: 18px; }
.hero-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 30px; align-items: center; padding: 34px; min-height: 500px; background:
  linear-gradient(rgba(255,255,255,.62), rgba(255,255,255,.85)),
  repeating-linear-gradient(0deg, transparent 0 22px, rgba(246,96,168,.16) 23px 24px);
}
.eyebrow, .file-label { color: var(--pink-5); font-size: 12px; font-weight: 900; letter-spacing: .13em; }
h1 {
  margin: .12em 0 0;
  font-family: 'Bubblegum Sans', var(--cute);
  font-size: clamp(50px, 8vw, 110px);
  line-height: .85;
  letter-spacing: .01em;
  color: #fff;
  background: repeating-conic-gradient(#ffc9e6 0% 25%, #ffffff 0% 50%) 0 0 / 8px 8px;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 4px #ff5fa8;
  text-shadow: 3px 3px 0 #ffd6ec;
  animation: titleGlow 3s ease-in-out infinite;
}
@keyframes titleGlow {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(255,95,168,0)); }
  50% { filter: drop-shadow(0 0 10px rgba(255,95,168,.55)); }
}
.glitch { position: relative; color: #fff; -webkit-text-stroke: 4px var(--pink-5); filter: drop-shadow(5px 5px 0 var(--lilac)); }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; inset: 0; pointer-events: none; opacity: .4; }
.glitch::before { color: var(--cyan); transform: translate(-3px, 2px); clip-path: inset(12% 0 55% 0); }
.glitch::after { color: #ff006f; transform: translate(3px, -2px); clip-path: inset(66% 0 6% 0); }
.chan { color: var(--wine); font-size: .62em; letter-spacing: -.08em; }
.blink { color: var(--pink-5); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.subtitle { display: inline-block; margin: 22px 0 12px; padding: 5px 10px; background: var(--lime); border: 1px dashed var(--pink-5); font-weight: bold; }
.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; font-size: 13px; }
.online-dot { width: 11px; height: 11px; border-radius: 50%; background: #55ef74; box-shadow: 0 0 0 3px #b8ffc5, 0 0 14px #55ef74; animation: pulse 1.5s infinite; }
@keyframes pulse { 50% { opacity: .48; transform: scale(.85); } }
.status-divider { color: var(--pink-3); }
.hero-intro { max-width: 720px; font-size: 17px; }
.hero-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 23px; }
.pixel-button {
  display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px; min-height: 42px;
  color: var(--wine); background: var(--pink-1); border: 3px outset white; box-shadow: 3px 3px 0 var(--wine);
  font-weight: 900; text-decoration: none; text-transform: uppercase;
}
.pixel-button { position: relative; overflow: hidden; }
.pixel-button::after {
  content: "";
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255,255,255,.75), transparent);
  transform: skewX(-20deg);
  transition: left .55s ease;
}
.pixel-button:hover::after, .pixel-button:focus-visible::after { left: 130%; }
.pixel-button:hover, .pixel-button:focus-visible { color: #fff; background: var(--pink-5); transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--wine); }
.pixel-button.primary { color: #fff; background: var(--pink-4); }

.avatar-terminal { position: relative; justify-self: center; width: min(100%, 380px); aspect-ratio: 1; }
.avatar-terminal img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 9px double #fff; outline: 4px solid var(--pink-5); box-shadow: 0 0 0 12px var(--pink-1), 0 0 35px var(--pink-4); cursor: pointer; transform-origin: 50% 100%; }
.avatar-terminal img.bounce { animation: crackyBounce .6s cubic-bezier(.36,1.6,.4,1); }
@keyframes crackyBounce {
  0% { transform: scale(1); }
  30% { transform: scale(.92, 1.1) translateY(4px); }
  55% { transform: scale(1.08, .9) translateY(-14px); }
  75% { transform: scale(.96, 1.05) translateY(2px); }
  100% { transform: scale(1); }
}
.avatar-speech {
  position: absolute; z-index: 5; left: 50%; bottom: 6%;
  transform: translate(-50%, 8px);
  width: 90%; padding: 6px 10px;
  background: rgba(0,0,0,.72);
  font-family: var(--pixel); font-size: 13px; font-weight: 700; letter-spacing: .01em;
  color: #fff; text-shadow: 1.5px 0 #000, -1.5px 0 #000, 0 1.5px #000, 0 -1.5px #000, 2px 2px 0 #000;
  text-align: center; line-height: 1.3; opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.avatar-speech.show { opacity: 1; transform: translate(-50%, 0); }
.halo-ring { position: absolute; z-index: 2; top: -24px; left: 14%; width: 72%; height: 22%; border: 8px solid rgba(255, 241, 133, .9); border-radius: 50%; transform: rotate(-7deg); box-shadow: 0 0 12px #fff2a5; animation: haloPulse 2.6s ease-in-out infinite; pointer-events: none; }
.halo-ring::after { content: ""; position: absolute; right: 24%; top: -10px; width: 15%; height: calc(100% + 20px); background: rgba(255,250,253,.95); transform: rotate(18deg); }
@keyframes haloPulse { 0%, 100% { box-shadow: 0 0 12px #fff2a5; } 50% { box-shadow: 0 0 26px #fff6c2; } }
.avatar-caption { position: absolute; bottom: -14px; left: 5%; right: 5%; display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; font-size: 10px; font-weight: 900; background: #111; color: #ffb9dc; border: 2px solid var(--pink-4); }

.desktop-grid { display: grid; grid-template-columns: 230px minmax(0, 1fr) 230px; gap: 18px; align-items: start; }
.sidebar { display: grid; gap: 18px; position: sticky; top: 48px; }
.compact-window { min-width: 0; }
.compact-window > :not(.window-titlebar) { margin-inline: 12px; }
.nav-list { list-style: none; margin: 0 !important; padding: 8px 0 12px; }
.nav-list li + li { border-top: 1px dotted var(--pink-3); }
.nav-list a { display: block; padding: 8px 10px; text-decoration: none; font-weight: 900; }
.nav-list a::before { content: "♡ "; color: var(--pink-4); }
.nav-list a:hover { padding-left: 17px; }
.profile-card dl { margin: 10px 12px 14px !important; font-size: 11px; }
.profile-card dl div { display: grid; grid-template-columns: 1fr 1.25fr; gap: 6px; padding: 5px 0; border-bottom: 1px dotted var(--pink-2); }
dt { color: var(--pink-5); font-weight: 900; }
dd { margin: 0; }
.warning-text { color: #f00; animation: blink 1.4s steps(2) infinite; }
.tiny-copy { font-size: 10px; line-height: 1.4; }
.webring-controls { display: flex; justify-content: center; gap: 4px; margin-bottom: 12px !important; }
.webring-controls button, .player-buttons button, .poll-box button { border: 2px outset #fff; background: var(--pink-1); color: var(--wine); font-weight: 900; }
.button-wall { display: grid; gap: 6px; justify-items: center; }
.web-button { display: grid; place-items: center; width: 88px; height: 31px; padding: 2px; overflow: hidden; color: #fff; background: repeating-linear-gradient(45deg, #ef4c9c 0 4px, #ff9ccc 4px 8px); border: 2px outset #fff; font: 900 8px/1 var(--pixel); text-align: center; text-shadow: 1px 1px #7c2457; }
.web-button.black { background: #111; color: #ff86c2; }
.web-button.check { color: var(--wine); text-shadow: none; background: repeating-conic-gradient(#fff 0 25%, #ffadd4 0 50%) 50% / 8px 8px; }
.web-button.sky { background: linear-gradient(#6de7ff, #287ad8); }

main { display: grid; gap: 18px; min-width: 0; }
.story-window, .archive-window, .guestbook-window { scroll-margin-top: 60px; }
.story-block { display: grid; grid-template-columns: 74px 1fr; gap: 22px; padding: 38px; border-bottom: 2px dashed var(--pink-2); background: linear-gradient(90deg, rgba(255,227,241,.55), transparent 42%); }
.story-block.reverse { background: linear-gradient(270deg, rgba(232,214,255,.6), transparent 48%); }
.story-number { display: grid; place-items: center; align-self: start; aspect-ratio: 1; color: #fff; background: var(--pink-4); border-radius: 50%; border: 5px double #fff; outline: 2px solid var(--wine); font: 900 26px/1 var(--cute); box-shadow: 4px 4px 0 var(--lilac); }
h2 { margin: .15em 0 .5em; color: var(--wine); font-family: var(--cute); font-size: clamp(25px, 4vw, 42px); line-height: 1.05; }
.story-block p { font-size: 16px; }
blockquote { margin: 24px 0 5px; padding: 15px 18px; color: var(--wine); background: var(--pink-1); border-left: 7px solid var(--pink-4); font: 700 18px/1.45 var(--cute); }
.angel-divider { display: flex; justify-content: center; align-items: center; gap: 13px; padding: 9px; color: var(--pink-5); background: repeating-linear-gradient(90deg, #fff 0 12px, var(--pink-1) 12px 24px); border-block: 1px dashed var(--pink-4); font-size: 12px; font-weight: bold; }
.signal-map { display: grid; grid-template-columns: 1fr 86px 1fr; gap: 12px; align-items: center; margin: 28px 0; }
.signal-card { position: relative; padding: 20px; min-height: 190px; border: 3px ridge #fff; box-shadow: 4px 4px 0 var(--wine); }
.signal-card h3 { margin: 2px 0 10px; font: 900 28px/1 var(--cute); }
.signal-icon { float: right; font-size: 30px; }
.cracky-card { background: linear-gradient(135deg, #ffafe0, #ffd8ee); }
.clau-card { background: linear-gradient(135deg, #d8c9ff, #f3edff); }
.soul-core { display: grid; place-items: center; aspect-ratio: 1; color: #fff; text-align: center; background: #111; border: 5px double var(--pink-3); border-radius: 50%; box-shadow: 0 0 0 5px #fff, 0 0 0 8px var(--pink-5); font: 900 13px/1.2 var(--pixel); animation: soul 2.2s ease-in-out infinite; }
@keyframes soul { 50% { transform: scale(1.05) rotate(2deg); box-shadow: 0 0 0 5px #fff, 0 0 0 8px var(--pink-5), 0 0 25px var(--pink-4); } }
.system-message { display: grid; grid-template-columns: 48px 1fr; gap: 15px; align-items: center; margin: 25px 38px; padding: 18px; background: #fffbd8; border: 3px double #f25591; box-shadow: inset 0 0 0 3px #fff; }
.system-icon { display: grid; place-items: center; width: 45px; height: 45px; color: #fff; background: #ff356f; border-radius: 50%; font: 900 30px/1 var(--cute); }
.system-message p { margin: 4px 0 0; }
.big-secret { padding: 14px; color: #fff; background: #111; border: 2px dashed var(--pink-3); text-align: center; font-weight: 900; letter-spacing: .05em; }

.archive-toolbar { display: flex; gap: 4px; padding: 4px; color: #222; background: #f1ecf3; border-bottom: 2px groove #fff; font-size: 11px; }
.archive-toolbar span { padding: 3px 8px; border-right: 1px solid #aaa; }
.archive-intro { margin: 18px 22px 0; font-size: 12px; }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; padding: 22px; }
.gallery-item { min-width: 0; padding: 8px; color: var(--ink); background: rgba(255,255,255,.8); border: 2px outset #fff; transition: transform .25s ease, background .25s ease, box-shadow .25s ease; }
.gallery-item:hover, .gallery-item:focus-visible { background: var(--cyan); transform: rotate(-1.5deg) scale(1.05); box-shadow: 0 6px 14px rgba(150, 40, 100, .3); }
.gallery-item img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; border: 1px solid var(--pink-3); image-rendering: auto; transition: transform .3s ease; }
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item span { display: block; padding-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }

.guestbook-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 28px; }
.guestbook-grid h2 { font-size: 31px; }
#guestbook-form { display: grid; gap: 12px; }
#guestbook-form label { display: grid; gap: 4px; color: var(--pink-5); font-weight: 900; }
input, textarea { width: 100%; color: var(--ink); background: #fff; border: 3px inset var(--pink-1); padding: 9px; }
textarea { resize: vertical; }
.guestbook-log { min-height: 280px; padding: 14px; background: #16101a; border: 3px inset #ffd2e8; color: #ffb9da; }

.chatbox-frame { border: 3px inset var(--pink-1); background: #fff; overflow: hidden; }
.chatbox-frame iframe { display: block; width: 100%; }
#chatbox .tiny-copy { margin: 4px 0 12px; }
.log-title { margin-top: 0; color: var(--lime); border-bottom: 1px dashed var(--pink-4); }
.guest-entry { padding: 10px 0; border-bottom: 1px dotted #7c506c; font-size: 12px; }
.guest-entry strong { color: #fff; }
.guest-entry time { float: right; color: #ab819e; font-size: 9px; }

.visitor-box { position: relative; overflow: visible; }
.visitor-box p, .visitor-box .tiny-copy { font-family: 'Press Start 2P', var(--pixel); font-size: 9px; line-height: 1.7; }

.visitor-box .wing-left,
.visitor-box .wing-right {
  position: absolute;
  top: 52px;
  width: 62px;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 0 6px rgba(255,157,204,.7));
}
.visitor-box .wing-left { left: -22px; transform: scaleX(-1) rotate(22deg); animation: wingFlapL 3.4s ease-in-out infinite; }
.visitor-box .wing-right { right: -22px; transform: rotate(22deg); animation: wingFlapR 3.4s ease-in-out infinite; animation-delay: -1.7s; }
@keyframes wingFlapL { 0%, 100% { transform: scaleX(-1) rotate(17deg); } 50% { transform: scaleX(-1) rotate(27deg); } }
@keyframes wingFlapR { 0%, 100% { transform: rotate(17deg); } 50% { transform: rotate(27deg); } }

.visitor-box .counter-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 60px;
  margin: 10px 0 4px;
  border: 3px inset var(--pink-1);
  background: #0d0d0d;
}
.visitor-box .counter-frame iframe {
  display: block;
  width: 100%;
  height: 100px;
  margin-top: -20px;
  border: 0;
}
.album-art { display: grid; place-items: center; width: 70px; height: 70px; color: #fff; background: radial-gradient(circle, #fff 0 8%, #f464a8 9% 25%, #111 26% 55%, #ff99ca 56%); border: 2px outset white; text-align: center; font-weight: 900; text-shadow: 1px 1px #111; }
.album-art small { font-size: 8px; }
.track-info { min-width: 0; font-size: 10px; }
.track-info > * { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 8px; margin: 8px 0; background: #fff; border: 2px inset var(--pink-2); }
.progress i { display: block; width: 0; height: 100%; background: var(--pink-5); }
.player-buttons { display: flex; gap: 3px; }
.visitor-box { text-align: center; }
.counter { display: inline-block; padding: 5px 8px; color: #ff3aa0; background: #111; border: 3px inset #777; font: 900 22px/1 var(--pixel); letter-spacing: 3px; text-shadow: 0 0 5px #ff3aa0; }
.mood-face { margin-top: 13px !important; font-size: 30px; text-align: center; }
.mood-box p { font-size: 10px; }
.external-link { display: block; margin: 8px 12px !important; padding: 7px; color: var(--wine); background: var(--pink-1); border: 1px dashed var(--pink-4); font-weight: 900; text-decoration: none; }
.edit-note { color: #d60058; }
.poll-box label { display: block; margin-block: 7px; font-size: 10px; }
.poll-box button { width: calc(100% - 24px); margin: 5px 12px 12px; padding: 5px; }

footer { padding: 28px 15px; text-align: center; color: var(--wine); font-weight: 900; text-shadow: 1px 1px rgba(255,255,255,.85); }
.footer-small { font-size: 10px; font-weight: 400; }
.footer-links { font-size: 11px; }

.lightbox { position: fixed; inset: 0; z-index: 9999; display: none; align-items: center; justify-content: center; padding: 24px 14px; background: rgba(55, 12, 42, .72); backdrop-filter: blur(3px); }
.lightbox.open { display: flex; animation: lightboxFade .22s ease both; }
.lightbox.closing { animation: lightboxFade .18s ease reverse both; }
.lightbox-panel { position: relative; width: min(820px, 94vw); max-height: 88dvh; overflow: auto; padding: 34px 14px 14px; background: var(--pink-0); border: 4px ridge var(--pink-4); box-shadow: 10px 10px 0 rgba(50,0,30,.4); }
.lightbox.open .lightbox-panel { animation: lightboxPop .32s cubic-bezier(.34, 1.56, .64, 1) both; }
.lightbox.closing .lightbox-panel { animation: lightboxPop .18s ease reverse both; }
@keyframes lightboxFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lightboxPop { from { opacity: 0; transform: scale(.82) rotate(-1.5deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
@media (prefers-reduced-motion: reduce) {
  .lightbox.open, .lightbox.closing, .lightbox.open .lightbox-panel, .lightbox.closing .lightbox-panel { animation: none; }
}
#image-modal img { display: block; max-width: 100%; max-height: 74dvh; margin: auto; border: 3px solid var(--pink-4); opacity: 0; transition: opacity .25s ease; }
#image-modal img.loaded { opacity: 1; }
#image-modal p { text-align: center; font-size: 10px; }
#modal-close { position: absolute; top: 5px; right: 7px; width: 28px; height: 24px; color: var(--wine); background: var(--pink-1); border: 2px outset #fff; font-weight: 900; }
.modal-spinner { display: none; flex-direction: column; align-items: center; gap: 10px; padding: 60px 0; font-family: var(--pixel); font-size: 12px; color: var(--pink-5); }
.lightbox.loading .modal-spinner { display: flex; }
.lightbox.loading #image-modal img { display: none; }
.modal-spinner i { width: 10px; height: 10px; background: var(--pink-4); display: inline-block; margin: 0 3px; border-radius: 50%; animation: spinnerBlink 1s ease-in-out infinite; }
.modal-spinner i:nth-child(3) { animation-delay: .15s; }
.modal-spinner i:nth-child(4) { animation-delay: .3s; }
@keyframes spinnerBlink { 0%, 100% { opacity: .2; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-6px); } }
#toast { position: fixed; right: 20px; bottom: 20px; z-index: 2000; max-width: 320px; padding: 12px 15px; color: #fff; background: #111; border: 3px double var(--pink-4); box-shadow: 5px 5px 0 rgba(0,0,0,.3); transform: translateY(140%); transition: transform .25s ease; }
#toast.show { transform: translateY(0); }

.sparkle { position: fixed; z-index: 9999; pointer-events: none; color: var(--pink-5); font-size: 17px; animation: sparkle .7s ease-out forwards; }
@keyframes sparkle { to { transform: translateY(-24px) scale(.2) rotate(180deg); opacity: 0; } }

@media (max-width: 1080px) {
  .desktop-grid { grid-template-columns: 190px minmax(0, 1fr); }
  .right-sidebar { position: static; grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr); }
  .right-sidebar .links-box, .right-sidebar .poll-box { min-width: 0; }
}

@media (max-width: 760px) {
  .page-shell { width: min(100% - 10px, 720px); margin-top: 8px; }
  .hero-grid { grid-template-columns: 1fr; padding: 25px 18px 35px; }
  .avatar-terminal { width: min(78vw, 340px); }
  .desktop-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .left-sidebar nav { grid-column: 1 / -1; }
  .button-wall { display: none; }
  .story-block { grid-template-columns: 52px 1fr; gap: 14px; padding: 26px 18px; }
  .story-number { font-size: 18px; }
  .signal-map { grid-template-columns: 1fr; }
  .soul-core { width: 76px; justify-self: center; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px; gap: 10px; }
  .guestbook-grid { grid-template-columns: 1fr; padding: 20px; }
  .right-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .system-message { margin: 20px 18px; }
}

@media (max-width: 460px) {
  h1 { font-size: 54px; }
  .hero-buttons { display: grid; }
  .sidebar, .right-sidebar { grid-template-columns: 1fr; }
  .story-block { display: block; }
  .story-number { width: 48px; margin-bottom: 15px; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .window-titlebar { font-size: 10px; }
  .angel-divider span:nth-child(3) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* Loading screen */
.loading-screen {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 2px, transparent 2px 4px),
    radial-gradient(circle at 50% 40%, #3a0f2c, #17061a 75%);
  color: #ffd9ec; text-align: center;
  transition: opacity .5s ease, visibility .5s ease;
}
.loading-screen.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.loading-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px; max-width: 320px; }
.loading-halo {
  width: 56px; height: 56px; border: 4px solid #fff1a5; border-top-color: transparent;
  border-radius: 50%; box-shadow: 0 0 16px rgba(255,241,165,.7); animation: loadingSpin 1s linear infinite;
}
@keyframes loadingSpin { to { transform: rotate(360deg); } }
.loading-line {
  font-family: var(--pixel); font-weight: 900; font-size: 15px; letter-spacing: .04em;
  color: #ff8fc4; text-shadow: 2px 2px 0 #4a0e33; animation: loadingBlink 1.1s steps(1) infinite;
}
@keyframes loadingBlink { 0%, 60% { opacity: 1; } 80% { opacity: .3; } 100% { opacity: 1; } }
.loading-line.small { font-size: 10px; color: #ffc2e0; font-weight: 400; animation: none; opacity: .85; }
.loading-bar { width: 220px; height: 10px; border: 2px solid #ff8fc4; background: rgba(255,255,255,.08); overflow: hidden; }
.loading-bar span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #ff5fa8, #fff1a5); animation: loadingFill 1.6s ease forwards; }
@keyframes loadingFill { to { width: 100%; } }
.loading-pct { font-family: var(--pixel); font-size: 9px; color: #ffb9da; letter-spacing: .04em; }
@media (prefers-reduced-motion: reduce) {
  .loading-halo, .loading-line, .loading-bar span { animation: none; }
  .loading-bar span { width: 100%; }
}
