/* ============================================================
   RANDOM BIBLE STUDY — stylesheet
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; width: 100%; overflow: hidden; }

body {
  font-family: "Helvetica Neue", Arial, sans-serif;
  background: #ffffff;
  color: #222;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.is-invisible { visibility: hidden !important; }

/* ============================================================
   Root container — everything is absolute inside here
   ============================================================ */

#app {
  position: relative;
  width: 100%; height: 100%;
  overflow: hidden;
}

/* ============================================================
   WHEEL — dead center of the page
   ============================================================ */

.col-wheel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  /* no width constraint — let content size it */
}

.title {
  /* Same font + size whether it's rave mode or not —
     only color + per-letter effects change in rave mode. */
  font-family: "Bungee Inline", "Bungee", "Helvetica Neue", Arial, sans-serif;
  font-size: 2.2rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: #fff;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  /* White fill with black outline. -webkit-text-stroke handles Chromium/WebKit;
     the layered text-shadow gives a matching outline as a fallback. */
  -webkit-text-stroke: 2px #000;
  text-shadow:
    -2px -2px 0 #000,
     2px -2px 0 #000,
    -2px  2px 0 #000,
     2px  2px 0 #000,
    -2px  0   0 #000,
     2px  0   0 #000,
     0   -2px 0 #000,
     0    2px 0 #000;
}

.wheel-stage {
  position: relative;
  width: min(70vmin, 540px);
  height: min(70vmin, 540px);
}

.wheel {
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 3px solid #ccc;
  position: relative;
  box-shadow: 0 4px 28px rgba(0,0,0,0.13);
}

.wheel::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #333;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.wheel-pointer {
  position: absolute;
  top: -8px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 20px solid #222;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2));
}


.wheel-divider {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 50%;
  background: rgba(0,0,0,0.3);
  transform-origin: bottom center;
  pointer-events: none;
}

.wheel-label {
  position: absolute;
  font-size: 0.55rem;
  font-weight: 600;
  color: rgba(0,0,0,0.75);
  white-space: nowrap;
  pointer-events: none;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}

.wheel-label.chapter-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(0,0,0,0.8);
}

.spin-button {
  position: relative;
  z-index: 50;
  appearance: none;
  padding: 6px 44px;
  font-size: 1.6rem;
  line-height: 1.1;
  font-family: "Bungee", "Bungee Inline", "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  -webkit-text-stroke: 2px #000;
  text-shadow:
    -2px -2px 0 #000,
     2px -2px 0 #000,
    -2px  2px 0 #000,
     2px  2px 0 #000,
    -2px  0   0 #000,
     2px  0   0 #000,
     0   -2px 0 #000,
     0    2px 0 #000;
  background: #fff;
  border: 3px solid #000;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none;
  transition: background 0.05s ease-out, transform 0.05s ease-out;
  animation: none;
}

.spin-button:hover {
  background: #f3f3f3;
  transform: translateY(-1px);
}
.spin-button:active {
  transform: translateY(4px);
  background: #e4e4e4;
  box-shadow: none;
  transition: background 0.02s ease-in, transform 0.02s ease-in;
}
.spin-button:disabled { opacity: 0.45; cursor: not-allowed; animation: none; }

/* ============================================================
   STUDY ROW — three horizontal boxes above the wheel.
   Replaces the title after the first spin is hit.
   ============================================================ */

.study-row {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: stretch;
  justify-content: center;
}

.study-row .study-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  min-width: 150px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  transition: background 0.25s, border-color 0.25s;
}

/* Slot colors are painted inline by script.js at startup (and on reset),
   so the boxes are already rave-colored before they become visible.
   Text is white from the start to pop against any saturated background. */
.study-row .study-slot {
  color: #fff;
}
.study-row .study-slot .study-book {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

.study-info { flex: 1 1 auto; min-width: 0; }

.study-book {
  font-size: 0.9rem;
  font-weight: 600;
  color: #222;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.study-chapter {
  font-size: 0.72rem;
  color: #777;
  margin-top: 2px;
}

/* Rave-mode styling — empty boxes stay dark; filled ones keep their painted rave hue. */
body.rave-active .study-row .study-slot {
  background: rgba(0,0,0,0.55);
  border-color: rgba(255,255,255,0.2);
  color: #fff;
  box-shadow: 0 2px 14px rgba(0,0,0,0.4);
}
body.rave-active .study-row .study-book    { color: #fff; }
body.rave-active .study-row .study-chapter { color: rgba(255,255,255,0.7); }

/* ============================================================
   DOCKET — pinned to right edge, full height
   ============================================================ */

.col-docket {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 220px;
  border-left: 1px solid #ddd;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  overflow: visible; /* allows pointer to hang off left edge; docket-window clips the list */
  z-index: 5;
}

.docket-label {
  padding: 10px 14px 8px;
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #888;
  border-bottom: 1px solid #e8e8e8;
  flex-shrink: 0;
}

.docket-outer {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  overflow: visible; /* pointer hangs off left edge — docket-window does the clipping */
  min-height: 0;
}

.docket-pointer {
  position: absolute;
  left: -8px; /* tip overhangs ~8px into the column */
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  pointer-events: none;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 16px solid #222;
  filter: drop-shadow(2px 0px 2px rgba(0,0,0,0.2));
}

.docket-outer::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 26px;
  border-top: 1px solid rgba(0,0,0,0.12);
  border-bottom: 1px solid rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.3);
  pointer-events: none;
  z-index: 2;
}

.docket-window {
  flex: 1 1 auto;
  overflow: hidden;
  position: relative;
  clip-path: inset(0); /* hard clip so list rows don't bleed past the window */
  mask-image: linear-gradient(to bottom, transparent 0%, black 12%, black 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 12%, black 88%, transparent 100%);
}

.docket-track {
  list-style: none;
  position: absolute;
  width: 100%;
  top: 0;
  will-change: transform;
}

.docket-track li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px 0 22px;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(0,0,0,0.75);
  height: 26px;
  border-bottom: 1px solid rgba(0,0,0,0.25);
}

.docket-chapters {
  font-size: 0.62rem;
  font-weight: 400;
  color: rgba(0,0,0,0.45);
  margin-left: 6px;
  flex-shrink: 0;
}

/* ============================================================
   Music dock — top-left. "Now Playing" row, then upcoming tracks
   fade into nothing. The last one is cropped to top-halves only —
   it's almost a rumor.
   ============================================================ */

.music-dock {
  position: absolute;
  top: 24px;
  left: 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 5;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  font-family: "Space Mono", ui-monospace, "Courier New", monospace;
}

.now-playing-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

/* Song title + upcoming tracks stack below the "Now Playing:" label. */
.now-playing-column {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.now-playing-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #888;
  flex-shrink: 0;
}

.now-playing-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #222;
  /* Reserve the row's height even when empty so upcoming tracks don't
     collapse up next to the "Now Playing:" label. Keeps the reel layout
     intact pre-rave. */
  display: block;
  min-height: 1.15em;
  line-height: 1;
}

.upcoming {
  font-size: 0.82rem;
  font-weight: 500;
  color: #222;
  line-height: 1.15;
}
.upcoming-1 { opacity: 0.45; }
.upcoming-2 { opacity: 0.22; }
/* Barely there — the last on-deck track is a whisper, full-height but
   almost transparent. A near-subliminal hint rather than a clipped tease. */
.upcoming-3 { opacity: 0.08; }
.upcoming-3 > span { display: inline-block; }

body.rave-active .now-playing-label { color: rgba(255,255,255,0.75); }
body.rave-active .now-playing-title,
body.rave-active .upcoming           { color: #fff; }

/* ============================================================
   Rave / chaos (stubbed)
   ============================================================ */

/* rave-off keeps the element in the compositor but invisible, so the first
   Spin doesn't pay the cost of layout + paint for 85 beams all at once. */
.rave-off { opacity: 0 !important; pointer-events: none !important; }
.rave-bg    { position: fixed; inset: 0; z-index: 2;  pointer-events: none; background: #000; }
.spotlights {
  position: fixed; inset: 0;
  z-index: 12;
  pointer-events: none;
  overflow: hidden;
  /* Blend the whole spotlight layer with what's below once, instead of
     blending every single beam — much cheaper to composite. */
  mix-blend-mode: screen;
  /* Beams all transform-only → keep this layer on the GPU compositor. */
  will-change: transform;
  /* Beams will use beam-specific width changes; let them animate smoothly. */
  transition: none;
}
.center-cycler {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 20px #fff, 0 0 40px #fff;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.confetti-canvas { position: fixed; inset: 0; z-index: 20; pointer-events: none; }

.takeover {
  position: fixed; inset: 0; z-index: 30;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: transparent;
  color: #fff;
  font-size: clamp(3rem, 14vw, 10rem);
  font-weight: 900; letter-spacing: 0.02em; text-align: center;
  text-shadow:
    0 0 20px #fff, 0 0 50px #fff, 0 0 100px rgba(255,255,255,0.4),
    -2px -2px 6px #000, 2px -2px 6px #000, -2px 2px 6px #000, 2px 2px 6px #000;
  pointer-events: none;
  line-height: 1.1;
}

.takeover-subtitle {
  font-size: clamp(3rem, 14vw, 10rem);
  font-weight: 900;
  letter-spacing: 0.02em;
}

body.rave-active .wheel        { border-color: #000; }
body.rave-active .col-docket  { border-left-color: #000; background: #000; }

/* Rave title — each letter is wrapped in a <span class="rave-letter">
   by script.js when the party starts. Keeps the font + size from .title;
   only adds per-letter color, black outline, and a colored glow. */
body.rave-active .title {
  color: #fff; /* fallback; per-letter spans override */
}

/* Rave-mode button — transparent fill, solid rave-colored border,
   glowing white text. Color is set inline via --rave-color by script.js. */
body.rave-active .spin-button {
  background: transparent;
  border: 3px solid var(--rave-color, #fff);
  box-shadow: none;
  animation: none;
}
body.rave-active .spin-button:hover {
  background: var(--rave-fill, rgba(255,255,255,0.15));
  box-shadow: none;
  transform: translateY(-1px);
}
body.rave-active .spin-button:active {
  background: var(--rave-fill, rgba(255,255,255,0.15));
  transform: translateY(4px);
  box-shadow: none;
}

body.rave-active .spin-button .rave-letter {
  display: inline-block;
  color: var(--letter-color, #fff);
  -webkit-text-stroke: 2px #000;
  /* No glow on the button letters — just the crisp black outline.
     The title still glows; the button stays grounded. */
  text-shadow:
    -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000,
    -2px  0   0 #000, 2px  0   0 #000,  0  -2px 0 #000, 0  2px 0 #000;
}

body.rave-active .title .rave-letter {
  display: inline-block;
  color: var(--letter-color, #fff);
  text-shadow:
    -2px -2px 0 #000,
     2px -2px 0 #000,
    -2px  2px 0 #000,
     2px  2px 0 #000,
    -2px  0   0 #000,
     2px  0   0 #000,
     0   -2px 0 #000,
     0    2px 0 #000,
     0 0 10px var(--glow, #fff),
     0 0 18px var(--glow, #fff);
  -webkit-text-stroke: 1px #000;
}

/* ============================================================
   Dev theme picker — bottom-right floating panel
   ============================================================ */
.theme-picker {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 60;
  background: rgba(0,0,0,0.75);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.theme-picker-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.7);
  padding: 2px 4px 4px;
}
.theme-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  color: #fff;
  font-size: 0.72rem;
}
.theme-row:hover { border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.08); }
.theme-swatch {
  width: 12px; height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.3);
}
.theme-name {
  margin-left: 4px;
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) { /* TODO */ }

