/* cyberspace site styles — shared chrome lives in aero.css */

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--net-blue);
  cursor: default;
  user-select: none;
  touch-action: none;
  font-family: var(--xp-font);
  -webkit-font-smoothing: antialiased;
}

body.prompt-open .viewport {
  pointer-events: none;
}

/* ==========================================================================
   viewport
   ========================================================================== */
.viewport {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  overflow: hidden;
}

#net-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ==========================================================================
   hud: hint, radar, tooltip, toast
   ========================================================================== */
.hint {
  position: fixed;
  top: calc(1.1rem + var(--sat));
  left: 50%;
  z-index: 5;
  margin: 0;
  padding: 0.5rem 1.25rem;
  max-width: min(46rem, calc(100vw - 2rem));
  transform: translateX(-50%);
  text-align: center;
  color: #fff;
  font-size: 1.1rem;
  line-height: 1.15;
  text-shadow: 0 1px 3px rgba(0, 0, 90, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08) 55%, rgba(120, 150, 255, 0.14));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 6px 22px rgba(0, 0, 90, 0.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  pointer-events: none;
  transition: opacity 0.8s, transform 0.8s var(--ease-out);
}

.hint.is-faded {
  opacity: 0;
  transform: translate(-50%, -12px);
}

.radar {
  position: fixed;
  top: 50%;
  right: 1rem;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  width: 2.7rem;
  padding: 0.5rem 0.2rem;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05) 50%, rgba(255, 255, 255, 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 8px 24px rgba(0, 0, 90, 0.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  touch-action: manipulation;
}

#radar-canvas {
  display: block;
  width: 100%;
  height: min(30vh, 15rem);
}

.radar-label {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 90, 0.8);
}

.node-tip {
  position: fixed;
  z-index: 30;
  max-width: 17rem;
  padding: 0.55rem 0.8rem 0.6rem;
  transform: translate(-50%, calc(-100% - 22px));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(120, 190, 255, 0.55), rgba(42, 35, 153, 0.82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 10px 26px rgba(0, 0, 90, 0.5), 0 0 22px rgba(120, 210, 255, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.node-tip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 12px;
  height: 12px;
  transform: translateX(-50%) rotate(45deg);
  border-right: 1px solid rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(42, 35, 153, 0.9);
}

.node-tip b {
  display: block;
  font-size: 1.15rem;
  font-weight: 400;
  text-shadow: 0 1px 2px rgba(0, 0, 90, 0.8);
}

.node-tip span {
  display: block;
  margin-top: 0.15rem;
  font-size: 1rem;
  line-height: 1.15;
  opacity: 0.92;
}

.node-tip small {
  display: block;
  margin-top: 0.3rem;
  color: var(--glow);
  font-size: 0.85rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(5.6rem + var(--sab));
  z-index: 40;
  padding: 0.5rem 1.2rem;
  transform: translate(-50%, 16px);
  opacity: 0;
  color: #fff;
  font-size: 1.15rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(160, 255, 170, 0.5), rgba(10, 120, 40, 0.8));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 8px 24px rgba(0, 0, 70, 0.45), 0 0 20px rgba(83, 255, 20, 0.45);
  text-shadow: 0 1px 2px rgba(0, 50, 0, 0.8);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.4s var(--ease-out);
}

.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ==========================================================================
   dock
   ========================================================================== */
.dock {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + var(--sab));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.8rem;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.1) 55%, rgba(80, 130, 255, 0.2) 80%, rgba(255, 255, 255, 0.14));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 10px 30px rgba(0, 0, 90, 0.5), 0 0 30px rgba(100, 190, 255, 0.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  backdrop-filter: blur(12px) saturate(1.4);
}

.site-locked .dock,
.site-locked .radar,
.site-locked .shoutbox,
.site-locked .hint {
  visibility: hidden;
}

.dock-sep {
  width: 1px;
  height: 1.8rem;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.7), transparent);
}

.dock-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.7rem;
  height: 2.7rem;
  padding: 0;
  overflow: visible;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background:
    radial-gradient(120% 90% at 50% 8%, rgba(255, 255, 255, 0.8) 0 30%, rgba(255, 255, 255, 0) 31%),
    radial-gradient(circle at 50% 120%, #7fe8ff 0, #1b8cff 45%, #1236c8 100%);
  box-shadow: inset 0 -4px 8px rgba(0, 20, 140, 0.4), 0 4px 10px rgba(0, 0, 90, 0.45), 0 0 16px rgba(0, 200, 255, 0.35);
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s, filter 0.2s;
}

.dock-btn svg {
  position: relative;
  width: 1.35rem;
  height: 1.35rem;
  filter: drop-shadow(0 1px 2px rgba(0, 20, 120, 0.8));
}

.dock-btn:hover {
  transform: translateY(-5px) scale(1.12);
  filter: brightness(1.12);
  box-shadow: inset 0 -4px 8px rgba(0, 20, 140, 0.4), 0 10px 16px rgba(0, 0, 90, 0.45), 0 0 24px rgba(120, 240, 255, 0.85);
}

.dock-btn:active {
  transform: translateY(-1px) scale(1.02);
}

.dock-btn[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.45rem;
  width: 0.4rem;
  height: 0.4rem;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime);
}

.dock-btn:hover::before {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 0.65rem);
  left: 50%;
  padding: 0.25rem 0.7rem;
  transform: translateX(-50%);
  color: #fff;
  font-size: 1rem;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  background: rgba(20, 20, 140, 0.88);
  text-shadow: 0 1px 2px rgba(0, 0, 80, 0.8);
  pointer-events: none;
}

/* ==========================================================================
   welcome
   ========================================================================== */
.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: radial-gradient(ellipse at 50% 40%, rgba(0, 20, 120, 0.45), rgba(0, 0, 20, 0.78));
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  font-family: var(--xp-font);
  transition: opacity 0.7s, visibility 0.7s;
}

.welcome-overlay.is-dismissed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.welcome-overlay.is-dismissed .welcome-popup {
  transform: scale(1.08);
  opacity: 0;
}

.welcome-popup {
  width: min(900px, calc(100vw - 2.5rem));
  max-height: calc(100vh - 2rem);
  animation: win-in 0.7s var(--ease-out) both;
  transition: transform 0.7s var(--ease-out), opacity 0.6s;
}

.welcome-popup .aero-title-icon {
  width: 30px;
  height: 30px;
  animation: float 4s ease-in-out infinite;
}

.welcome-popup .aero-title {
  font-size: 1.5rem;
}

.welcome-popup .aero-body {
  overflow-y: auto;
}

@keyframes float {
  50% {
    transform: translateY(-3px) rotate(4deg);
  }
}

.welcome-copy {
  padding: 12px 18px 14px;
  font-size: clamp(1.15rem, 2.2vw, 1.7rem);
  line-height: 1.08;
  text-shadow: 0 1px 2px rgba(0, 0, 90, 0.5);
}

.welcome-copy p {
  margin: 0;
}

.welcome-copy p + p {
  margin-top: 0.72em;
}

.welcome-copy #welcome-title {
  font-size: 1.2em;
  text-shadow: 0 1px 2px rgba(0, 0, 100, 0.8), 0 0 14px rgba(160, 230, 255, 0.9);
}

.welcome-status {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0.7rem 0.1rem 0;
  font-size: 1.05rem;
}

.welcome-status > span {
  min-width: 0;
  opacity: 0.92;
}

.xp-progress {
  flex: none;
  width: min(11rem, 36%);
  height: 15px;
  padding: 2px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 8px;
  background: rgba(0, 0, 90, 0.35);
  box-shadow: inset 0 1px 3px rgba(0, 0, 60, 0.6);
}

.xp-progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 5px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 55%),
    repeating-linear-gradient(90deg, #44e24f 0 8px, transparent 8px 10px);
  animation: boot 1.3s 0.2s var(--ease-out) forwards;
}

@keyframes boot {
  to {
    width: 100%;
  }
}

.welcome-enter {
  display: flex;
  width: min(320px, 60%);
  min-height: 52px;
  margin: 12px auto 4px;
  font-size: clamp(1.3rem, 2.3vw, 1.8rem);
  animation: breathe 2.8s ease-in-out infinite;
}

@keyframes breathe {
  50% {
    box-shadow:
      inset 0 1px 1px rgba(255, 255, 255, 0.9),
      inset 0 -8px 12px rgba(255, 255, 255, 0.16),
      0 5px 14px rgba(0, 0, 70, 0.4),
      0 0 34px rgba(83, 255, 20, 0.9);
  }
}

@media (max-height: 650px) {
  .welcome-copy {
    font-size: clamp(0.95rem, 3.6vh, 1.4rem);
  }

  .welcome-enter {
    min-height: 42px;
    font-size: clamp(1rem, 3.6vh, 1.4rem);
  }
}

/* ==========================================================================
   shoutbox
   ========================================================================== */
.shoutbox {
  bottom: calc(1.25rem + var(--sab));
  left: 1.25rem;
  width: min(22rem, calc(100vw - 2rem));
  user-select: text;
}

.shoutbox.is-max {
  width: min(32rem, calc(100vw - 2rem));
}

.shoutbox.is-max .shoutbox-messages {
  height: min(44vh, 24rem);
}

.shoutbox.is-nudged {
  animation: nudge 0.55s linear;
}

@keyframes nudge {
  0%, 100% { transform: translate(0, 0); }
  12% { transform: translate(-9px, 3px) rotate(-0.6deg); }
  25% { transform: translate(8px, -3px) rotate(0.6deg); }
  37% { transform: translate(-7px, 2px); }
  50% { transform: translate(6px, -2px); }
  62% { transform: translate(-4px, 1px); }
  75% { transform: translate(3px, 0); }
}

.shoutbox-panel {
  display: flex;
  flex-direction: column;
  padding: 0.45rem 0.5rem 0.5rem;
}

.shoutbox-identity {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.35rem 0.5rem;
  align-items: start;
}

.shoutbox-avatar {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 90, 0.5));
}

.shoutbox-user {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.shoutbox-user label {
  font-size: 1.25rem;
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(0, 0, 90, 0.6);
}

.glass-input,
.shoutbox-user input,
.shoutbox-compose input,
.node-name-input,
.archive-tools input,
.archive-tools select {
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(0, 20, 150, 0.32), rgba(0, 200, 255, 0.2));
  box-shadow: inset 0 2px 5px rgba(0, 0, 90, 0.4), 0 1px 0 rgba(255, 255, 255, 0.3);
  color: #fff;
  font: inherit;
  outline: none;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.glass-input:focus,
.shoutbox-user input:focus,
.shoutbox-compose input:focus,
.node-name-input:focus,
.archive-tools input:focus,
.archive-tools select:focus,
.leave-node-prompt textarea:focus {
  border-color: #fff;
  box-shadow: inset 0 2px 5px rgba(0, 0, 90, 0.4), 0 0 0 2px rgba(0, 234, 255, 0.6), 0 0 14px rgba(0, 234, 255, 0.55);
}

::placeholder {
  color: rgba(255, 255, 255, 0.62);
}

.shoutbox-user input {
  width: 100%;
  max-width: 10.5rem;
  height: 1.4rem;
  padding: 0 0.4rem;
  font-size: 1.05rem;
}

.shoutbox-presence {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  padding-top: 0.1rem;
  text-align: right;
}

.shoutbox-presence span:last-child {
  font-size: 1rem;
  line-height: 1.1;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 90, 0.6);
}

/* glossy lime status orb */
.presence-orb {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background:
    radial-gradient(60% 45% at 50% 24%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 100%),
    radial-gradient(circle at 50% 110%, #b8ff6a, #2bd21a 55%, #0a8a14);
  box-shadow: 0 0 12px var(--lime), 0 0 3px #fff;
  animation: orb 2.4s ease-in-out infinite;
}

@keyframes orb {
  50% {
    box-shadow: 0 0 22px var(--lime), 0 0 3px #fff;
  }
}

.shoutbox-rule {
  display: block;
  width: 100%;
  height: 5px;
  margin: 0.4rem 0 0.25rem;
  object-fit: fill;
}

#shoutbox {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.shoutbox-messages {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  height: 14rem;
  margin: 0;
  padding: 0.4rem 0.45rem;
  overflow-y: auto;
  list-style: none;
  color: #fff;
  border-radius: 6px;
  background: rgba(5, 8, 110, 0.38);
  box-shadow: inset 0 2px 8px rgba(0, 0, 90, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.shoutbox-messages li {
  position: relative;
  z-index: 1;
  line-height: 1.2;
  word-break: break-word;
  animation: msg-in 0.35s var(--ease-out);
}

@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.shoutbox-messages li.is-me {
  padding-left: 0.55rem;
  border-left: 2px solid rgba(143, 234, 255, 0.85);
}

.shoutbox-messages li.is-nudge {
  color: var(--glow);
  font-style: italic;
  text-align: center;
}

.shoutbox-empty {
  position: relative;
  z-index: 1;
  margin: auto;
  padding: 0 1rem;
  text-align: center;
  font-size: 1.1rem;
  text-shadow: 0 1px 2px rgba(0, 0, 90, 0.7);
}

.shoutbox-line {
  margin: 0;
  font-size: 1.2rem;
  text-shadow: 0 1px 2px rgba(0, 0, 90, 0.55);
}

.shoutbox-line b {
  font-weight: 700;
}

.shoutbox-stamp {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.9rem;
  opacity: 0.85;
}

.shoutbox-compose {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.45rem;
  flex-shrink: 0;
}

.shoutbox-compose input {
  flex: 1;
  min-width: 0;
  height: 1.9rem;
  padding: 0 0.6rem;
  border-radius: 999px;
  font-size: 1.1rem;
}

.shoutbox-compose button {
  position: relative;
  isolation: isolate;
  flex: none;
  height: 1.9rem;
  padding: 0 0.75rem;
  overflow: hidden;
  color: #fff;
  font: inherit;
  font-size: 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  background: linear-gradient(180deg, #9dff94 0%, #22d93a 42%, #0b8c20 78%, #22d93a 100%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9), 0 3px 8px rgba(0, 0, 70, 0.35);
  text-shadow: 0 1px 2px rgba(0, 70, 10, 0.75);
  cursor: pointer;
}

.shoutbox-compose button.nudge-btn {
  width: 1.9rem;
  padding: 0;
  background: linear-gradient(180deg, #b6f4ff 0%, #2ab4ff 42%, #0868d8 78%, #2ab4ff 100%);
  text-shadow: 0 1px 2px rgba(0, 20, 110, 0.75);
}

.shoutbox-compose button::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -12%;
  right: -12%;
  top: -62%;
  height: 112%;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.2));
  pointer-events: none;
}

.shoutbox-compose button:hover {
  filter: brightness(1.1);
}

.shoutbox-compose button:active {
  filter: brightness(0.9);
}

.shoutbox-compose button:disabled {
  filter: grayscale(0.8) brightness(0.8);
  cursor: not-allowed;
}

/* ==========================================================================
   archive window
   ========================================================================== */
.archive {
  top: 4.4rem;
  left: 1.25rem;
  width: min(21rem, calc(100vw - 2rem));
}

@media (min-width: 1000px) {
  .archive {
    left: 24rem;
  }
}

.archive .aero-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.archive-tools {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem;
}

.archive-tools input,
.archive-tools select {
  height: 1.8rem;
  padding: 0 0.6rem;
  border-radius: 999px;
  font-size: 1.05rem;
}

.archive-tools select option {
  color: #000;
}

.archive-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.chip {
  min-width: 2rem;
  height: 1.7rem;
  padding: 0 0.6rem;
  color: #fff;
  font: inherit;
  font-size: 1.05rem;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.12) 60%, rgba(100, 140, 255, 0.25));
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.35);
}

.chip.is-on {
  color: #0a2bc8;
  text-shadow: none;
  background: linear-gradient(180deg, #fff, #bfeaff);
  box-shadow: 0 0 14px rgba(0, 234, 255, 0.85);
}

.archive-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-height: min(46vh, 24rem);
  margin: 0;
  padding: 0.15rem 0.2rem 0.15rem 0;
  overflow-y: auto;
  list-style: none;
}

.archive-item {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.2rem 0.5rem;
  align-items: center;
  width: 100%;
  padding: 0.4rem 0.5rem;
  color: #fff;
  font: inherit;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  background: var(--glass);
  cursor: pointer;
  transition: transform 0.15s var(--ease-out), background 0.15s, box-shadow 0.15s;
}

.archive-item:hover {
  transform: translateX(3px);
  background: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 16px rgba(143, 234, 255, 0.55);
}

.archive-glyph {
  grid-row: span 2;
  font-size: 1.6rem;
  text-align: center;
  color: var(--c, #fff);
  text-shadow: 0 0 10px var(--c, #fff);
}

.archive-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 1.05rem;
  line-height: 1;
}

.archive-meta time,
.archive-meta em {
  flex: none;
  font-size: 0.9rem;
  font-style: normal;
  opacity: 0.8;
}

.archive-snippet {
  overflow: hidden;
  font-size: 1rem;
  line-height: 1.1;
  opacity: 0.9;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-empty {
  padding: 1.2rem 0.5rem;
  text-align: center;
  font-size: 1.1rem;
  opacity: 0.85;
}

.archive-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 1.05rem;
}

/* ==========================================================================
   about
   ========================================================================== */
.about {
  top: 20vh;
  left: calc(50% - 15rem);
  width: min(30rem, calc(100vw - 2rem));
}

.about-copy {
  padding: 0.6rem 0.8rem;
  font-size: 1.25rem;
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(0, 0, 90, 0.5);
}

.about-copy p {
  margin: 0;
}

.about-copy p + p {
  margin-top: 0.5em;
}

.keys {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 0.8rem;
  margin: 0.6rem 0 0.1rem;
  font-size: 1.05rem;
}

.keys div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.keys dt,
.keys dd {
  margin: 0;
}

kbd {
  display: inline-block;
  min-width: 1.7rem;
  padding: 0.1rem 0.45rem;
  text-align: center;
  color: #0a2bc8;
  font: inherit;
  font-size: 0.95rem;
  border: 1px solid #fff;
  border-radius: 5px;
  background: linear-gradient(180deg, #fff, #bcd8ff);
  box-shadow: 0 2px 0 rgba(0, 0, 100, 0.45);
}

/* ==========================================================================
   dialogs (leave / read a node)
   ========================================================================== */
.memory-prompt {
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  color: #fff;
  font-family: var(--xp-font);
  user-select: text;
  touch-action: auto;
}

.memory-prompt[open] {
  animation: win-in 0.36s var(--ease-out);
}

.memory-prompt::backdrop {
  background: radial-gradient(ellipse at 50% 45%, rgba(0, 40, 200, 0.35), rgba(0, 0, 40, 0.6));
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.memory-prompt .aero-window {
  max-height: calc(100vh - 2rem);
  margin: 0;
}

.memory-prompt .aero-body {
  overflow-y: auto;
}

.read-glyph {
  flex: none;
  width: 22px;
  color: var(--nc, #fff);
  font-size: 1.5rem;
  line-height: 1;
  text-align: center;
  text-shadow: 0 0 10px var(--nc, #fff), 0 0 3px #fff;
}

/* read */
.read-node-prompt {
  width: min(540px, calc(100vw - 2rem));
}

.read-node-surface {
  min-height: 300px;
  padding: 10px 16px 16px;
}

.read-node-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.read-author {
  margin: 0;
  color: #fff;
  font-size: clamp(1.3rem, 4.5vw, 1.9rem);
  line-height: 0.98;
  text-align: right;
  word-break: break-word;
  text-shadow: 0 1px 2px rgba(0, 0, 90, 0.7), 0 0 12px rgba(150, 225, 255, 0.55);
}

.read-time {
  display: block;
  padding-top: 0.15rem;
  color: #fff;
  font-size: clamp(1rem, 3.2vw, 1.3rem);
  line-height: 1;
  opacity: 0.92;
}

.read-story {
  max-height: 250px;
  margin: 0.7rem 0 0;
  padding-right: 0.3rem;
  overflow-y: auto;
  color: #fff;
  font-size: clamp(1.3rem, 4.2vw, 1.8rem);
  line-height: 1.08;
  white-space: pre-wrap;
  word-break: break-word;
  text-shadow: 0 1px 2px rgba(0, 0, 90, 0.5);
}

.read-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.read-actions b {
  font-weight: 400;
  min-width: 1ch;
}

.read-node-done {
  display: flex;
  width: min(300px, 70%);
  min-height: 52px;
  margin: 0.7rem auto 0;
  font-size: clamp(1.4rem, 5vw, 2rem);
}

/* leave */
.leave-node-prompt {
  width: min(735px, calc(100vw - 2rem));
}

.leave-node-surface {
  padding: 10px 16px 16px;
}

.leave-node-prompt form {
  margin: 0;
}

.leave-node-intro {
  margin: 0 0 0.7rem;
  color: #fff;
  font-size: clamp(1.05rem, 2.5vw, 1.45rem);
  line-height: 1.07;
  text-shadow: 0 1px 2px rgba(0, 0, 90, 0.5);
}

.leave-node-layout {
  display: grid;
  grid-template-columns: minmax(0, 323px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.story-wrap {
  position: relative;
}

.leave-node-prompt textarea {
  display: block;
  width: 100%;
  height: 222px;
  margin: 0;
  padding: 10px 12px 24px;
  resize: none;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(0, 40, 200, 0.28), rgba(0, 234, 255, 0.24));
  box-shadow: inset 0 3px 8px rgba(0, 0, 100, 0.4);
  color: #fff;
  font: inherit;
  font-size: 1.2rem;
  line-height: 1.1;
  outline: none;
  user-select: text;
}

.story-count {
  position: absolute;
  right: 10px;
  bottom: 6px;
  font-size: 0.9rem;
  opacity: 0.8;
  pointer-events: none;
}

.story-count.is-near {
  color: #ffd27a;
  opacity: 1;
}

.leave-node-options {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.node-picker,
.colour-picker {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.node-picker legend,
.colour-picker legend,
.node-name-label {
  display: block;
  margin: 0;
  padding: 0;
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 90, 0.6);
}

.node-icon-list {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0.35rem 0 0.7rem;
}

.node-icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 2px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.1) 60%, rgba(100, 140, 255, 0.28));
  cursor: pointer;
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s, background 0.15s;
}

.node-icon-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 12px rgba(143, 234, 255, 0.8);
}

.node-icon-button img {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.node-icon-text {
  font-size: 1.5rem;
  line-height: 1;
}

.node-icon-button.is-selected {
  color: #0a2bc8;
  border-color: #fff;
  background: linear-gradient(180deg, #fff, #bfeaff);
  box-shadow: 0 0 16px rgba(0, 234, 255, 0.95);
}

.node-icon-button.is-selected img {
  filter: brightness(0) saturate(100%) invert(12%) sepia(100%) saturate(7000%) hue-rotate(236deg);
}

.colour-swatches {
  display: grid;
  grid-template-columns: repeat(6, minmax(26px, 1fr));
  gap: 6px;
  margin: 0.4rem 0 0.7rem;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: rgba(0, 0, 100, 0.2);
  box-shadow: inset 0 2px 5px rgba(0, 0, 90, 0.35);
}

.colour-swatch {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background:
    radial-gradient(70% 45% at 50% 24%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0)),
    var(--swatch);
  box-shadow: inset 0 -3px 5px rgba(0, 0, 80, 0.3), 0 2px 5px rgba(0, 0, 80, 0.4);
  cursor: pointer;
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s;
}

.colour-swatch:hover {
  transform: scale(1.12);
}

.colour-swatch.is-selected {
  transform: scale(1.1);
  box-shadow: 0 0 0 2px #0a2bc8, 0 0 0 4px #fff, 0 0 16px var(--swatch);
}

.name-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.8rem;
}

.node-name-label {
  margin-bottom: 0.35rem;
}

.node-name-input {
  width: min(179px, 100%);
  height: 30px;
  padding: 2px 12px;
  border-radius: 999px;
  font-size: 1.1rem;
}

.node-preview {
  display: grid;
  justify-items: center;
  gap: 0.1rem;
  min-width: 3.6rem;
}

.node-preview span {
  display: grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  color: var(--pc, #fff);
  font-size: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(0, 0, 255, 0.5), rgba(0, 0, 120, 0.7));
  box-shadow: inset 0 0 14px rgba(0, 0, 80, 0.7), 0 0 18px var(--pc, #fff);
  text-shadow: 0 0 12px var(--pc, #fff);
  transition: color 0.2s, box-shadow 0.2s, text-shadow 0.2s;
}

.node-preview small {
  font-size: 0.85rem;
  opacity: 0.8;
}

.publish-node {
  display: flex;
  width: min(333px, 60%);
  min-height: 58px;
  margin: 13px auto 2px;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
}

@media (max-width: 640px) {
  .leave-node-layout {
    grid-template-columns: 1fr;
  }

  .leave-node-prompt textarea {
    height: 140px;
  }

  .publish-node {
    width: 75%;
    min-height: 48px;
  }

  .read-node-surface {
    min-height: 240px;
  }

  .read-story {
    max-height: 190px;
  }
}

/* ==========================================================================
   small screens: windows tuck above the dock
   ========================================================================== */
@media (max-width: 760px) {
  .radar {
    right: 0.4rem;
    width: 2.2rem;
  }

  .shoutbox {
    bottom: calc(5.2rem + var(--sab));
    left: 0.75rem;
    width: min(22rem, calc(100vw - 4rem));
  }

  .shoutbox-messages {
    height: 9rem;
  }

  .archive {
    left: 0.75rem;
    top: 3.6rem;
  }

  .about {
    left: 0.75rem;
    top: 14vh;
  }

  .dock {
    gap: 0.35rem;
    padding: 0.4rem 0.55rem;
  }

  .dock-btn {
    width: 2.45rem;
    height: 2.45rem;
  }

  .hint {
    font-size: 0.95rem;
    top: 0.7rem;
  }

  .keys {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   ux additions
   ========================================================================== */

/* unread count on the shoutbox dock button */
.dock-badge {
  position: absolute;
  top: -0.3rem;
  right: -0.3rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.28rem;
  overflow: hidden;
  color: #fff;
  font-size: 0.8rem;
  line-height: 1.05rem;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background: radial-gradient(120% 100% at 50% 0%, #ff9a86, #e03a1e 60%, #a81f0c);
  box-shadow: 0 0 10px rgba(255, 90, 60, 0.9), 0 2px 4px rgba(0, 0, 60, 0.5);
  text-shadow: 0 1px 1px rgba(90, 0, 0, 0.8);
  animation: badge-pop 0.35s var(--ease-out);
}

@keyframes badge-pop {
  from {
    transform: scale(0.4);
  }
}

/* tooltips follow keyboard focus too, not only hover */
.dock-btn:focus-visible::before {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 0.65rem);
  left: 50%;
  padding: 0.25rem 0.7rem;
  transform: translateX(-50%);
  color: #fff;
  font-size: 1rem;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  background: rgba(20, 20, 140, 0.88);
  text-shadow: 0 1px 2px rgba(0, 0, 80, 0.8);
  pointer-events: none;
}

.publish-hint {
  margin: 0.35rem 0 0;
  color: #fff;
  font-size: 1rem;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 90, 0.7);
}

.publish-node:disabled {
  filter: grayscale(0.55) brightness(0.85);
  cursor: not-allowed;
  box-shadow: none;
}

/* fly pad: only where there is no scroll wheel (touch), in thumb reach above the dock */
.flypad {
  position: fixed;
  right: 0.7rem;
  bottom: calc(5.4rem + var(--sab));
  z-index: 9;
  display: none;
  flex-direction: column;
  gap: 0.6rem;
}

.site-locked .flypad {
  visibility: hidden;
}

@media (pointer: coarse) {
  .flypad {
    display: flex;
  }

  /* 44px minimum touch targets */
  .dock-btn,
  .node-icon-button,
  .chip {
    min-width: 44px;
    min-height: 44px;
  }

  .aero-btn {
    height: 28px;
  }

  .colour-swatch {
    min-width: 40px;
  }
}


/* ==========================================================================
   mobile + short screens
   ========================================================================== */

/* the dock is centred, so on anything narrower than a laptop the shoutbox sits above it */
@media (max-width: 1000px) {
  .shoutbox {
    bottom: calc(5.2rem + var(--sab));
    left: 0.75rem;
  }
}

/* landscape phones and other short viewports */
@media (max-height: 560px) {
  .shoutbox-messages {
    height: 6.5rem;
  }

  .archive {
    top: 2.6rem;
  }

  .archive-list {
    max-height: 22vh;
  }

  .aero-titlebar {
    min-height: 1.8rem;
  }

  .leave-node-prompt textarea {
    height: 110px;
  }

  .leave-node-intro {
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
  }

  .leave-node-surface,
  .read-node-surface {
    padding-block: 6px 10px;
  }

  .read-node-surface {
    min-height: 0;
  }

  .read-story {
    max-height: 30vh;
    font-size: 1.15rem;
  }

  .publish-node,
  .read-node-done {
    min-height: 44px;
    margin-top: 8px;
    font-size: 1.3rem;
  }

  .node-icon-list,
  .colour-swatches {
    margin-block: 0.2rem 0.35rem;
  }
}

/* on phones the form is one tall column: keep publish reachable while it scrolls */
@media (max-width: 640px) {
  .leave-node-prompt .publish-node {
    position: sticky;
    bottom: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* very short viewports (landscape phones): the prompt text gives way to the form */
@media (max-height: 460px) {
  .leave-node-intro {
    display: none;
  }
}
