/* ======================================================================
   GO OUTSIDE  —  first-person ASCII walk around an address
   The view is the page: everything else hides behind one character.
   See dist/views/go-outside.ejs
   ====================================================================== */

:root {
  --go-panel-w: min(360px, 88vw);
}

/* The stage is exactly one screenful, so nothing ever scrolls behind it. */
body:has(.go-shell) {
  overflow: hidden;
}

body:has(.go-shell) .footer-component {
  display: none;
}

/* Fixed rather than in-flow: the view should meet the nav and the edges of the
   window, whatever padding the page shell around it has. */
.go-shell {
  position: fixed;
  top: var(--nav-height, 53px);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  overflow: hidden;
  background: var(--color-bg-black);
  font-family: 'Roboto Mono', 'Courier New', monospace;
}

/* ── The view ── */
.go-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: crosshair;
  background: #000;
  /* Dragging to look shouldn't select the characters under the cursor. */
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.go-layer {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  padding: 0;
  font-family: 'Roboto Mono', 'Courier New', monospace;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0;
  white-space: pre;
  pointer-events: none;
}

.go-layer--main {
  color: var(--color-terminal-green);
  text-shadow: 0 0 6px rgba(51, 255, 51, 0.25);
}

/* Second layer, same grid, so the address itself can be a different colour. */
.go-layer--accent {
  color: var(--color-cyberpunk-pink);
  text-shadow: 0 0 8px rgba(230, 34, 197, 0.35);
}

/* ── Overlay (loading, errors) ── */
.go-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  padding: var(--space-lg);
  text-align: center;
}

.go-overlay--on {
  opacity: 1;
}

.go-overlay-text {
  color: var(--color-terminal-green);
  font-size: var(--font-size-sm);
  letter-spacing: 3px;
  text-transform: uppercase;
  text-shadow: var(--glow-green);
}

.go-overlay-text--error {
  color: var(--color-cyberpunk-pink);
  text-shadow: var(--glow-pink);
}

/* ── Readout strip (off by default) ── */
.go-status {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 6px 12px;
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(51, 255, 51, 0.75);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
  text-align: center;
  pointer-events: none;
  display: none;
}

.go-status--on {
  display: block;
}

/* ── The one character that isn't the view ── */
.go-toggle {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(51, 255, 51, 0.45);
  border-radius: var(--border-radius-sm);
  color: var(--color-terminal-green);
  font-family: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity var(--transition-fast), transform var(--transition-base),
              box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.go-toggle:hover {
  opacity: 1;
  border-color: var(--color-terminal-green);
  box-shadow: var(--glow-green);
}

/* Ride along the edge of the drawer rather than hiding under it. */
.go-toggle--open {
  opacity: 1;
  transform: translateX(var(--go-panel-w));
  color: var(--color-cyberpunk-pink);
  border-color: rgba(230, 34, 197, 0.55);
}

/* ── The drawer everything else lives in ── */
.go-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  width: var(--go-panel-w);
  transform: translateX(-101%);
  transition: transform var(--transition-base);
  background: rgba(0, 0, 0, 0.94);
  border-right: 1px solid var(--color-terminal-green);
  box-shadow: 8px 0 24px rgba(0, 0, 0, 0.6);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.go-panel--open {
  transform: translateX(0);
}

.go-panel-inner {
  padding: var(--space-lg) var(--space-md) var(--space-2xl);
  /* The page shell centres text; a column of settings shouldn't be. */
  text-align: left;
}

.go-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
  border-bottom: 1px solid rgba(51, 255, 51, 0.3);
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-md);
}

.go-title {
  margin: 0;
  font-size: var(--font-size-xl);
  color: var(--color-cyberpunk-pink);
  letter-spacing: 4px;
  font-style: italic;
  text-transform: uppercase;
}

.go-sub {
  margin: 4px 0 0;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

.go-close {
  background: none;
  border: none;
  color: var(--color-terminal-green);
  font-family: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.go-close:hover {
  color: var(--color-cyberpunk-pink);
}

/* ── Blocks ── */
.go-block {
  padding: var(--space-md) 0;
  border-bottom: 1px solid rgba(51, 255, 51, 0.18);
}

.go-block:last-child {
  border-bottom: none;
}

.go-block-title {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--color-cyberpunk-pink);
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

.go-label {
  font-size: var(--font-size-xs);
  color: var(--color-cyberpunk-pink);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.go-val {
  font-size: var(--font-size-xs);
  color: var(--color-terminal-green);
  font-weight: bold;
  letter-spacing: 1px;
}

.go-hint {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--color-text-muted);
}

/* ── Address ── */
.go-row {
  display: flex;
  gap: var(--space-sm);
  margin-top: 6px;
}

.go-input {
  flex: 1 1 auto;
  min-width: 0;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(51, 255, 51, 0.35);
  border-radius: var(--border-radius-sm);
  color: var(--color-terminal-green);
  font-family: inherit;
  font-size: var(--font-size-sm);
  letter-spacing: 1px;
  padding: 9px 10px;
}

.go-input:focus {
  outline: none;
  border-color: var(--color-terminal-green);
  box-shadow: var(--glow-green);
}

.go-input::placeholder {
  color: var(--color-text-muted);
}

.go-btn {
  background: transparent;
  border: 1px solid var(--color-terminal-green);
  border-radius: var(--border-radius-sm);
  color: var(--color-terminal-green);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--font-size-xs);
  letter-spacing: 2px;
  padding: 9px 16px;
  text-transform: uppercase;
  transition: background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}

.go-btn:hover:not(:disabled) {
  background: var(--color-terminal-green);
  color: var(--color-bg-black);
  box-shadow: var(--glow-green);
}

.go-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.go-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--space-sm);
}

.go-chip {
  background: transparent;
  border: 1px solid rgba(51, 255, 51, 0.3);
  border-radius: var(--border-radius-sm);
  color: rgba(51, 255, 51, 0.8);
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 1.5px;
  padding: 5px 8px;
  transition: all var(--transition-fast);
}

.go-chip:hover {
  border-color: var(--color-cyberpunk-pink);
  color: var(--color-cyberpunk-pink);
}

.go-place {
  margin: var(--space-sm) 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: rgba(51, 255, 51, 0.8);
}

.go-facts {
  margin: 4px 0 0;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--color-text-muted);
}

/* ── Controls ── */
.go-control {
  margin-top: var(--space-md);
}

.go-control:first-child {
  margin-top: 0;
}

.go-control-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: 6px;
}

.go-slider {
  width: 100%;
  height: 3px;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(51, 255, 51, 0.25);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.go-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--color-terminal-green);
  box-shadow: var(--glow-green);
  cursor: pointer;
}

.go-slider::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: none;
  border-radius: 50%;
  background: var(--color-terminal-green);
  box-shadow: var(--glow-green);
  cursor: pointer;
}

.go-select {
  width: 100%;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(51, 255, 51, 0.35);
  border-radius: var(--border-radius-sm);
  color: var(--color-terminal-green);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 8px 10px;
  cursor: pointer;
}

.go-select:focus {
  outline: none;
  border-color: var(--color-terminal-green);
}

.go-check {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.go-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--color-cyberpunk-pink);
  cursor: pointer;
}

.go-check label {
  font-size: var(--font-size-xs);
  letter-spacing: 2px;
  color: var(--color-cyberpunk-pink);
  text-transform: uppercase;
  cursor: pointer;
}

/* ── Key legend ── */
.go-keys {
  list-style: none;
  margin: 0;
  padding: 0;
}

.go-keys li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 7px;
  font-size: 11px;
  color: var(--color-text-muted);
}

kbd {
  display: inline-block;
  min-width: 20px;
  padding: 2px 5px;
  border: 1px solid rgba(51, 255, 51, 0.4);
  border-radius: 3px;
  background: rgba(51, 255, 51, 0.06);
  color: var(--color-terminal-green);
  font-family: inherit;
  font-size: 10px;
  text-align: center;
}

.go-keys li span {
  margin-left: 4px;
}

.go-keys-note {
  margin-left: 0 !important;
  line-height: 1.45;
}

/* ── Notes ── */
.go-note {
  margin: 0 0 var(--space-sm);
  font-size: 11px;
  line-height: 1.55;
  color: var(--color-text-muted);
}

.go-note strong {
  color: rgba(51, 255, 51, 0.85);
  font-weight: normal;
}

.go-note-accent {
  color: var(--color-cyberpunk-pink);
}

.go-note a {
  color: var(--color-terminal-green);
  text-decoration: none;
  border-bottom: 1px dotted rgba(51, 255, 51, 0.4);
}

.go-note a:hover {
  color: var(--color-cyberpunk-pink);
  border-bottom-color: var(--color-cyberpunk-pink);
}

.go-note--muted {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
}

/* ── Narrow screens: the drawer takes the width it needs, the view keeps
   the rest of the page to itself. ── */
@media (max-width: 600px) {
  .go-toggle {
    top: 10px;
    left: 10px;
  }

  /* The drawer is nearly the whole screen here, so there's nowhere to park the
     toggle that isn't on top of the panel's own close button. */
  .go-toggle--open {
    opacity: 0;
    pointer-events: none;
  }
}
