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

html, body {
  height: 100%;
  background: #050605;
  color: #b8cdbb;
  font-family: ui-monospace, 'Cascadia Mono', 'Courier New', monospace;
  overflow: hidden;
}

#congregation, #congregation canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
}

#status {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 3;
  font-size: 13px;
  letter-spacing: 0.18em;
  color: #9dbfa2;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  user-select: none;
}

#sound {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 3;
  font-size: 13px;
  letter-spacing: 0.18em;
  color: #9dbfa2;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  user-select: none;
  cursor: pointer;
}

#sound:hover {
  color: #6d8a70;
}

#ritual {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 8px;
  background: rgba(4, 7, 4, 0.75);
  padding: 6px;
}

#ritual button {
  background: rgba(10, 18, 11, 0.9);
  border: 1px solid #4d6b50;
  color: #b8d4bb;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.14em;
  padding: 10px 16px;
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s, box-shadow 0.3s;
}

#ritual button:hover {
  border-color: #74997a;
  color: #e2f4e4;
}

#ritual button.active {
  border-color: #6fae76;
  color: #d6f0d9;
  box-shadow: 0 0 10px rgba(120, 220, 140, 0.3), inset 0 0 6px rgba(120, 220, 140, 0.15);
}

#stage {
  position: fixed;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: min(760px, 92vw);
  z-index: 2;
}

#screen {
  height: min(320px, 40vh);
  overflow-y: auto;
  padding: 28px 32px;
  background: #030803;
  border: 1px solid #1c2b1e;
  box-shadow: 0 0 60px rgba(20, 60, 30, 0.25), inset 0 0 80px rgba(0, 0, 0, 0.7);
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0.04em;
  color: #a9d4ae;
  white-space: pre-wrap;
  text-shadow: 0 0 6px rgba(120, 220, 140, 0.35);
  position: relative;
  transition: border-color 0.9s, box-shadow 0.9s;
}

#screen::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.18) 3px
  );
}

body.entity #screen {
  border-color: #274a5e;
  box-shadow: 0 0 70px rgba(70, 150, 200, 0.35), inset 0 0 80px rgba(0, 0, 0, 0.7);
}

#cursor {
  animation: blink 1.1s steps(1) infinite;
  color: #a9d4ae;
}

#text span.blue {
  color: #8fd0f0;
  text-shadow: 0 0 6px rgba(100, 180, 230, 0.45);
}

#text span.purple {
  color: #c19ae6;
  text-shadow: 0 0 6px rgba(170, 120, 230, 0.4);
}

#screen.dead #text span {
  color: #5a705d;
  text-shadow: none;
}

#text span.amber {
  color: #e0c080;
  text-shadow: 0 0 6px rgba(220, 180, 110, 0.35);
}

#promptrow {
  position: fixed;
  top: calc(28px + min(320px, 40vh) + 14px);
  left: 50%;
  transform: translateX(-50%);
  width: min(760px, 92vw);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #030803;
  border: 1px solid #1c2b1e;
  padding: 10px 16px;
}

#promptmark {
  color: #e0c080;
  font-size: 14px;
}

#prompt {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #e0c080;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.04em;
}

#promptrow:has(#prompt:disabled) {
  opacity: 0.4;
}

#sendbtn {
  background: none;
  border: 1px solid #4d6b50;
  color: #b8d4bb;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.16em;
  padding: 7px 16px;
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s;
}

#sendbtn:hover {
  border-color: #74997a;
  color: #e2f4e4;
}

#sendbtn:disabled {
  cursor: default;
}

#presence {
  position: fixed;
  top: calc(28px + min(320px, 40vh) + 90px);
  left: 50%;
  transform: translateX(-50%);
  width: 46px;
  height: 46px;
  background: #4f7d59;
  animation: presencepulse 2.6s ease-in-out infinite;
  z-index: 1;
}

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

#screen.dead {
  color: #55665a;
  text-shadow: none;
}

#screen.dead #cursor {
  animation: none;
  opacity: 0.2;
}

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

#veil {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: #050605;
  display: flex;
  align-items: center;
  justify-content: center;
}

#connect {
  background: none;
  border: 1px solid #2a3d2c;
  color: #8fae93;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.35em;
  text-transform: lowercase;
  padding: 14px 42px 14px 46px;
  cursor: pointer;
  transition: border-color 0.4s, color 0.4s;
}

#connect:hover {
  border-color: #4d6b50;
  color: #c2dcc5;
}

#veilbox {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

#signin a {
  color: #6aa2cf;
  text-decoration: none;
  letter-spacing: 0.2em;
  font-size: 12px;
  border: 1px solid #274a5e;
  padding: 9px 18px;
  transition: border-color 0.3s, color 0.3s;
}

#signin a:hover {
  border-color: #3f82b8;
  color: #8bc0ea;
}

#signin .idlabel {
  color: #9dbfa2;
  font-size: 12px;
  letter-spacing: 0.15em;
  margin-right: 10px;
}

#signin .signout {
  color: #7a927d;
  border-color: #2a3d2c;
  padding: 5px 12px;
  letter-spacing: 0.15em;
}

#signinmsg {
  color: #a05a5a;
  font-size: 12px;
  letter-spacing: 0.1em;
  min-height: 16px;
}

#whoami {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 3;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: #9dbfa2;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  user-select: none;
}

#whoami a {
  color: #6aa2cf;
  text-decoration: none;
  margin-left: 8px;
}

#whoami a:hover {
  color: #8bc0ea;
}
