/* ============================================================
 * Break the Chains — standalone stylesheet (mirror of
 * jsmodules/BreakTheChains.css + the standalone shell + title +
 * reset). Keep the board rules in sync with the timeline mirror.
 * ============================================================ */

body {
  margin: 0;
  background: radial-gradient(1200px 800px at 50% -10%, #1b1020, #0b0710 70%);
  color: #e9e2d5;
  font-family: Georgia, 'Times New Roman', serif;
}

.chainbreak-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 60px;
  text-align: center;
}

.chainbreak-heading {
  font-family: 'Pirata One', 'Arial Black', sans-serif;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  letter-spacing: 0.08em;
  color: #f6f2e8;
  margin: 8px 0 4px;
  text-shadow: 0 0 16px rgba(255, 90, 20, 0.35);
}

.chainbreak-tagline {
  font-size: 0.95rem;
  color: rgba(233, 226, 213, 0.72);
  margin: 0 0 18px;
}

.chainbreak-readout {
  margin: 14px 0 6px;
  font-family: 'Pirata One', sans-serif;
  letter-spacing: 0.12em;
  color: #e6c08a;
  min-height: 1.4em;
}

.chainbreak-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 14px;
}
.chainbreak-gender-label {
  font-family: 'Pirata One', sans-serif;
  letter-spacing: 0.14em;
  color: rgba(233, 226, 213, 0.78);
  font-size: 0.9rem;
}
.chainbreak-gender {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.9rem;
  padding: 6px 10px;
  color: #f6f2e8;
  background: #1e0a20;
  border: 1px solid #b87333;
  border-radius: 16px;
}

.chainbreak-reset {
  margin-top: 16px;
  padding: 10px 26px;
  font-family: 'Pirata One', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.12em;
  color: #f6f2e8;
  background: linear-gradient(180deg, #3a1230, #1e0a20);
  border: 1px solid #b87333;
  border-radius: 24px;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.1s ease;
}
.chainbreak-reset:hover {
  box-shadow: 0 0 14px rgba(255, 120, 40, 0.5);
}
.chainbreak-reset:active {
  transform: translateY(1px);
}

/* ---------- the board (mirror of jsmodules/BreakTheChains.css) ---------- */
.chainbreak-board {
  width: min(800px, 100%);
  max-width: 100%;
  box-sizing: border-box;
  height: 600px;
  background-color: #0c0620;
  border: 5px solid #000000;
  border-radius: 38px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  margin: 20px auto;

  box-shadow:
    0 0 50px rgba(0, 240, 255, 0.28),
    0 0 10px rgba(0, 240, 255, 0.42),
    0 0 0px rgba(255, 43, 214, 0.36),
    inset 0 0 3px #999a9a,
    inset 0 0 7px #bebebee8;
}

.chainbreak-board::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 35px;
  background: radial-gradient(ellipse at 30% 18%, rgba(255, 255, 255, 0.10), transparent 55%);
  pointer-events: none;
  z-index: 7;
}
.chainbreak-board::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 35px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.08) 0%, transparent 30%);
  pointer-events: none;
  z-index: 8;
}

.chainbreak-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
  touch-action: manipulation;
}

/* the CRT scanline overlay (the retro-Atari phosphor look) */
.chainbreak-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.28) 3px,
    rgba(0, 0, 0, 0.28) 4px
  );
}

.chainbreak-cta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  text-align: center;
  font-family: 'Press Start 2P', 'Pirata One', 'Arial Black', monospace;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: clamp(0.6rem, 1.9vw, 1.2rem);
  color: #fff;
  pointer-events: none;
  z-index: 5;
  animation: chainbreak-breathe 1.05s ease-in-out infinite;
  text-shadow:
    1px 0 0 rgba(255, 80, 110, 0.6),
    -1px 0 0 rgba(80, 190, 255, 0.6),
    0 0 6px #ffd7f2,
    0 0 18px #ff5bd6,
    0 0 40px #ff2bd6;
}
.chainbreak-sub {
  display: block;
  font-size: 0.6em;
  letter-spacing: 0.06em;
  margin-top: 10px;
  color: #46ff8c;
  text-shadow: 0 0 8px #46ff8c, 0 0 20px #46ff8c;
  /* the seeker's sentence keeps its own capitals (2026-10-20) */
  text-transform: none;
}
.chainbreak-broken .chainbreak-cta {
  color: #46ff8c;
  animation: none;
  text-shadow: 0 0 8px #46ff8c, 0 0 22px #46ff8c, 0 0 46px #46ff8c;
}
.chainbreak-held .chainbreak-cta {
  color: #ff3b1f;
  animation: none;
  text-shadow: 0 0 8px #ff3b1f, 0 0 22px #ff3b1f, 0 0 46px #ff3b1f;
}

.chainbreak-meter {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 92px;
  width: min(260px, 60%);
  z-index: 5;
  pointer-events: none;
  text-align: center;
}
.chainbreak-meter-label {
  display: block;
  font-family: 'Press Start 2P', 'Pirata One', monospace;
  font-size: 0.5rem;
  letter-spacing: 0.2em;
  color: rgba(0, 240, 255, 0.85);
  margin-bottom: 4px;
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.6);
}
.chainbreak-meter-track {
  height: 8px;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(0, 240, 255, 0.4);
  overflow: hidden;
}
.chainbreak-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00f0ff, #ff2bd6 55%, #ff3b1f);
  box-shadow: 0 0 12px rgba(255, 59, 31, 0.8);
  transition: width 0.1s linear;
}
.chainbreak-broken .chainbreak-meter-fill {
  background: linear-gradient(90deg, #46ff8c, #46ff8c);
  box-shadow: 0 0 14px rgba(70, 255, 140, 0.9);
}

@keyframes chainbreak-breathe {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 1; text-shadow: 1px 0 0 rgba(255, 80, 110, 0.6), -1px 0 0 rgba(80, 190, 255, 0.6), 0 0 10px #ffd7f2, 0 0 28px #ff5bd6, 0 0 60px #ff2bd6; }
}

/* the click-synced vibration */
.chainbreak-board.chainbreak-jolt {
  animation: chainbreak-jolt 0.12s linear;
}
@keyframes chainbreak-jolt {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2px, 1px); }
  50% { transform: translate(2px, -1px); }
  75% { transform: translate(-1px, -1px); }
  100% { transform: translate(0, 0); }
}

@media (max-width: 768px) {
  .chainbreak-board {
    height: auto;
    padding: 0;
    margin-bottom: 40px;
  }
  .chainbreak-canvas {
    position: relative;
    inset: auto;
    aspect-ratio: 4 / 3;
    height: auto;
  }
  .chainbreak-meter {
    bottom: 64px;
    width: min(200px, 56%);
  }
  .chainbreak-cta {
    bottom: 12px;
    font-size: clamp(0.52rem, 3.2vw, 0.9rem);
  }
}

@media (max-width: 480px) {
  .chainbreak-board {
    border-width: 4px;
    border-radius: 34px;
  }
  .chainbreak-cta {
    letter-spacing: 0.02em;
  }
  .chainbreak-meter-label {
    font-size: 0.42rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chainbreak-cta {
    animation: none;
  }
}

/* the cured-curse banner (2026-10-20) — only when the break lifted an Omikuji
   curse AND that turned the verdict into a Yes */
.chainbreak-cure {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 124px;   /* above the meter + CTA so the cure never covers the victory */
  width: min(420px, 84%);
  z-index: 6;
  pointer-events: none;
  text-align: center;
  font-family: 'Press Start 2P', 'Pirata One', monospace;
  color: #ffe9a8;
  text-shadow: 0 0 10px rgba(255, 233, 168, 0.9), 0 0 24px rgba(255, 140, 60, 0.6);
  animation: chainbreakCureGlow 2.4s ease-in-out infinite;
}
.chainbreak-cure strong { display: block; font-size: 0.62rem; letter-spacing: 0.12em; }
.chainbreak-cure span {
  display: block;
  margin-top: 6px;
  font-family: 'Quintessential', 'Pirata One', serif;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: rgba(255, 244, 214, 0.92);
  text-shadow: 0 0 8px rgba(255, 200, 120, 0.5);
}
@keyframes chainbreakCureGlow {
  0%, 100% { opacity: 0.82; }
  50% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .chainbreak-cure { animation: none; opacity: 1; }
}
.chainbreak-meter-low .chainbreak-meter-track {
  border-color: rgba(255, 59, 31, 0.85);
  box-shadow: 0 0 12px rgba(255, 59, 31, 0.55);
}
.chainbreak-meter-low .chainbreak-meter-label { color: #ff6b4a; }
