@font-face {
  font-family: "Pixelify Sans";
  src: url("/fonts/pixelify-sans.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0a0d13;
  --surface: rgba(20, 24, 34, 0.94);
  --surface-2: rgba(28, 33, 45, 0.94);
  --edge: rgba(185, 202, 220, 0.13);
  --edge-strong: rgba(185, 202, 220, 0.25);
  --text: #e8edf4;
  --muted: #8994a5;
  --faint: #5d6675;
  --green: #8fe16c;
  --green-dark: #294b30;
  --violet: #8e82ff;
  --warning: #f2c45a;
  --danger: #ef6b70;
  --panel-shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
  font-family: "Pixelify Sans", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, textarea, select, a { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, canvas:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
[hidden] { display: none !important; }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.app-shell {
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-rows: 68px minmax(0, 1fr);
  background: #0d1119;
}

.topbar {
  position: relative;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--edge);
  background: rgba(13, 16, 24, 0.94);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}
.brand-stack {
  position: relative;
  width: 36px;
  height: 38px;
  filter: drop-shadow(0 6px 12px rgba(119, 224, 112, 0.2));
}
.brand-stack i {
  position: absolute;
  width: 19px;
  height: 19px;
  transform: rotate(30deg) skewY(-30deg) scaleY(.86);
  border: 1px solid rgba(255,255,255,.25);
  background: #78cf67;
}
.brand-stack i:nth-child(1) { top: 2px; left: 8px; background: #a0eb7d; }
.brand-stack i:nth-child(2) { top: 15px; left: 1px; background: #4d9d55; }
.brand-stack i:nth-child(3) { top: 15px; left: 15px; background: #347c48; }
.brand-copy { display: grid; line-height: 1; }
.brand-copy strong { font-size: 19px; font-weight: 850; letter-spacing: -.6px; }
.brand-copy strong span { color: var(--green); }
.brand-copy small {
  margin-top: 6px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.65px;
}

.world-summary {
  display: flex;
  height: 46px;
  align-items: center;
  gap: 17px;
  padding: 0 18px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 13px;
  background: rgba(255,255,255,.025);
}
.summary-item { display: flex; align-items: center; gap: 9px; }
.summary-item > span:last-child { display: grid; gap: 3px; }
.summary-item small {
  color: var(--faint);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 1.2px;
}
.summary-item strong { color: #cdd5df; font-size: 14px; font-weight: 750; }
.summary-divider { width: 1px; height: 24px; background: var(--edge); }
.summary-icon {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: #7e8da1;
}
.plot-icon {
  border: 1px solid #6f7c8f;
  transform: rotate(30deg) skewY(-30deg) scale(.7);
  background: rgba(143,225,108,.12);
  box-shadow: inset 0 0 0 5px rgba(143,225,108,.06);
}
.block-icon::before {
  content: "";
  width: 15px;
  height: 15px;
  transform: rotate(30deg) skewY(-30deg);
  border: 1px solid #9c8cff;
  background: rgba(142,130,255,.25);
}
.world-icon { font-size: 24px; }

.top-actions { justify-self: end; display: flex; align-items: center; gap: 9px; }
.live-builders {
  display: flex;
  height: 34px;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--edge);
  border-radius: 9px;
  background: rgba(255,255,255,.025);
}
.live-builders > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(143,225,108,.7);
}
.live-builders b { color: #cad5ca; font-size: 13px; }
.live-builders small { color: var(--faint); font-size: 9px; font-weight: 850; letter-spacing: 1px; }
.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--edge);
  border-radius: 9px;
  background: rgba(255,255,255,.025);
  cursor: pointer;
}
.icon-button:hover { border-color: var(--edge-strong); background: rgba(255,255,255,.055); }
.icon-button svg {
  width: 17px;
  fill: none;
  stroke: #8996a7;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sync-state {
  display: flex;
  height: 34px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid rgba(143,225,108,.13);
  border-radius: 9px;
  color: #84928a;
  background: rgba(143,225,108,.035);
  font-size: 11px;
  font-weight: 750;
}
.sync-dot { width: 6px; height: 6px; border-radius: 50%; background: #6b7482; }
.sync-state[data-status="online"] .sync-dot { background: var(--green); box-shadow: 0 0 8px rgba(143,225,108,.65); }
.sync-state[data-status="saving"] .sync-dot,
.sync-state[data-status="connecting"] .sync-dot { background: var(--warning); animation: pulse 1s infinite; }
.sync-state[data-status="offline"] .sync-dot,
.sync-state[data-status="error"] .sync-dot { background: var(--danger); }

.world-shell { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.world-stage { position: absolute; inset: 0; overflow: hidden; background: #0b0e15; }
#worldCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: default;
  touch-action: none;
}
#worldCanvas[data-dragging="true"] { cursor: grabbing; }
.world-haze {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 20%, rgba(111,102,209,.08), transparent 42%),
    linear-gradient(180deg, rgba(10,13,19,0), rgba(5,7,10,.24));
}
.world-grid-glow {
  position: absolute;
  right: 8%;
  bottom: 7%;
  width: 360px;
  height: 220px;
  pointer-events: none;
  opacity: .09;
  transform: rotate(-9deg);
  background: repeating-linear-gradient(90deg, transparent 0 28px, #8fe16c 29px 30px);
  mask-image: radial-gradient(ellipse, #000, transparent 70%);
}
.world-status {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  transform: translate(-50%,-50%);
  border: 1px solid var(--edge);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(13,17,24,.92);
  font-size: 13px;
  transition: opacity .25s, visibility .25s;
}
.world-status.is-hidden { visibility: hidden; opacity: 0; }
.status-spinner {
  width: 13px;
  height: 13px;
  border: 2px solid #46505e;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.plot-chip {
  position: absolute;
  top: 17px;
  left: 50%;
  display: flex;
  height: 45px;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  transform: translateX(-50%);
  border: 1px solid var(--edge);
  border-radius: 11px;
  background: rgba(16,20,28,.84);
  box-shadow: 0 8px 25px rgba(0,0,0,.2);
  backdrop-filter: blur(13px);
}
.plot-chip-swatch {
  width: 15px;
  height: 15px;
  transform: rotate(30deg) skewY(-30deg);
  border: 1px solid rgba(255,255,255,.25);
  background: var(--green-dark);
}
.plot-chip > span:nth-child(2) { display: grid; gap: 3px; }
.plot-chip small { color: var(--faint); font-size: 9px; font-weight: 850; letter-spacing: 1.2px; }
.plot-chip strong { color: #d0d7e1; font-size: 12px; letter-spacing: .3px; }
.plot-chip > b {
  margin-left: 4px;
  padding: 4px 6px;
  border-radius: 5px;
  color: #9fd799;
  background: rgba(143,225,108,.09);
  font-size: 9px;
  letter-spacing: .8px;
}
.camera-hint {
  position: absolute;
  right: 19px;
  bottom: 77px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #616c7b;
  font-size: 11px;
}
kbd {
  display: inline-grid;
  min-width: 25px;
  height: 21px;
  padding: 0 5px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.13);
  border-bottom-color: rgba(255,255,255,.22);
  border-radius: 5px;
  color: #8d98a8;
  background: rgba(255,255,255,.045);
  font: 750 10px var(--pixel-font, "Pixelify Sans", ui-monospace, monospace);
}
.zoom-controls {
  position: absolute;
  right: 19px;
  bottom: 25px;
  display: flex;
  height: 36px;
  align-items: center;
  border: 1px solid var(--edge);
  border-radius: 9px;
  background: rgba(16,20,28,.84);
  overflow: hidden;
}
.zoom-controls, .plot-chip, .camera-hint { z-index: 10; }
.zoom-controls button {
  width: 34px;
  height: 100%;
  border: 0;
  background: transparent;
  color: #8592a3;
  cursor: pointer;
}
.zoom-controls button:hover { color: #fff; background: rgba(255,255,255,.05); }
.zoom-controls span {
  display: grid;
  width: 48px;
  height: 100%;
  place-items: center;
  border-inline: 1px solid var(--edge);
  color: #687385;
  font: 700 10px var(--pixel-font, "Pixelify Sans", ui-monospace, monospace);
}
.panel-rail {
  position: absolute;
  z-index: 12;
  top: 19px;
  left: 18px;
  display: grid;
  gap: 9px;
}
.panel-tile {
  position: relative;
  display: grid;
  width: 58px;
  height: 58px;
  padding: 5px 3px;
  grid-template-rows: 1fr auto;
  place-items: center;
  border: 1px solid var(--edge);
  border-radius: 12px;
  color: #697587;
  background: rgba(16,20,28,.88);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: border-color .2s, color .2s, transform .2s;
}
.panel-tile:hover { transform: translateY(-1px); border-color: var(--edge-strong); color: #aab5c4; }
.panel-tile.is-active {
  border-color: rgba(143,225,108,.35);
  color: #cce7c9;
  background: rgba(31,45,36,.94);
}
.panel-tile > .panel-tile-icon + span { font-size: 9px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; }
.panel-tile-icon { position: relative; display: grid; width: 26px; height: 26px; place-items: center; }
.blocks-tool i {
  position: absolute;
  width: 12px;
  height: 12px;
  transform: rotate(30deg) skewY(-30deg);
  background: currentColor;
  opacity: .85;
}
.blocks-tool i:nth-child(1) { top: 2px; }
.blocks-tool i:nth-child(2) { bottom: 1px; left: 2px; opacity: .55; }
.blocks-tool i:nth-child(3) { right: 2px; bottom: 1px; opacity: .35; }
.plots-tool i { width: 21px; height: 16px; transform: rotate(30deg) skewY(-30deg); border: 1px solid currentColor; }
.objectives-tool { display: grid; align-content: center; gap: 3px; }
.objectives-tool i { position: relative; display: block; width: 18px; height: 2px; margin-left: 5px; border-radius: 2px; background: currentColor; opacity: .75; }
.objectives-tool i::before { content: ""; position: absolute; top: -1px; left: -5px; width: 3px; height: 3px; border: 1px solid currentColor; border-radius: 1px; }
.foreman-tool { color: #a89eff; font-size: 22px; }
.panel-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  place-items: center;
  border: 2px solid #10141c;
  border-radius: 9px;
  color: #192217;
  background: var(--green);
  font-size: 9px;
}

.panel-host { position: absolute; z-index: 11; top: 19px; left: 88px; bottom: 88px; pointer-events: none; }
.game-panel {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  width: 300px;
  max-height: 100%;
  min-height: 0;
  flex-direction: column;
  border: 1px solid var(--edge);
  border-radius: 15px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-16px) scale(.97);
  transform-origin: left top;
  background: var(--surface);
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(18px);
  transition: opacity .2s, transform .25s cubic-bezier(.2,.8,.2,1), visibility 0s .25s;
}
.game-panel.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: none;
  transition-delay: 0s;
}
.panel-header {
  display: flex;
  min-height: 59px;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--edge);
  background: linear-gradient(110deg, rgba(255,255,255,.025), transparent 60%);
}
.panel-header > div:not(.foreman-avatar) { display: grid; gap: 4px; min-width: 0; }
.panel-header strong { color: #d7dee8; font-size: 14px; }
.panel-kicker { color: #667286; font-size: 9px; font-weight: 850; letter-spacing: 1.3px; }
.panel-shortcut, .registry-mark { margin-left: auto; color: #617080; }
.panel-content { min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: #343c49 transparent; }
.build-content { padding: 14px; }
.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid var(--edge);
  border-radius: 9px;
  background: rgba(4,7,11,.28);
}
.mode-switch button {
  height: 35px;
  border: 0;
  border-radius: 6px;
  color: #6e798a;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.mode-switch button.is-active { color: #d8ead4; background: rgba(143,225,108,.12); box-shadow: inset 0 0 0 1px rgba(143,225,108,.16); }
.mode-plus, .mode-minus { margin-right: 4px; color: var(--green); font-size: 13px; }
.mode-switch button:last-child.is-active { color: #f1c0c0; background: rgba(239,107,112,.1); }
.mode-switch button:last-child .mode-minus { color: var(--danger); }
.tool-section-heading { display: flex; align-items: center; gap: 8px; margin: 18px 0 10px; }
.tool-section-heading > span { color: #606b7d; font-size: 9px; font-weight: 850; letter-spacing: 1.2px; }
.tool-section-heading i { height: 1px; flex: 1; background: var(--edge); }
.tool-section-heading small { color: #8894a5; font-size: 10px; }
.color-palette { display: grid; grid-template-columns: repeat(8, 1fr); gap: 7px; }
.color-palette button {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 7px;
  background: var(--swatch);
  box-shadow: inset 0 -6px 10px rgba(0,0,0,.15);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.color-palette button:hover { transform: translateY(-2px); }
.color-palette button.is-active {
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 0 0 2px #111620, 0 0 0 3px rgba(255,255,255,.65), inset 0 -6px 10px rgba(0,0,0,.15);
}
.build-note, .road-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 11px;
  border: 1px solid rgba(142,130,255,.13);
  border-radius: 9px;
  background: rgba(142,130,255,.045);
}
.build-note-icon { display: grid; width: 28px; height: 28px; place-items: center; color: #a69cff; font-size: 20px; }
.build-note p, .road-note p { display: grid; gap: 3px; margin: 0; }
.build-note strong, .road-note strong { color: #b8c1ce; font-size: 11px; }
.build-note small, .road-note small { color: #667184; font-size: 10px; line-height: 1.4; }
.panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 15px -14px -14px;
  padding: 11px 14px;
  border-top: 1px solid var(--edge);
  color: #667184;
  font-size: 9px;
}
.panel-footer > span { display: flex; align-items: center; gap: 7px; }
.footer-swatch { width: 9px; height: 9px; border-radius: 3px; background: #ef5b5b; }
.panel-footer b { color: #8691a1; letter-spacing: .7px; }

.plots-content { padding: 14px; }
.selected-plot-card {
  display: grid;
  grid-template-columns: 47px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid rgba(143,225,108,.16);
  border-radius: 11px;
  background: rgba(143,225,108,.045);
}
.selected-plot-visual {
  position: relative;
  display: grid;
  width: 45px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: #17211b;
  overflow: hidden;
}
.selected-plot-visual span { position: absolute; inset: 9px; transform: rotate(30deg) skewY(-30deg); border: 1px solid #5a7561; }
.selected-plot-visual b { position: relative; color: #a9d3aa; font-size: 9px; }
.selected-plot-copy { display: grid; gap: 3px; min-width: 0; }
.selected-plot-copy > span { color: #6f7a8a; font-size: 8px; font-weight: 850; letter-spacing: 1px; }
.selected-plot-copy strong { overflow: hidden; color: #d0d8e3; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.selected-plot-copy small { color: #667184; font-size: 9px; }
.claim-state { padding: 4px 6px; border-radius: 5px; color: #95ce90; background: rgba(143,225,108,.08); font-size: 8px; font-weight: 850; letter-spacing: .6px; }
.selected-plot-card[data-state="visited"] { border-color: rgba(142,130,255,.17); background: rgba(142,130,255,.045); }
.selected-plot-card[data-state="visited"] .claim-state { color: #aaa2ef; background: rgba(142,130,255,.09); }
.plot-description { margin: 13px 2px; color: #7a8596; font-size: 11px; line-height: 1.55; }
.claim-button, .home-button {
  display: flex;
  width: 100%;
  align-items: center;
  border-radius: 9px;
  cursor: pointer;
}
.claim-button {
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid rgba(143,225,108,.22);
  color: #183019;
  background: var(--green);
}
.claim-button span { font-size: 12px; font-weight: 850; }
.claim-button small { margin-left: 8px; opacity: .6; font-size: 9px; }
.claim-button b { margin-left: auto; }
.home-button {
  justify-content: center;
  gap: 7px;
  height: 38px;
  border: 1px solid var(--edge);
  color: #8e99a8;
  background: rgba(255,255,255,.025);
  font-size: 10px;
  font-weight: 750;
}
.home-button:hover { color: #d4dde7; border-color: var(--edge-strong); }
.owned-plot-list { display: grid; gap: 7px; }
.owned-plot-item {
  display: grid;
  width: 100%;
  height: 48px;
  grid-template-columns: 31px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border: 1px solid var(--edge);
  border-radius: 9px;
  color: #7d8998;
  background: rgba(255,255,255,.02);
  text-align: left;
  cursor: pointer;
}
.owned-plot-item > span:first-child { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 7px; color: #9cd995; background: rgba(143,225,108,.08); }
.owned-plot-item > span:nth-child(2) { display: grid; gap: 2px; }
.owned-plot-item strong { color: #c0cad5; font-size: 11px; }
.owned-plot-item small { color: #646f7e; font-size: 9px; }
.owned-plot-item b { color: #687483; font: 750 10px var(--pixel-font, "Pixelify Sans", ui-monospace, monospace); }
.owned-empty { margin: 0; color: #697485; font-size: 11px; }
.road-note { border-color: var(--edge); background: rgba(255,255,255,.02); }
.road-note > span { color: #6f7b8b; }

.objectives-panel { width: 315px; }
.objective-total { margin-left: auto; color: #8e99a9; font: 750 10px var(--pixel-font, "Pixelify Sans", ui-monospace, monospace); }
.objectives-content { padding: 14px; }
.objective-intro {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 9px;
  margin-bottom: 13px;
  padding: 11px;
  border: 1px solid rgba(142,130,255,.16);
  border-radius: 10px;
  background: rgba(142,130,255,.045);
}
.objective-intro > span { display: grid; width: 28px; height: 28px; place-items: center; color: #aaa2ef; font-size: 18px; }
.objective-intro p, .objective-item p { display: grid; gap: 3px; margin: 0; }
.objective-intro strong { color: #c7cfdb; font-size: 11px; }
.objective-intro small { color: #687385; font-size: 9px; }
.objective-list { display: grid; gap: 7px; }
.objective-item {
  display: grid;
  min-height: 50px;
  grid-template-columns: 27px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--edge);
  border-radius: 9px;
  background: rgba(255,255,255,.018);
  transition: border-color .2s, background .2s, opacity .2s;
}
.objective-item > span { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid #485363; border-radius: 50%; color: #192217; font-size: 12px; font-weight: 900; }
.objective-item strong { color: #aeb8c5; font-size: 11px; }
.objective-item small { color: #626d7d; font-size: 9px; }
.objective-item.is-complete { border-color: rgba(143,225,108,.13); background: rgba(143,225,108,.035); opacity: .72; }
.objective-item.is-complete > span { border-color: var(--green); background: var(--green); }
.objective-item.is-complete strong { color: #91a98e; text-decoration: line-through; }

.foreman-panel { width: 335px; }
.foreman-header { min-height: 65px; }
.foreman-avatar { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(142,130,255,.2); border-radius: 9px; color: #a69cff; background: rgba(142,130,255,.07); }
.readonly-badge { margin-left: auto; padding: 4px 6px; border: 1px solid var(--edge); border-radius: 5px; color: #626d7c; font-size: 8px; letter-spacing: .8px; }
.foreman-content { padding: 13px; }
.mcp-status-card {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: rgba(255,255,255,.02);
}
.mcp-status-light { width: 8px; height: 8px; border-radius: 50%; background: #58616f; }
.mcp-status-card[data-status="connected"] .mcp-status-light { background: var(--green); box-shadow: 0 0 10px rgba(143,225,108,.7); }
.mcp-status-card[data-status="waiting"] .mcp-status-light { background: var(--warning); animation: pulse 1.2s infinite; }
.mcp-status-card[data-status="setup"] .mcp-status-light { background: var(--warning); }
.mcp-status-card > div { display: grid; gap: 3px; min-width: 0; }
.mcp-status-card strong { color: #bdc6d2; font-size: 11px; }
.mcp-status-card small { overflow: hidden; color: #667182; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.connect-mcp {
  display: flex;
  height: 29px;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  border: 1px solid rgba(142,130,255,.2);
  border-radius: 7px;
  color: #b1aaf4;
  background: rgba(142,130,255,.07);
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}
.connect-mcp:disabled { cursor: default; opacity: .58; }
.mcp-setup {
  margin-top: 9px;
  padding: 11px;
  border: 1px solid rgba(242,196,90,.14);
  border-radius: 9px;
  background: rgba(242,196,90,.035);
}
.mcp-setup p { margin: 0 0 9px; color: #8a8491; font-size: 10px; line-height: 1.45; }
.connector-actions { display: flex; gap: 6px; }
.connector-actions a, .connector-actions button {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--edge);
  border-radius: 6px;
  color: #929dab;
  background: rgba(255,255,255,.025);
  font-size: 9px;
  text-decoration: none;
  cursor: pointer;
}
.connector-actions a { color: #b7aff4; border-color: rgba(142,130,255,.18); }
.mcp-setup > small { display: block; margin-top: 8px; color: #5f6978; font-size: 9px; line-height: 1.4; }
.feed-heading { display: flex; align-items: center; gap: 8px; margin: 15px 0 9px; }
.feed-heading span { color: #606b7c; font-size: 9px; font-weight: 850; letter-spacing: 1.2px; }
.feed-heading i { height: 1px; flex: 1; background: var(--edge); }
.feed-heading b { color: #6d956b; font-size: 8px; letter-spacing: .8px; }
.mcp-feed { display: grid; gap: 7px; max-height: 300px; overflow: auto; }
.mcp-empty { display: grid; min-height: 125px; place-content: center; justify-items: center; text-align: center; }
.mcp-empty > span { color: #8278d3; font-size: 24px; }
.mcp-empty strong { margin-top: 6px; color: #8994a4; font-size: 11px; }
.mcp-empty p { width: 200px; margin: 5px 0 0; color: #5f6978; font-size: 10px; line-height: 1.45; }
.feed-entry {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: start;
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 8px;
  background: rgba(255,255,255,.018);
}
.feed-dot { width: 6px; height: 6px; margin-top: 3px; border-radius: 50%; background: #6b7481; }
.feed-dot.success, .feed-dot.connected { background: var(--green); }
.feed-dot.error { background: var(--danger); }
.feed-dot.working, .feed-dot.waiting { background: var(--warning); }
.feed-entry div { display: grid; gap: 3px; }
.feed-entry strong { color: #929dab; font-size: 10px; }
.feed-entry p { margin: 0; color: #667181; font-size: 9px; line-height: 1.4; }
.feed-entry time { color: #505a68; font: 650 8px var(--pixel-font, "Pixelify Sans", ui-monospace, monospace); }

.mods-panel { width: 335px; }
.mods-content { padding: 13px; }
.mods-list { display: grid; gap: 7px; max-height: 440px; overflow: auto; }
.mod-entry {
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 8px;
  background: rgba(255,255,255,.018);
  text-align: left;
  cursor: pointer;
}
.mod-entry:hover { border-color: rgba(142,130,255,.28); background: rgba(142,130,255,.05); }
.mod-entry strong { color: #929dab; font-size: 11px; }
.mod-entry small { color: #626d7c; font-size: 8px; letter-spacing: .4px; }
.mod-entry p { margin: 2px 0 0; overflow: hidden; color: #667181; font-size: 9px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.mod-back { margin-bottom: 11px; padding: 6px 9px; border: 1px solid var(--edge); border-radius: 6px; color: #8994a4; background: rgba(255,255,255,.02); font-size: 9px; cursor: pointer; }
.mod-back:hover { border-color: rgba(142,130,255,.28); color: #b1aaf4; }
.mod-detail-head { display: grid; gap: 5px; margin-bottom: 9px; }
.mod-detail-head strong { color: #bdc6d2; font-size: 13px; }
.mod-detail-head small { color: #626d7c; font-size: 9px; word-break: break-word; }
.mod-detail-desc { margin: 0 0 13px; color: #7d8794; font-size: 10px; line-height: 1.5; }
.mod-markdown {
  margin: 0;
  padding: 11px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--edge);
  border-radius: 8px;
  color: #9aa4b2;
  font: 500 10px/1.55 var(--pixel-font, ui-monospace, monospace);
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(255,255,255,.015);
}

.selection-tray {
  position: absolute;
  z-index: 10;
  bottom: 20px;
  left: 50%;
  width: min(760px, calc(100% - 320px));
  min-height: 55px;
  transform: translateX(-50%);
  border: 1px solid var(--edge);
  border-radius: 13px;
  background: rgba(16,20,28,.88);
  box-shadow: 0 13px 35px rgba(0,0,0,.28);
  backdrop-filter: blur(14px);
  transition: width .28s cubic-bezier(.2,.8,.2,1), min-height .28s cubic-bezier(.2,.8,.2,1), border-radius .28s, transform .28s;
}
.selection-tray.is-empty { width: 210px; min-height: 38px; border-radius: 20px; }
.selection-empty, .selection-content { animation: trayContentIn .22s ease both; }
.selection-empty { display: flex; min-height: 36px; align-items: center; justify-content: center; gap: 8px; }
.selection-empty > span { color: #677384; font-size: 16px; }
.selection-empty p { display: grid; gap: 2px; margin: 0; }
.selection-empty strong { color: #838e9e; font-size: 10px; }
.selection-empty small { color: #596371; font-size: 9px; }
.selection-content {
  display: grid;
  min-height: 54px;
  grid-template-columns: 32px 1fr auto 30px;
  align-items: center;
  gap: 10px;
  padding: 7px 8px 7px 12px;
}
.selection-color { width: 25px; height: 25px; transform: rotate(30deg) skewY(-30deg); border: 1px solid rgba(255,255,255,.22); background: #6c63ff; }
.selection-content > div { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 9px; }
.selection-content small { color: #647081; font-size: 8px; font-weight: 850; letter-spacing: 1px; }
.selection-content strong { color: #c6cfda; font-size: 12px; }
.selection-content span { grid-column: 1 / -1; color: #687384; font-size: 9px; }
.selection-content button {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--edge);
  border-radius: 7px;
  color: #8d98a7;
  background: rgba(255,255,255,.025);
  font-size: 9px;
  cursor: pointer;
}
.selection-content .close-selection { width: 28px; padding: 0; border: 0; background: transparent; color: #616c7a; font-size: 16px; }

.toast-stack { position: absolute; z-index: 50; top: 75px; right: 18px; display: grid; gap: 7px; pointer-events: none; }
.toast {
  max-width: 300px;
  padding: 10px 12px;
  transform: translateX(15px);
  border: 1px solid var(--edge);
  border-left: 3px solid #7f8a99;
  border-radius: 8px;
  opacity: 0;
  color: #aeb8c5;
  background: rgba(17,21,29,.96);
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
  font-size: 11px;
  transition: opacity .2s, transform .2s;
}
.toast.is-visible { opacity: 1; transform: none; }
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--danger); }

.onboarding {
  width: min(790px, calc(100% - 32px));
  padding: 0;
  grid-template-columns: .95fr 1.05fr;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 20px;
  color: var(--text);
  background: #121721;
  box-shadow: 0 35px 100px rgba(0,0,0,.65);
  overflow: hidden;
}
.onboarding[open] { display: grid; animation: dialogIn .3s cubic-bezier(.2,.8,.2,1); }
.onboarding::backdrop { background: rgba(3,5,8,.77); backdrop-filter: blur(8px); }
.onboarding-world {
  position: relative;
  min-height: 450px;
  background:
    radial-gradient(circle at 40% 18%, rgba(142,130,255,.35), transparent 22%),
    linear-gradient(155deg, #252941, #101621 64%);
  overflow: hidden;
}
.onboarding-world::after {
  content: "";
  position: absolute;
  right: -20%;
  bottom: -16%;
  left: -20%;
  height: 64%;
  transform: rotate(-8deg);
  background:
    linear-gradient(30deg, transparent 49%, rgba(143,225,108,.14) 50% 51%, transparent 52%),
    linear-gradient(-30deg, transparent 49%, rgba(143,225,108,.1) 50% 51%, transparent 52%),
    #18221d;
  background-size: 38px 22px;
}
.onboarding-sun { position: absolute; top: 56px; left: 62px; width: 62px; height: 62px; border-radius: 50%; background: #978cff; box-shadow: 0 0 65px rgba(142,130,255,.55); }
.onboarding-cubes { position: absolute; z-index: 2; right: 60px; bottom: 93px; width: 190px; height: 180px; }
.onboarding-cubes i {
  position: absolute;
  width: 54px;
  height: 54px;
  transform: rotate(30deg) skewY(-30deg);
  border: 1px solid rgba(255,255,255,.3);
  background: #ef6b70;
  box-shadow: 12px 18px 0 rgba(0,0,0,.17);
}
.onboarding-cubes i:nth-child(1) { left: 15px; bottom: 15px; background: #ef6b70; }
.onboarding-cubes i:nth-child(2) { left: 73px; bottom: 15px; background: #f3c94f; }
.onboarding-cubes i:nth-child(3) { left: 131px; bottom: 15px; background: #5eb8e8; }
.onboarding-cubes i:nth-child(4) { left: 44px; bottom: 63px; background: #4fae72; }
.onboarding-cubes i:nth-child(5) { left: 102px; bottom: 63px; background: #855ec8; }
.onboarding-cubes i:nth-child(6) { left: 73px; bottom: 111px; background: #ed82ad; }
.onboarding-cubes i:nth-child(7) { left: 15px; bottom: 111px; width: 34px; height: 34px; background: #f08b3e; }
.onboarding-copy { padding: 48px 43px 35px; }
.welcome-label { color: var(--green); font-size: 10px; font-weight: 900; letter-spacing: 1.8px; }
.onboarding h1 { margin: 13px 0 15px; color: #eef2f6; font-size: clamp(27px, 4vw, 39px); line-height: 1.08; letter-spacing: -1.7px; }
.onboarding h1 em { color: #9f96f0; font-style: normal; }
.onboarding-copy > p { margin: 0; color: #8792a2; font-size: 13px; line-height: 1.65; }
.onboarding-steps { display: grid; gap: 9px; margin: 25px 0; }
.onboarding-steps > div { display: grid; grid-template-columns: 39px 1fr; align-items: center; gap: 10px; }
.onboarding-steps span { display: grid; gap: 2px; }
.onboarding-steps strong { color: #b9c2ce; font-size: 11px; }
.onboarding-steps small { color: #667181; font-size: 10px; }
.start-button {
  display: flex;
  width: 100%;
  height: 47px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  border-radius: 10px;
  color: #193019;
  background: var(--green);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(143,225,108,.13);
}
.start-button:hover { filter: brightness(1.06); }
.skip-onboarding { display: flex; justify-content: center; align-items: center; gap: 7px; margin-top: 13px; color: #667181; font-size: 10px; }
.skip-onboarding input { accent-color: var(--green); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes dialogIn { from { transform: translateY(18px) scale(.98); opacity: 0; } }
@keyframes trayContentIn { from { opacity: 0; transform: translateY(3px); } }

@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr auto; }
  .world-summary { display: none; }
  .optional-summary, .live-builders { display: none; }
  .panel-host { right: 82px; }
  .game-panel { width: min(300px, calc(100vw - 118px)); }
  .foreman-panel { width: min(335px, calc(100vw - 118px)); }
  .selection-tray { width: calc(100% - 180px); }
  .onboarding-world { min-height: 390px; }
}

@media (max-width: 640px) {
  .app-shell { grid-template-rows: 58px minmax(0,1fr); }
  .topbar { padding: 0 11px; }
  .brand-stack { transform: scale(.83); transform-origin: left center; }
  .brand-copy small { display: none; }
  .brand-copy strong { font-size: 17px; }
  .sync-state { display: none; }
  .top-actions { gap: 6px; }
  .icon-button { width: 34px; height: 34px; }
  .panel-rail { top: 11px; left: 9px; gap: 7px; }
  .panel-tile { width: 50px; height: 50px; border-radius: 10px; }
  .panel-host { top: 11px; right: 68px; bottom: 74px; left: 68px; }
  .game-panel, .foreman-panel { width: calc(100vw - 90px); max-height: calc(100vh - 155px); }
  .plot-chip { top: 10px; left: auto; right: 9px; transform: none; }
  .plot-chip-swatch, .plot-chip > b { display: none; }
  .camera-hint { display: none; }
  .zoom-controls { right: 10px; bottom: 75px; }
  .selection-tray { bottom: 10px; width: calc(100% - 88px); }
  .selection-tray.is-empty { width: 180px; }
  .selection-content { grid-template-columns: 27px 1fr 26px; }
  .selection-content #selectionAction { display: none; }
  .onboarding[open] { grid-template-columns: 1fr; }
  .onboarding-world { min-height: 180px; }
  .onboarding-sun { top: 25px; left: 30px; width: 40px; height: 40px; }
  .onboarding-cubes { right: 40px; bottom: 10px; transform: scale(.64); transform-origin: right bottom; }
  .onboarding-copy { padding: 27px 24px 24px; }
  .onboarding h1 { margin: 9px 0 11px; font-size: 27px; }
  .onboarding-copy > p { font-size: 12px; }
  .onboarding-steps { margin: 17px 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* Voxel material skin ----------------------------------------------------- */
:root {
  --bg: #17120c;
  --surface: #332c22;
  --surface-2: #40372a;
  --edge: #675741;
  --edge-strong: #a1845c;
  --text: #f4e8ca;
  --muted: #b7a789;
  --faint: #81725b;
  --green: #8fb35c;
  --green-dark: #3e6036;
  --violet: #b48a58;
  --warning: #ddb85d;
  --danger: #c85d48;
  --wood: #65472e;
  --wood-light: #82603e;
  --stone: #4b4941;
  --stone-dark: #302f2b;
  --dirt: #664a32;
  --panel-shadow: 6px 7px 0 rgba(13, 9, 5, .72), 0 16px 32px rgba(0, 0, 0, .25);
  --pixel-font: "Pixelify Sans", ui-monospace, monospace;
  font-family: var(--pixel-font);
}

body {
  background:
    linear-gradient(rgba(255,255,255,.015) 50%, transparent 50%) 0 0 / 4px 4px,
    #17120c;
}
.app-shell { grid-template-rows: 72px minmax(0, 1fr); background: #211a11; }

.topbar {
  padding: 0 22px;
  border: 0;
  border-bottom: 4px solid #25170d;
  background:
    linear-gradient(90deg, rgba(255,255,255,.045), transparent 32%, rgba(0,0,0,.1)),
    repeating-linear-gradient(0deg, #65472e 0 10px, #604129 10px 12px);
  box-shadow: inset 0 -2px 0 #8b6540, 0 5px 0 rgba(12,8,4,.45);
  backdrop-filter: none;
}
.topbar::before,
.topbar::after {
  position: absolute;
  top: 10px;
  width: 7px;
  height: 7px;
  border: 1px solid #17110c;
  background: #3a332b;
  box-shadow: inset 1px 1px 0 #716b5e;
  content: "";
}
.topbar::before { left: 8px; }
.topbar::after { right: 8px; }
.brand { gap: 11px; text-shadow: 2px 2px 0 #1c130b; }
.brand-stack { filter: drop-shadow(4px 5px 0 rgba(20,13,7,.48)); }
.brand-stack i { border: 2px solid #28351f; border-radius: 1px; }
.brand-stack i:nth-child(1) { background: #9fca68; }
.brand-stack i:nth-child(2) { background: #5c843e; }
.brand-stack i:nth-child(3) { background: #3f6637; }
.brand-copy strong { color: #f5e6c2; font: 900 20px/1 var(--pixel-font); letter-spacing: -.9px; }
.brand-copy strong span { color: #a9cf6f; }
.brand-copy small,
.summary-item small,
.live-builders small,
.panel-tile > .panel-tile-icon + span,
.panel-kicker,
.tool-section-heading > span,
.feed-heading span { font-family: var(--pixel-font); }
.brand-copy small { color: #c19a66; }

.world-summary,
.live-builders,
.icon-button,
.sync-state {
  border: 2px solid #26231d;
  border-top-color: #716b5e;
  border-left-color: #716b5e;
  border-radius: 3px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.06), transparent 38%),
    #46443d;
  box-shadow: 0 3px 0 #211b13, inset -2px -2px 0 rgba(0,0,0,.18);
}
.world-summary { height: 48px; padding: 0 16px; }
.summary-item small { color: #a89c85; }
.summary-item strong { color: #f0e4c9; font-family: var(--pixel-font); }
.summary-divider { width: 2px; background: #282620; box-shadow: 1px 0 0 #67635a; }
.plot-icon { border: 2px solid #405a34; background: #718f4f; box-shadow: inset 0 0 0 5px #526e3e; }
.block-icon::before { border: 2px solid #6f4f34; background: #a66c40; }
.world-icon { color: #c8aa74; }
.live-builders > span { border-radius: 1px; background: #9ac562; box-shadow: 0 0 0 2px #324429; }
.live-builders b { color: #f0e6cc; font-family: var(--pixel-font); }
.icon-button { cursor: pointer; }
.icon-button:hover { border-color: #211b14; background: #555148; transform: translateY(-1px); }
.icon-button:active { transform: translateY(2px); box-shadow: 0 1px 0 #211b13; }
.icon-button svg { stroke: #dfd0ad; stroke-width: 2; }
.sync-state { color: #c5b99f; background: #3d4035; }
.sync-dot { border-radius: 1px; }
.sync-state[data-status="online"] .sync-dot { background: #9ac562; box-shadow: 0 0 0 2px #314329; }

.world-stage { background: #171a13; }
.world-haze {
  background:
    radial-gradient(circle at 50% 16%, rgba(221,184,93,.07), transparent 38%),
    linear-gradient(180deg, rgba(40,48,31,.04), rgba(23,15,8,.25));
}
.world-grid-glow { opacity: .07; background: repeating-linear-gradient(90deg, transparent 0 28px, #d2a75f 29px 30px); }
.world-status,
.plot-chip {
  border: 2px solid #28231a;
  border-top-color: #81735c;
  border-left-color: #81735c;
  border-radius: 3px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.05), transparent 45%),
    #49463e;
  box-shadow: 0 4px 0 rgba(23,16,9,.72);
  backdrop-filter: none;
}
.world-status { color: #d1c4a7; }
.status-spinner { border-color: #292720; border-top-color: #a9ce70; border-radius: 2px; }
.plot-chip { height: 48px; }
.plot-chip-swatch { border: 2px solid #26351f; background: #6f944d; box-shadow: 3px 4px 0 rgba(25,17,9,.35); }
.plot-chip small { color: #b5a27e; font-family: var(--pixel-font); }
.plot-chip strong { color: #f0e3c5; font-family: var(--pixel-font); }
.plot-chip > b { border: 1px solid #3f5d33; border-radius: 2px; color: #d8edb7; background: #557641; }
.camera-hint { color: #99896f; text-shadow: 1px 1px 0 #17110a; }
kbd {
  border: 2px solid #26231c;
  border-top-color: #777064;
  border-left-color: #777064;
  border-radius: 2px;
  color: #e4d7b9;
  background: #4b4942;
  box-shadow: 0 2px 0 #1f1a13;
}

.zoom-controls {
  height: 40px;
  border: 2px solid #27231c;
  border-top-color: #797166;
  border-left-color: #797166;
  border-radius: 3px;
  background: #47453e;
  box-shadow: 0 4px 0 #18120c, 4px 6px 18px rgba(0,0,0,.24);
  overflow: visible;
}
.zoom-controls button {
  width: 38px;
  border-left: 1px solid #292720;
  border-right: 1px solid #656158;
  color: #e4d7ba;
  background: linear-gradient(#514f47, #403e38);
  font: 900 15px var(--pixel-font);
  text-shadow: 1px 2px 0 #211b14;
}
.zoom-controls button:first-child { border-left: 0; }
.zoom-controls button:last-child { border-right: 0; }
.zoom-controls button:hover { color: #fff5d8; background: #5c584e; }
.zoom-controls button:active { padding-top: 3px; background: #393730; box-shadow: inset 0 3px 0 #24221d; }
.zoom-controls .home-control { color: #dff1bc; background: linear-gradient(#607e45, #486238); }
.zoom-controls span {
  width: 52px;
  border-inline: 1px solid #292720;
  color: #e0d3b5;
  background: #35332e;
  font-family: var(--pixel-font);
}
.panel-rail { top: 18px; left: 18px; gap: 10px; }
.panel-tile {
  width: 62px;
  height: 62px;
  padding: 6px 3px;
  border: 2px solid #261b12;
  border-top-color: #987049;
  border-left-color: #987049;
  border-radius: 4px;
  color: #d0b68e;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 8px, rgba(0,0,0,.035) 8px 10px),
    #68492e;
  box-shadow: 0 4px 0 #24160c, 4px 7px 14px rgba(0,0,0,.18), inset -2px -2px 0 rgba(27,16,9,.25);
  backdrop-filter: none;
  transition: transform .12s, filter .12s, box-shadow .12s;
}
.panel-tile:hover { transform: translateY(-2px); border-color: #2b1d11; color: #f5dfb7; filter: brightness(1.08); }
.panel-tile:active { transform: translateY(3px); box-shadow: 0 1px 0 #24160c; }
.panel-tile.is-active {
  border-color: #26351e;
  border-top-color: #b2d17b;
  border-left-color: #b2d17b;
  color: #f3f0d4;
  background:
    linear-gradient(#70934e 0 15%, #5f7f43 15% 31%, #654a32 31%),
    #654a32;
  box-shadow: 0 4px 0 #26351d, 4px 7px 14px rgba(0,0,0,.18), inset -2px -2px 0 rgba(25,31,18,.25);
}
.panel-tile > .panel-tile-icon + span { font-size: 9px; letter-spacing: .5px; text-shadow: 1px 1px 0 rgba(22,14,8,.65); }
.blocks-tool i { border: 1px solid rgba(34,24,15,.55); border-radius: 1px; }
.plots-tool i { border-width: 2px; }
.plot-tool i { width: 20px; height: 17px; transform: rotate(30deg) skewY(-30deg); border: 2px solid currentColor; }
.plot-tool b { position: absolute; right: 0; bottom: 0; color: #f1d272; font: 900 14px var(--pixel-font); text-shadow: 1px 1px 0 #302014; }
.objectives-tool i { border-radius: 0; }
.objectives-tool i::before { border-radius: 0; }
.foreman-tool { color: #e2bd68; text-shadow: 2px 2px 0 #463119; }
.panel-badge {
  border: 2px solid #2d1e12;
  border-radius: 2px;
  color: #24180d;
  background: #e1bf65;
  box-shadow: 1px 2px 0 rgba(18,11,5,.55);
  font-family: var(--pixel-font);
}

.panel-host { top: 18px; bottom: 18px; left: 94px; }
.game-panel {
  width: 310px;
  border: 3px solid #28251f;
  border-top-color: #777269;
  border-left-color: #777269;
  border-radius: 5px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.035), transparent 42%),
    repeating-linear-gradient(0deg, #47453e 0 17px, #45433c 17px 18px);
  box-shadow: var(--panel-shadow), inset -3px -3px 0 rgba(19,18,15,.32);
  backdrop-filter: none;
}
.game-panel.is-open { animation: voxelPanelIn .16s steps(3, end); }
.panel-header {
  min-height: 62px;
  padding: 0 15px;
  border-bottom: 3px solid #281b11;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 9px, rgba(0,0,0,.035) 9px 11px),
    #68492f;
  box-shadow: inset 0 -2px 0 #86603e;
}
.panel-header strong { color: #f4e5c4; font: 850 14px var(--pixel-font); text-shadow: 2px 2px 0 #27180e; }
.panel-kicker { color: #d0a96d; }
.panel-shortcut,
.registry-mark,
.plot-panel-mark { margin-left: auto; color: #e1c28c; }
.panel-content {
  scrollbar-color: #79684f #302e29;
  background: linear-gradient(90deg, rgba(255,255,255,.018), transparent 22%, rgba(0,0,0,.025));
}

.mode-switch {
  border: 2px solid #27241e;
  border-top-color: #68635a;
  border-left-color: #68635a;
  border-radius: 3px;
  background: #34322d;
  box-shadow: 0 3px 0 #252018;
}
.mode-switch button {
  border-radius: 2px;
  color: #c0b398;
  font-family: var(--pixel-font);
}
.mode-switch button.is-active { color: #eef4d5; background: #53713e; box-shadow: inset 2px 2px 0 #769454, inset -2px -2px 0 #344c2a; }
.mode-switch button:last-child.is-active { color: #f0d0c3; background: #77483b; box-shadow: inset 2px 2px 0 #9a6251, inset -2px -2px 0 #4c3028; }
.tool-section-heading > span { color: #c1a777; }
.tool-section-heading i { height: 2px; background: #2b2923; box-shadow: 0 1px 0 #69645a; }
.tool-section-heading small { color: #ead8b4; font-family: var(--pixel-font); }
.color-palette { gap: 8px; }
.color-palette button {
  border: 2px solid rgba(29,24,18,.8);
  border-top-color: rgba(255,255,255,.35);
  border-left-color: rgba(255,255,255,.24);
  border-radius: 2px;
  box-shadow: 0 3px 0 rgba(22,15,8,.7), inset -5px -6px 0 rgba(0,0,0,.14);
}
.color-palette button.is-active { transform: translateY(-2px); box-shadow: 0 0 0 2px #30291e, 0 0 0 4px #f2d68d, 0 4px 0 #18100a, inset -5px -6px 0 rgba(0,0,0,.14); }

.build-note,
.road-note,
.objective-intro,
.mcp-status-card,
.mcp-setup,
.feed-entry,
.selected-plot-card,
.owned-plot-item,
.plot-inspector-note {
  border: 2px solid #2a2720;
  border-top-color: #6f695e;
  border-left-color: #6f695e;
  border-radius: 3px;
  background: #3d3b35;
  box-shadow: 0 3px 0 #251f18, inset -2px -2px 0 rgba(19,17,14,.18);
}
.build-note-icon,
.objective-intro > span { color: #d6b45e; }
.build-note strong,
.road-note strong,
.objective-intro strong,
.plot-inspector-note strong { color: #f0e2c2; font-family: var(--pixel-font); }
.build-note small,
.road-note small,
.objective-intro small,
.plot-inspector-note small { color: #b8aa90; }
.panel-footer { border-top: 2px solid #292720; color: #a89a80; }
.panel-footer b { color: #d8c8a8; font-family: var(--pixel-font); }
.footer-swatch { border: 1px solid #241c13; border-radius: 1px; box-shadow: 1px 2px 0 #20150c; }

.selected-plot-card { border-color: #30422a; border-top-color: #75925b; border-left-color: #75925b; background: #3f5037; }
.selected-plot-visual { border: 2px solid #292720; border-radius: 2px; background: #323b2d; box-shadow: inset -2px -2px 0 #20261d; }
.selected-plot-copy > span { color: #c4a76e; font-family: var(--pixel-font); }
.selected-plot-copy strong { color: #f2e6c9; font-family: var(--pixel-font); }
.selected-plot-copy small,
.plot-description { color: #b6a98e; }
.claim-state { border: 1px solid #314626; border-radius: 2px; color: #e1efc7; background: #587443; }
.selected-plot-card[data-state="visited"] { border-color: #5f4932; background: #594833; }
.selected-plot-card[data-state="visited"] .claim-state { color: #f0dbb0; background: #80613d; }
.claim-button,
.home-button,
.connect-mcp,
.connector-actions a,
.connector-actions button,
.selection-content button,
.start-button {
  border: 2px solid #26321e;
  border-top-color: #b2ce7d;
  border-left-color: #b2ce7d;
  border-radius: 3px;
  color: #1f2a18;
  background: #86a95b;
  box-shadow: 0 3px 0 #25321e, inset -2px -2px 0 rgba(36,55,27,.25);
  font-family: var(--pixel-font);
}
.claim-button:active,
.home-button:active,
.connect-mcp:active,
.connector-actions a:active,
.connector-actions button:active,
.selection-content button:active,
.start-button:active { transform: translateY(2px); box-shadow: 0 1px 0 #251b12; }
.home-button,
.connector-actions button {
  border-color: #28251f;
  border-top-color: #756f64;
  border-left-color: #756f64;
  color: #e2d5b8;
  background: #4a4841;
  box-shadow: 0 3px 0 #251f18;
}
.home-button:hover { color: #fff0cc; border-color: #29251e; }
.owned-plot-item { color: #bbaa8c; }
.owned-plot-item > span:first-child { border: 1px solid #34452b; border-radius: 2px; color: #dcebc1; background: #526d41; }
.owned-plot-item strong { color: #eee0c1; font-family: var(--pixel-font); }
.owned-plot-item small,
.owned-plot-item b,
.owned-empty { color: #a6977c; }
.objective-total,
.objective-item b,
.readonly-badge { border-radius: 2px; font-family: var(--pixel-font); }
.objective-item { border-color: #28261f; border-radius: 2px; background: #3a3832; }
.objective-item strong { color: #e9dbbd; font-family: var(--pixel-font); }
.objective-item small { color: #a99b81; }
.objective-item.is-complete { border-color: #3f5535; background: #3a4933; }
.foreman-avatar { border: 2px solid #725328; border-radius: 2px; color: #f1cf75; background: #5e482a; }
.readonly-badge { border: 1px solid #604b30; color: #d1b278; background: #493a28; }
.mcp-status-card strong { color: #eee1c5; font-family: var(--pixel-font); }
.mcp-status-card small,
.mcp-setup p,
.mcp-setup > small { color: #ac9e84; }
.mcp-status-light { border-radius: 1px; box-shadow: 0 0 0 2px #242019; }
.connect-mcp { color: #2a2114; background: #d0a658; border-color: #4b361e; border-top-color: #eed287; border-left-color: #eed287; box-shadow: 0 3px 0 #4b361e; }
.connector-actions a { color: #2a2114; background: #c99d51; border-color: #4b361e; border-top-color: #e4c67e; border-left-color: #e4c67e; box-shadow: 0 3px 0 #4b361e; }
.feed-heading b { color: #b6d17d; }
.mcp-empty > span { color: #dbb75e; }
.mcp-empty strong,
.feed-entry strong { color: #decfb0; font-family: var(--pixel-font); }
.mcp-empty p,
.feed-entry p { color: #a99b81; }
.feed-entry time { color: #8e8068; }

.plot-inspector-content { padding: 14px; }
.selection-tray {
  position: relative;
  inset: auto;
  width: 100%;
  min-height: 0;
  transform: none;
  border: 2px solid #28251f;
  border-top-color: #787167;
  border-left-color: #787167;
  border-radius: 3px;
  background: #3d3b35;
  box-shadow: 0 4px 0 #231e17, inset -2px -2px 0 rgba(18,16,13,.24);
  backdrop-filter: none;
}
.selection-tray.is-empty { width: 100%; min-height: 132px; border-radius: 3px; }
.selection-empty { min-height: 128px; flex-direction: column; gap: 10px; padding: 20px; text-align: center; }
.selection-empty > span { display: grid; width: 42px; height: 42px; place-items: center; transform: rotate(45deg); border: 2px solid #776346; color: #e3bd69; background: #55442f; box-shadow: 4px 4px 0 #22180f; font-size: 23px; }
.selection-empty p { gap: 5px; }
.selection-empty strong { color: #f0e1c0; font: 850 12px var(--pixel-font); }
.selection-empty small { color: #ae9e83; font-size: 10px; }
.selection-content {
  min-height: 150px;
  grid-template-columns: 42px minmax(0, 1fr) 28px;
  grid-template-rows: auto 38px;
  gap: 12px 10px;
  padding: 14px;
}
.selection-color { width: 36px; height: 36px; border: 2px solid #292119; box-shadow: 4px 4px 0 #22170d; }
.selection-content > .selection-color { grid-column: 1; grid-row: 1; }
.selection-content > div { grid-template-columns: 1fr; gap: 4px; }
.selection-content small { color: #c4a66e; font-family: var(--pixel-font); }
.selection-content strong { color: #f1e4c5; font: 850 13px var(--pixel-font); }
.selection-content span { color: #b5a68a; }
.selection-content #selectionAction { grid-column: 1 / -1; grid-row: 2; height: 38px; }
.selection-content .close-selection {
  grid-column: 3;
  grid-row: 1;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid #33261d;
  border-top-color: #a26955;
  border-left-color: #a26955;
  color: #f0c5b6;
  background: #754639;
  box-shadow: 0 3px 0 #382019;
}
.plot-inspector-note { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px; }
.plot-inspector-note > span { color: #d5af5b; }
.plot-inspector-note p { display: grid; gap: 4px; margin: 0; }

.toast {
  border: 2px solid #2a251d;
  border-left: 5px solid #8d806a;
  border-radius: 3px;
  color: #eadcbe;
  background: #46433b;
  box-shadow: 4px 5px 0 rgba(20,14,8,.65);
  font-family: var(--pixel-font);
}
.onboarding {
  border: 3px solid #29251e;
  border-top-color: #81796d;
  border-left-color: #81796d;
  border-radius: 5px;
  color: var(--text);
  background: #3f3c35;
  box-shadow: 10px 12px 0 rgba(17,11,6,.72), 0 35px 80px rgba(0,0,0,.45);
}
.onboarding::backdrop { background: rgba(22,15,8,.82); backdrop-filter: none; }
.onboarding-world { background: linear-gradient(155deg, #9c7b49, #3f5c38 64%); }
.onboarding-world::after { background-color: #354a2f; }
.onboarding-sun { border: 3px solid #b0773f; border-radius: 3px; background: #e1bd62; box-shadow: 0 0 0 7px rgba(225,189,98,.14); }
.onboarding-copy { background: repeating-linear-gradient(0deg, #46433c 0 17px, #44413a 17px 18px); }
.welcome-label { color: #d9b866; font-family: var(--pixel-font); }
.onboarding h1 { color: #f5e7c7; font-family: var(--pixel-font); letter-spacing: -1.4px; text-shadow: 3px 3px 0 #251b12; }
.onboarding h1 em { color: #b8d17f; }
.onboarding-copy > p,
.onboarding-steps small { color: #b7a98f; }
.onboarding-steps strong { color: #ebddbf; font-family: var(--pixel-font); }
.skip-onboarding { color: #aa9b80; }
.skip-onboarding input { accent-color: #85aa5a; }

@keyframes voxelPanelIn {
  from { opacity: 0; transform: translateX(-12px) scale(.98); }
}

@media (max-width: 900px) {
  .panel-host { right: 16px; bottom: 16px; }
  .game-panel { width: min(310px, calc(100vw - 126px)); }
  .foreman-panel { width: min(350px, calc(100vw - 126px)); }
}

@media (max-width: 640px) {
  .app-shell { grid-template-rows: 60px minmax(0, 1fr); }
  .topbar { padding: 0 11px; border-bottom-width: 3px; }
  .panel-rail { top: 10px; left: 8px; gap: 7px; max-height: calc(100% - 20px); overflow-y: auto; scrollbar-width: none; }
  .panel-tile { width: 49px; height: 49px; padding: 4px 2px; }
  .panel-tile-icon { transform: scale(.84); }
  .panel-host { top: 10px; right: 8px; bottom: 10px; left: 67px; }
  .game-panel,
  .foreman-panel { width: calc(100vw - 79px); max-height: calc(100vh - 83px); }
  .plot-chip { top: 9px; right: 8px; }
  .zoom-controls { right: 9px; bottom: 11px; height: 38px; }
  .zoom-controls button { width: 34px; }
  .zoom-controls span { width: 45px; }
  .selection-tray,
  .selection-tray.is-empty { width: 100%; }
  .selection-content { grid-template-columns: 38px minmax(0,1fr) 27px; }
  .selection-content #selectionAction { display: block; }
  .onboarding { border-width: 2px; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .panel-tile { width: 44px; height: 44px; }
  .panel-rail { grid-template-columns: repeat(3, 44px); }
  .panel-host { left: 154px; }
  .game-panel,
  .foreman-panel { width: min(310px, calc(100vw - 165px)); max-height: calc(100vh - 80px); }
}

/* Full-screen world controls -------------------------------------------- */
.app-shell { display: block; height: 100%; background: #171a13; }
.world-shell { width: 100%; height: 100%; }

.panel-rail {
  top: 18px;
  max-height: calc(100% - 72px);
  padding: 0 8px 8px 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}
.panel-rail::-webkit-scrollbar { display: none; }
.panel-host { top: 18px; }

.world-tool i:first-child {
  position: absolute;
  inset: 3px;
  border: 2px solid currentColor;
  background:
    linear-gradient(90deg, transparent 44%, currentColor 45% 55%, transparent 56%),
    linear-gradient(transparent 44%, currentColor 45% 55%, transparent 56%);
  opacity: .82;
  box-shadow: inset -2px -2px 0 rgba(29,18,10,.25);
}
.world-tool i:last-child {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 8px;
  height: 8px;
  border: 1px solid #2a1c11;
  background: #a9ca70;
  box-shadow: 1px 2px 0 rgba(27,17,9,.55);
}

.world-panel { width: 350px; }
.world-panel-mark {
  margin-left: auto;
  color: #b8d77c;
  font-size: 19px;
  text-shadow: 2px 2px 0 #2b1c10;
}
.world-panel-content {
  display: grid;
  gap: 11px;
  padding: 14px;
}

.circuit-tooltip {
  position: absolute;
  z-index: 24;
  max-width: 260px;
  padding: 8px 10px;
  pointer-events: none;
  border: 2px solid #26231d;
  border-top-color: #8b826f;
  border-left-color: #8b826f;
  color: #efe2c3;
  background: rgba(52, 49, 43, .96);
  box-shadow: 4px 4px 0 rgba(25, 18, 11, .72);
  font: 700 11px var(--pixel-font);
  line-height: 1.45;
  white-space: pre-line;
}

.circuit-tooltip b { color: #f4cf76; }

.circuit-inspector {
  display: grid;
  gap: 7px;
  padding: 11px;
  border: 2px solid #29261f;
  border-top-color: #746d61;
  border-left-color: #746d61;
  background: #35342f;
  box-shadow: inset -2px -2px 0 rgba(18, 16, 13, .22);
}

.circuit-inspector[hidden] { display: none; }
.circuit-inspector header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.circuit-inspector header span,
.circuit-inspector header b {
  color: #c9aa6c;
  font: 800 9px var(--pixel-font);
  letter-spacing: .8px;
}
.circuit-inspector header b { color: #b9d982; }
.circuit-inspector[data-status="paused"] header b { color: #e4bd64; }
.circuit-inspector[data-status="suspended"] header b { color: #f08a72; }
.circuit-inspector > strong { color: #f0e1bf; font: 850 14px var(--pixel-font); }
.circuit-inspector > code { color: #a99a80; font: 700 10px ui-monospace, monospace; overflow-wrap: anywhere; }
.circuit-inspector > p { margin: 0; color: #b8aa8e; font-size: 11px; line-height: 1.45; }
.circuit-port-list { display: grid; gap: 4px; }
.circuit-port {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 24px;
  padding: 4px 7px;
  border: 1px solid #27251f;
  color: #d8ccb2;
  background: #403e37;
  font: 700 10px var(--pixel-font);
}
.circuit-port i { width: 7px; height: 7px; border: 1px solid #171511; background: #6b8790; }
.circuit-port[data-direction="output"] i { background: #c69b50; }
.circuit-port[data-value="1"] i { background: #ffe16a; box-shadow: 0 0 7px rgba(255, 220, 92, .8); }
.circuit-port small { color: #998b73; font-size: 9px; }
.world-panel-brand {
  width: 100%;
  justify-content: flex-start;
  padding: 12px;
  border: 2px solid #29261f;
  border-top-color: #766f63;
  border-left-color: #766f63;
  border-radius: 3px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.045), transparent 40%),
    #3d3b35;
  box-shadow: 0 3px 0 #241d16, inset -2px -2px 0 rgba(18,16,13,.18);
  cursor: pointer;
  text-align: left;
}
.world-panel-brand:hover { filter: brightness(1.08); }
.world-panel-brand:active { transform: translateY(2px); box-shadow: 0 1px 0 #241d16; }
.world-panel-brand .brand-stack { flex: 0 0 36px; }
.world-panel-brand .brand-copy small { display: block; }

.world-panel-summary {
  display: grid !important;
  width: 100%;
  height: auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 10px 5px;
}
.world-panel-summary .summary-item {
  position: relative;
  display: grid;
  min-width: 0;
  justify-items: center;
  gap: 5px;
  padding: 0 5px;
  border-right: 2px solid #292720;
  box-shadow: 1px 0 0 #666158;
  text-align: center;
}
.world-panel-summary .summary-item:last-child { border-right: 0; box-shadow: none; }
.world-panel-summary .summary-icon { width: 21px; height: 21px; }
.world-panel-summary .summary-item > span:last-child { justify-items: center; }
.world-panel-summary .summary-item small { font-size: 8px; white-space: nowrap; }
.world-panel-summary .summary-item strong { font-size: 14px; }
.world-panel-summary .live-builders {
  display: grid;
  height: auto;
  padding: 0 5px;
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: 1px 0 0 #666158;
}
.world-panel-summary .live-builders::before {
  width: 18px;
  height: 18px;
  border: 2px solid #4b613d;
  background:
    linear-gradient(90deg, transparent 43%, #6f8c51 44% 56%, transparent 57%),
    linear-gradient(transparent 43%, #6f8c51 44% 56%, transparent 57%),
    #343a2e;
  content: "";
}
.world-panel-summary .live-builders > .sync-dot {
  position: absolute;
  top: 0;
  right: 7px;
  width: 5px;
  height: 5px;
}
.world-panel-summary .live-builders > span:not(.sync-dot) {
  display: grid;
  width: auto;
  height: auto;
  justify-items: center;
  gap: 3px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.player-access {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  padding: 8px 9px 8px 11px;
  border: 2px solid #29261f;
  border-top-color: #766f63;
  border-left-color: #766f63;
  border-radius: 3px;
  background: #3d3b35;
  box-shadow: 0 3px 0 #241d16, inset -2px -2px 0 rgba(18,16,13,.18);
}
.player-access > span { display: grid; min-width: 0; gap: 3px; }
.player-access small { color: #c4a66e; font: 700 8px var(--pixel-font); letter-spacing: .8px; }
.player-access strong { overflow: hidden; color: #efe1c3; font: 750 11px var(--pixel-font); text-overflow: ellipsis; white-space: nowrap; }
.player-access a {
  margin-left: auto;
  padding: 8px 9px;
  border: 2px solid #30422a;
  border-top-color: #b2d17b;
  border-left-color: #b2d17b;
  border-radius: 3px;
  color: #1f2a18;
  background: #86a95b;
  box-shadow: 0 3px 0 #25321e;
  font: 750 9px var(--pixel-font);
  text-decoration: none;
  white-space: nowrap;
}
.player-access a:active { transform: translateY(2px); box-shadow: 0 1px 0 #25321e; }
.compact-plot-card { grid-template-columns: 39px minmax(0, 1fr) auto; gap: 8px; padding: 9px; }
.compact-plot-card .selected-plot-visual { width: 38px; height: 35px; }
.compact-plot-description { margin: -1px 2px 0; font-size: 10px; }
.compact-claim-button { min-height: 42px; }
.plot-reactions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.plot-reactions[hidden] { display: none; }
.plot-reactions button {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 2px solid #29261f;
  border-top-color: #766f63;
  border-left-color: #766f63;
  border-radius: 3px;
  color: #c7b794;
  background: #3d3b35;
  box-shadow: 0 3px 0 #241d16;
  font: 800 11px var(--pixel-font);
  cursor: pointer;
}
.plot-reactions button:hover { filter: brightness(1.1); }
.plot-reactions button:active { transform: translateY(2px); box-shadow: 0 1px 0 #241d16; }
.plot-reactions button[aria-pressed="true"] { color: #effbd4; border-color: #425b35; background: #5d7848; }
.plot-reactions button[data-reaction="dislike"][aria-pressed="true"] { color: #f4d4bd; border-color: #734b3d; background: #764b3b; }
.plot-reactions button[data-reaction="favorite"][aria-pressed="true"] { color: #fff0b2; border-color: #765b2e; background: #7a6138; }
.plot-reactions button:disabled { cursor: default; opacity: .55; filter: grayscale(.5); }
.plot-reactions span { font-size: 12px; }
.plot-reactions b { min-width: 12px; text-align: center; }

body[data-spectating="true"] [data-auth-required] { display: none !important; }

.world-panel-actions {
  display: grid;
  grid-template-columns: 40px 40px 40px minmax(0, 1fr);
  align-items: stretch;
  gap: 8px;
}
.world-panel-actions .icon-button { width: 40px; height: 40px; }
.world-panel-actions .sync-state {
  display: flex;
  width: auto;
  height: 40px;
  min-width: 0;
  padding: 0 9px;
  overflow: hidden;
}
.world-panel-actions .sync-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sfx-toggle { font: 800 10px var(--pixel-font); letter-spacing: .5px; }
.sound-toggle { color: #e6c86f; font: 700 17px var(--pixel-font); }
.sound-toggle[aria-pressed="false"] { color: #897b64; filter: saturate(.35); }
.sound-toggle:disabled { cursor: not-allowed; opacity: .48; filter: grayscale(1); }
.world-panel-tip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 2px solid #30422a;
  border-top-color: #75925b;
  border-left-color: #75925b;
  border-radius: 3px;
  background: #3f5037;
  box-shadow: 0 3px 0 #251f18, inset -2px -2px 0 rgba(19,17,14,.18);
}
.world-panel-tip > span { color: #d6b45e; font-size: 20px; }
.world-panel-tip p { display: grid; gap: 3px; margin: 0; }
.world-panel-tip strong { color: #f0e2c2; font-size: 11px; }
.world-panel-tip small { color: #bcc7a4; font-size: 10px; line-height: 1.4; }

.build-version {
  position: absolute;
  z-index: 12;
  bottom: 18px;
  left: 18px;
  min-width: 62px;
  padding: 6px 7px 5px;
  border: 2px solid #29231a;
  border-top-color: #75684f;
  border-left-color: #75684f;
  border-radius: 2px;
  color: #c6b48f;
  background: #3d3931;
  box-shadow: 0 3px 0 rgba(23,16,9,.72);
  font: 600 10px/1 var(--pixel-font);
  letter-spacing: .5px;
  pointer-events: none;
  text-align: center;
}

.camera-dock {
  position: absolute;
  z-index: 12;
  right: 19px;
  bottom: 25px;
  display: grid;
  justify-items: end;
  gap: 8px;
  pointer-events: none;
}
.camera-dock > * { pointer-events: auto; }
.camera-dock .zoom-controls { position: static; }
@media (max-width: 900px) {
  .world-panel { width: min(350px, calc(100vw - 126px)); }
}

@media (max-width: 640px) {
  .panel-rail { top: 10px; max-height: calc(100% - 54px); }
  .panel-host { top: 10px; }
  .game-panel,
  .foreman-panel { max-height: 100%; }
  .world-panel { width: calc(100vw - 79px); }
  .world-panel-brand { padding: 9px; }
  .world-panel-brand .brand-stack { transform: scale(.83); transform-origin: left center; }
  .world-panel-summary { padding-inline: 2px; }
  .world-panel-summary .summary-item { padding-inline: 3px; }
  .compact-plot-card { grid-template-columns: 34px minmax(0, 1fr); }
  .compact-plot-card .selected-plot-visual { width: 33px; }
  .compact-plot-card .claim-state { display: none; }
  .build-version { bottom: 10px; left: 8px; min-width: 49px; padding-inline: 4px; font-size: 9px; }
  .camera-dock { right: 9px; bottom: 11px; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .panel-rail { max-height: calc(100% - 48px); }
  .build-version { bottom: 8px; left: 8px; }
}

/* Readable controls and cinematic camera -------------------------------- */
.world-haze { opacity: .5; }
body[data-cinematic="true"] #worldCanvas { cursor: default; }

.zoom-controls .camera-tool {
  display: grid;
  place-items: center;
  color: #e8dcc0;
}
.zoom-controls .camera-tool svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(1px 1px 0 #211b14);
}
.zoom-controls .cinematic-control[aria-pressed="true"] {
  color: #effbd4;
  background: linear-gradient(#69894b, #4e693b);
  box-shadow: inset 0 0 0 1px rgba(200,235,150,.2);
}
.zoom-controls button:disabled {
  cursor: default;
  filter: grayscale(.55);
  opacity: .46;
}
.zoom-controls button:disabled:active { padding-top: 0; box-shadow: none; }

.plot-chip { min-height: 52px; height: auto; padding-block: 6px; }
.world-panel { width: 370px; }
.foreman-panel { width: 370px; }
.connector-actions { flex-wrap: wrap; }
.build-version { min-width: 74px; }
.onboarding { max-height: calc(100dvh - 28px); }
.onboarding-copy { min-height: 0; overflow: auto; }

@media (max-width: 900px) {
  .world-panel,
  .foreman-panel { width: min(370px, calc(100vw - 126px)); }
}

@media (max-width: 640px) {
  .panel-tile { width: 54px; height: 54px; }
  .panel-host { left: 72px; }
  .world-panel,
  .foreman-panel { width: calc(100vw - 84px); }
  .zoom-controls button { width: 38px; }
  .zoom-controls span { width: 58px; }
  .build-version { min-width: 62px; }
}

@media (max-width: 380px) {
  .build-version { bottom: 62px; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .panel-rail { grid-template-columns: repeat(2, 48px); }
  .panel-tile { width: 48px; height: 48px; }
  .panel-host { left: 112px; }
  .game-panel,
  .foreman-panel { width: min(340px, calc(100vw - 124px)); }
}

/* The top world chip is the single selection inspector. */
.plot-chip.world-inspector {
  display: flex;
  width: min(680px, calc(100% - 360px));
  min-width: 330px;
  max-height: min(46vh, 330px);
  height: auto;
  align-items: stretch;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  overflow: auto;
  pointer-events: auto;
}
.plot-chip-main {
  display: grid;
  min-height: 40px;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 0 4px;
}
.plot-chip-copy { display: grid; min-width: 0; gap: 2px; }
.plot-chip-copy small { color: #c4a66e; font: 800 8px var(--pixel-font); letter-spacing: 1px; }
.plot-chip-copy strong {
  overflow: hidden;
  color: #f0e3c5;
  font: 800 12px var(--pixel-font);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plot-chip-copy em {
  overflow: hidden;
  color: #b3a58b;
  font: normal 700 9px var(--pixel-font);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plot-chip-main > b {
  padding: 5px 7px;
  border: 1px solid #3f5d33;
  border-radius: 2px;
  color: #d8edb7;
  background: #557641;
  font: 800 9px var(--pixel-font);
  letter-spacing: .6px;
  white-space: nowrap;
}
.world-inspector[data-kind="device"] .plot-chip-swatch,
.world-inspector[data-kind="wire"] .plot-chip-swatch {
  transform: none;
  border-color: #304b54;
  background: #5e8b98;
  box-shadow: inset 0 0 0 5px #293c42, 3px 4px 0 rgba(25,17,9,.35);
}
.world-inspector[data-kind="wire"] .plot-chip-swatch { width: 22px; height: 7px; background: #e5c85d; box-shadow: 3px 4px 0 rgba(25,17,9,.35); }
.world-inspector[data-kind="block"] .plot-chip-swatch { transform: rotate(30deg) skewY(-30deg); }
.world-inspector[data-status="paused"] .plot-chip-main > b { color: #ffe5a5; border-color: #765b2e; background: #7a6138; }
.world-inspector[data-status="suspended"] .plot-chip-main > b { color: #ffd8ca; border-color: #734b3d; background: #764b3b; }
.world-inspector-ports {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 6px;
  border-top: 2px solid #28231a;
}
.world-inspector-ports[hidden] { display: none; }
.world-inspector-ports .circuit-port { min-width: 0; }
.world-inspector-ports .circuit-port span,
.world-inspector-ports .circuit-port small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.circuit-input-action {
  margin: 0 6px 6px;
  min-height: 30px;
  border: 2px solid #604d2e;
  border-radius: 2px;
  color: #fff1c4;
  background: #8b6534;
  font: 800 9px var(--pixel-font);
  letter-spacing: .6px;
  box-shadow: 2px 3px 0 rgba(20,14,8,.35);
}
.circuit-input-action:hover { background: #a47a42; }
.circuit-input-action[hidden] { display: none; }
.inspector-reactions {
  grid-template-columns: repeat(3, minmax(70px, 1fr));
  padding: 6px;
  border-top: 2px solid #28231a;
}
.inspector-reactions button { min-height: 29px; }

@media (max-width: 900px) {
  .plot-chip.world-inspector { width: min(560px, calc(100% - 180px)); }
}

@media (max-width: 640px) {
  .plot-chip.world-inspector {
    top: 8px;
    right: 8px;
    left: 70px;
    width: auto;
    min-width: 0;
    max-height: 42vh;
    transform: none;
  }
  .plot-chip-main { grid-template-columns: minmax(0, 1fr) auto; }
  .plot-chip-main .plot-chip-swatch { display: none; }
  .plot-chip-copy em { font-size: 8px; }
  .world-inspector-ports { grid-template-columns: 1fr; }
  .inspector-reactions { gap: 4px; }
  .inspector-reactions button { min-width: 0; padding-inline: 5px; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .plot-chip.world-inspector { top: 7px; max-height: 50vh; }
}

/* Hover affordance, visitor access, and movement ------------------------ */
#worldCanvas[data-hover="object"] { cursor: crosshair; }
#worldCanvas[data-dragging="true"][data-hover] { cursor: grabbing; }
body[data-cinematic="true"] #worldCanvas[data-hover] { cursor: default; }

.plot-access {
  display: flex;
  padding: 6px 6px 0;
  justify-content: stretch;
}
.plot-access[hidden] { display: none; }
.plot-access button {
  display: flex;
  width: 100%;
  min-height: 30px;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  border: 2px solid #29261f;
  border-top-color: #766f63;
  border-left-color: #766f63;
  border-radius: 3px;
  color: #c7b794;
  background: #3d3b35;
  box-shadow: 0 3px 0 #241d16;
  font: 800 10px var(--pixel-font);
  letter-spacing: .8px;
  cursor: pointer;
}
.plot-access button:hover { filter: brightness(1.1); }
.plot-access button:active { transform: translateY(2px); box-shadow: 0 1px 0 #241d16; }
.plot-access button:disabled { cursor: default; opacity: .55; filter: grayscale(.5); }
.plot-access small { flex: 1; text-align: left; color: #9c8f77; }
.plot-access b { color: #d8cbaa; letter-spacing: 1px; }
.plot-access-dot {
  width: 9px;
  height: 9px;
  border: 2px solid #2b2620;
  border-radius: 2px;
  background: #6e6455;
}
.plot-access[data-access="public"] button { color: #effbd4; border-color: #425b35; background: #5d7848; }
.plot-access[data-access="public"] small { color: #cbe3ae; }
.plot-access[data-access="public"] b { color: #f4ffdf; }
.plot-access[data-access="public"] .plot-access-dot {
  border-color: #2f4423;
  background: #b7ec7c;
  box-shadow: 0 0 7px rgba(160,235,110,.7);
}

.move-stick {
  position: absolute;
  z-index: 12;
  bottom: 74px;
  left: 18px;
  display: none;
  width: 116px;
  height: 116px;
  align-items: center;
  justify-content: center;
  border: 2px solid #29231a;
  border-top-color: #75684f;
  border-left-color: #75684f;
  border-radius: 50%;
  background: rgba(38,34,27,.62);
  box-shadow: 0 4px 0 rgba(20,15,10,.5);
  touch-action: none;
  user-select: none;
}
.move-stick-ring {
  position: absolute;
  inset: 14px;
  border: 2px dashed rgba(200,182,142,.28);
  border-radius: 50%;
}
.move-stick-thumb {
  width: 42px;
  height: 42px;
  border: 2px solid #2b2620;
  border-top-color: #8d8064;
  border-left-color: #8d8064;
  border-radius: 50%;
  background: #6b6350;
  box-shadow: 0 3px 0 rgba(20,15,10,.55);
  transition: background 120ms ease;
}
.move-stick small {
  position: absolute;
  bottom: 8px;
  color: #a99b7c;
  font: 800 8px var(--pixel-font);
  letter-spacing: 1.4px;
}
body[data-moving="true"] .move-stick-thumb { background: #8aa367; border-top-color: #b5cf90; border-left-color: #b5cf90; }
body[data-cinematic="true"] .move-stick { display: none !important; }

@media (pointer: coarse) {
  .move-stick { display: flex; }
  .build-version { display: none; }
}

@media (pointer: coarse) and (max-width: 640px) {
  .move-stick { bottom: 88px; left: 10px; width: 104px; height: 104px; }
  .move-stick-thumb { width: 38px; height: 38px; }
}
