/* ═══════════════════════════════
   NOTHING HERE v1.8
   Mobile-first, portrait only
═══════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

html {
  height: 100%;
  height: -webkit-fill-available;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: -webkit-fill-available;
  background: #000;
  color: #d0d0d0;
  font-family: monospace;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
#header {
  text-align: center;
  padding: clamp(24px, 6vh, 64px) 1rem 1rem;
}
#sub {
  color: #666;
  line-height: 2;
  font-size: clamp(.75rem, 2.5vw, .9rem);
}
h1 {
  letter-spacing: .35em;
  font-weight: 200;
  margin: 0 0 12px 0;
  font-size: clamp(1rem, 5vw, 1.6rem);
}

/* ── Word grid ── */
#obs {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 8px;
  padding: 8px;
}
.slot { position: relative; }
.word {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 1.5s;
  color: #666;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  font-size: clamp(.65rem, 2vw, .85rem);
}
.word.rare {
  color: #c0392b;
  text-shadow: 0 0 8px #c0392b44;
}
.word.soul {
  color: #fff;
  text-shadow: 0 0 12px #ffffff66;
  font-weight: 400;
}

/* ── Footer ── */
#footer {
  opacity: 0;
  border-top: 1px solid #222;
  padding: 10px 12px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  transition: opacity 0.8s;
  /* fixed height prevents layout jump when END button appears */
  min-height: 52px;
}
#footer.active { opacity: 1; }

.row {
  display: flex;
  gap: 10px;
  font-size: clamp(.62rem, 2vw, .72rem);
  align-items: center;
}

/* status group left, button right */
.footer-status {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.footer-status span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* mobile: stack into two rows */
@media (max-width: 600px) {
  .row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .footer-status {
    gap: 8px;
  }
  .footer-hide-sm { display: none; }
  #endBtn {
    margin-left: 0 !important;
    width: 100%;
    padding: 13px;
    font-size: .78rem;
    letter-spacing: .1em;
  }
}
.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #7dff9c;
  box-shadow: 0 0 10px #7dff9c;
  flex-shrink: 0;
}
button {
  background: #111;
  color: #ccc;
  border: 1px solid #333;
  padding: 10px 14px;
  font-family: monospace;
  cursor: pointer;
  font-size: clamp(.65rem, 2vw, .72rem);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button:active { background: #1a1a1a; }
#endBtn {
  visibility: hidden;
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.4s ease;
}
#endBtn.visible {
  visibility: visible;
  opacity: 1;
}

/* ── Overlays ── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  align-items: flex-start;
  justify-content: center;
  z-index: 100;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  padding-bottom: env(safe-area-inset-bottom, 16px);
}
.overlay.show { display: flex; }

.panel {
  border: 1px solid #2a2a2a;
  padding: clamp(18px, 4vw, 28px);
  width: 100%;
  max-width: 540px;
  background: #000;
  margin: auto;
}

/* confirm panel */
.panel h3 {
  margin: 0 0 16px 0;
  font-weight: 200;
  letter-spacing: .1em;
  font-size: clamp(.78rem, 2.5vw, .88rem);
  line-height: 1.8;
  color: #aaa;
}
.panel p {
  color: #888;
  line-height: 1.8;
  font-size: clamp(.75rem, 2.2vw, .82rem);
  margin: 0 0 20px 0;
}
.panel > button {
  margin-right: 8px;
  min-height: 44px;
}

/* ── Report panel ── */
.report-panel {
  /* panel itself scrolls on mobile */
  max-height: none;
}

.report-header {
  border-bottom: 1px solid #1a1a1a;
  padding-bottom: 14px;
  margin-bottom: 20px;
}
.report-header-label {
  font-size: clamp(.58rem, 1.8vw, .62rem);
  letter-spacing: .25em;
  color: #7dff9c;
  opacity: .6;
  margin-bottom: 4px;
}
.report-header-title {
  font-size: clamp(.85rem, 3vw, 1rem);
  letter-spacing: .2em;
  font-weight: 200;
  color: #ccc;
  margin-bottom: 4px;
}
.report-header-sub {
  font-size: clamp(.58rem, 1.8vw, .64rem);
  letter-spacing: .1em;
  color: #444;
}

/* ── Conclusions ── */
#conclusionsList {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}
.conclusion-block {
  border-left: 1px solid #1a1a1a;
  padding: 10px 0 10px 14px;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  position: relative;
}
.conclusion-block + .conclusion-block {
  border-top: 1px solid #0d0d0d;
}
.conclusion-block.visible {
  opacity: 1;
  transform: translateX(0);
}
.conclusion-block.visible .conclusion-dot {
  background: #7dff9c;
  box-shadow: 0 0 6px #7dff9c44;
}
.conclusion-dot {
  position: absolute;
  left: -4px; top: 16px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #1a1a1a;
  transition: background 0.3s, box-shadow 0.3s;
}
.conclusion-index {
  font-size: clamp(.56rem, 1.7vw, .6rem);
  letter-spacing: .18em;
  color: #2a2a2a;
  margin-bottom: 3px;
}
.conclusion-label {
  font-size: clamp(.62rem, 1.9vw, .67rem);
  letter-spacing: .12em;
  color: #555;
  margin-bottom: 5px;
  text-transform: uppercase;
}
.conclusion-text {
  font-size: clamp(.72rem, 2.2vw, .78rem);
  color: #999;
  line-height: 1.8;
  min-height: 16px;
}
.conclusion-text .cursor {
  display: inline-block;
  width: 6px; height: 12px;
  background: #444;
  margin-left: 2px;
  vertical-align: middle;
  animation: blink .85s step-end infinite;
}
.conclusion-text.pending { color: #111; }

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

/* ── Raw telemetry ── */
.raw-toggle {
  font-size: clamp(.6rem, 1.9vw, .64rem);
  letter-spacing: .1em;
  color: #2a2a2a;
  cursor: pointer;
  padding: 12px 0;
  border-top: 1px solid #111;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.raw-toggle:active { color: #555; }
.raw-telemetry {
  border: 1px solid #111;
  padding: 10px;
  margin-top: 6px;
  margin-bottom: 16px;
}
.raw-telemetry.hidden { display: none; }
.raw-row {
  display: flex;
  justify-content: space-between;
  font-size: clamp(.64rem, 2vw, .68rem);
  padding: 4px 0;
  border-bottom: 1px solid #0a0a0a;
  color: #383838;
}
.raw-row:last-child { border-bottom: none; }
.raw-row span:last-child { color: #4a4a4a; }

/* ── CTA block ── */
.cta-block { margin-top: 20px; }
.cta-block.hidden { display: none; }

.cta-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.cta-divider::before,
.cta-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #1a1a1a;
}
.cta-divider-label {
  font-size: clamp(.56rem, 1.7vw, .6rem);
  letter-spacing: .18em;
  color: #2a2a2a;
  white-space: nowrap;
}

/* ACCESS ARCHIVE */
.cta-archive {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border: 1px solid #2a2a2a;
  background: #050505;
  text-decoration: none;
  margin-bottom: 16px;
  min-height: 64px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: border-color 0.2s, background 0.2s;
}
.cta-archive:active,
.cta-archive:hover {
  border-color: #7dff9c;
  background: #040404;
}
.cta-archive:active .cta-archive-title,
.cta-archive:hover .cta-archive-title { color: #7dff9c; }
.cta-archive:active .cta-archive-arrow,
.cta-archive:hover .cta-archive-arrow { color: #7dff9c; }

.cta-archive-inner { flex: 1; }
.cta-archive-label {
  font-size: clamp(.56rem, 1.7vw, .6rem);
  letter-spacing: .2em;
  color: #333;
  display: block;
  margin-bottom: 4px;
}
.cta-archive-title {
  font-size: clamp(.78rem, 2.5vw, .88rem);
  letter-spacing: .18em;
  color: #bbb;
  transition: color 0.2s;
}
.cta-archive-arrow {
  font-size: 1.1rem;
  color: #333;
  padding-left: 12px;
  flex-shrink: 0;
  transition: color 0.2s;
}

/* Share */
.share-block {
  border: 1px solid #111;
  padding: 14px;
}
.share-label {
  font-size: clamp(.56rem, 1.7vw, .6rem);
  letter-spacing: .18em;
  color: #2a2a2a;
  margin-bottom: 10px;
}
.share-buttons {
  display: flex;
  gap: 8px;
}
.share-btn {
  flex: 1;
  padding: 14px 6px;
  min-height: 48px;
  font-size: clamp(.64rem, 2vw, .68rem);
  letter-spacing: .12em;
  background: #0a0a0a;
  color: #444;
  border: 1px solid #1a1a1a;
  cursor: pointer;
  font-family: monospace;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: color 0.15s, border-color 0.15s;
}
.share-btn:active,
.share-btn:hover { color: #ccc; border-color: #444; }

/* Report footer */
.report-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: clamp(.6rem, 1.9vw, .66rem);
  color: #222;
  padding-top: 12px;
  border-top: 1px solid #111;
  margin-top: 16px;
}
.report-footer a { color: #333; text-decoration: none; }

/* ── Rotate screen ── */
.rotate-screen {
  display: none;
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 99999;
}
.rotate-inner {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.rotate-label  { color: #777; letter-spacing: .25em; font-size: .7rem; }
.rotate-line   { width: 120px; height: 1px; background: #333; margin: 20px auto; }
.rotate-title  { font-size: 1.4rem; margin-bottom: 10px; }
.rotate-sub    { font-size: .7rem; color: #777; letter-spacing: .15em; }

@media (orientation: landscape) and (max-width: 1100px) {
  .rotate-screen { display: block; }
  header, main, footer, #confirm, #report { display: none !important; }
}


/* ── SOUL easter egg ── */
#anomalyMsg {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  font-size: .62rem;
  letter-spacing: .25em;
  color: #fff;
  padding: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 50;
}
#anomalyMsg.show { opacity: 1; }
