:root {
  --panel: rgba(20, 20, 26, 0.92);
  --text: #e2e2ea;
  --text-dim: #8a8a9a;
  --border: rgba(255, 255, 255, 0.12);
  --accent: #6366f1;
  --success: #22c55e;
  --orange: #f97316;
}

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

body {
  font-family: system-ui, sans-serif;
  overflow: hidden;
  background: #000;
  color: var(--text);
  height: 100vh;
  width: 100vw;
  user-select: none;
  -webkit-user-select: none;
}

.scene-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #1a1a22;
  z-index: 1;
  cursor: pointer;
}

.scene-canvas:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.text-boxes-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.scene-text {
  position: absolute;
  left: var(--pos-x, 50%);
  top: var(--pos-y, 50%);
  transform: translate(-50%, -50%);
  width: var(--box-width, auto);
  min-width: 3vw;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--font-size, 1.25vw);
  line-height: 1.6;
  padding: 0.8em 1.2em;
  word-wrap: break-word;
  white-space: pre-wrap;
  pointer-events: none;
}

.scene-text.mode-default {
  background: transparent;
  color: #fff;
}

.scene-text.mode-default.shadow {
  text-shadow: 0 .08em .42em rgba(0, 0, 0, .9), 0 0 .08em rgba(0, 0, 0, .95);
}

.scene-text.mode-default.dynamic {
  mix-blend-mode: difference;
  text-shadow: none;
}

.scene-text.mode-bw {
  background: #fff;
  color: #000;
  text-shadow: none;
}

.scene-text.mode-wb {
  background: #000;
  color: #fff;
  text-shadow: none;
}

.scene-text .yellow {
  color: #fbbf24;
}

.scene-text .blue {
  color: #60a5fa;
}

.scene-text .italic {
  font-style: italic;
}

.scene-text .times {
  font-family: 'Times New Roman', serif;
}

.scene-text .twitter {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.scene-text .roman {
  font-family: Cinzel, serif;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.scene-text .colonial {
  font-family: UnifrakturMaguntia, fantasy, serif;
}

.scene-text.mode-bw .yellow {
  color: #b45309;
}

.scene-text.mode-bw .blue {
  color: #1d4ed8;
}

.scene-text.mode-wb .yellow {
  color: #fde047;
}

.scene-text.mode-wb .blue {
  color: #93c5fd;
}

.import-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
}

.import-overlay.hidden {
  display: none;
}

.import-btn {
  padding: 14px 32px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.import-btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.import-label {
  color: var(--text-dim);
  font-size: 14px;
}

input[type=file] {
  display: none;
}

.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
}

.nav-arrow {
  pointer-events: auto;
  width: 48px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  font-size: 24px;
  opacity: 0;
  transition: opacity 0.3s;
  backdrop-filter: blur(12px);
}

.nav-arrow:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.nav-overlay:hover .nav-arrow {
  opacity: 1;
}

.nav-arrow.disabled {
  opacity: 0 !important;
  pointer-events: none;
}

.hint-text {
  position: fixed;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  color: var(--text-dim);
  font-size: 13px;
  background: rgba(0, 0, 0, 0.6);
  padding: 8px 18px;
  border-radius: 20px;
  display: none;
  text-align: center;
  line-height: 1.4;
  pointer-events: none;
}

.hint-text.show {
  display: block;
}

.next-scene-indicator {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  display: none;
  pointer-events: none;
}

.logo-link {
  position: fixed;
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  transition: top 0.4s ease, left 0.4s ease, right 0.4s ease, bottom 0.4s ease;
}

.logo-link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.logo-link svg {
  width: 40px;
  height: 40px;
  display: block;
  flex-shrink: 0;
}

.logo-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: lowercase;
  color: inherit;
  white-space: nowrap;
}