:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, "Noto Sans SC", sans-serif;
  color: #eaf0ed;
  background: #152024;
  font-size: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  height: 100dvh;
  overflow: hidden;
}
button,
input,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  min-height: 40px;
  border: 1px solid #ffffff24;
  border-radius: 10px;
  background: #253337;
  color: #edf5ef;
  padding: 8px 14px;
}
button:hover {
  background: #35484b;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #b8f1c3;
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
#world {
  position: absolute;
  inset: 64px 0 0;
}
#viewer {
  width: 100%;
  height: 100%;
  border: 0;
  background: #172428;
}
header {
  position: absolute;
  inset: 0 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: #152024;
  z-index: 5;
  border-bottom: 1px solid #ffffff16;
}
.brand {
  font-size: 14px;
  letter-spacing: 0.12em;
  color: #b8f1c3;
  text-decoration: none;
  font-weight: 800;
}
#identity {
  font-size: 15px;
  font-weight: 650;
}
#connection {
  font-size: 12px;
  color: #afbfbc;
}
.spacer {
  flex: 1;
}
header button {
  background: transparent;
  font-size: 14px;
}
.nav-button {
  color: #edf5ef;
  text-decoration: none;
  border: 1px solid #ffffff24;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  white-space: nowrap;
}
@media (max-width: 480px) {
  header .brand {
    display: none;
  }
  header .nav-button {
    font-size: 13px;
    padding: 8px 9px;
  }
  #identity {
    min-width: 0;
    white-space: nowrap;
  }
}
#empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: radial-gradient(ellipse at 50% 35%, #314747 0, transparent 65%);
}
.wordmark {
  letter-spacing: 0.3em;
  font-size: 13px;
  color: #b8f1c3;
}
h1 {
  font-weight: 550;
  font-size: clamp(24px, 4vw, 38px);
  margin: 20px 0 4px;
}
#empty p {
  color: #b7c4c2;
  line-height: 1.7;
}
#createForm {
  display: flex;
  gap: 8px;
  width: min(460px, 100%);
  margin: 18px 0 12px;
}
input {
  min-width: 0;
  flex: 1;
  background: #111c20;
  border: 1px solid #617475;
  border-radius: 10px;
  color: white;
  padding: 12px;
}
#create,
#send {
  background: #b8f1c3;
  color: #102019;
  font-weight: 700;
}
small {
  color: #90a4a0;
  font-size: 12px;
}
#setupError {
  color: #ffa99d !important;
  min-height: 24px;
}
#hud {
  position: absolute;
  left: 20px;
  top: 116px;
  display: flex;
  gap: 14px;
  color: white;
  background: #142225bf;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  pointer-events: none;
}
#console {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(740px, calc(100% - 32px));
  padding: 12px 14px 10px;
  border: 1px solid #ffffff36;
  background: #142225eb;
  backdrop-filter: blur(16px);
  border-radius: 16px;
  box-shadow: 0 10px 45px #0004;
  z-index: 4;
}
#statusRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
  margin-bottom: 8px;
}
#taskStatus {
  font-size: 13px;
  color: #a8ccba;
}
#stop {
  color: #ffc2b8;
  min-height: 28px;
  padding: 3px 9px;
  font-size: 13px;
  background: transparent;
}
#composer {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
textarea {
  background: #08141680;
  color: #fff;
  resize: none;
  min-height: 44px;
  max-height: 160px;
  flex: 1;
  min-width: 0;
  border: 1px solid #ffffff25;
  border-radius: 10px;
  padding: 11px 12px;
  line-height: 1.45;
}
#send {
  height: 46px;
}
#latest {
  margin: 8px 2px 0;
  line-height: 1.5;
  color: #bfcdca;
  font-size: 14px;
  max-height: 66px;
  overflow: auto;
  white-space: pre-wrap;
}
#chat {
  position: absolute;
  right: 20px;
  top: 145px;
  bottom: 205px;
  width: min(380px, calc(100% - 40px));
  background: #142225ed;
  backdrop-filter: blur(16px);
  border: 1px solid #ffffff25;
  border-radius: 14px;
  z-index: 3;
  overflow: auto;
}
#messages {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bubble {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.65;
  padding: 10px 12px;
  border-radius: 12px;
  background: #273a3d;
}
.bubble.user {
  background: #365447;
  margin-left: 28px;
}
.bubble.system {
  background: transparent;
  color: #a9bbb4;
  font-size: 12px;
  padding: 0 6px;
}
dialog {
  max-width: 520px;
  width: calc(100% - 32px);
  border: 1px solid #506866;
  border-radius: 18px;
  background: #1b2b2f;
  color: #edf5ef;
  padding: 22px;
  box-shadow: 0 20px 70px #0008;
}
dialog::backdrop {
  background: #0008;
  backdrop-filter: blur(4px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
h2 {
  font-size: 20px;
  margin: 0;
}
dialog p {
  color: #b5c6c1;
  font-size: 14px;
  line-height: 1.7;
}
.player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #ffffff18;
}
.player .name {
  flex: 1;
}
.player small {
  display: block;
}
.player button {
  font-size: 13px;
}
.danger {
  color: #ffaea0;
}
.safety-option {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  line-height: 1.6;
}
.safety-option input {
  flex: none;
  width: 18px;
  height: 18px;
  accent-color: #b8f1c3;
}
#toast {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  background: #152326;
  color: #fff;
  padding: 12px 18px;
  border: 1px solid #7f9c94;
  border-radius: 12px;
  z-index: 20;
}
#serverAddress {
  font-family: monospace;
}
#copyInvite {
  margin-top: 16px;
}
@media (max-width: 650px) {
  header {
    padding: 0 12px;
    gap: 8px;
  }
  .brand {
    font-size: 12px;
  }
  #connection {
    display: none;
  }
  header button {
    padding: 7px 9px;
    font-size: 13px;
  }
  #identity {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #console {
    bottom: 12px;
  }
  #hud {
    top: 111px;
    left: 12px;
    gap: 8px;
    font-size: 12px;
  }
  #chat {
    top: 145px;
    bottom: 210px;
    right: 12px;
    width: calc(100% - 24px);
  }
  #empty p {
    font-size: 14px;
  }
  #createForm {
    flex-direction: column;
  }
}
