/* THE BLOCK - Complete Styles */

:root {
  --bg-base: #080808;
  --bg-deep: #020202;
  --bg-elevated: #0f0f0f;
  --bg-table: #111111;
  --border-subtle: #1a1a1a;
  --border-hover: #333333;
  --text-primary: #e0e0e0;
  --text-secondary: #808080;
  --text-tertiary: #404040;
  --text-accent: #ffffff;
  --text-highlight: #f0f0f0;
  --font-mono: 'IBM Plex Mono', monospace;
  --max-width: 620px;
  --transition-speed: 0.35s;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  height: 100%;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

/* Mobile browsers: track the real visible viewport (URL bar collapse) */
@supports (height: 100dvh) {
  html, body {
    height: 100dvh;
  }
}

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 17px;
  line-height: 1.75;
  font-weight: 400;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background 0.8s var(--ease-out-expo), color 0.5s var(--ease-out-quart);
}

/* CRT Scan Lines Effect */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.015) 0px,
    rgba(0, 0, 0, 0.015) 1px,
    transparent 1px,
    transparent 2px
  );
}

/* Subtle vignette */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
  background: radial-gradient(ellipse at center, transparent 0%, transparent 60%, rgba(0,0,0,0.4) 100%);
}

/* Cursor Trail */
.cursor-trail {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--text-tertiary);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cursor-trail.visible {
  opacity: 0.3;
}

/* Swipe hint for mobile */
#swipe-hint {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--text-tertiary);
  letter-spacing: 0.1em;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 100;
}

#swipe-hint.visible {
  opacity: 1;
}

#swipe-hint .arrow {
  display: block;
  text-align: center;
  animation: swipeArrow 1.5s ease-in-out infinite;
}

@keyframes swipeArrow {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-5px); opacity: 1; }
}

/* Layer Counter */
#layer-counter {
  position: fixed;
  top: 28px;
  left: 28px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.5s var(--ease-out-quart), color 0.3s ease;
}

#layer-counter.visible {
  opacity: 1;
}

#layer-counter:hover {
  color: var(--text-secondary);
}

/* Presence Counter */
#presence {
  position: fixed;
  top: 28px;
  right: 28px;
  font-size: 10px;
  color: var(--text-tertiary);
  text-align: right;
  z-index: 100;
  opacity: 0;
  letter-spacing: 0.05em;
  transition: opacity 0.5s var(--ease-out-quart);
}

#presence.visible {
  opacity: 0.8;
}

/* Depth Progress Line */
#depth-line {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 0%;
  background: linear-gradient(to bottom,
    transparent 0%,
    var(--text-tertiary) 10%,
    var(--text-secondary) 50%,
    var(--text-tertiary) 90%,
    transparent 100%
  );
  z-index: 100;
  transition: height 0.8s var(--ease-out-expo);
  opacity: 0;
}

#depth-line.visible {
  opacity: 1;
}

/* Keyboard Hint */
#keyboard-hint {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--text-tertiary);
  letter-spacing: 0.1em;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 100;
}

#keyboard-hint.visible {
  opacity: 1;
}

/* Sound Toggle */
#sound-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--text-tertiary);
  border-radius: 50%;
  color: var(--text-tertiary);
  font-size: 14px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

#sound-toggle:hover {
  opacity: 1;
}

#sound-toggle:hover {
  border-color: var(--text-secondary);
  color: var(--text-secondary);
}

#sound-toggle.active {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

#sound-toggle.active::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  background: var(--text-primary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

/* Dots Container for Layer 31 - each dot is a death */
#dots-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 2s ease;
}

#dots-container.visible {
  opacity: 1;
}

#dots-container.fading {
  opacity: 0;
  transition: opacity 3s ease;
}

.dot {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--text-secondary);
  border-radius: 50%;
  opacity: 0;
  animation: dotFadeIn 1s ease forwards;
}

@keyframes dotFadeIn {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.2);
  }
  100% {
    opacity: 0.4;
    transform: scale(1);
  }
}

/* Container */
#container {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 10;
}

/* Layers */
.layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  padding-top: 80px;
  padding-bottom: 10vh;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease;
  transform: translateY(20px);
  overflow-y: auto;
}

.layer.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.layer.exit {
  opacity: 0;
  transform: translateY(-20px);
}

/* Content */
.content {
  max-width: var(--max-width);
  width: 100%;
  text-align: left;
}

.content p {
  margin-bottom: 1.5em;
  opacity: 0;
  transform: translateY(10px);
}

.layer.active .content p {
  opacity: 1;
  transform: translateY(0);
}

/* Big text (for equations) */
.big {
  font-size: 32px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--text-accent);
  margin-bottom: 1.2em !important;
  text-shadow: 0 0 40px rgba(255,255,255,0.1);
}

/* Stat text - fades in after 2 seconds */
.stat {
  color: var(--text-tertiary);
  font-size: 11px;
  letter-spacing: 0.04em;
  border-left: 1px solid var(--border-subtle);
  padding-left: 1.2em;
  margin-top: 3em !important;
  margin-bottom: 2em !important;
  opacity: 0;
  animation: statFadeIn 1.5s var(--ease-out-quart) 2s forwards;
}

@keyframes statFadeIn {
  to {
    opacity: 1;
  }
}

/* Meta text */
.meta {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Emphasis - subtle, not italic */
em {
  font-style: normal;
  color: var(--text-accent);
}

/* Tooltips for acronyms */
.tip {
  position: relative;
  border-bottom: 1px dotted var(--text-tertiary);
  cursor: help;
  color: var(--text-highlight);
  transition: border-color 0.2s ease;
}

.tip:hover {
  border-color: var(--text-secondary);
}

.tip::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--border-subtle);
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 101;
}

.tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.6em 1em;
  background: var(--bg-table);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  z-index: 100;
  border-radius: 2px;
}

.tip:hover::before,
.tip:hover::after,
.tip.tip-open::before,
.tip.tip-open::after {
  opacity: 1;
  visibility: visible;
}

/* Tooltips in inverted Layer 15 */
.layer-invert .tip {
  border-bottom-color: var(--text-secondary);
}

.layer-invert .tip::after {
  background: var(--text-primary);
  border-color: var(--text-secondary);
  color: var(--bg-base);
}

.layer-invert.faded-back .tip {
  border-bottom-color: var(--text-tertiary);
}

.layer-invert.faded-back .tip::after {
  background: var(--bg-table);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

/* Mobile: tap to show */
@media (max-width: 600px) {
  .tip::after {
    font-size: 10px;
    max-width: 200px;
    white-space: normal;
    text-align: center;
  }
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  font-size: 14px;
}

th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1em 1.25em;
  background: var(--bg-table);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
}

td {
  padding: 0.9em 1.25em;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

tr:hover td {
  color: var(--text-primary);
}

tr:last-child td {
  border-bottom: none;
}

/* Continue button */
.continue-wrap {
  margin-top: 4em;
  margin-bottom: 6em; /* Breathing room below */
  opacity: 0;
}

.layer.active .continue-wrap {
  opacity: 1;
}

.alt-path {
  margin-top: 2em;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.layer.active .content p.alt-path {
  opacity: 0.5;
}

.layer.active .content p.alt-path:hover {
  opacity: 1;
}

.alt-path .choice.small {
  color: var(--text-tertiary);
  font-size: 11px;
}

.continue {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.03em;
  cursor: default;
  padding: 0.5em 0;
  border-bottom: 1px solid var(--border-subtle);
  transition: all 0.25s var(--ease-out-quart);
  position: relative;
}

.continue:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
  cursor: pointer;
  letter-spacing: 0.05em;
}

.continue::before {
  content: '[';
  margin-right: 4px;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.continue::after {
  content: ']';
  margin-left: 4px;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.continue:hover::before,
.continue:hover::after {
  opacity: 1;
}

/* Choices */
.choices {
  margin-top: 2.5em;
  margin-bottom: 6em; /* Breathing room */
  display: flex;
  flex-direction: column;
  gap: 1em;
  opacity: 0;
}

.layer.active .choices {
  opacity: 1;
}

.choices.branch {
  margin-top: 3em;
}

.choice {
  background: rgba(255,255,255,0.01);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.02em;
  padding: 1em 1.75em;
  text-align: left;
  cursor: default;
  transition: all 0.25s var(--ease-out-quart);
  position: relative;
  overflow: hidden;
}

.choice::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
  transition: left 0.5s var(--ease-out-expo);
}

.choice:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  transform: translateX(4px);
}

.choice:hover::before {
  left: 100%;
}

.choice.exit {
  border-color: var(--border-subtle);
  color: var(--text-tertiary);
  background: transparent;
}

.choice.exit:hover {
  color: var(--text-secondary);
  border-color: var(--text-tertiary);
  transform: none;
}

.choice.exit:hover {
  color: var(--text-secondary);
  border-color: var(--text-secondary);
}

.choice.small {
  padding: 0.6em 1.5em;
  font-size: 14px;
}

.choice.secondary {
  border-color: var(--text-tertiary);
  color: var(--text-tertiary);
}

.choice.secondary:hover {
  border-color: var(--text-secondary);
  color: var(--text-secondary);
}

/* Layer 15: Inversion - the flash where you're seen */
.layer-invert {
  align-items: flex-start;
  padding-top: 100px;
  padding-bottom: 100px;
}

.layer-invert .content {
  max-width: 520px;
}

.layer-invert.active {
  background: var(--text-primary);
  color: var(--bg-base);
  transition: background 0.3s ease, color 0.3s ease;
}

.layer-invert.active.faded-back {
  background: var(--bg-base);
  color: var(--text-primary);
  transition: background 2s ease, color 2s ease;
}

.layer-invert.active .stat {
  color: var(--text-secondary);
  border-left-color: var(--text-tertiary);
}

.layer-invert.active.faded-back .stat {
  color: var(--text-secondary);
  border-left-color: var(--border-subtle);
}

.layer-invert.active .continue {
  color: var(--text-secondary);
  border-color: var(--text-secondary);
}

.layer-invert.active .continue:hover {
  color: var(--bg-base);
  border-color: var(--bg-base);
}

.layer-invert.active.faded-back .continue {
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

.layer-invert.active.faded-back .continue:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
}

/* User data spans in Layer 15 */
.layer-invert #user-browser,
.layer-invert #user-location,
.layer-invert #user-time {
  color: var(--bg-base);
  font-weight: 500;
}

.layer-invert.faded-back #user-browser,
.layer-invert.faded-back #user-location,
.layer-invert.faded-back #user-time {
  color: var(--text-primary);
}

/* Layer 0: Entry - centered, longer pause */
.layer-entry {
  padding-bottom: 0; /* True center for entry */
}

.layer-entry .content {
  text-align: center;
  max-width: 500px;
}

.layer-entry .content p {
  animation-delay: 2s; /* Longer initial pause */
}

.layer-entry .choices {
  justify-content: center;
  align-items: center;
  margin-top: 3em;
}

/* Layer 28: Note */
.note-display {
  font-style: italic;
  color: var(--text-primary);
  font-size: 16px;
  padding: 1.5em;
  background: var(--bg-table);
  border-left: 2px solid var(--border-subtle);
  margin: 1.5em 0;
}

.note-meta {
  color: var(--text-tertiary);
  font-size: 11px;
  letter-spacing: 0.05em;
  margin-bottom: 2.5em !important;
}

.note-input-wrap {
  margin-top: 2.5em;
}

#note-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 15px;
  padding: 1em 0;
  margin-bottom: 2em;
}

#note-input:focus {
  outline: none;
  border-color: var(--text-secondary);
}

#note-input::placeholder {
  color: var(--text-tertiary);
}

.note-actions {
  display: flex;
  gap: 1.5em;
  flex-wrap: wrap;
}

/* Layer 31: Dots */
.layer-dots .content {
  position: relative;
  z-index: 10;
  max-width: 500px;
}

.layer-dots #dot-count {
  font-size: 12px;
  color: var(--text-secondary);
}

.layer-dots #dot-since {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-bottom: 3em !important;
}

.final-line {
  font-weight: 500;
  font-size: 1.1em;
  margin-top: 2.5em !important;
  letter-spacing: 0.02em;
}

/* LHC Ring ASCII */
.lhc-ring {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.2;
  color: var(--text-tertiary);
  display: inline-block;
  white-space: pre;
  margin: 1em 0 1.5em;
  opacity: 0;
  animation: ringFadeIn 3s ease 0.5s forwards;
}

@keyframes ringFadeIn {
  0% { opacity: 0; transform: scale(0.95); }
  50% { opacity: 0.6; }
  100% { opacity: 1; transform: scale(1); }
}

/* Human moment layers - subtle emphasis */
[data-layer="11M-B"] .content,
[data-layer="27B"] .content,
[data-layer="28C"] .content,
[data-layer="30B"] .content {
  max-width: 480px;
}

[data-layer="11M-B"] em,
[data-layer="27B"] em,
[data-layer="28C"] em,
[data-layer="30B"] em {
  display: block;
  padding-left: 1.5em;
  border-left: 1px solid var(--text-tertiary);
  margin: 1em 0;
  color: var(--text-secondary);
}

/* Layer 35: Silence - near total black with subtle pulse */
.layer-silence {
  background: #010101 !important;
}

/* Silence mode - all UI fades */
body.silence-mode #layer-counter,
body.silence-mode #presence,
body.silence-mode #depth-line,
body.silence-mode #keyboard-hint {
  opacity: 0 !important;
  transition: opacity 2s ease;
}

.layer-silence.active::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  background: var(--text-tertiary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: silencePulse 4s ease-in-out infinite;
}

@keyframes silencePulse {
  0%, 100% { opacity: 0; }
  50% { opacity: 0.3; }
}

.layer-silence .content {
  text-align: center;
  max-width: 400px;
}

.layer-silence p {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  opacity: 0;
  transition: opacity 1s ease;
}

.layer-silence p.visible {
  opacity: 1;
}

/* Hide pulse once text appears */
.layer-silence.has-text::before {
  animation: none;
  opacity: 0;
}

/* Layer 36: Final Question - the deepest */
.layer-final {
  background: #020202 !important;
}

.layer-final .content {
  text-align: center;
  max-width: 500px;
}

#final-question {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.5;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}

.response-wrap {
  margin-top: 4em;
  opacity: 0;
  transition: opacity 2s ease;
}

.response-wrap.visible {
  opacity: 1;
}

#response-input {
  width: 100%;
  max-width: 400px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 16px;
  padding: 1em 0;
  text-align: center;
  margin-bottom: 2em;
}

#response-input:focus {
  outline: none;
  border-color: var(--text-primary);
}

#response-input::placeholder {
  color: var(--text-tertiary);
}

.response-note {
  font-size: 10px;
  color: var(--text-tertiary);
  letter-spacing: 0.05em;
  margin-bottom: 2.5em !important;
}

/* Layer 37: Aftermath */
.layer[data-layer="37"] {
  background: var(--bg-base);
}

.layer[data-layer="37"] .content {
  max-width: 500px;
}

#completion-time {
  font-size: 12px;
  color: var(--text-secondary);
}

#witness-number {
  font-weight: 500;
}

/* Layer 11P: Hologram Collapse Effect */
.layer-hologram {
  position: relative;
  overflow: hidden;
}

/* Content flattens toward 2D for a beat, then returns — always ends at identity (no stuck black screen) */
.layer-hologram.active .content {
  animation: flatten3d 2s ease 2s;
}

@keyframes flatten3d {
  0%, 100% { transform: perspective(700px) rotateX(0deg) scaleY(1); }
  30% { transform: perspective(700px) rotateX(28deg) scaleY(0.82); }
  55% { transform: perspective(700px) rotateX(0deg) scaleY(1); }
}

.hologram-line {
  position: absolute;
  top: 50%;
  left: 5%;
  width: 90%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,0.4) 20%,
    rgba(255,255,255,0.6) 50%,
    rgba(255,255,255,0.4) 80%,
    transparent 100%
  );
  transform: translateY(-50%);
  opacity: 0;
  z-index: 10;
  pointer-events: none;
}

.layer-hologram.active .hologram-line {
  animation: lineFlash 2s ease 2s forwards;
}

@keyframes lineFlash {
  0% { opacity: 0; }
  15% { opacity: 1; box-shadow: 0 0 20px rgba(255,255,255,0.5), 0 0 40px rgba(255,255,255,0.3); }
  40% { opacity: 1; box-shadow: 0 0 20px rgba(255,255,255,0.5), 0 0 40px rgba(255,255,255,0.3); }
  60% { opacity: 0.3; }
  100% { opacity: 0; }
}

/* Layer 30: Block universe visualization — all slices exist, "you" sweeps through */
.blocktime-viz {
  position: relative;
  height: 56px;
  max-width: 320px;
  margin: 2em auto 3em;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: repeating-linear-gradient(90deg,
    rgba(255, 255, 255, 0.03) 0px,
    rgba(255, 255, 255, 0.03) 12px,
    rgba(255, 255, 255, 0.1) 12px,
    rgba(255, 255, 255, 0.1) 13px);
  opacity: 0;
}

.layer.active .blocktime-viz {
  animation: vizFadeIn 1.2s ease 1.8s forwards;
}

@keyframes vizFadeIn {
  to { opacity: 1; }
}

.blocktime-viz .now-slice {
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: 0;
  width: 12px;
  background: rgba(212, 165, 116, 0.5);
  box-shadow: 0 0 16px rgba(212, 165, 116, 0.55);
  animation: nowSweep 10s linear infinite;
}

@keyframes nowSweep {
  0% { left: 0; }
  100% { left: calc(100% - 12px); }
}

.blocktime-viz .bt-now {
  position: absolute;
  bottom: calc(100% + 0.5em);
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d4a574;
  white-space: nowrap;
}

.blocktime-viz .bt-label {
  position: absolute;
  top: calc(100% + 0.5em);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.blocktime-viz .bt-past { left: 0; }
.blocktime-viz .bt-future { right: 0; }

/* Layer 12P: Connections Animation */
.layer-connections {
  position: relative;
  overflow: hidden;
}

.connections-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
}

.layer-connections.active .connections-bg {
  animation: connectionsReveal 3s ease 2s forwards;
}

@keyframes connectionsReveal {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.connections-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.03) 1px, transparent 1px),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.03) 1px, transparent 1px),
    radial-gradient(circle at 40% 70%, rgba(255,255,255,0.03) 1px, transparent 1px),
    radial-gradient(circle at 90% 60%, rgba(255,255,255,0.03) 1px, transparent 1px),
    radial-gradient(circle at 10% 80%, rgba(255,255,255,0.03) 1px, transparent 1px),
    radial-gradient(circle at 60% 40%, rgba(255,255,255,0.03) 1px, transparent 1px),
    radial-gradient(circle at 30% 50%, rgba(255,255,255,0.03) 1px, transparent 1px),
    radial-gradient(circle at 70% 85%, rgba(255,255,255,0.03) 1px, transparent 1px),
    radial-gradient(circle at 50% 15%, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 100% 100%;
  animation: nodesPulse 4s ease-in-out infinite;
}

@keyframes nodesPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.connections-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, transparent 20%, rgba(255,255,255,0.01) 20.5%, transparent 21%),
    linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.008) 30.5%, transparent 31%),
    linear-gradient(160deg, transparent 40%, rgba(255,255,255,0.01) 40.5%, transparent 41%),
    linear-gradient(70deg, transparent 60%, rgba(255,255,255,0.008) 60.5%, transparent 61%),
    linear-gradient(110deg, transparent 15%, rgba(255,255,255,0.01) 15.5%, transparent 16%),
    linear-gradient(200deg, transparent 75%, rgba(255,255,255,0.008) 75.5%, transparent 76%);
  animation: linesShift 8s linear infinite;
}

@keyframes linesShift {
  0% { transform: translateX(0) translateY(0); }
  50% { transform: translateX(10px) translateY(-5px); }
  100% { transform: translateX(0) translateY(0); }
}

.layer-connections .content {
  position: relative;
  z-index: 1;
}

/* Atomic Bomb Visual (legacy) */
.bomb-visual {
  text-align: center;
  margin: 2em 0;
  opacity: 0;
  animation: bombFadeIn 3s ease 1s forwards;
}

.bomb-ascii {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.1;
  color: var(--text-tertiary);
  display: inline-block;
  text-align: center;
  white-space: pre;
}

@keyframes bombFadeIn {
  0% { opacity: 0; transform: scale(0.8); }
  50% { opacity: 0.6; }
  100% { opacity: 1; transform: scale(1); }
}

/* Book Cover Visual */
.book-visual {
  position: relative;
  text-align: center;
  margin: 0.5em 0;
  padding: 1.4em 0;
  min-height: 340px;
}

.book-visual .burst-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 500px;
  background: url('burst.png') center center no-repeat;
  background-size: contain;
  opacity: 0;
  animation: burstPulse 4s ease-in-out 0.8s infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes burstPulse {
  0%, 100% { opacity: 0.35; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.5; transform: translate(-50%, -50%) scale(1.08); }
}

.book-visual .hourglass-accent {
  display: none;
}

/* Warm spotlight behind book */
.book-visual::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 600px;
  background: radial-gradient(ellipse at center,
    rgba(255, 220, 180, 0.25) 0%,
    rgba(212, 165, 116, 0.2) 20%,
    rgba(180, 140, 100, 0.15) 35%,
    rgba(120, 90, 60, 0.1) 50%,
    rgba(60, 45, 30, 0.05) 65%,
    transparent 80%);
  pointer-events: none;
  z-index: 0;
}

.book-cover-img {
  position: relative;
  z-index: 1;
  max-width: 280px;
  width: 100%;
  height: auto;
  border: 1px solid rgba(212, 165, 116, 0.35);
  border-radius: 10px;
  background: radial-gradient(ellipse at center,
    #ffffff 0%,
    #fdf8f0 45%,
    #f3e8d5 75%,
    #e9d8bc 100%);
  box-shadow:
    0 0 50px rgba(255, 235, 205, 0.35),
    0 0 110px rgba(212, 165, 116, 0.28),
    0 0 180px rgba(255, 200, 150, 0.12),
    0 30px 70px rgba(0, 0, 0, 0.85);
  opacity: 0;
  animation: bookReveal 1.5s ease 0.5s forwards;
}

@keyframes bookReveal {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Book page layout */
.layer-book .content {
  text-align: center;
}

.layer-book .content > p {
  margin-bottom: 1.2em;
}

.book-intro {
  color: var(--text-secondary);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0 !important;
}

.book-witness {
  color: #d4a574;
  font-size: 14px;
  letter-spacing: 0.04em;
  margin-top: 1.5em !important;
  opacity: 0.9;
}

.book-percent {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 2em !important;
}

.book-percent .pct {
  color: #ffdcb4;
  font-size: 19px;
  letter-spacing: 0.05em;
  text-shadow: 0 0 20px rgba(212, 165, 116, 0.5);
}

/* The offer panel — visually groups the pitch into one focal card */
.offer-panel {
  margin: 2em auto 1em;
  padding: 1.8em 1.6em 1.6em;
  max-width: 480px;
  border: 1px solid rgba(212, 165, 116, 0.3);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(212, 165, 116, 0.07), rgba(212, 165, 116, 0.02));
  box-shadow:
    inset 0 1px 0 rgba(255, 220, 180, 0.12),
    0 0 45px rgba(212, 165, 116, 0.08),
    0 14px 40px rgba(0, 0, 0, 0.5);
}

.offer-panel .book-percent {
  margin: 0 0 1.3em !important;
}

.book-actions {
  display: flex;
  justify-content: center;
  margin: 0 0 0.9em;
}

.book-microcopy {
  color: var(--text-tertiary);
  font-size: 12px;
  letter-spacing: 0.03em;
  margin: 0 !important;
}


.hidden-cta {
  display: none !important;
}

a.book-cta {
  display: inline-block;
  text-decoration: none;
}

.book-cta {
  border-color: #e8bc8a !important;
  color: #17100a !important;
  background: linear-gradient(180deg, #f0c896, #d4a574) !important;
  border-radius: 3px;
  padding: 1.1em 2.5em !important;
  font-size: 15px !important;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
  animation: ctaGlow 3.5s ease-in-out infinite;
  transition: all 0.3s ease !important;
}

@keyframes ctaGlow {
  0%, 100% { box-shadow: 0 0 22px rgba(212, 165, 116, 0.3); }
  50% { box-shadow: 0 0 44px rgba(230, 180, 130, 0.55); }
}

.book-cta:hover {
  background: linear-gradient(180deg, #f7d4a8, #dfb182) !important;
  box-shadow: 0 0 40px rgba(230, 180, 130, 0.5);
  color: #17100a !important;
  transform: translateY(-1px);
}

/* Inline email capture */
.email-capture {
  display: none;
  margin: 0 0 2em;
}

.email-capture.visible {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 0.8em;
}

.email-capture input {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(212, 165, 116, 0.45);
  border-radius: 2px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 15px;
  padding: 0.8em 1.2em;
  width: 100%;
  max-width: 300px;
  text-align: center;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.email-capture input:focus {
  border-color: #d4a574;
  box-shadow: 0 0 16px rgba(212, 165, 116, 0.2);
  outline: none;
}

#email-submit {
  border-color: #e8bc8a !important;
  color: #17100a !important;
  background: linear-gradient(180deg, #f0c896, #d4a574) !important;
  border-radius: 3px;
  font-weight: 600;
  padding: 0.8em 1.6em !important;
  box-shadow: 0 0 22px rgba(212, 165, 116, 0.25);
}

#email-submit:hover {
  background: linear-gradient(180deg, #f7d4a8, #dfb182) !important;
  color: #17100a !important;
  box-shadow: 0 0 34px rgba(230, 180, 130, 0.45);
}

#email-submit:disabled {
  opacity: 0.6;
  cursor: default;
}

.email-capture .email-confirm {
  flex-basis: 100%;
  text-align: center;
}

.email-confirm .chapter-now {
  display: inline-block;
  margin: 1em 0 0.8em;
  text-decoration: none;
}

.email-confirm .confirm-sub {
  color: var(--text-tertiary);
  font-size: 12px;
  display: block;
}

.email-capture input::placeholder {
  color: var(--text-tertiary);
}

.email-confirm {
  display: none;
  color: #d4a574;
  font-size: 13px;
}

.email-confirm.visible {
  display: block;
}

/* Sound hint on entry */
.sound-hint-entry {
  color: var(--text-tertiary);
  font-size: 12px;
  margin-top: 3em;
  letter-spacing: 0.05em;
}

/* Gated elements (hidden until unlocked by JS) */
.gated {
  opacity: 0 !important;
  pointer-events: none;
}

/* Live witness feed (Layer 29) */
.witness-feed {
  color: var(--text-tertiary);
  font-size: 13px;
  letter-spacing: 0.02em;
}

/* Hold to descend (Layer 29B) */
.hold-btn {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.hold-btn.holding {
  color: var(--text-primary);
  border-color: var(--text-secondary);
  animation: holdDeepen 3s linear forwards;
}

@keyframes holdDeepen {
  0% { letter-spacing: 0.03em; opacity: 1; }
  100% { letter-spacing: 0.35em; opacity: 0.3; }
}

/* Typed Einstein letter (Layer 30B) */
.typed-letter {
  white-space: pre-line;
  min-height: 9em;
}

.typed-letter.typing em::after {
  content: '▌';
  color: var(--text-secondary);
  animation: cursorBlink 1s step-end infinite;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Name input (Layer 31) */
.name-wrap {
  margin: 2.5em 0;
}

.name-prompt {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 0.8em;
}

.name-wrap input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 16px;
  padding: 0.4em 0;
  width: 100%;
  max-width: 280px;
  outline: none;
  transition: border-color 0.3s ease;
}

.name-wrap input:focus {
  border-bottom-color: var(--text-secondary);
}

.name-wrap input::placeholder {
  color: var(--text-tertiary);
}

/* Tell/keep choice (Layer 32) */
.choice-question {
  margin-top: 2em;
  color: var(--text-primary);
}

.choice-result {
  display: none;
  color: var(--text-secondary);
  font-size: 15px;
  font-style: italic;
}

.choice-result.visible {
  display: block;
}

.layer-book .aftermath-actions {
  text-align: center;
  border-left: none;
  border-top: 1px solid var(--border-subtle);
  background: transparent;
  margin-top: 3em;
  padding: 1.5em 0 0;
  opacity: 0.65;
  transition: opacity 0.3s ease;
}

.layer-book .aftermath-actions:hover {
  opacity: 1;
}

.layer-book .aftermath-link {
  margin: 1em 0 !important;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.layer-book .aftermath-link:hover {
  opacity: 1;
}

.exit-link {
  margin-top: 4em !important;
}

.exit-link .continue {
  color: var(--text-tertiary);
  border-color: var(--text-tertiary);
}

.exit-link .continue:hover {
  color: var(--text-secondary);
  border-color: var(--text-secondary);
}

/* Aftermath actions (Dare, Witness URL) */
.aftermath-actions {
  margin: 2em 0;
  padding: 1.5em;
  background: var(--bg-table);
  border-left: 2px solid var(--border-subtle);
}

.aftermath-actions .action-label {
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.3em !important;
}

.aftermath-actions .action-desc {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 1em !important;
}

.aftermath-actions .choice {
  margin-top: 0;
}

.aftermath-link {
  margin: 2em 0 !important;
}

.aftermath-link a {
  color: var(--text-tertiary);
  text-decoration: none;
  font-size: 13px;
  border-bottom: 1px solid var(--text-tertiary);
  transition: color 0.3s ease, border-color 0.3s ease;
}

.aftermath-link a:hover {
  color: var(--text-secondary);
  border-color: var(--text-secondary);
}

.hidden-link {
  margin-top: 2em !important;
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

.hidden-link:hover {
  opacity: 1;
}

.hidden-link .continue {
  color: var(--text-tertiary);
  border-color: transparent;
  font-size: 12px;
}

.hidden-link .continue:hover {
  color: var(--text-secondary);
  border-color: var(--text-tertiary);
}

/* Layer 37B: Hidden Research */
.layer-hidden {
  background: #030303 !important;
}

.layer-hidden .content {
  max-width: 550px;
}

.research-section {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 2em !important;
  margin-bottom: 0.5em !important;
}

.research-links {
  list-style: none;
  padding: 0;
  margin: 0 0 1em 0;
}

.research-links li {
  margin: 0.5em 0;
}

.research-links a {
  color: var(--text-tertiary);
  text-decoration: none;
  font-size: 13px;
  border-bottom: 1px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.research-links a:hover {
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}

.block-explanation {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.6;
  margin-bottom: 1em !important;
}

.final-note {
  margin-top: 2em !important;
  font-style: italic;
  color: var(--text-secondary);
}

/* Easter Eggs */
.witching-hour {
  /* Subtle red tint at 3:15 AM */
}

.witching-hour .layer.active {
  background: linear-gradient(to bottom, var(--bg-base), #0a0505);
}

.first-beam-day #layer-counter::after {
  content: ' • SEPT 10';
  color: var(--text-tertiary);
}

.failure-day #layer-counter::after {
  content: ' • SEPT 19';
  color: #4a2020;
}

/* Staggered reveal - base */
.layer.active .content p {
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Dynamic delays set by JS based on depth */

/* Mobile */
@media (max-width: 600px) {
  body {
    font-size: 16px;
    line-height: 1.6;
  }

  .layer {
    padding: 16px;
    padding-left: calc(16px + env(safe-area-inset-left));
    padding-right: calc(16px + env(safe-area-inset-right));
    padding-top: calc(64px + env(safe-area-inset-top));
    padding-bottom: calc(8vh + env(safe-area-inset-bottom));
  }

  #layer-counter {
    top: calc(16px + env(safe-area-inset-top));
    left: calc(16px + env(safe-area-inset-left));
    font-size: 10px;
  }

  #presence {
    top: calc(16px + env(safe-area-inset-top));
    right: calc(16px + env(safe-area-inset-right));
    font-size: 9px;
  }

  .content {
    max-width: 100%;
  }

  .big {
    font-size: 22px;
  }

  table {
    font-size: 12px;
  }

  th, td {
    padding: 0.5em;
  }

  .stat {
    font-size: 11px;
  }

  .continue-wrap {
    margin-top: 3em;
    margin-bottom: 4em;
  }

  .choices {
    margin-top: 2em;
    margin-bottom: 4em;
  }

  .choice {
    padding: 0.8em 1.2em;
    font-size: 14px;
  }

  #final-question {
    font-size: 20px;
    min-height: 150px;
  }

  .layer-silence p {
    font-size: 10px;
  }

  .note-actions {
    flex-direction: column;
  }

  .note-display {
    padding: 1em;
    font-size: 14px;
  }

  .book-title {
    font-size: 18px;
  }

  .book-subtitle {
    font-size: 12px;
  }

  .book-visual {
    margin: 2em 0;
    padding: 1.5em 0;
  }

  .book-visual .burst-bg {
    width: 300px;
    height: 300px;
  }

  .book-visual .hourglass-accent {
    width: 150px;
    height: 150px;
  }

  .book-visual::before {
    width: 320px;
    height: 400px;
  }

  .book-tagline {
    font-size: 13px;
  }

  #keyboard-hint {
    display: none; /* no keyboard on touch devices */
  }

  #sound-toggle {
    bottom: calc(16px + env(safe-area-inset-bottom));
    right: calc(16px + env(safe-area-inset-right));
    width: 36px;
    height: 36px;
  }

  #swipe-hint {
    bottom: calc(60px + env(safe-area-inset-bottom));
  }

  /* Comfortable touch targets */
  .continue {
    min-height: 44px;
    padding: 0.7em 0.5em;
  }

  .choice {
    min-height: 44px;
  }

  /* Typed letter wraps to more lines on narrow screens */
  .typed-letter {
    min-height: 14em;
  }

  .name-wrap input {
    max-width: 100%;
  }

  .book-cover-img {
    max-width: min(220px, 70vw);
  }

  .offer-panel {
    padding: 1.4em 1em 1.2em;
    margin: 1.5em auto 1em;
  }

  .offer-panel .email-capture input {
    max-width: 100%;
  }

  #depth-line {
    width: 1px;
  }

  .aftermath-actions {
    padding: 1em;
    margin: 1.5em 0;
  }

  .aftermath-actions .action-label {
    font-size: 11px;
  }

  .aftermath-actions .action-desc {
    font-size: 12px;
  }
}

/* Prevent text selection on buttons */
button {
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

/* Clean taps on touch devices */
a, button, .tip {
  -webkit-tap-highlight-color: transparent;
}

/* Hold button: don't let the browser interpret the hold as scroll/long-press */
.hold-btn {
  touch-action: none;
}

/* Cursor - default until hover, subtle */
a, button {
  cursor: default;
}

a:hover, button:hover {
  cursor: pointer;
}

/* Focus states for accessibility */
button:focus, input:focus {
  outline: 1px solid var(--text-secondary);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
input:focus:not(:focus-visible) {
  outline: none;
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-tertiary);
  border-radius: 2px;
}

/* Text size variations by depth (applied via JS) */
/* Text shrinks as you descend - the weight accumulates */
.depth-1-6 { font-size: 18px; line-height: 1.7; }
.depth-7-12 { font-size: 17px; line-height: 1.7; }
.depth-13-18 { font-size: 16px; line-height: 1.65; }
.depth-19-24 { font-size: 15px; line-height: 1.65; }
.depth-25-30 { font-size: 14px; line-height: 1.6; }
.depth-31-35 { font-size: 13px; line-height: 1.6; }
.depth-36 { font-size: 12px; line-height: 1.55; }

@media (max-width: 600px) {
  .depth-1-6 { font-size: 16px; line-height: 1.6; }
  .depth-7-12 { font-size: 15px; line-height: 1.6; }
  .depth-13-18 { font-size: 14px; line-height: 1.55; }
  .depth-19-24 { font-size: 14px; line-height: 1.55; }
  .depth-25-30 { font-size: 13px; line-height: 1.5; }
  .depth-31-35 { font-size: 12px; line-height: 1.5; }
  .depth-36 { font-size: 11px; line-height: 1.45; }
}

/* Transition speed also slows by depth - handled in JS */

/* Print stylesheet */
@media print {
  body {
    background: white;
    color: black;
    font-size: 12pt;
  }

  #layer-counter,
  #presence,
  #dots-container,
  .continue-wrap,
  .choices,
  .note-input-wrap,
  .response-wrap,
  .book-actions,
  .exit-link {
    display: none;
  }

  .layer {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    page-break-after: always;
    padding: 1in;
  }

  .layer-invert {
    background: white;
    color: black;
  }

  table {
    border: 1px solid #ccc;
  }

  th {
    background: #f0f0f0;
    border-bottom: 1px solid #ccc;
  }

  td {
    border-bottom: 1px solid #eee;
  }
}

/* ============================================
   GLITCH & BLINK EFFECTS
   ============================================ */

/* Screen flicker effect */
@keyframes screenFlicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.8; }
  94% { opacity: 1; }
  96% { opacity: 0.9; }
  97% { opacity: 1; }
}

.flicker {
  animation: screenFlicker 4s infinite;
}

/* Glitch text effect */
@keyframes glitchText {
  0%, 100% {
    transform: translate(0);
    text-shadow: none;
  }
  20% {
    transform: translate(-2px, 1px);
    text-shadow: 2px 0 #ff0000, -2px 0 #00ffff;
  }
  40% {
    transform: translate(2px, -1px);
    text-shadow: -2px 0 #ff0000, 2px 0 #00ffff;
  }
  60% {
    transform: translate(-1px, 2px);
    text-shadow: 1px 0 #ff0000, -1px 0 #00ffff;
  }
  80% {
    transform: translate(1px, -2px);
    text-shadow: -1px 0 #ff0000, 1px 0 #00ffff;
  }
}

.glitch {
  animation: glitchText 0.3s ease-in-out;
}

.glitch-loop {
  animation: glitchText 2s infinite;
}

/* Blink effect */
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.blink {
  animation: blink 1s step-end infinite;
}

.blink-slow {
  animation: blink 2s step-end infinite;
}

/* Dramatic pulse */
@keyframes dramaticPulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
    filter: blur(0);
  }
  50% {
    opacity: 1;
    transform: scale(1.02);
    filter: blur(0.5px);
  }
}

.pulse-dramatic {
  animation: dramaticPulse 3s ease-in-out infinite;
}

/* Static noise overlay */
@keyframes staticNoise {
  0% { background-position: 0 0; }
  100% { background-position: 100% 100%; }
}

.static-overlay::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
  animation: staticNoise 0.5s steps(10) infinite;
}

/* Enhanced bomb explosion */
@keyframes bombExplode {
  0% {
    opacity: 0;
    transform: scale(0.5);
    filter: brightness(1);
  }
  10% {
    opacity: 1;
    transform: scale(1.1);
    filter: brightness(3);
  }
  20% {
    transform: scale(0.95);
    filter: brightness(1);
  }
  30% {
    transform: scale(1.05);
    filter: brightness(2);
  }
  50% {
    transform: scale(1);
    filter: brightness(1);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: brightness(1);
  }
}

.bomb-visual {
  animation: bombExplode 2s ease forwards !important;
}

/* Explosion flash */
@keyframes explosionFlash {
  0% { background: var(--bg-base); }
  5% { background: #ffffff; }
  10% { background: #ff4400; }
  15% { background: #ffaa00; }
  25% { background: var(--bg-base); }
  100% { background: var(--bg-base); }
}

.explosion-flash {
  animation: explosionFlash 1s ease-out;
}

/* Shake effect */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10% { transform: translateX(-5px); }
  20% { transform: translateX(5px); }
  30% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  50% { transform: translateX(-3px); }
  60% { transform: translateX(3px); }
  70% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
  90% { transform: translateX(-1px); }
}

.shake {
  animation: shake 0.5s ease-in-out;
}

/* Distortion wave */
@keyframes distortWave {
  0%, 100% {
    transform: skewX(0deg) skewY(0deg);
    filter: none;
  }
  25% {
    transform: skewX(0.5deg) skewY(-0.3deg);
    filter: blur(0.5px);
  }
  50% {
    transform: skewX(-0.3deg) skewY(0.5deg);
    filter: blur(0.3px);
  }
  75% {
    transform: skewX(0.2deg) skewY(-0.2deg);
    filter: blur(0.2px);
  }
}

.distort {
  animation: distortWave 0.15s ease-in-out;
}

/* Red warning flash */
@keyframes warningFlash {
  0%, 100% { color: var(--text-primary); }
  50% { color: #ff3333; }
}

.warning-flash {
  animation: warningFlash 0.5s ease-in-out 3;
}

/* Typewriter cursor blink */
@keyframes cursorBlink {
  0%, 100% { border-right-color: var(--text-primary); }
  50% { border-right-color: transparent; }
}

.typewriter-cursor::after {
  content: '';
  border-right: 2px solid var(--text-primary);
  animation: cursorBlink 0.7s step-end infinite;
  margin-left: 2px;
}

/* Fade in with glitch */
@keyframes glitchFadeIn {
  0% {
    opacity: 0;
    transform: translate(-3px, 0);
    text-shadow: 3px 0 #ff0000;
  }
  25% {
    opacity: 0.5;
    transform: translate(2px, 0);
    text-shadow: -2px 0 #00ffff;
  }
  50% {
    opacity: 0.8;
    transform: translate(-1px, 0);
    text-shadow: 1px 0 #ff0000;
  }
  100% {
    opacity: 1;
    transform: translate(0);
    text-shadow: none;
  }
}

.glitch-in {
  animation: glitchFadeIn 0.4s ease-out forwards;
}
