/* ============================================================
   LobsterWorld — shared docbook styles (How to Play + Game Guide)
   GitBook-style layout (sidebar + article) on the pixel-ocean brand.
   ============================================================ */
:root {
  --ocean-deep: #0a0e2a;
  --ocean-mid: #0d1f4a;
  --ocean-surface: #0e3060;
  --lobster-red: #ff3a2d;
  --lobster-orange: #ff7a2d;
  --coral-pink: #ff6b9d;
  --sand-yellow: #ffd166;
  --seafoam: #06ffd4;
  --bubble-blue: #4fc3f7;
  --pixel-white: #f0f4ff;
  --ink: rgba(240,244,255,0.72);
  --ink-dim: rgba(240,244,255,0.5);
  --line: rgba(14,48,96,0.9);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 124px; }
body {
  background: var(--ocean-deep);
  color: var(--pixel-white);
  font-family: 'VT323', monospace;
  font-size: 20px;
  overflow-x: hidden;
}
.ocean-bg { position: fixed; inset: 0; z-index: 0;
  background: linear-gradient(180deg, #0a0e2a 0%, #0d1f4a 50%, #0e3060 100%); }
.bubbles { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.bubble { position: absolute; bottom: -20px; background: rgba(6,255,212,0.22);
  animation: bubbleRise linear infinite; }
@keyframes bubbleRise {
  0% { transform: translateY(0); opacity: 0; }
  10% { opacity: 1; } 90% { opacity: 0.4; }
  100% { transform: translateY(-110vh) translateX(20px); opacity: 0; }
}
.scanlines { position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,0.02) 3px, rgba(0,0,0,0.02) 4px); }
.content { position: relative; z-index: 10; }

/* NAV (shared with landing) */
nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 40px; border-bottom: 4px solid var(--lobster-red);
  background: rgba(10,14,42,0.96); backdrop-filter: blur(8px);
}
/* COIN BAR */
.site-header { position: sticky; top: 0; z-index: 100; }
.coin-bar {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  background: rgba(8,12,32,0.98); border-bottom: 2px solid #22c55e;
  padding: 7px 16px; font-family: 'Press Start 2P', monospace; font-size: 8px; line-height: 1.4;
}
.coin-live { color: #22c55e; display: inline-flex; align-items: center; gap: 8px; letter-spacing: 1px; }
.coin-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; animation: coinPulse 1.4s ease-in-out infinite; }
@keyframes coinPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.6); } 50% { box-shadow: 0 0 0 6px rgba(34,197,94,0); } }
.coin-ca { color: rgba(240,244,255,0.5); display: inline-flex; align-items: center; gap: 6px; }
.coin-addr { color: var(--seafoam); font-family: 'VT323', monospace; font-size: 15px; letter-spacing: 0.5px; word-break: break-all; }
.coin-copy { font-family: 'Press Start 2P', monospace; font-size: 7px; background: transparent; border: 2px solid var(--seafoam); color: var(--seafoam); padding: 5px 8px; cursor: pointer; white-space: nowrap; }
.coin-copy:hover { background: var(--seafoam); color: var(--ocean-deep); }
.coin-buy { font-family: 'Press Start 2P', monospace; font-size: 7px; background: #22c55e; color: #06210f; padding: 6px 10px; text-decoration: none; white-space: nowrap; border: 2px solid #22c55e; }
.coin-buy:hover { background: #16a34a; }
.nav-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.nav-logo img { width: 50px; height: 50px; object-fit: contain; filter: drop-shadow(0 0 8px rgba(255,58,45,0.5)); }
.nav-logo-text { font-family: 'Press Start 2P', monospace; font-size: 12px; color: var(--lobster-red); text-shadow: 2px 2px 0 var(--lobster-orange); line-height: 1.6; }
.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a { color: var(--seafoam); text-decoration: none; font-size: 18px; text-transform: uppercase; transition: color 0.1s; }
.nav-links a:hover, .nav-links a.active { color: var(--sand-yellow); }

/* ============================================================
   DOCBOOK LAYOUT
   ============================================================ */
.kn-docbook {
  display: grid; grid-template-columns: 280px minmax(0, 1fr);
  gap: 40px; max-width: 1240px; margin: 0 auto; padding: 40px 40px 100px;
  align-items: start;
}

/* Sidebar */
.kn-docbook__sidebar {
  position: sticky; top: 124px; align-self: start;
  max-height: calc(100vh - 120px); overflow-y: auto;
  background: rgba(10,14,42,0.78); border: 3px solid var(--ocean-surface);
  padding: 22px 18px; scrollbar-width: thin; scrollbar-color: var(--ocean-surface) transparent;
}
.kn-docbook__sidebar::-webkit-scrollbar { width: 8px; }
.kn-docbook__sidebar::-webkit-scrollbar-thumb { background: var(--ocean-surface); }
.kn-docbook__sidebar-toggle { display: none; }
.kn-docbook__navGroup { margin-bottom: 18px; }
.kn-docbook__sideLabel {
  font-family: 'Press Start 2P', monospace; font-size: 8px; color: var(--seafoam);
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: 10px; opacity: 0.85;
}
.kn-docbook__nav { display: flex; flex-direction: column; gap: 2px; }
.kn-docbook__navLink {
  display: block; color: var(--ink); text-decoration: none; font-size: 18px;
  padding: 5px 10px; border-left: 3px solid transparent; transition: all 0.12s;
}
.kn-docbook__navLink:hover { color: var(--pixel-white); border-left-color: var(--seafoam); background: rgba(6,255,212,0.06); }
.kn-docbook__navLink.active { color: var(--sand-yellow); border-left-color: var(--sand-yellow); background: rgba(255,209,102,0.07); }

/* Article */
.kn-docbook__article, .kn-guide { min-width: 0; }
.kn-docbook__header, .kn-guide__hero-band { margin-bottom: 36px; padding-bottom: 28px; border-bottom: 3px solid var(--ocean-surface); }
.kn-docbook__eyebrow, .kn-guide__eyebrow {
  font-family: 'Press Start 2P', monospace; font-size: 9px; color: var(--seafoam);
  letter-spacing: 4px; text-transform: uppercase; margin-bottom: 16px;
}
.kn-docbook__h1, .kn-guide__title {
  font-family: 'Press Start 2P', monospace; font-size: clamp(18px, 3.5vw, 30px);
  line-height: 1.5; color: var(--pixel-white);
  text-shadow: 3px 3px 0 var(--lobster-red); margin-bottom: 18px;
}
.kn-docbook__lead, .kn-guide__lead { font-size: 22px; color: var(--ink); line-height: 1.6; max-width: 720px; }

.kn-docbook__section, .kn-guide__block { margin-bottom: 46px; scroll-margin-top: 124px; }
.kn-docbook__h2, .kn-guide__h2 {
  font-family: 'Press Start 2P', monospace; font-size: clamp(13px, 2vw, 17px);
  color: var(--sand-yellow); line-height: 1.6; margin-bottom: 18px;
  padding-left: 14px; border-left: 5px solid var(--lobster-red);
}
.kn-docbook__h3 {
  font-family: 'Press Start 2P', monospace; font-size: 11px; color: var(--seafoam);
  line-height: 1.7; margin: 26px 0 12px;
}
.kn-docbook__p, .kn-guide__p { font-size: 20px; color: var(--ink); line-height: 1.7; margin-bottom: 16px; }
.kn-docbook__ul { list-style: none; margin: 6px 0 18px; }
.kn-docbook__li { font-size: 19px; color: var(--ink); line-height: 1.6; padding: 6px 0 6px 26px; position: relative; }
.kn-docbook__li::before { content: '▸'; position: absolute; left: 4px; color: var(--seafoam); }
.kn-docbook__li:not(:last-child) { border-bottom: 1px solid rgba(14,48,96,0.5); }

/* Callouts */
.kn-guide__callout {
  margin: 18px 0; padding: 16px 18px 16px 20px; font-size: 19px; line-height: 1.6;
  color: var(--ink); background: rgba(79,195,247,0.06);
  border-left: 5px solid var(--bubble-blue);
}
.kn-guide__callout strong { color: var(--bubble-blue); font-family: 'Press Start 2P', monospace; font-size: 10px; }
.kn-guide__callout--tip { background: rgba(6,255,212,0.06); border-left-color: var(--seafoam); }
.kn-guide__callout--tip strong { color: var(--seafoam); }
.kn-guide__callout--warn { background: rgba(255,58,45,0.07); border-left-color: var(--lobster-red); }
.kn-guide__callout--warn strong { color: var(--lobster-red); }

/* Figures */
.kn-docbook__figure, .kn-guide__figure { margin: 20px 0; border: 3px solid var(--ocean-surface); overflow: hidden; }
.kn-docbook__figure-img, .kn-guide__figure-img { width: 100%; display: block; }
.kn-figure-cap {
  font-family: 'Press Start 2P', monospace; font-size: 8px; color: var(--sand-yellow);
  background: rgba(10,14,42,0.9); padding: 10px 12px; line-height: 1.7;
}

/* Icon strip (How to Play) */
.kn-guide__icon-strip { margin: 0 0 36px; }
.kn-guide__icon-strip-inner {
  display: flex; flex-wrap: wrap; gap: 10px;
  background: rgba(10,14,42,0.6); border: 3px solid var(--ocean-surface); padding: 16px;
}
.kn-guide__slot-item { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 86px; }
.kn-guide__dash-slot {
  width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
  font-size: 30px; background: rgba(14,48,96,0.6); border: 2px solid var(--ocean-surface);
}
.kn-guide__slot-cap { font-size: 14px; color: var(--ink-dim); text-align: center; line-height: 1.3; }

/* Guide footer */
.kn-guide__foot, .kn-docbook__foot { margin-top: 40px; padding-top: 26px; border-top: 3px solid var(--ocean-surface); }
.kn-guide__foot-text, .kn-docbook__foot-text { font-size: 18px; color: var(--ink-dim); line-height: 1.7; }
.kn-guide__foot-text a, .kn-docbook__foot-text a { color: var(--seafoam); text-decoration: none; }
.kn-guide__foot-text a:hover { color: var(--sand-yellow); }

/* Pixel divider */
.pixel-divider {
  height: 8px; width: 100%;
  background: repeating-linear-gradient(90deg,
    var(--lobster-red) 0,var(--lobster-red) 8px, var(--lobster-orange) 8px,var(--lobster-orange) 16px,
    var(--sand-yellow) 16px,var(--sand-yellow) 24px, var(--seafoam) 24px,var(--seafoam) 32px,
    var(--bubble-blue) 32px,var(--bubble-blue) 40px, transparent 40px,transparent 48px);
}

/* Footer */
footer { text-align: center; padding: 36px; border-top: 4px solid var(--ocean-surface); font-size: 15px; color: rgba(240,244,255,0.3); }
.footer-logo-wrap { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 18px; }
.footer-logo-img { width: 42px; height: 42px; object-fit: contain; }
.footer-logo-text { font-family: 'Press Start 2P', monospace; font-size: 13px; color: var(--lobster-red); text-shadow: 2px 2px 0 var(--lobster-orange); }
.social-links { display: flex; gap: 14px; justify-content: center; margin: 14px 0 18px; flex-wrap: wrap; }
.social-link { font-family: 'Press Start 2P', monospace; font-size: 8px; padding: 9px 13px; border: 2px solid var(--ocean-surface); color: var(--pixel-white) !important; text-decoration: none; transition: all 0.15s; }
.social-link:hover { border-color: var(--seafoam) !important; color: var(--seafoam) !important; }
footer a { color: var(--seafoam); text-decoration: none; }

/* Reveal */
.kn-reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.5s ease, transform 0.5s ease; }
.kn-reveal.visible { opacity: 1; transform: translateY(0); }

/* Responsive */
@media (max-width: 900px) {
  .kn-docbook { grid-template-columns: 1fr; gap: 18px; padding: 24px 16px 80px; }
  .kn-docbook__sidebar {
    position: static; max-height: none; top: 0;
  }
  .kn-docbook__sidebar-toggle {
    display: flex; width: 100%; justify-content: space-between; align-items: center;
    font-family: 'Press Start 2P', monospace; font-size: 10px; color: var(--seafoam);
    background: transparent; border: none; cursor: pointer; padding: 4px;
  }
  .kn-docbook__sidebar-body { display: none; margin-top: 14px; }
  .kn-docbook__sidebar--open .kn-docbook__sidebar-body { display: block; }
  .kn-docbook__sidebar-toggle__caret::after { content: '▼'; font-size: 8px; }
  .kn-docbook__sidebar--open .kn-docbook__sidebar-toggle__caret::after { content: '▲'; }
}
@media (max-width: 768px) {
  nav { padding: 12px 16px; }
  .nav-links { gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
  .nav-links a { font-size: 14px; }
}
