* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #08090c; font-family: 'Courier New', monospace; }
canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; }

.reader-label {
  position: fixed;
  top: 18px;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.3;
  z-index: 10;
  pointer-events: none;
}
#reader-label-a { left: 12%; color: #d4a050; transform: translateX(-50%); }
#reader-label-b { right: 12%; color: #50a0d4; transform: translateX(50%); }

#archive-column {
  position: fixed;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  height: calc(100% - 120px);
  overflow: hidden;
  z-index: 5;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, transparent 0%, white 8%, white 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, white 8%, white 85%, transparent 100%);
}

.archive-entry {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  text-align: center;
  font-size: 10px;
  line-height: 1.4;
  color: rgba(140, 145, 160, 0.6);
  padding: 6px 10px;
  border: 1px solid rgba(140, 145, 160, 0.08);
  border-radius: 3px;
  background: rgba(12, 14, 20, 0.7);
  pointer-events: auto;
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.archive-entry:hover {
  border-color: rgba(140, 145, 160, 0.25);
  color: rgba(180, 185, 200, 0.8);
}

.reader-column {
  position: fixed;
  top: 40px;
  width: 180px;
  height: calc(100% - 120px);
  overflow: hidden;
  z-index: 4;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, transparent 0%, white 8%, white 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, white 8%, white 85%, transparent 100%);
}
#reader-a { left: calc(12% - 90px); }
#reader-b { right: calc(12% - 90px); }

.reader-interpretation {
  position: absolute;
  width: 170px;
  font-size: 9px;
  line-height: 1.3;
  padding: 4px 8px;
  border-radius: 2px;
  opacity: 0.55;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#reader-a .reader-interpretation {
  color: #d4a050;
  text-align: right;
  border-right: 2px solid rgba(212, 160, 80, 0.2);
}
#reader-b .reader-interpretation {
  color: #50a0d4;
  text-align: left;
  border-left: 2px solid rgba(80, 160, 212, 0.2);
}

#coherence-meter {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 20;
}
.coherence-label {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(140, 145, 160, 0.4);
}
.coherence-bar {
  width: 120px;
  height: 3px;
  background: rgba(140, 145, 160, 0.1);
  border-radius: 2px;
  overflow: hidden;
}
.coherence-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #50a0d4, #8c8ca0, #d4a050);
  border-radius: 2px;
  transition: width 0.5s ease;
}
.coherence-value {
  font-size: 10px;
  color: rgba(140, 145, 160, 0.5);
  min-width: 36px;
}

#drift-control {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 20;
  background: rgba(8, 9, 12, 0.8);
  padding: 8px 16px;
  border-radius: 6px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(140, 145, 160, 0.08);
}
#drift-control label {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(140, 145, 160, 0.4);
}
#drift-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 180px;
  height: 3px;
  background: rgba(140, 145, 160, 0.12);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
#drift-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(180, 160, 140, 0.6);
  border: 1px solid rgba(180, 160, 140, 0.3);
  cursor: pointer;
}
#drift-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(180, 160, 140, 0.6);
  border: 1px solid rgba(180, 160, 140, 0.3);
  cursor: pointer;
}
#drift-value {
  font-size: 10px;
  color: rgba(140, 145, 160, 0.5);
  min-width: 28px;
}

#entry-detail {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 480px;
  max-width: 90vw;
  background: rgba(12, 14, 20, 0.95);
  border: 1px solid rgba(140, 145, 160, 0.12);
  border-radius: 8px;
  padding: 20px;
  z-index: 100;
  backdrop-filter: blur(12px);
}
.detail-header {
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(140, 145, 160, 0.35);
  margin-bottom: 8px;
}
.detail-entry {
  font-size: 12px;
  color: rgba(180, 185, 200, 0.7);
  margin-bottom: 16px;
  line-height: 1.5;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(140, 145, 160, 0.08);
}
.detail-readings {
  display: flex;
  gap: 20px;
}
.detail-reading-a, .detail-reading-b {
  flex: 1;
}
.detail-reading-a .detail-label {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(212, 160, 80, 0.5);
  margin-bottom: 6px;
}
.detail-reading-b .detail-label {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(80, 160, 212, 0.5);
  margin-bottom: 6px;
}
.detail-reading-a .detail-text {
  font-size: 11px;
  color: rgba(212, 160, 80, 0.65);
  line-height: 1.5;
}
.detail-reading-b .detail-text {
  font-size: 11px;
  color: rgba(80, 160, 212, 0.65);
  line-height: 1.5;
}
.detail-close {
  margin-top: 16px;
  background: none;
  border: 1px solid rgba(140, 145, 160, 0.12);
  color: rgba(140, 145, 160, 0.4);
  font-family: 'Courier New', monospace;
  font-size: 10px;
  padding: 4px 12px;
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: 0.1em;
}
.detail-close:hover {
  color: rgba(180, 185, 200, 0.6);
  border-color: rgba(140, 145, 160, 0.25);
}

#info {
  position: fixed;
  bottom: 60px;
  left: 20px;
  max-width: 380px;
  color: #5a6878;
  font-size: 12px;
  line-height: 1.5;
  background: rgba(8, 9, 12, 0.9);
  padding: 16px;
  border-radius: 8px;
  backdrop-filter: blur(8px);
  transition: opacity 0.3s;
  z-index: 50;
  border: 1px solid rgba(140, 145, 160, 0.06);
}
#info h1 { font-size: 16px; margin-bottom: 4px; font-weight: 600; color: #8a8e9a; }
#info .subtitle { font-size: 11px; opacity: 0.5; margin-bottom: 10px; font-style: italic; }
#info .description { font-size: 11px; line-height: 1.6; margin-bottom: 8px; }
#info .controls-hint { font-size: 10px; opacity: 0.3; }
#info .credit { font-size: 10px; opacity: 0.35; margin-top: 6px; }
#info .credit a { color: inherit; text-decoration: none; }

#controls {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: 50;
}
#controls button {
  background: rgba(8, 9, 12, 0.5);
  border: 1px solid rgba(140, 145, 160, 0.1);
  color: #505868;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  backdrop-filter: blur(8px);
  transition: all 0.2s;
}
#controls button:hover { background: rgba(12, 14, 20, 0.7); color: #7a8090; }
