:root {
  --bs-tile: #c8c0b0;
  --bs-grout: #8a8478;
  --bs-ink: #0c0a0a;
  --bs-cream: #e8e0d0;
  --bs-blood: #8b1a1a;
  --bs-muted: rgba(232, 224, 208, 0.7);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #080606;
  color: var(--bs-cream);
  font-family: "Segoe UI", system-ui, sans-serif;
  touch-action: none;
}

#bs-root {
  position: relative;
  width: 100%;
  height: 100%;
  background: #080606;
}

#bs-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: none;
  outline: none;
}

.bs-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(0,0,0,0.65), transparent);
  pointer-events: none;
}

.bs-hud a {
  pointer-events: auto;
  color: var(--bs-muted);
  text-decoration: none;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bs-meter-wrap {
  flex: 1;
  max-width: 420px;
  margin: 0 auto;
}

.bs-meter-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bs-muted);
  margin-bottom: 6px;
  text-align: center;
}

.bs-meter {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
}

.bs-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6a8a58, #c8e0a0);
  transition: width 0.08s linear;
}

.bs-trick {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  padding: 24px;
  text-align: center;
}

.bs-trick[hidden] { display: none !important; }

.bs-trick-card {
  pointer-events: auto;
  max-width: min(440px, 92vw);
  padding: 22px 24px;
  border-radius: 12px;
  background: rgba(12, 10, 10, 0.92);
  border: 1px solid rgba(232, 224, 208, 0.28);
  box-shadow: 0 18px 48px rgba(0,0,0,0.55);
  color: var(--bs-cream);
}

.bs-trick-card h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
  color: #fff;
}

.bs-trick-card p {
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--bs-muted);
  margin-bottom: 14px;
}

.bs-trick-card.is-urgent {
  border-color: rgba(196, 40, 40, 0.7);
  animation: bs-shake 0.18s linear infinite;
}

.bs-trick-card.is-rotate {
  transform: rotate(90deg);
}

.bs-trick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.bs-trick-btn {
  font: inherit;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(232,224,208,0.3);
  background: transparent;
  color: var(--bs-cream);
  cursor: pointer;
}

.bs-trick-btn--danger {
  background: linear-gradient(135deg, #a02828, #601010);
  border-color: transparent;
  color: #fff;
}

.bs-vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,0.55) 100%);
  opacity: 0.85;
}

.bs-flash {
  position: absolute;
  inset: 0;
  z-index: 9;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}

.bs-flash.is-on {
  opacity: 0.85;
  animation: bs-flash 0.35s ease-out forwards;
}

.bs-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 3, 3, 0.88);
}

.bs-overlay[hidden] { display: none !important; }

.bs-overlay--scare {
  background: rgba(20, 0, 0, 0.92);
}

.bs-box {
  width: min(520px, 100%);
  text-align: center;
  padding: 28px 24px;
  border: 1px solid rgba(200, 168, 75, 0.28);
  border-radius: 14px;
  background: rgba(16, 12, 12, 0.95);
}

.bs-credit {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bs-muted);
  margin-bottom: 10px;
}

.bs-box h1,
.bs-box h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  margin-bottom: 12px;
  color: #e8c547;
}

.bs-overlay--scare h2 { color: #e06060; }

.bs-lead, .bs-rule, .bs-box p {
  color: var(--bs-muted);
  line-height: 1.55;
  margin-bottom: 12px;
}

.bs-rule { font-size: 0.92rem; }

.bs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 6px 4px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid rgba(200, 168, 75, 0.35);
  background: transparent;
  color: var(--bs-cream);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

.bs-btn--primary {
  background: linear-gradient(135deg, #c9a227, #9a7420);
  border-color: transparent;
  color: #120f08;
  font-weight: 700;
}

@keyframes bs-shake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-2px, 1px); }
  75% { transform: translate(2px, -1px); }
}

@keyframes bs-flash {
  from { opacity: 0.9; }
  to { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .bs-trick-card.is-urgent { animation: none; }
  .bs-flash.is-on { animation: none; opacity: 0; }
}
