/* ── Tokens ──────────────────────────────────────────── */
:root {
  --bg: #0c0404;
  --crimson: #c41e2a;
  --crimson-bright: #ff3a45;
  --ember: #ff8a3d;
  --brass: #c9a227;
  --brass-dim: #8a7020;
  --ink: #1a0a0a;
  --panel: rgba(28, 8, 8, 0.72);
  --panel-edge: rgba(201, 162, 39, 0.35);
  --text: #f5e6d3;
  --muted: rgba(245, 230, 211, 0.55);
  --danger: #ff5a4a;
  --ok: #5dff9a;
  --mono: 'Share Tech Mono', ui-monospace, monospace;
  --display: 'Orbitron', sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

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

html, body {
  width: 100%;
  height: 100%;
}

body {
  overflow: hidden;
  background: var(--bg);
  font-family: var(--mono);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  user-select: none;
}

canvas#scene {
  display: block;
  width: 100vw;
  height: 100vh;
  position: fixed;
  inset: 0;
  z-index: 0;
}

.site-mark {
  position: fixed;
  top: calc(0.55rem + var(--safe-t));
  left: 0.9rem;
  z-index: 12;
  pointer-events: auto;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.site-mark a {
  color: var(--brass);
  text-decoration: none;
}

.site-mark a:hover {
  color: var(--ember);
}

@media (max-width: 720px) {
  .site-mark { font-size: 0.55rem; max-width: 55vw; }
}

#vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(ellipse at center, transparent 40%, rgba(8, 0, 0, 0.75) 100%),
    linear-gradient(180deg, rgba(40, 5, 5, 0.35) 0%, transparent 18%, transparent 78%, rgba(10, 0, 0, 0.55) 100%);
}

#scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  opacity: 0.06;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.35) 2px,
    rgba(0, 0, 0, 0.35) 4px
  );
}

#flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background: radial-gradient(circle, rgba(255, 200, 120, 0.55), transparent 55%);
  opacity: 0;
  transition: opacity 0.12s ease;
}

#flash.active {
  opacity: 1;
}

/* ── HUD ─────────────────────────────────────────────── */
#hud {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding:
    calc(0.9rem + var(--safe-t))
    0.9rem
    calc(0.75rem + var(--safe-b));
}

.hud-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  pointer-events: none;
}

.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.brand .title {
  font-family: var(--display);
  font-size: clamp(1.35rem, 4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--text);
  text-shadow:
    0 0 18px rgba(196, 30, 42, 0.65),
    0 2px 0 rgba(0, 0, 0, 0.45);
  animation: brandPulse 4s ease-in-out infinite;
}

.brand .subtitle {
  margin-top: 0.2rem;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
}

@keyframes brandPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); }
}

.status-cluster {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
}

.status-pill,
.coord-chip {
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}

.status-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}

.status-pill.warning .status-dot {
  background: var(--ember);
  box-shadow: 0 0 8px var(--ember);
  animation: blink 0.35s steps(1) infinite;
}

.status-pill.critical .status-dot {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
  animation: blink 0.18s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0.25; }
}

.coord-chip {
  color: var(--brass);
  max-width: 11rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Side gauges ─────────────────────────────────────── */
.gauge-rail {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 4.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.gauge-rail.left { left: 0; }
.gauge-rail.right { right: 0; }

.gauge-label,
.tel-row span:first-child {
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.gauge-track {
  margin: 0.35rem 0;
  height: 5.5rem;
  width: 0.55rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(201, 162, 39, 0.25);
  position: relative;
  overflow: hidden;
}

.gauge-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  background: linear-gradient(180deg, var(--ember), var(--crimson));
  transition: height 0.45s ease;
}

.gauge-track.paradox .gauge-fill {
  background: linear-gradient(180deg, var(--brass), #5a1a10);
  height: 8%;
}

.gauge-value {
  font-size: 0.7rem;
  color: var(--ember);
}

.telemetry {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.55rem 0.45rem;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.tel-row {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.62rem;
  color: var(--text);
}

/* ── Center travel overlay ───────────────────────────── */
.hud-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.hud-center[hidden],
.dest-drawer[hidden] {
  display: none !important;
}

.vortex-readout {
  position: relative;
  width: 9rem;
  height: 9rem;
  display: grid;
  place-items: center;
}

.vortex-ring {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255, 90, 60, 0.55);
  border-radius: 50%;
  border-top-color: var(--brass);
  animation: spin 1.1s linear infinite;
}

.vortex-copy {
  font-family: var(--display);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  color: var(--ember);
  text-align: center;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Bottom cluster ──────────────────────────────────── */
.hud-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: min(920px, 100%);
  margin: 0 auto;
}

#time-display {
  text-align: center;
  pointer-events: none;
}

.time-label {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.time-value {
  font-family: var(--display);
  font-size: clamp(0.95rem, 3.2vw, 1.25rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ember);
  text-shadow: 0 0 14px rgba(255, 100, 40, 0.35);
}

.time-value.scramble {
  animation: scrambleFlicker 0.08s steps(1) infinite;
}

.era-value {
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: var(--brass);
  letter-spacing: 0.12em;
}

@keyframes scrambleFlicker {
  50% { opacity: 0.55; }
}

/* Destination drawer — interaction container */
.dest-drawer {
  pointer-events: auto;
  width: min(520px, 100%);
  max-height: 38vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(40, 10, 10, 0.92), rgba(18, 4, 4, 0.94));
  border: 1px solid var(--panel-edge);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.dest-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.22);
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--brass);
}

.icon-btn {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  min-width: 2rem;
  min-height: 2rem;
}

.dest-list {
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  max-height: calc(38vh - 2.6rem);
}

.dest-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  font-family: inherit;
  display: grid;
  gap: 0.15rem;
}

.dest-item:hover,
.dest-item:focus-visible,
.dest-item.active {
  background: rgba(196, 30, 42, 0.22);
  outline: none;
}

.dest-item .d-year {
  font-family: var(--display);
  font-size: 0.78rem;
  color: var(--ember);
  letter-spacing: 0.06em;
}

.dest-item .d-loc {
  font-size: 0.78rem;
}

.dest-item .d-era {
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

/* ── Dial cluster ─────────────────────────────────────── */
.dial-cluster {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  width: 100%;
  padding: 0.3rem 0;
}

/* Secondary knobs — arranged as a row */
.secondary-ring {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Small knob buttons */
.dial-knob {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, rgba(60, 18, 18, 0.95), rgba(20, 6, 6, 0.98));
  border: 1px solid rgba(201, 162, 39, 0.35);
  box-shadow:
    0 0 0 3px rgba(20, 6, 6, 0.9),
    0 0 0 4px rgba(201, 162, 39, 0.18),
    inset 0 1px 0 rgba(255, 200, 100, 0.12),
    0 3px 8px rgba(0,0,0,0.5);
  color: var(--text);
  font-family: var(--mono);
  cursor: pointer;
  transition: box-shadow 0.18s, transform 0.12s, border-color 0.18s;
}
.dial-knob:hover, .dial-knob:focus-visible {
  border-color: var(--ember);
  box-shadow:
    0 0 0 3px rgba(20, 6, 6, 0.9),
    0 0 0 4px rgba(255, 138, 61, 0.38),
    0 0 16px rgba(255, 138, 61, 0.22),
    inset 0 1px 0 rgba(255, 200, 100, 0.18);
  outline: none;
}
.dial-knob:active { transform: scale(0.94); }
.dial-knob:disabled { opacity: 0.38; cursor: not-allowed; transform: none; }

.knob-icon {
  font-size: 1.15rem;
  line-height: 1;
  opacity: 0.9;
}
.knob-label {
  font-size: 0.52rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  line-height: 1;
}

/* Main dial — large rotary handset button */
.dial-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, rgba(200, 28, 36, 0.9), rgba(100, 10, 16, 0.98));
  border: 1px solid rgba(255, 80, 60, 0.5);
  box-shadow:
    0 0 0 4px rgba(20, 6, 6, 0.95),
    0 0 0 6px rgba(201, 162, 39, 0.22),
    0 0 0 7px rgba(20, 6, 6, 0.9),
    inset 0 2px 0 rgba(255, 220, 180, 0.18),
    0 6px 20px rgba(0,0,0,0.6);
  color: #ffe8d8;
  font-family: var(--display);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.14s, border-color 0.2s;
  flex-shrink: 0;
}
.dial-main:hover, .dial-main:focus-visible {
  border-color: var(--ember);
  box-shadow:
    0 0 0 4px rgba(20, 6, 6, 0.95),
    0 0 0 6px rgba(255, 138, 61, 0.45),
    0 0 0 7px rgba(20, 6, 6, 0.9),
    0 0 32px rgba(255, 60, 40, 0.3),
    inset 0 2px 0 rgba(255, 220, 180, 0.22);
  outline: none;
}
.dial-main:active { transform: scale(0.94) rotate(-8deg); }
.dial-main:disabled { opacity: 0.38; cursor: not-allowed; transform: none; }
.dial-main.traveling {
  animation: dialSpin 0.6s ease-in-out infinite alternate;
}
@keyframes dialSpin {
  from { box-shadow: 0 0 0 4px rgba(20,6,6,.95), 0 0 0 6px rgba(255,80,40,.3), 0 0 0 7px rgba(20,6,6,.9), 0 0 12px rgba(255,60,40,.2); }
  to   { box-shadow: 0 0 0 4px rgba(20,6,6,.95), 0 0 0 6px rgba(255,138,61,.6), 0 0 0 7px rgba(20,6,6,.9), 0 0 40px rgba(255,90,40,.45); }
}

.dial-main-icon {
  font-size: 1.8rem;
  line-height: 1;
}
.dial-main-label {
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1;
}

/* keep .btn for any legacy references */
.btn { display: none; }

@keyframes travelPulse {
  from { box-shadow: 0 0 0 rgba(255, 80, 40, 0); }
  to { box-shadow: 0 0 28px rgba(255, 90, 40, 0.45); }
}

#instructions {
  font-size: 0.65rem;
  color: rgba(245, 230, 211, 0.35);
  letter-spacing: 0.04em;
  text-align: center;
}

.mobile-only { display: none; }
.desktop-only { display: inline; }

@media (hover: none) and (pointer: coarse) {
  .mobile-only { display: inline; }
  .desktop-only { display: none; }
  .dial-knob { width: 48px; height: 48px; }
  .dial-main  { width: 76px; height: 76px; }
}

@media (max-width: 720px) {
  .gauge-rail { display: none; }
  .hud-top { align-items: flex-start; }
  .brand .subtitle { max-width: 12rem; }
}

@media (max-width: 420px) {
  .btn-label { font-size: 0.68rem; }
  .status-cluster { gap: 0.3rem; }
  .coord-chip { display: none; }
}

/* Jack voice widget (jack-face.js): tuck it under the status cluster */
#jack-face {
  top: 76px !important;
  right: 12px !important;
}

/* ── Story panel ──────────────────────────────────────── */
#story-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(540px, 92vw);
  max-height: 60vh;
  overflow-y: auto;
  background: rgba(12, 4, 4, 0.92);
  border: 1px solid var(--panel-edge);
  border-top: 2px solid var(--brass);
  border-radius: 2px;
  padding: 1.2rem 1.4rem 1.4rem;
  z-index: 200;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 48px rgba(201, 162, 39, 0.12), 0 8px 40px rgba(0,0,0,0.7);
  animation: story-in 0.4s ease both;
}
#story-panel[hidden] { display: none; }

@keyframes cursor-blink {
  50% { opacity: 0; }
}

@keyframes story-in {
  from { opacity: 0; transform: translate(-50%, -48%); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}

.story-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid var(--panel-edge);
  padding-bottom: 0.55rem;
}

.story-loc {
  font-family: var(--display);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--brass);
  text-transform: uppercase;
}

.story-head-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.story-speak {
  background: none;
  border: 1px solid var(--panel-edge);
  color: var(--muted);
  font-size: 0.85rem;
  width: 1.6rem;
  height: 1.6rem;
  cursor: pointer;
  border-radius: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s;
}
.story-speak:hover { color: var(--text); border-color: var(--brass); }
.story-speak.speaking { border-color: var(--ember); color: var(--ember); }

.story-close {
  background: none;
  border: 1px solid var(--panel-edge);
  color: var(--muted);
  font-size: 0.8rem;
  width: 1.6rem;
  height: 1.6rem;
  cursor: pointer;
  border-radius: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s;
}
.story-close:hover { color: var(--text); border-color: var(--brass); }

.story-text {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-wrap;
}

.story-text::after {
  content: '▌';
  animation: cursor-blink 0.75s step-end infinite;
  color: var(--brass);
}
.story-text.done::after { display: none; }

.story-learn {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--brass-dim);
  background: rgba(196, 30, 42, 0.28);
  color: var(--text);
  font-family: var(--display);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  cursor: pointer;
}
.story-learn:hover, .story-learn:focus-visible { border-color: var(--ember); outline: none; }
.story-learn:disabled { opacity: 0.6; cursor: default; }
.story-learn[hidden] { display: none; }

/* ── Temporal Shuttle ─────────────────────────────────── */
.shuttle {
  margin-top: 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.shuttle-label {
  font-family: var(--display);
  font-size: 0.52rem;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.shuttle-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* Vertical range slider styled as a lever */
.shuttle-lever {
  -webkit-appearance: none;
  appearance: none;
  writing-mode: vertical-lr;
  direction: rtl;
  width: 28px;
  height: 80px;
  background: transparent;
  cursor: ns-resize;
  outline: none;
}

.shuttle-lever::-webkit-slider-runnable-track {
  width: 4px;
  height: 80px;
  background: linear-gradient(to bottom, rgba(255,90,40,0.5), var(--brass-dim), rgba(100,200,100,0.4));
  border-radius: 2px;
  border: 1px solid rgba(201,162,39,0.3);
}

.shuttle-lever::-moz-range-track {
  width: 4px;
  height: 80px;
  background: linear-gradient(to bottom, rgba(255,90,40,0.5), var(--brass-dim), rgba(100,200,100,0.4));
  border-radius: 2px;
}

.shuttle-lever::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 14px;
  background: radial-gradient(ellipse at 40% 35%, #d9c090, #8a6a20);
  border-radius: 3px;
  border: 1px solid rgba(201,162,39,0.8);
  box-shadow: 0 0 6px rgba(201,162,39,0.4), inset 0 1px 0 rgba(255,240,200,0.3);
  cursor: ns-resize;
}

.shuttle-lever::-moz-range-thumb {
  width: 22px;
  height: 14px;
  background: radial-gradient(ellipse at 40% 35%, #d9c090, #8a6a20);
  border-radius: 3px;
  border: 1px solid rgba(201,162,39,0.8);
  box-shadow: 0 0 6px rgba(201,162,39,0.4);
  cursor: ns-resize;
}

.shuttle-rate {
  font-family: var(--mono);
  font-size: 0.58rem;
  color: var(--ember);
  letter-spacing: 0.04em;
  text-align: center;
  min-width: 6ch;
  white-space: nowrap;
}

.shuttle-now {
  background: none;
  border: 1px solid rgba(201,162,39,0.3);
  color: var(--muted);
  font-family: var(--display);
  font-size: 0.5rem;
  letter-spacing: 0.14em;
  padding: 0.15rem 0.45rem;
  cursor: pointer;
  border-radius: 1px;
  transition: color 0.15s, border-color 0.15s;
}
.shuttle-now:hover { color: var(--brass); border-color: var(--brass); }

/* ── Addressable timepod context ──────────────────────── */
.pod-context-open {
  pointer-events: auto;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--panel-edge);
  background: var(--panel);
  color: var(--brass);
  font: 0.58rem var(--mono);
  letter-spacing: 0.1em;
  cursor: pointer;
}
.pod-context-open[hidden] { display: none; }

#pod-context {
  position: fixed;
  z-index: 180;
  top: calc(4.5rem + var(--safe-t));
  left: 1rem;
  width: min(330px, calc(100vw - 2rem));
  max-height: min(72vh, 680px);
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  user-select: text;
  -webkit-user-select: text;
  padding: 0.85rem;
  background: rgba(12, 4, 4, 0.94);
  border: 1px solid var(--panel-edge);
  border-top: 2px solid var(--brass);
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
}
#pod-context[hidden] { display: none; }
.pod-context-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.pod-context-head h2, .pod-context-section h3 {
  color: var(--brass);
  font: 0.62rem var(--display);
  letter-spacing: 0.12em;
}
.pod-context-head h2 { overflow-wrap: anywhere; }
#pod-place { margin-top: 0.3rem; font-size: 0.82rem; color: var(--text); }
#pod-context-close {
  flex: 0 0 auto;
  width: 1.65rem;
  height: 1.65rem;
  border: 1px solid var(--panel-edge);
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
}
.pod-context-coordinate, .pod-context-message {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.4;
}
.pod-map-link, .pod-signin, #pod-action-link a {
  display: inline-block;
  margin-top: 0.45rem;
  color: var(--ember);
  font-size: 0.68rem;
}
.pod-context-section { margin-top: 0.8rem; padding-top: 0.65rem; border-top: 1px solid rgba(201, 162, 39, 0.2); }
.pod-context-section h3 { margin-bottom: 0.4rem; }
#pod-progress { color: var(--text); font-size: 0.7rem; line-height: 1.4; }
.pod-context-list { list-style: none; margin-top: 0.35rem; }
.pod-context-list li { padding: 0.3rem 0; border-top: 1px solid rgba(255, 255, 255, 0.06); font-size: 0.7rem; line-height: 1.4; overflow-wrap: anywhere; }
.pod-entry-text { display: block; color: var(--text); white-space: pre-wrap; }
.pod-entry-author, .pod-empty { display: block; color: var(--muted); font-size: 0.6rem; }
.pod-context-form { display: grid; gap: 0.35rem; margin-top: 0.55rem; }
.pod-context-form label { color: var(--muted); font-size: 0.65rem; }
.pod-context-form textarea {
  width: 100%;
  min-height: 3.2rem;
  resize: vertical;
  padding: 0.45rem;
  border: 1px solid var(--panel-edge);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font: 0.72rem/1.4 var(--mono);
  touch-action: auto;
  user-select: text;
  -webkit-user-select: text;
}
.pod-context-form button {
  justify-self: end;
  min-height: 2rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--panel-edge);
  background: rgba(196, 30, 42, 0.28);
  color: var(--text);
  font: 0.58rem var(--display);
  letter-spacing: 0.08em;
  cursor: pointer;
}
.pod-context-form button:disabled { opacity: 0.4; cursor: not-allowed; }
.pod-context-form button:not(:disabled):hover { border-color: var(--ember); }
#pod-signin[hidden], #pod-action-link[hidden] { display: none; }

/* ── Planet info sheet ────────────────────────────────── */
#planet-sheet {
  position: fixed;
  right: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  width: min(240px, 88vw);
  background: rgba(8, 3, 3, 0.94);
  border: 1px solid var(--panel-edge);
  border-top: 2px solid var(--brass);
  border-radius: 2px;
  z-index: 190;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 40px rgba(201,162,39,0.10), 0 6px 32px rgba(0,0,0,0.7);
  animation: psheet-in 0.3s ease both;
}
#planet-sheet[hidden] { display: none; }

@keyframes psheet-in {
  from { opacity: 0; transform: translateY(-48%) translateX(12px); }
  to   { opacity: 1; transform: translateY(-50%) translateX(0); }
}

.psheet-inner {
  padding: 1.1rem 1.2rem 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  position: relative;
}

.psheet-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: 1px solid var(--panel-edge);
  color: var(--muted);
  font-size: 0.75rem;
  width: 1.4rem;
  height: 1.4rem;
  cursor: pointer;
  border-radius: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.psheet-close:hover { color: var(--text); border-color: var(--brass); }

.psheet-glyph {
  font-size: 2.8rem;
  line-height: 1;
  margin-top: 0.2rem;
  filter: drop-shadow(0 0 12px currentColor);
  transition: color 0.3s;
}

.psheet-name {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text);
  text-transform: uppercase;
  margin-top: 0.15rem;
}

.psheet-era {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}

.psheet-data {
  width: 100%;
  margin-top: 0.6rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.22rem 0.7rem;
  font-size: 0.7rem;
}

.psheet-data dt {
  color: var(--muted);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.psheet-data dd {
  color: var(--ember);
  font-family: var(--mono);
  text-align: right;
}

.psheet-hint {
  margin-top: 0.5rem;
  font-size: 0.6rem;
  color: rgba(201, 162, 39, 0.45);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.psheet-go {
  margin-top: 0.5rem;
  width: 100%;
  padding: 0.55rem 1rem;
  background: var(--crimson);
  border: none;
  color: #fff;
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 1px;
  transition: background 0.15s, box-shadow 0.15s;
}
.psheet-go:hover {
  background: var(--crimson-bright);
  box-shadow: 0 0 16px rgba(255, 58, 69, 0.4);
}

@media (max-width: 540px) {
  #planet-sheet {
    right: 50%;
    transform: translateY(-50%) translateX(50%);
  }
  @keyframes psheet-in {
    from { opacity: 0; transform: translateY(-46%) translateX(50%); }
    to   { opacity: 1; transform: translateY(-50%) translateX(50%); }
  }
}
