@font-face {
  font-family: 'Unifont';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/unifont-site.woff') format('woff');
}

:root {
  --bg: #0d0a1a;
  --panel: #151030;
  --panel-2: #1d1640;
  --line: #9a86ff;
  --line-dim: #3f3575;
  --text: #ece6ff;
  --muted: #a59cd2;
  --link: #c3b6ff;
  --visited: #e0b8ff;
  --accent: #7ff0c4;
  --gold: #ffe08a;
  --phosphor: #c3b6ff;
  --phosphor-dim: rgba(195, 182, 255, 0.4);
  --glass: rgba(21, 16, 48, 0.86);
  --glow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  background: var(--bg) url('assets/stars.svg') 0 0 / 120px 120px;
}

.farewell {
  position: fixed;
  inset: 0;
  z-index: -1;
  image-rendering: pixelated;
  pointer-events: none;
}

body {
  margin: 0;
  padding: 24px 16px 40px;
  min-height: 100vh;
  color: var(--text);
  font: 16px/1.6 'Unifont', monospace;
  background: transparent;
  -webkit-font-smoothing: none;
}

a { color: var(--link); text-decoration: underline dotted; text-underline-offset: 3px; }
a:visited { color: var(--visited); }
a:hover { color: var(--accent); text-decoration-style: solid; text-shadow: var(--glow); }
::selection { background: var(--accent); color: var(--bg); }
html { scrollbar-color: var(--line-dim) var(--bg); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 1px dashed var(--accent); outline-offset: 2px; }

small { font-size: 16px; color: var(--muted); }
.muted { color: var(--muted); }





.gate {
  position: relative;
  max-width: 560px;
  margin: 6vh auto 0;
  padding: 26px 22px 20px;
  text-align: center;
  background: var(--glass);
  backdrop-filter: blur(3px);
  border: 1px solid var(--line);
}
.gate-kao { margin: 0; color: var(--muted); }
.kao { display: inline-block; text-align: left; font: 18px/1.3 'Noto Sans', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif; color: var(--muted); }
.gate-title { margin: 6px 0 0; font-size: 32px; font-weight: normal; color: var(--text); text-shadow: 2px 2px 0 var(--line-dim); }
.gate-enter { margin: 14px 0 20px; font-size: 16px; }
.gate-enter a { padding: 2px 6px; }
.gate-enter .enter { color: var(--accent); font-size: 20px; }

.gate-notes {
  text-align: left;
  font-size: 16px;
  padding: 10px 14px;
  border: 1px dashed var(--line-dim);
  background: var(--panel-2);
}
.notes-head { margin: 0 0 4px; text-align: center; color: var(--accent); }
.gate-notes { text-align: center; }
.gate-notes ul { margin: 0; padding: 0; list-style: none; }
.gate-notes li { padding: 4px 0; }
.gate-notes li + li { border-top: 1px dotted var(--line-dim); }

.counter { margin: 18px 0 6px; }
.counter-label { color: var(--muted); font-size: 16px; }
.counter-digits {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  background: #07051a;
  color: var(--accent);
  text-shadow: var(--glow);
  border: 2px inset #3a3358;
  letter-spacing: 4px;
  font-size: 16px;
}
.kiriban { margin: 6px 0 0; min-height: 1em; color: var(--gold); font-size: 16px; }

.gate-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  padding: 4px 12px;
  border: 2px dotted var(--line-dim);
  background: var(--glass);
  color: var(--muted);
  font-size: 16px;
}
.gate-status #gsstatus { color: var(--text); }
.gs-sep { font-style: normal; margin-right: 6px; color: var(--line-dim); }
.gs-front b { font-weight: normal; color: var(--accent); text-shadow: var(--glow); }
.gs-front[hidden] { display: none; }
.gate-foot { margin: 14px 0 0; font-size: 16px; color: var(--muted); }

.frame {
  max-width: 800px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr);
  grid-template-areas: "top top" "menu pages" "foot foot";
  gap: 18px;
}

.topbar {
  position: relative;
  min-width: 0;
  grid-area: top;
  background: var(--glass);
  backdrop-filter: blur(3px);
  border: 1px solid var(--line);
  padding: 10px 14px 6px;
}
.logo { font-size: 32px; text-decoration: none; color: var(--text); }
.logo:visited { color: var(--text); }
.logo small { color: var(--muted); letter-spacing: 2px; margin-left: 6px; }
.ticker {
  margin-top: 6px;
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px dotted var(--line-dim);
  padding-top: 4px;
  color: var(--accent);
  font-size: 16px;
}
.ticker span { display: inline-block; padding-left: 100%; animation: ticker 26s linear infinite; }
@keyframes ticker { to { transform: translateX(-100%); } }

.menu {
  grid-area: menu;
  align-self: start;
  position: sticky;
  top: 12px;
  background: var(--glass);
  backdrop-filter: blur(3px);
  border: 1px solid var(--line);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.menu-head { margin: 0 0 6px; padding: 0 6px; color: var(--muted); font-size: 16px; }
.menu a {
  display: block;
  padding: 3px 6px;
  text-decoration: none;
  color: var(--link);
  font-size: 16px;
}
.menu a:visited { color: var(--link); }
.menu a:hover { background: var(--panel-2); }
.menu a.here { color: var(--accent); }
.menu-back { margin-top: 8px; border-top: 1px dotted var(--line-dim); }

.pages {
  grid-area: pages;
  min-width: 0;
  background: var(--glass);
  backdrop-filter: blur(3px);
  border: 1px solid var(--line);
  padding: 14px 18px 18px;
  min-height: 460px;
}
.page { display: none; }
.page.shown { display: block; }
.page h2 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: normal;
  color: var(--accent);
  padding: 0 0 2px;
  border-bottom: 1px solid var(--line-dim);
}
.page h3 { margin: 20px 0 6px; font-size: 16px; font-weight: normal; color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.page p { margin: 0 0 10px; }
.hello { color: var(--accent); text-shadow: var(--glow); }

.log { margin: 0; font-size: 16px; }
.log dt { float: left; clear: left; width: 96px; color: var(--muted); }
.log dd { margin: 0 0 4px 96px; }
.new { color: var(--accent); font-size: 16px; animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.prof { border-collapse: collapse; width: 100%; margin-bottom: 14px; font-size: 16px; }
.prof th, .prof td { border: 1px solid var(--line-dim); padding: 4px 8px; text-align: left; vertical-align: top; }
.prof th { width: 96px; font-weight: normal; color: var(--muted); background: var(--panel-2); }

.badges { display: flex; gap: 16px; margin: 6px 0 14px; }
.badge { position: relative; display: inline-flex; text-decoration: none; }
.badge:hover { background: none; }
.badge img, .badge .emoji-icon { width: 24px; height: 24px; display: block; }
.badge .emoji-icon { font-size: 21px; line-height: 1; }
.badge .tip {
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 1px 8px;
  font-size: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.badge:hover .tip, .badge:focus-visible .tip { opacity: 1; }

.work {
  display: block;
  padding: 6px 8px;
  margin-bottom: 6px;
  border: 1px dashed var(--line-dim);
  text-decoration: none;
  color: var(--text);
}
.work:visited { color: var(--text); }
.work:hover { border-style: solid; border-color: var(--line); background: var(--panel-2); color: var(--text); }
.work-name { display: block; color: var(--link); }
.work-meta { display: block; font-size: 16px; color: var(--muted); }
.work-desc { display: block; font-size: 16px; }
#repostatus { color: var(--muted); font-size: 16px; }

.likes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.likes li { display: flex; gap: 12px; align-items: center; padding: 6px 8px; border: 1px dashed var(--line-dim); }
.likes a { display: block; line-height: 0; padding: 4px; border: 1px solid var(--line-dim); }
.likes img { width: 32px; height: 32px; image-rendering: pixelated; }
.likes img.hd { image-rendering: auto; }
.likes b { display: block; font-weight: normal; color: var(--link); }
.likes span { font-size: 16px; color: var(--muted); }

.contact { list-style: none; margin: 0; padding: 0; }
.contact li { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.contact img { width: 18px; height: 18px; }

.foot { grid-area: foot; justify-self: center; text-align: center; font-size: 16px; padding: 6px 16px; background: var(--panel); border: 2px dotted var(--line-dim); }
.foot p { margin: 0; }
.hidden-link, .hidden-link:visited { color: var(--panel); text-decoration: none; }
.hidden-link::selection, .hidden-link *::selection { background: var(--accent); color: var(--bg); }

.nowtable th, .nowtable td { padding: 6px 8px; }
.now-row { display: flex; align-items: center; gap: 8px; }
.now-row > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.now-sub { color: var(--muted); font-size: 16px; overflow-wrap: anywhere; }
.now-custom { font-style: normal; }


.now-logo-glow { line-height: 0; }
.now-logo {
  display: none;
  height: 36px;
  max-width: 180px;
  margin-top: 8px;
  background: var(--phosphor);
  -webkit-mask: var(--logo) left center / contain no-repeat;
  mask: var(--logo) left center / contain no-repeat luminance;
}
.now-avatar { display: none; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-dim); }
.now-logo.shown, .now-avatar.shown { display: block; }

.now-music { display: flex; gap: 12px; align-items: flex-start; }
.now-music-text { flex: 1; min-width: 0; }
.now-cover-glow { display: none; flex: none; }
.now-cover-glow.shown { display: block; }
.now-cover {
  position: relative;
  width: 72px;
  height: 72px;
  margin-top: 2px;
  border: 1px solid var(--line);
  overflow: hidden;
}
.now-cover::before { content: ""; position: absolute; inset: 0; background: var(--cover) center / cover no-repeat; }
.now-time { font-size: 16px; color: var(--muted); margin-top: 2px; }

.pass { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0; }
.pass label { color: var(--accent); }
.pass input {
  flex: 1 1 160px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 2px 6px;
}
.pass input:focus { border-color: var(--accent); box-shadow: var(--glow); outline: none; }
.pass button {
  font: inherit;
  color: var(--bg);
  background: var(--line);
  border: 1px solid var(--line);
  padding: 1px 12px;
  cursor: pointer;
}
.pass button:hover { background: var(--accent); border-color: var(--accent); }
.pass-line { padding: 6px 0; border-bottom: 1px dotted var(--line-dim); }
.pass-said { color: var(--muted); font-size: 16px; }



.egg-red { color: #ff6b8b; }
.egg-gold { color: var(--gold); }
.mc-splash { display: inline-block; color: #ffff55; transform: rotate(-8deg); animation: mc-splash 0.5s ease-in-out infinite alternate; }
@keyframes mc-splash { to { transform: rotate(-8deg) scale(1.08); } }
.bigshot { color: #ffff55; animation: bigshot 0.4s steps(1) 10; }
@keyframes bigshot { 50% { color: #ff77ff; } }
.jevil { display: inline-block; animation: jevil 0.5s ease-in-out 6; }
@keyframes jevil { 25% { transform: rotate(-4deg) scale(1.05); } 75% { transform: rotate(4deg) scale(1.05); } }
.gaster { animation: gaster 3s forwards; }
@keyframes gaster { 70% { opacity: 1; } to { opacity: 0; } }
.frame.shake { animation: shake 0.5s; }
@keyframes shake { 10%, 50%, 90% { transform: translate(-6px, 3px); } 30%, 70% { transform: translate(6px, -3px); } }
body.flicker { animation: flicker 0.4s steps(2) 2; }
@keyframes flicker { 50% { filter: brightness(0.4) hue-rotate(40deg); } }
body.sunlit .frame { filter: sepia(0.6) saturate(1.6) brightness(1.15); transition: filter 0.6s; }

.breathe { display: block; position: relative; height: 80px; margin-top: 8px; }
.feather { position: absolute; left: 0; bottom: 0; animation: feather 8s ease-in-out 3 forwards; }
@keyframes feather { 50% { transform: translateY(-50px); } }
.breathe-in, .breathe-out { position: absolute; left: 40px; bottom: 0; }
.breathe-in { animation: breathe-in 8s step-end 3 forwards; }
.breathe-out { opacity: 0; animation: breathe-out 8s step-end 3 forwards; }
@keyframes breathe-in { 0% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes breathe-out { 0% { opacity: 0; } 50%, 100% { opacity: 1; } }

@media (max-width: 640px) {
  body { padding: 12px 10px 30px; }
  .frame { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "menu" "pages" "foot"; }
  .menu { position: static; flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .menu-head { display: none; }
  .menu a { font-size: 16px; }
  .menu-back { margin-top: 0; border-top: 0; }
  .logo { font-size: 16px; }
  .logo small { display: none; }
  .gate { margin-top: 2vh; }
  .gate-title { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker span { animation: none; padding-left: 0; }
  .new, .mc-splash, .bigshot, .jevil, .feather, .frame.shake, body.flicker { animation: none; }
}


.pages { position: relative; }

.cats { width: auto; flex: none; }
.gate-title { display: flex; align-items: stretch; justify-content: center; gap: 22px; }
.logo { display: inline-flex; align-items: stretch; gap: 16px; }
@media (max-width: 640px) {
  .gate-title { gap: 10px; }
  .gate-title .cats { height: 58px; }
  .gate-title .title-text { white-space: nowrap; }
  .logo .cats { height: 40px; }
  .logo { gap: 8px; }
}

.title-text { display: inline-flex; flex-direction: column; align-items: center; justify-content: space-between; line-height: 1; padding: 3px 0 2px; }
.title-heart { font: 20px/1 'Noto Sans', sans-serif; color: var(--accent); text-shadow: var(--glow); }
.logo .title-heart { font-size: 16px; }

#latestpost { margin: 14px 0 0; }
.latest-label { color: var(--accent); text-shadow: var(--glow); }
.bpost { padding: 0 0 16px; margin: 0 0 16px; border-bottom: 1px dashed var(--line-dim); }
.bpost:last-child { border-bottom: 0; margin-bottom: 0; }
.bpost-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin: 0 0 8px !important; }
.bpost-title { color: var(--accent); text-shadow: var(--glow); }
.bpost-date { color: var(--muted); }
.bpost-body { overflow-wrap: anywhere; }
.bpost-body p { margin: 0 0 10px; }
.bpost-body ul { margin: 0 0 10px; padding-left: 22px; }
.bpost-body blockquote { margin: 0 0 10px; padding-left: 10px; border-left: 2px solid var(--line-dim); color: var(--muted); }
.bpost-body code { background: var(--bg); padding: 0 4px; }
.bpost-gallery { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.bpost-gallery a { line-height: 0; border: 1px solid var(--line-dim); }
.bpost-gallery a:hover { border-color: var(--accent); }
.bpost-gallery img { max-width: 100%; height: auto; max-height: 260px; width: auto; display: block; }
