:root {
  --bh-primary: #7c3aed;
  --bh-accent: #22d3ee;
  --bh-bg: #05040a;
  --bh-bg-elev: #0d0b18;
  --bh-card: #12101f;
  --bh-border: rgba(255,255,255,0.08);
  --bh-text: #e9e7f5;
  --bh-text-dim: #9c98b8;
  --bh-radius: 14px;
  --bh-font-display: 'Press Start 2P', monospace;
  --bh-font-body: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bh-bg);
  color: var(--bh-text);
  font-family: var(--bh-font-body);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* ---------- Space background ---------- */
.bh-stars {
  position: fixed; inset: 0; z-index: -2;
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 120px 80px, #fff, transparent),
    radial-gradient(1px 1px at 210px 160px, #cbd5ff, transparent),
    radial-gradient(2px 2px at 320px 60px, #fff, transparent),
    radial-gradient(1px 1px at 60px 190px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 400px 220px, #cbd5ff, transparent);
  background-repeat: repeat;
  background-size: 420px 420px;
  animation: bh-drift 90s linear infinite;
  opacity: .8;
}
@keyframes bh-drift { from { background-position: 0 0; } to { background-position: -420px 420px; } }

.bh-blackhole-glow {
  position: fixed; top: -20%; left: 50%; transform: translateX(-50%);
  width: 900px; height: 900px; z-index: -1; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--bh-primary) 35%, transparent) 0%, transparent 60%);
  filter: blur(40px);
}

/* ---------- Nav ---------- */
.bh-nav { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(10px); background: rgba(5,4,10,0.75); border-bottom: 1px solid var(--bh-border); }
.bh-nav-inner { max-width: 1200px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 24px; }
.bh-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--bh-text); flex: 1; }
.bh-brand-mark { font-size: 22px; color: var(--bh-accent); text-shadow: 0 0 12px var(--bh-accent); }
.bh-brand-logo { height: 32px; width: auto; }
.bh-brand-text { font-family: var(--bh-font-display); font-size: 13px; letter-spacing: 1px; }
.bh-nav-links { display: flex; gap: 22px; flex-wrap: wrap; }
.bh-nav-links a { color: var(--bh-text-dim); text-decoration: none; font-weight: 600; font-size: 14px; transition: color .15s; }
.bh-nav-links a:hover { color: var(--bh-accent); }
.bh-nav-toggle { display: none; background: none; border: none; color: var(--bh-text); font-size: 22px; cursor: pointer; }
.bh-lang-switch { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--bh-text-dim); }
.bh-lang-switch a { color: var(--bh-text-dim); text-decoration: none; }
.bh-lang-switch a.active { color: var(--bh-accent); font-weight: 700; }

@media (max-width: 860px) {
  .bh-nav-toggle { display: block; }
  .bh-nav-links { position: absolute; top: 100%; left: 0; right: 0; background: var(--bh-bg-elev); flex-direction: column; padding: 16px 20px; display: none; border-bottom: 1px solid var(--bh-border); }
  .bh-nav-links.open { display: flex; }
}

/* ---------- Hero ---------- */
.bh-hero { position: relative; padding: 90px 20px 60px; text-align: center; overflow: hidden; }
.bh-hero-visual { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: -1; opacity: .55; }
.bh-hole {
  width: 340px; height: 340px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #000 0%, #000 32%, color-mix(in srgb, var(--bh-primary) 70%, black) 55%, transparent 78%);
  box-shadow: 0 0 120px 40px color-mix(in srgb, var(--bh-primary) 45%, transparent);
  animation: bh-spin 40s linear infinite;
}
.bh-hole::before {
  content: ''; position: absolute; inset: -30px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent, var(--bh-accent), transparent 30%);
  opacity: .35; filter: blur(6px);
}
@keyframes bh-spin { to { transform: rotate(360deg); } }
.bh-hero-title { font-family: var(--bh-font-display); font-size: clamp(28px, 6vw, 56px); margin: 0 0 18px; letter-spacing: 2px; text-shadow: 0 0 24px color-mix(in srgb, var(--bh-primary) 70%, transparent); }
.bh-hero-desc { max-width: 620px; margin: 0 auto 30px; color: var(--bh-text-dim); font-size: 17px; }
.bh-hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.bh-hero-social { display: flex; gap: 14px; justify-content: center; margin-top: 22px; }
.bh-hero-social-icon {
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06); border: 1px solid var(--bh-border); color: var(--bh-text-dim);
  transition: transform .15s, color .15s, border-color .15s;
}
.bh-hero-social-icon svg { width: 19px; height: 19px; }
.bh-hero-social-icon:hover { color: var(--bh-accent); border-color: var(--bh-accent); transform: translateY(-3px); }

/* ---------- Buttons ---------- */
.bh-btn { display: inline-flex; align-items: center; gap: 6px; padding: 12px 22px; border-radius: 10px; font-weight: 700; text-decoration: none; font-size: 14px; cursor: pointer; border: 1px solid transparent; transition: transform .12s, box-shadow .12s; }
.bh-btn:hover { transform: translateY(-2px); }
.bh-btn-primary { background: linear-gradient(135deg, var(--bh-primary), var(--bh-accent)); color: #fff; box-shadow: 0 8px 24px color-mix(in srgb, var(--bh-primary) 45%, transparent); }
.bh-btn-ghost { background: rgba(255,255,255,0.05); color: var(--bh-text); border-color: var(--bh-border); }
.bh-btn-small { padding: 8px 14px; font-size: 13px; }

/* ---------- Server connect card ---------- */
.bh-connect { padding: 0 20px 60px; display: flex; justify-content: center; }
.bh-connect-card { background: var(--bh-card); border: 1px solid var(--bh-border); border-radius: var(--bh-radius); padding: 24px 28px; max-width: 560px; width: 100%; }
.bh-connect-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--bh-border); }
.bh-connect-row:last-of-type { border-bottom: none; }
.bh-connect-label { display: block; font-size: 12px; color: var(--bh-text-dim); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.bh-connect-ip { font-family: monospace; font-size: 20px; font-weight: 700; }
.bh-connect-port { color: var(--bh-accent); }
.bh-status { display: flex; align-items: center; gap: 8px; padding-top: 14px; font-size: 14px; color: var(--bh-text-dim); }
.bh-status-dot { width: 9px; height: 9px; border-radius: 50%; background: #666; }
.bh-status.online .bh-status-dot { background: #34d399; box-shadow: 0 0 8px #34d399; }
.bh-status.offline .bh-status-dot { background: #f87171; }

/* ---------- Sections / cards ---------- */
.bh-section { max-width: 1200px; margin: 0 auto; padding: 50px 20px; }
.bh-section-title { font-family: var(--bh-font-display); font-size: clamp(18px, 3vw, 26px); margin-bottom: 26px; }
.bh-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.bh-card { background: var(--bh-card); border: 1px solid var(--bh-border); border-radius: var(--bh-radius); overflow: hidden; text-decoration: none; color: var(--bh-text); display: block; transition: transform .15s, border-color .15s; }
.bh-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--bh-accent) 50%, var(--bh-border)); }
.bh-card-img { width: 100%; height: 160px; object-fit: cover; display: block; background: #000; }
.bh-card-body { padding: 16px; }
.bh-card-body h3 { margin: 6px 0; font-size: 16px; }
.bh-card-meta { color: var(--bh-text-dim); font-size: 13px; }
.bh-tag { display: inline-block; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--bh-accent); background: rgba(34,211,238,0.1); padding: 3px 8px; border-radius: 20px; }
.bh-empty { color: var(--bh-text-dim); }

/* ---------- Rules: book shelf (category picker) ---------- */
.bh-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 26px; margin-bottom: 14px; }
.bh-book-cover {
  --book-color: #3f7d3a;
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  aspect-ratio: 3 / 4; border-radius: 8px 12px 12px 8px; text-decoration: none; color: #f1efe6; text-align: center;
  padding: 18px 14px; background: linear-gradient(155deg, color-mix(in srgb, var(--book-color) 88%, white 6%), color-mix(in srgb, var(--book-color) 60%, black 35%));
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 14px 30px rgba(0,0,0,0.45), inset 0 0 0 3px rgba(0,0,0,0.15), inset 0 0 20px rgba(255,255,255,0.06);
  transition: transform .18s, box-shadow .18s;
}
.bh-book-cover::before {
  content: ''; position: absolute; left: 10px; top: 8px; bottom: 8px; width: 6px; border-radius: 3px;
  background: rgba(255,255,255,0.18);
}
.bh-book-cover:hover { transform: translateY(-6px) rotate(-1deg); box-shadow: 0 22px 40px rgba(0,0,0,0.55); }
.bh-book-cover-icon { font-size: 30px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4)); }
.bh-book-cover-title { font-weight: 800; font-size: 14px; letter-spacing: .3px; }
.bh-book-cover-clasp { position: absolute; bottom: 14px; width: 22px; height: 8px; border-radius: 3px; background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.2); }
.bh-rules-hint { color: var(--bh-text-dim); font-size: 14px; }

/* ---------- Rules: open book + hanging signs ---------- */
.bh-back-link { color: var(--bh-text-dim); text-decoration: none; display: inline-block; margin-bottom: 16px; }
.bh-rules-chain-wrap { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }

.bh-open-book { width: 100%; }
.bh-open-book-inner {
  background: linear-gradient(160deg, #efe3c4, #d9c79e);
  color: #2a2013; border-radius: 8px; padding: 34px 36px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.55), inset 0 0 40px rgba(120,90,40,0.25);
  position: relative;
}
.bh-open-book-inner::before, .bh-open-book-inner::after {
  content: ''; position: absolute; top: 6px; bottom: 6px; width: 10px; background: rgba(0,0,0,0.08);
}
.bh-open-book-inner::before { left: 50%; transform: translateX(-50%); box-shadow: 0 0 14px rgba(0,0,0,0.25); }
.bh-open-book-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.bh-open-book-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.5; }
.bh-rule-num {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; background: #2a2013; color: #efe3c4;
  font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.bh-scroll-hint { text-align: center; color: #5b4a2c; font-size: 13px; margin: 22px 0 0; animation: bh-bounce 1.8s ease-in-out infinite; }
@keyframes bh-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

.bh-signs { width: 100%; display: flex; flex-direction: column; align-items: center; margin-top: 4px; }
.bh-sign-link {
  width: 2px; height: 26px; background: repeating-linear-gradient(180deg, #6b6b6b 0 4px, transparent 4px 8px);
  opacity: .8;
}
.bh-sign {
  width: 100%; max-width: 460px; background: linear-gradient(160deg, #8a5a2f, #6b4322);
  border: 3px solid #4a2e16; border-radius: 6px; padding: 18px 22px; margin-bottom: 0;
  box-shadow: 0 16px 28px rgba(0,0,0,0.5); color: #f5e9d0; position: relative;
  opacity: 0; transform: translateY(-16px) scale(.96); transition: opacity .5s ease, transform .5s ease;
}
.bh-sign[data-revealed] { opacity: 1; transform: translateY(0) scale(1); }
.bh-sign::before, .bh-sign::after {
  content: ''; position: absolute; top: -6px; width: 10px; height: 10px; border-radius: 50%;
  background: #2a2a2a; box-shadow: inset 0 0 0 2px #555;
}
.bh-sign::before { left: 16px; } .bh-sign::after { right: 16px; }
.bh-sign-num { display: inline-block; background: rgba(0,0,0,0.25); border-radius: 20px; padding: 2px 10px; font-size: 11px; font-weight: 800; margin-bottom: 6px; }
.bh-sign-title { margin: 4px 0 6px; font-size: 15px; font-family: var(--bh-font-display); letter-spacing: .5px; }
.bh-sign-text { margin: 0; font-size: 14px; line-height: 1.55; color: #f0e2c4; }
.bh-sign-final { background: linear-gradient(160deg, #245c3f, #163d29); border-color: #0f2c1c; text-align: center; }
.bh-sign-check { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.15); font-size: 18px; margin-bottom: 6px; }
.bh-sign-final h3 { margin: 4px 0 6px; font-family: var(--bh-font-display); font-size: 14px; }
.bh-sign-final p { margin: 0; color: #d7f2e4; font-size: 13px; }

@media (max-width: 560px) {
  .bh-open-book-inner { padding: 24px 20px; }
  .bh-sign { padding: 14px 16px; }
}

/* ---------- Article ---------- */
.bh-article { max-width: 780px; }
.bh-article-cover { width: 100%; border-radius: var(--bh-radius); margin: 16px 0; }
.bh-article-meta { display: flex; align-items: center; gap: 10px; color: var(--bh-text-dim); margin-bottom: 20px; }
.bh-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }

/* ---------- Gallery ---------- */
.bh-gallery-grid { column-count: 3; column-gap: 16px; }
.bh-gallery-item { break-inside: avoid; margin-bottom: 16px; position: relative; border-radius: var(--bh-radius); overflow: hidden; border: 1px solid var(--bh-border); }
.bh-gallery-item img { width: 100%; display: block; }
.bh-gallery-item figcaption { padding: 10px 12px; font-size: 13px; color: var(--bh-text-dim); display: flex; justify-content: space-between; }
.bh-gallery-item.bh-featured { outline: 2px solid var(--bh-accent); }
@media (max-width: 760px) { .bh-gallery-grid { column-count: 2; } }
@media (max-width: 480px) { .bh-gallery-grid { column-count: 1; } }

/* ---------- Store ---------- */
.bh-store-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 10px; }
.bh-store-category { margin-bottom: 40px; }
.bh-store-category h2 { font-size: 18px; margin-bottom: 16px; color: var(--bh-accent); }
.bh-product-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.bh-price { font-weight: 700; }

.bh-social-links { display: flex; gap: 12px; flex-wrap: wrap; }
.bh-social-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 30px;
  background: var(--bh-card); border: 1px solid var(--bh-border); color: var(--bh-text); text-decoration: none;
  font-weight: 600; font-size: 14px; transition: transform .15s, border-color .15s, color .15s;
}
.bh-social-pill:hover { transform: translateY(-2px); border-color: var(--bh-accent); color: var(--bh-accent); }
.bh-social-icon { display: flex; width: 18px; height: 18px; }
.bh-social-icon svg { width: 100%; height: 100%; }

/* ---------- Footer ---------- */
.bh-footer { border-top: 1px solid var(--bh-border); padding: 30px 20px; margin-top: 40px; }
.bh-footer-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--bh-text-dim); font-size: 13px; }

/* ---------- Toast ---------- */
.bh-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--bh-card); border: 1px solid var(--bh-accent); color: var(--bh-text); padding: 12px 20px; border-radius: 10px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 100; font-size: 14px; }
.bh-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.bh-404 { text-align: center; padding: 100px 20px; }
.bh-404 h1 { font-family: var(--bh-font-display); font-size: 60px; color: var(--bh-primary); }
