/* ==========================================================================
   《這網站有蟲子》（Literal Bugs）v2.0
   Editorial Swiss Tech Luxury Disguise + Tactile DevTools Combat HUD
   ========================================================================== */

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-subtle: #f4f4f5;
  --ink: #09090b;
  --ink-secondary: #52525b;
  --ink-muted: #71717a;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --accent: #09090b;
  --accent-green: #10b981;
  --accent-cyan: #06b6d4;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-purple: #8b5cf6;
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'PingFang TC', 'Noto Sans TC', 'Inter', sans-serif;
  --font-mono: 'SF Mono', 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius-sm: 8px;
  --radius-md: 13px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(9, 9, 11, 0.04), 0 1px 1px rgba(9, 9, 11, 0.03);
  --shadow-md: 0 10px 30px rgba(9, 9, 11, 0.08), 0 2px 6px rgba(9, 9, 11, 0.04);
  --shadow-lg: 0 24px 60px rgba(9, 9, 11, 0.16);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

body.custom-cursor-active,
body.custom-cursor-active * {
  cursor: none !important;
}

body.screen-shake {
  animation: screenShake 0.22s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes screenShake {
  0%, 100% { transform: translate3d(0, 0, 0); }
  20% { transform: translate3d(-4px, 3px, 0); }
  45% { transform: translate3d(4px, -3px, 0); }
  70% { transform: translate3d(-2px, 2px, 0); }
}

.mono { font-family: var(--font-mono); }

/* Architectural Swiss Grid + Ambient Radial Specular Glow */
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, rgba(9, 9, 11, 0.036) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(9, 9, 11, 0.036) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 18%, #000 35%, transparent 100%);
}

.bg-glow {
  position: fixed;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 960px;
  height: 460px;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse at center, rgba(16, 185, 129, 0.08) 0%, rgba(6, 182, 212, 0.04) 40%, transparent 72%);
  filter: blur(28px);
}

/* Full-viewport Canvases */
#stain-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 30;
}

#bug-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 40;
}

/* ==========================================================================
   FAKE TECH COMPANY WEBSITE (VERITAS LABS)
   ========================================================================== */
.site-shell {
  position: relative;
  z-index: 10;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px 160px;
}

/* Top Announcement Ticker */
.top-ticker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #e4e4e7;
  font-size: 11.5px;
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-sm);
}

.ticker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
}

.ticker-sep { opacity: 0.4; }
.ticker-tag {
  background: rgba(255, 255, 255, 0.14);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  color: #a7f3d0;
}

/* Destructible Elements Physics & Nibble Feedback */
.destructible {
  position: relative;
  transform-origin: top left;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
  will-change: transform;
}

.destructible.chewed {
  border-style: dashed;
}

.destructible.cracked {
  border-color: rgba(239, 68, 68, 0.5) !important;
  box-shadow: 0 12px 30px rgba(239, 68, 68, 0.1);
}

.destructible.snapped {
  box-shadow: 0 22px 44px rgba(9, 9, 11, 0.18);
}

.destructible.taped {
  border-color: #f59e0b !important;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.18);
}

.destructible.nibble-pulse {
  animation: nibblePulse 0.18s ease-out;
}

@keyframes nibblePulse {
  0% { filter: brightness(1); }
  50% { filter: brightness(0.95) contrast(1.06); }
  100% { filter: brightness(1); }
}

/* Nav Bar */
.site-nav {
  position: sticky;
  top: 14px;
  z-index: 20;
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  gap: 16px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(145deg, #18181b, #09090b);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.brand-name { font-size: 16px; display: flex; align-items: baseline; gap: 4px; }
.brand-sub { font-weight: 500; font-size: 10.5px; color: var(--ink-muted); letter-spacing: 0.06em; }

.nav-links { display: flex; gap: 24px; }
.nav-link {
  text-decoration: none;
  color: var(--ink-secondary);
  font-size: 13.5px;
  font-weight: 500;
  transition: color 0.15s;
}
.nav-link:hover { color: var(--ink); }

.nav-actions { display: flex; align-items: center; gap: 10px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}

.status-pill.panic {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
  animation: pulseDot 2s infinite;
}

.status-pill.panic .status-dot {
  background: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

/* Buttons */
button { font-family: var(--font-sans); cursor: pointer; }

.btn-primary {
  background: linear-gradient(180deg, #18181b 0%, #09090b 100%);
  color: #fff;
  border: 1px solid #09090b;
  border-radius: var(--radius-sm);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 2px 6px rgba(9, 9, 11, 0.12);
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}

.btn-primary:hover {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 8px 20px rgba(9, 9, 11, 0.2);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-secondary:hover { background: var(--surface-subtle); border-color: var(--ink); }

.btn-ghost {
  background: transparent;
  color: var(--ink-secondary);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 500;
}
.btn-ghost:hover { color: var(--ink); background: var(--surface-subtle); }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 15px; border-radius: 11px; }
.btn-block { width: 100%; padding: 11px 16px; font-size: 14px; }

/* Hero Section */
.hero-section {
  padding: 72px 0 44px;
  text-align: center;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--ink-secondary);
  box-shadow: var(--shadow-sm);
  margin-bottom: 26px;
}

.mono-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface-subtle);
  padding: 2px 8px;
  border-radius: 999px;
}

.hero-title {
  margin: 0 auto 22px;
  max-width: 940px;
  font-size: clamp(2.4rem, 5.2vw, 4.4rem);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.04em;
  color: var(--ink);
}

/* Iconic Period That Sprouts 6 Legs! */
.hero-period {
  display: inline-block;
  position: relative;
  color: var(--ink);
  font-weight: 900;
  margin-left: 2px;
}

.hero-period.twitching { animation: periodTwitch 0.13s ease-in-out infinite; }
.hero-period.escaped { color: transparent; }
.hero-period.escaped::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0.16em;
  width: 0.22em;
  height: 0.22em;
  transform: translateX(-50%);
  border-radius: 50%;
  border: 1.5px dashed rgba(9, 9, 11, 0.3);
}

@keyframes periodTwitch {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-1.8px, -1px) rotate(-7deg); }
  50% { transform: translate(2.2px, 0.5px) rotate(9deg); }
  75% { transform: translate(-1px, 1px) rotate(-4deg); }
}

.hero-subtitle {
  margin: 0 auto 34px;
  max-width: 680px;
  font-size: 17px;
  color: var(--ink-secondary);
  line-height: 1.75;
}

.hero-cta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 44px;
}

/* Trust Logos Strip */
.trust-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 48px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(228, 228, 231, 0.7);
  background: rgba(255, 255, 255, 0.65);
}

.trust-label { font-size: 10px; letter-spacing: 0.12em; color: var(--ink-muted); }
.trust-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
  font-size: 13px;
  font-weight: 700;
  color: #a1a1aa;
  letter-spacing: 0.06em;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  text-align: left;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
}

.metric-val { font-size: 32px; font-weight: 800; letter-spacing: -0.04em; color: var(--ink); margin-bottom: 4px; }
.metric-label { font-size: 13px; color: var(--ink-secondary); margin-bottom: 12px; }
.metric-meta { font-size: 10px; color: var(--ink-muted); letter-spacing: 0.04em; }

/* Sections */
.section-block { padding: 48px 0; }
.section-header { text-align: center; margin-bottom: 34px; }
.section-eyebrow { font-size: 11.5px; font-weight: 600; color: var(--ink-muted); letter-spacing: 0.08em; margin-bottom: 10px; }
.section-title { margin: 0 0 10px; font-size: clamp(1.65rem, 3vw, 2.35rem); font-weight: 800; letter-spacing: -0.03em; }
.section-desc { margin: 0; color: var(--ink-secondary); font-size: 15px; }

/* Bento Grid */
.bento-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.bento-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 18px;
}

.bento-card h3 { margin: 0 0 10px; font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.bento-card p { margin: 0 0 20px; font-size: 14px; color: var(--ink-secondary); flex: 1; }
.card-footer { font-size: 11px; color: var(--ink-muted); padding-top: 14px; border-top: 1px solid var(--border); }

/* Code Showcase */
.code-showcase {
  background: #0d0d11;
  color: #e4e4e7;
  border-radius: var(--radius-lg);
  border: 1px solid #27272a;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.code-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #141419;
  border-bottom: 1px solid #27272a;
}

.window-dots { display: flex; gap: 7px; }
.window-dots .dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.red { background: #ef4444; }
.dot.yellow { background: #f59e0b; }
.dot.green { background: #10b981; }
.code-filename { font-size: 12px; color: #a1a1aa; }
.code-badge { font-size: 11px; color: #10b981; background: rgba(16, 185, 129, 0.12); padding: 2px 8px; border-radius: 999px; }
.code-body { margin: 0; padding: 24px 26px; font-size: 13.5px; line-height: 1.75; overflow-x: auto; }
.c-kw { color: #c084fc; }
.c-fn { color: #38bdf8; }
.c-ty { color: #fbbf24; }
.c-str { color: #4ade80; }
.c-cm { color: #71717a; }
.c-num { color: #fb7185; }

/* Pricing */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.price-card.featured { border-color: var(--ink); box-shadow: var(--shadow-md); }
.featured-tag {
  position: absolute; top: -11px; right: 20px;
  background: var(--ink); color: #fff; font-size: 10px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; letter-spacing: 0.06em;
}
.price-tier { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.price-num { font-size: 34px; font-weight: 800; letter-spacing: -0.04em; margin-bottom: 12px; }
.price-num span { font-size: 14px; font-weight: 500; color: var(--ink-muted); }
.price-desc { font-size: 14px; color: var(--ink-secondary); margin: 0 0 24px; flex: 1; }

/* Testimonials */
.testimonial-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.quote-card {
  margin: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow-sm);
}
.quote-card p { margin: 0 0 18px; font-size: 15px; line-height: 1.7; color: var(--ink); }
.quote-card footer { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--ink-muted); }
.quote-card footer strong { color: var(--ink); }

/* Footer */
.site-footer {
  margin-top: 40px; padding: 22px 24px;
  border-top: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-md);
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--ink-muted); flex-wrap: wrap; gap: 10px; }

/* ==========================================================================
   META-WEB COMEDY WIDGETS (Cookie Banner & Panicking AI Support Chat)
   ========================================================================== */
.cookie-banner {
  position: fixed;
  bottom: 104px;
  left: 20px;
  z-index: 52;
  width: min(380px, calc(100vw - 40px));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: slideUpSimple 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpSimple {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.cookie-title { font-size: 13px; font-weight: 800; margin-bottom: 2px; }
.cookie-text { font-size: 12px; color: var(--ink-secondary); line-height: 1.5; }
.cookie-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.cookie-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-strong);
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  transition: opacity 0.2s;
}

.cookie-close-btn.escaped {
  color: transparent;
  border-style: dashed;
  background: transparent;
}

/* Panicking AI Support Chat Widget */
.ai-chat-widget {
  position: fixed;
  bottom: 104px;
  right: 20px;
  z-index: 52;
  width: 276px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: slideUpSimple 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-chat-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
}

.ai-avatar { font-size: 18px; }
.ai-meta { flex: 1; }
.ai-name { font-size: 12.5px; font-weight: 700; line-height: 1.2; }
.ai-status { font-size: 9.5px; color: #34d399; }
.ai-status.panic { color: #f87171; }
.ai-caret { font-size: 12px; opacity: 0.7; }

.ai-chat-body {
  padding: 10px 12px;
  max-height: 170px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: #fafafa;
}

.ai-chat-widget.collapsed .ai-chat-body { display: none; }

.ai-msg {
  font-size: 11.5px;
  line-height: 1.45;
  padding: 7px 10px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--ink);
}

.ai-msg.panic {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
  font-weight: 600;
}

/* ==========================================================================
   GAME HUD: COMBO RANK, TOP TELEMETRY, BOSS BAR, SLACK FEED, DEVTOOLS DOCK
   ========================================================================== */
.hidden { display: none !important; }

/* Stylish Combo Badge */
.combo-hud {
  position: fixed;
  top: 14px;
  left: 18px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(9, 9, 11, 0.9);
  backdrop-filter: blur(14px);
  color: #fff;
  padding: 8px 14px 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(251, 191, 36, 0.45);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  animation: comboPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes comboPop {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.combo-rank {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  display: grid;
  place-items: center;
  font-size: 19px;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.combo-count { font-size: 13px; font-weight: 800; color: #fde68a; line-height: 1.1; }
.combo-sub { font-size: 9.5px; color: #a1a1aa; letter-spacing: 0.06em; margin-bottom: 4px; }
.combo-timer-track { width: 88px; height: 4px; background: rgba(255, 255, 255, 0.14); border-radius: 999px; overflow: hidden; }
.combo-timer-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #fbbf24, #f97316); }

/* Top-Right Telemetry */
.hud-top {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(9, 9, 11, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #fafafa;
  padding: 7px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.3);
  animation: slideDownFade 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  flex-wrap: wrap;
}

@keyframes slideDownFade {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

.hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 11.5px;
}

.hud-label { color: #a1a1aa; font-size: 10.5px; }
.hud-val { font-weight: 700; color: #fff; }
.hud-bar-track { width: 64px; height: 7px; background: rgba(255, 255, 255, 0.14); border-radius: 999px; overflow: hidden; }
.hud-bar-fill { height: 100%; background: linear-gradient(90deg, #10b981, #34d399); transition: width 0.25s ease; }
.hud-bar-fill.warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.hud-bar-fill.crit { background: linear-gradient(90deg, #ef4444, #f87171); }

.act-pill {
  background: rgba(139, 92, 246, 0.24);
  border: 1px solid rgba(139, 92, 246, 0.45);
  color: #ddd6fe;
  font-size: 10.5px;
  font-weight: 600;
}

.hud-icon-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s, transform 0.12s;
}
.hud-icon-btn:hover { background: rgba(255, 255, 255, 0.22); transform: translateY(-1px); }

/* Boss Bar */
.boss-hud {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 32px));
  z-index: 60;
  background: rgba(15, 10, 18, 0.94);
  border: 1px solid rgba(239, 68, 68, 0.65);
  border-radius: 14px;
  padding: 12px 16px;
  color: #fff;
  box-shadow: 0 16px 44px rgba(239, 68, 68, 0.28);
  animation: slideDownFade 0.4s ease;
}

.boss-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.boss-tag { font-size: 10px; background: #ef4444; color: #fff; padding: 2px 7px; border-radius: 4px; font-weight: 700; }
.boss-name { font-weight: 800; flex: 1; }
.boss-bar-track { height: 10px; background: rgba(255, 255, 255, 0.12); border-radius: 999px; overflow: hidden; }
.boss-bar-fill { height: 100%; background: linear-gradient(90deg, #dc2626, #f97316, #ef4444); transition: width 0.18s ease; }

/* Slack / Achievement Notifications */
.slack-stack {
  position: fixed;
  top: 72px;
  right: 18px;
  z-index: 55;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 315px;
  pointer-events: none;
}

.slack-toast {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--ink);
  border-radius: 11px;
  padding: 10px 13px;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.slack-toast.urgent { border-left-color: var(--accent-red); background: #fff5f5; }
.slack-toast.unlock { border-left-color: var(--accent-cyan); background: #ecfeff; }
.slack-toast.mutation { border-left-color: var(--accent-purple); background: #f5f3ff; }
.slack-toast.achievement { border-left-color: #f59e0b; background: #fffbeb; }
.slack-toast.fade-out { opacity: 0; transform: translateX(24px); transition: all 0.3s ease; }
.slack-sender { font-size: 11px; font-weight: 700; color: var(--ink-muted); display: flex; justify-content: space-between; margin-bottom: 3px; }
.slack-msg { font-size: 12.5px; color: var(--ink); line-height: 1.45; font-weight: 500; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(28px) scale(0.96); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

/* Bottom DevTools Weapon Dock */
.tool-dock {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(9, 9, 11, 0.93);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 8px 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.4);
  animation: slideUpDock 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: calc(100vw - 20px);
}

@keyframes slideUpDock {
  from { opacity: 0; transform: translate(-50%, 30px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.dock-tools { display: flex; gap: 5px; }

.tool-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 8px 8px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #e4e4e7;
  transition: all 0.16s ease;
}

.tool-btn:hover:not(.locked) { background: rgba(255, 255, 255, 0.15); transform: translateY(-2px); }
.tool-btn.active {
  background: #ffffff;
  color: #09090b;
  border-color: #ffffff;
  box-shadow: 0 6px 22px rgba(255, 255, 255, 0.25);
  transform: translateY(-3px);
}
.tool-btn.locked { opacity: 0.48; cursor: not-allowed; }
.tool-btn.just-unlocked { animation: unlockPop 0.6s ease; }

.tool-btn.ult-btn {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.1);
}

.tool-btn.ult-btn.ready {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  border-color: #fde68a;
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.6);
  animation: ultPulse 1.1s ease-in-out infinite;
}

@keyframes ultPulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.04); }
}

@keyframes unlockPop {
  0% { transform: scale(0.85); box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.8); }
  50% { transform: scale(1.12); box-shadow: 0 0 24px 8px rgba(6, 182, 212, 0.45); }
  100% { transform: scale(1); }
}

.tool-key { position: absolute; top: 4px; left: 6px; font-size: 9px; opacity: 0.55; }
.tool-svg-icon { display: grid; place-items: center; height: 22px; margin-bottom: 2px; font-size: 17px; }
.tool-name { font-size: 11px; font-weight: 700; white-space: nowrap; }
.tool-sub { font-size: 9px; opacity: 0.65; margin-top: 1px; }

.tool-meter { width: 48px; height: 4px; border-radius: 999px; background: rgba(128, 128, 128, 0.3); margin-top: 4px; overflow: hidden; }
.tool-meter-fill { height: 100%; background: #06b6d4; transition: width 0.1s linear; }
.tool-meter-fill.green { background: #10b981; }
.tool-meter-fill.amber { background: #fbbf24; }

.lock-badge {
  position: absolute; inset: 0; background: rgba(9, 9, 11, 0.74);
  border-radius: 11px; display: grid; place-items: center;
  font-size: 9.5px; font-weight: 700; color: #fbbf24;
}
.tool-btn:not(.locked) .lock-badge { display: none; }

.dock-divider { width: 1px; height: 44px; background: rgba(255, 255, 255, 0.14); }
.dock-extras { display: flex; flex-direction: column; gap: 5px; }

.extra-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.13);
  color: #e4e4e7;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s;
}
.extra-btn:hover { background: rgba(255, 255, 255, 0.2); }
.extra-btn.active { background: #8b5cf6; border-color: #a78bfa; color: #fff; }

/* ==========================================================================
   BESPOKE SVG CUSTOM CURSOR VISUALS
   ========================================================================== */
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 100;
  transform: translate(-50%, -50%);
  will-change: transform;
  display: grid;
  place-items: center;
}

.cur-svg-wrap {
  transition: transform 0.07s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 6px 12px rgba(9, 9, 11, 0.25));
}

.custom-cursor.pressing .cur-svg-wrap {
  transform: scale(0.82) rotate(-14deg);
}

.custom-cursor.tool-vacuum .cur-svg-wrap {
  animation: spinSlow 2s linear infinite;
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Magnifying Glass Inspector Tooltip */
.inspector-tooltip {
  position: fixed;
  z-index: 90;
  width: 262px;
  background: rgba(9, 9, 11, 0.95);
  backdrop-filter: blur(14px);
  color: #f4f4f5;
  border: 1px solid rgba(245, 158, 11, 0.55);
  border-radius: 12px;
  padding: 12px 14px;
  pointer-events: none;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.38);
  font-size: 12px;
}

.insp-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.insp-glyph { width: 34px; height: 34px; border-radius: 8px; background: rgba(245, 158, 11, 0.18); color: #fbbf24; font-family: var(--font-mono); font-size: 17px; font-weight: 800; display: grid; place-items: center; }
.insp-name { font-weight: 700; font-size: 13.5px; }
.insp-latin { font-family: var(--font-mono); font-size: 10px; color: #a1a1aa; font-style: italic; }
.insp-badge { margin-left: auto; font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: rgba(139, 92, 246, 0.25); color: #c4b5fd; }
.insp-row { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 11.5px; }
.insp-row span:first-child { color: #a1a1aa; }
.insp-lore { margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(255, 255, 255, 0.12); color: #d4d4d8; font-size: 11px; line-height: 1.5; }
.insp-heat-wrap { margin-top: 8px; }
.insp-heat-label { font-size: 10px; color: #fbbf24; margin-bottom: 3px; }
.insp-heat-bar { height: 5px; background: rgba(255, 255, 255, 0.12); border-radius: 999px; overflow: hidden; }
.insp-heat-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #f59e0b, #ef4444); }

/* Sandbox Drawer */
.sandbox-panel {
  position: fixed;
  bottom: 98px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 65;
  width: min(680px, calc(100vw - 24px));
  background: rgba(9, 9, 11, 0.96);
  backdrop-filter: blur(18px);
  color: #fff;
  border: 1px solid rgba(139, 92, 246, 0.55);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.48);
  animation: slideUpDock 0.25s ease;
}

.sandbox-header { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: #c4b5fd; font-weight: 700; margin-bottom: 6px; }
.close-sm { background: transparent; border: none; color: #a1a1aa; font-size: 15px; }
.close-sm:hover { color: #fff; }
.sandbox-hint { font-size: 12px; color: #a1a1aa; margin-bottom: 10px; }
.sandbox-spawners { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

.spawner-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.12s;
}
.spawner-chip:hover { background: rgba(139, 92, 246, 0.35); border-color: #a78bfa; transform: translateY(-1px); }
.spawner-chip .sym { font-family: var(--font-mono); font-weight: 800; color: #fbbf24; }
.sandbox-actions { display: flex; flex-wrap: wrap; gap: 7px; }

.sb-act-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  border-radius: 8px;
  padding: 6px 11px;
  font-size: 11.5px;
  font-weight: 600;
}
.sb-act-btn:hover { background: rgba(255, 255, 255, 0.22); }
.sb-act-btn.danger:hover { background: rgba(239, 68, 68, 0.45); border-color: #ef4444; }

/* Modals (Perks, Codex, Ending) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: rgba(9, 9, 11, 0.68);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-card {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  max-height: 86vh;
  overflow-y: auto;
}

/* Perk Modal */
.perk-card {
  width: min(760px, 100%);
  padding: 28px;
  text-align: center;
}

.perk-sub { margin: 6px 0 22px; font-size: 14px; color: var(--ink-secondary); }
.perk-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; text-align: left; }

.perk-option {
  background: var(--bg);
  border: 1.5px solid var(--border-strong);
  border-radius: 14px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.perk-option:hover {
  border-color: var(--ink);
  background: #fff;
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.perk-icon { font-size: 28px; }
.perk-pkg { font-family: var(--font-mono); font-size: 10.5px; color: var(--accent-purple); font-weight: 700; }
.perk-name { font-size: 15px; font-weight: 800; color: var(--ink); }
.perk-desc { font-size: 12.5px; color: var(--ink-secondary); line-height: 1.5; flex: 1; }

/* Codex Modal */
.codex-card { width: min(860px, 100%); padding: 24px 28px; }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.modal-eyebrow { font-size: 11px; color: var(--ink-muted); margin-bottom: 4px; }
.modal-title { margin: 0; font-size: 22px; font-weight: 800; }
.modal-title span { font-size: 14px; color: var(--accent-purple); margin-left: 8px; }
.modal-close { background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 8px; width: 34px; height: 34px; font-size: 16px; }

.codex-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.codex-tab { padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-subtle); font-size: 13px; font-weight: 600; color: var(--ink-secondary); }
.codex-tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.codex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.codex-item { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--bg); }
.codex-item.undiscovered { opacity: 0.52; filter: grayscale(1); }
.codex-item-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.codex-sym {
  width: 44px; height: 44px; border-radius: 10px; background: #fff; border: 1px solid var(--border);
  display: grid; place-items: center; overflow: hidden; flex-shrink: 0;
}
.codex-item-name { font-weight: 700; font-size: 14px; }
.codex-item-latin { font-family: var(--font-mono); font-size: 10px; color: var(--ink-muted); }
.codex-item-recipe { font-family: var(--font-mono); font-size: 10.5px; color: var(--accent-purple); background: rgba(139, 92, 246, 0.1); padding: 2px 7px; border-radius: 6px; display: inline-block; margin-bottom: 6px; }
.codex-item-lore { font-size: 12px; color: var(--ink-secondary); line-height: 1.5; }

.ach-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: var(--bg);
  display: flex;
  align-items: flex-start;
  gap: 11px;
}
.ach-item.locked { opacity: 0.5; filter: grayscale(1); }
.ach-item.unlocked { background: #fffbeb; border-color: #fde68a; }
.ach-ico { font-size: 24px; line-height: 1; }
.ach-title { font-size: 13.5px; font-weight: 800; margin-bottom: 3px; }
.ach-desc { font-size: 11.5px; color: var(--ink-secondary); line-height: 1.45; }

/* Ending Modal */
.ending-card { width: min(560px, 100%); padding: 32px; text-align: center; }
.ending-seal { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; padding: 5px 12px; border-radius: 999px; background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; margin-bottom: 14px; }
.ending-seal.chaos { background: #f5f3ff; color: #5b21b6; border-color: #ddd6fe; }
.ending-seal.doom { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.ending-title { margin: 0 0 8px; font-size: 25px; font-weight: 900; letter-spacing: -0.03em; }
.ending-subtitle { margin: 0 0 22px; color: var(--ink-secondary); font-size: 14px; line-height: 1.6; }
.ending-stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; text-align: left; }
.ending-stat { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.ending-stat-k { font-size: 11px; color: var(--ink-muted); }
.ending-stat-v { font-family: var(--font-mono); font-size: 20px; font-weight: 800; color: var(--ink); }
.ending-quote { font-size: 14px; font-style: italic; color: var(--ink-secondary); padding: 12px 16px; background: var(--surface-subtle); border-radius: 10px; margin-bottom: 22px; }
.sneaky-dot { display: inline-block; font-weight: 900; color: var(--ink); animation: periodTwitch 0.6s ease-in-out infinite; }
.ending-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.ending-actions button { padding: 11px 18px; font-size: 13.5px; }

/* Responsive */
@media (max-width: 900px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .bento-grid, .pricing-grid, .testimonial-grid, .perk-choices { grid-template-columns: 1fr; }
  .nav-links, .ai-chat-widget { display: none; }
}

@media (max-width: 680px) {
  .tool-btn { min-width: 50px; padding: 6px 4px; }
  .tool-sub { display: none; }
  .hud-top { left: 10px; right: 10px; justify-content: center; }
  .combo-hud { top: 68px; left: 10px; }
  .slack-stack { width: calc(100vw - 24px); right: 12px; }
}
