:root {
  --bg: #07040c;
  --bg-2: #12081a;
  --ink: #fff7ea;
  --muted: #c9b8a4;
  --pink: #ff3eb5;
  --lime: #d6ff00;
  --cyan: #21f0ff;
  --gold: #ffd400;
  --card: #16101f;
  --stroke: rgba(255, 247, 234, 0.14);
  --font-display: "ZCOOL KuaiLe", "Bangers", cursive;
  --font-pixel: "Press Start 2P", monospace;
  --font-comic: "Comic Neue", "Noto Sans SC", sans-serif;
  --font-body: "Noto Sans SC", "Comic Neue", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><text y='24' font-size='24'>🐾</text></svg>") 4 4, auto;
  overflow-x: hidden;
}
body.rainbow {
  animation: hue 4s linear infinite;
}
img { max-width: 100%; display: block; }
button, a, input { font-family: inherit; }
button { cursor: pointer; }

.wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.pixel { font-family: var(--font-pixel); line-height: 1.8; }
.tiny { font-size: 8px; letter-spacing: 1px; }
.blink { animation: blink 1.1s steps(2) infinite; }

#sparkles {
  position: fixed; inset: 0; pointer-events: none; z-index: 80;
}
.scanlines {
  position: fixed; inset: 0; pointer-events: none; z-index: 70;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0.12) 0px,
    rgba(0,0,0,0.12) 1px,
    transparent 1px,
    transparent 4px
  );
  mix-blend-mode: multiply;
}
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 69; opacity: .12;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
#nyan {
  position: fixed; top: 18%; left: -220px; width: 140px; height: 140px;
  object-fit: cover; border-radius: 16px; z-index: 60; pointer-events: none;
  box-shadow: -40px 0 40px -8px #ff3eb5, -80px 0 50px -12px #21f0ff, -120px 0 40px -16px #ffd400;
  animation: nyanfly 18s linear infinite;
}

#splash {
  position: fixed; inset: 0; z-index: 200; background: #050208;
  display: grid; place-items: center; text-align: center;
  transition: opacity .5s ease, visibility .5s ease;
}
#splash.go { opacity: 0; visibility: hidden; }
.splash-inner { padding: 24px; }
.splash-inner .pixel { color: var(--lime); font-size: 12px; }
.splash-note { color: var(--muted); font-size: 13px; }
.loadbar {
  width: min(320px, 70vw); height: 14px; margin: 18px auto;
  border: 2px solid var(--lime); background: #111;
}
.loadbar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--pink), var(--lime), var(--cyan));
  animation: load 1.15s ease forwards;
}

.brand {
  position: fixed;
  top: 48px;
  left: 16px;
  z-index: 90;
  display: block;
  width: 86px;
  height: 86px;
  border: 3px solid #000;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 4px 4px 0 var(--pink);
  background: #07040c;
}
.brand img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.brand:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--pink);
}

.buy-btn {
  position: fixed;
  top: 48px;
  right: 16px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 10px 18px;
  background: var(--gold);
  color: #111;
  text-decoration: none;
  font-family: var(--font-pixel);
  font-size: 14px;
  letter-spacing: 2px;
  border: 3px solid #000;
  box-shadow: 5px 5px 0 #000;
  cursor: pointer;
  animation: buyPulse 1.2s steps(2) infinite;
}
.buy-btn:hover {
  background: var(--lime);
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 #000;
}

.bgm-dock {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 90;
}
.bgm-dock button {
  border: 3px solid #000;
  background: var(--pink);
  color: #fff;
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 1px;
  padding: 10px 12px;
  box-shadow: 5px 5px 0 #000;
  line-height: 1.6;
}
.bgm-dock button[aria-pressed="true"] {
  background: var(--lime);
  color: #111;
}
#hajimiPlayer,
#biliBgm {
  position: fixed;
  width: 1px;
  height: 1px;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
  border: 0;
}

.ticker {
  position: sticky; top: 0; z-index: 40;
  background: var(--lime); color: #111;
  border-bottom: 3px solid #000; overflow: hidden;
  font-family: var(--font-pixel); font-size: 10px;
  padding: 8px 0;
}
.ticker-track {
  display: flex; gap: 48px; white-space: nowrap; width: max-content;
  animation: marquee 36s linear infinite;
}

.hero {
  position: relative; min-height: 100svh;
  display: grid; place-items: center; text-align: center;
  isolation: isolate;
}
.hero-bg {
  position: absolute; inset: 0; z-index: -2;
  background: url("images/hero.jpg") center/cover no-repeat;
  filter: saturate(1.15) contrast(1.05);
}
.hero-vignette {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse at center, transparent 20%, rgba(7,4,12,.55) 70%, #07040c 100%),
    linear-gradient(to top, #07040c 0%, transparent 40%);
}
.hero-content { padding: 80px 20px 48px; }
.hero-kicker {
  color: var(--cyan);
  font-size: clamp(12px, 2.4vw, 18px);
  cursor: pointer;
  letter-spacing: 1px;
  margin: 0 auto 8px;
  max-width: min(920px, 92vw);
  word-break: break-all;
  line-height: 1.7;
}
.hero-kicker[data-ca=""] { opacity: .75; }
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(72px, 18vw, 180px);
  margin: 0; line-height: .9;
  color: #fff;
  text-shadow:
    4px 4px 0 var(--pink),
    8px 8px 0 #000,
    0 0 40px var(--pink);
  animation: jitter 3s steps(2) infinite;
}
.hero-en {
  font-family: "Bangers", cursive;
  font-size: clamp(28px, 6vw, 56px);
  letter-spacing: 6px; margin: 4px 0 0;
  background: linear-gradient(90deg, var(--pink), var(--gold), var(--cyan), var(--lime), var(--pink));
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: rainbow 4s linear infinite;
}
.hero-sub { color: var(--muted); margin: 8px 0 28px; font-size: 16px; }
.hero-stats {
  display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; margin-bottom: 28px;
}
.stat b {
  display: block; font-family: var(--font-pixel); font-size: 14px; color: var(--gold);
}
.stat span { font-size: 12px; color: var(--muted); }
.cta {
  display: inline-block;
  background: var(--pink); color: #fff; text-decoration: none;
  font-family: var(--font-display); font-size: 22px;
  padding: 12px 28px; border: 3px solid #000;
  box-shadow: 6px 6px 0 #000;
  transition: transform .12s ease, box-shadow .12s ease;
}
.cta:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 #000; }
.hero-warn { margin-top: 18px; color: var(--lime); font-size: 13px; }

.toolbar {
  position: sticky; top: 32px; z-index: 30;
  background: rgba(7,4,12,.88); backdrop-filter: blur(10px);
  border-top: 2px solid var(--pink); border-bottom: 2px solid var(--cyan);
}
.toolbar-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto; padding: 12px 0;
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
#search {
  flex: 1 1 220px; min-width: 180px;
  background: #0d0a14; color: var(--ink);
  border: 2px solid var(--stroke); border-radius: 999px;
  padding: 10px 16px; font-size: 14px; outline: none;
}
#search:focus { border-color: var(--lime); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip, .ghost, .gb-form button {
  border: 2px solid #000; background: #1b1426; color: var(--ink);
  padding: 8px 12px; font-weight: 700;
}
.chip.on, .chip:hover { background: var(--lime); color: #111; }
.toolbar-actions { display: flex; gap: 8px; margin-left: auto; }
.ghost:hover { background: var(--pink); }

.section-head { margin: 48px 0 20px; }
.section-head h2 {
  font-family: var(--font-display); font-size: clamp(32px, 6vw, 48px);
  margin: 0; color: var(--gold);
}
.section-head p { margin: 6px 0 0; color: var(--muted); }

.featured-card {
  display: grid; grid-template-columns: 280px 1fr; gap: 24px;
  background: var(--card); border: 3px solid #000;
  box-shadow: 10px 10px 0 var(--pink);
  padding: 16px; cursor: pointer;
}
.featured-card img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border: 3px solid #000;
}
.featured-card h3 {
  font-family: var(--font-display); font-size: 36px; margin: 0 0 6px;
}
.kicker { color: var(--cyan); font-size: 12px; letter-spacing: 2px; }
.quote {
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 22px; text-transform: uppercase;
  color: #fff; text-shadow: 2px 2px 0 #000; margin: 12px 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px; padding-bottom: 24px;
}
.card {
  background: #f4ead7; color: #111;
  padding: 12px 12px 16px;
  border: 3px solid #000;
  box-shadow: 6px 6px 0 #000;
  transform-style: preserve-3d;
  transition: transform .15s ease, box-shadow .15s ease;
  cursor: pointer;
}
.card:hover {
  transform: translateY(-6px) rotate(-1deg);
  box-shadow: 10px 10px 0 var(--pink);
}
.card-photo {
  position: relative; overflow: hidden; border: 2px solid #111;
  aspect-ratio: 1; background: #222;
}
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.holo {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(255,255,255,.45) 40%, transparent 60%);
  transform: translateX(-60%);
  transition: opacity .2s;
}
.card:hover .holo { opacity: 1; animation: shine .7s ease; }
.badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--pink); color: #fff; font-size: 11px; font-weight: 900;
  padding: 3px 8px; border: 2px solid #000;
}

.card h3 {
  font-family: var(--font-display); font-size: 26px;
  margin: 10px 0 0; line-height: 1.1;
}
.card .en { font-size: 12px; color: #664; margin: 2px 0 8px; }
.card .catch {
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 14px; text-transform: uppercase; min-height: 2.4em;
}
.meter { height: 8px; background: #d7c8b0; border: 2px solid #111; }
.meter i { display: block; height: 100%; background: var(--pink); }

.empty { text-align: center; color: var(--muted); padding: 40px 0 80px; }

.guestbook { padding-bottom: 40px; }
.gb-box {
  background: #0e1a0e; border: 4px ridge #6f6; color: #9f6;
  font-family: "Comic Neue", monospace; padding: 16px;
}
.gb-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.gb-item { border-bottom: 1px dashed #3a3; padding-bottom: 8px; }
.gb-item b { color: var(--lime); }
.gb-item time { color: #6a6; font-size: 12px; margin-left: 8px; }
.gb-form { display: flex; gap: 8px; flex-wrap: wrap; }
.gb-form input {
  flex: 1 1 180px; background: #031003; color: #cfc; border: 1px solid #6f6;
  padding: 8px;
}
.gb-form button { background: #6f6; color: #031003; }

.footer {
  text-align: center; padding: 40px 16px 80px; color: var(--muted); font-size: 13px;
  border-top: 3px dashed var(--pink);
}
.webring { font-family: var(--font-pixel); font-size: 9px; color: var(--cyan); }
.webring a { color: var(--gold); }
.footer a { color: var(--gold); }

.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.72); }
.modal-card {
  position: relative; z-index: 1;
  width: min(860px, 100%);
  display: grid; grid-template-columns: 1.05fr 1fr;
  background: var(--card); border: 4px solid #000;
  box-shadow: 12px 12px 0 var(--cyan);
  max-height: min(90vh, 720px); overflow: auto;
}
.modal-x {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 40px; height: 40px; background: var(--pink); color: #fff;
  border: 3px solid #000; font-size: 24px; line-height: 1;
}
.modal-shot { position: relative; background: #000; }
.modal-shot img { width: 100%; height: 100%; object-fit: cover; min-height: 280px; }
.impact {
  position: absolute; left: 8px; right: 8px; bottom: 12px; margin: 0;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(22px, 4vw, 34px); text-align: center; text-transform: uppercase;
  color: #fff; -webkit-text-stroke: 2px #000; text-shadow: 3px 3px 0 #000;
}
.modal-body { padding: 24px 22px 28px; }
.modal-era { color: var(--lime); font-size: 12px; letter-spacing: 2px; margin: 0 0 6px; }
.modal-body h3 { font-family: var(--font-display); font-size: 40px; margin: 0; }
.modal-en { color: var(--muted); margin: 0 0 12px; }
.modal-bio { line-height: 1.7; }
.stats { display: grid; grid-template-columns: 88px 1fr; gap: 6px 10px; margin: 16px 0; }
.stats dt { color: var(--cyan); font-size: 12px; }
.stats dd { margin: 0; }
.power { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.power .bar { height: 12px; background: #2a2233; border: 2px solid #000; }
.power .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--pink), var(--gold)); }

@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes nyanfly {
  0% { transform: translateX(0) rotate(-6deg); }
  100% { transform: translateX(calc(100vw + 360px)) rotate(8deg); }
}
@keyframes rainbow { to { background-position: 200% 0; } }
@keyframes hue { to { filter: hue-rotate(360deg); } }
@keyframes jitter {
  0%, 100% { transform: translate(0,0); }
  50% { transform: translate(-2px, 1px); }
}
@keyframes blink { 50% { opacity: 0; } }
@keyframes load { to { width: 100%; } }
@keyframes shine {
  from { transform: translateX(-60%); }
  to { transform: translateX(60%); }
}
@keyframes buyPulse {
  50% { filter: brightness(1.25); }
}

@media (max-width: 800px) {
  .brand {
    top: 44px;
    left: 10px;
    width: 56px;
    height: 56px;
    border-radius: 14px;
  }
  .buy-btn {
    top: 44px;
    right: 10px;
    min-width: 72px;
    padding: 8px 12px;
    font-size: 11px;
  }
  .bgm-dock {
    left: 10px;
    bottom: 10px;
  }
  .bgm-dock button { font-size: 8px; padding: 8px 10px; }
  .featured-card, .modal-card { grid-template-columns: 1fr; }
  .toolbar-actions { margin-left: 0; width: 100%; }
  .hero-title { text-shadow: 3px 3px 0 var(--pink), 6px 6px 0 #000; }
  .scanlines { opacity: .35; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important; transition: none !important;
  }
  #nyan { display: none; }
}
