/* The Red Queen's office — Grok great-room palette: near-black room,
   dark cards, white text, green accent, red for her. */

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: #0a0a10;
  color: #e8e6e3;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.page-head { text-align: center; margin-bottom: 14px; }
.page-head h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  margin: 0 0 4px;
  color: #f2f0ec;
}
.page-head p { margin: 0; color: #9a97a3; font-size: 14px; }

/* --- Stage: the isometric room --- */
.stage-frame {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #0a0a10;
  border: 1px solid #23232e;
  aspect-ratio: 16 / 10;
}
@media (max-width: 640px) {
  .stage-frame { aspect-ratio: 3 / 4; }
}
#stage-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#stage-canvas:active { cursor: grabbing; }

.top-bar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: flex-start;
  pointer-events: none;
}
.room-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(12, 12, 18, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #f2f0ec;
  backdrop-filter: blur(4px);
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3ddc97;
  box-shadow: 0 0 8px #3ddc97;
  flex: none;
}

/* Name tag pinned at her feet, status bubble above her head. */
.name-tag {
  position: absolute;
  transform: translate(-50%, 6px);
  background: rgba(10, 10, 16, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
}
.status-bubble {
  position: absolute;
  transform: translate(-50%, -100%);
  max-width: 300px;
  background: rgba(10, 10, 16, 0.9);
  border: 1px solid #ff3b30;
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
  padding: 7px 12px;
  border-radius: 14px;
  text-align: center;
  pointer-events: none;
}

/* Details card, bottom-left — Grok style. */
.details-card {
  position: absolute;
  left: 12px;
  bottom: 12px;
  max-width: min(62%, 340px);
  background: rgba(18, 18, 26, 0.92);
  border: 1px solid #2a2a38;
  border-radius: 14px;
  padding: 12px 16px;
  backdrop-filter: blur(4px);
}
.details-name { margin: 0; font-size: 17px; font-weight: 700; color: #fff; }
.details-status { margin: 4px 0 0; font-size: 14px; line-height: 1.4; color: #b9b6c2; }
.details-hint { margin: 6px 0 0; font-size: 13px; color: #3ddc97; }
.details-meta { margin: 6px 0 0; font-size: 13px; color: #3ddc97; }

/* Virtual joystick, bottom-right. */
.joystick {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  touch-action: none;
}
.joystick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #7ff0bd, #3ddc97 60%, #23a86e);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.scene-error {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 56px;
  background: #3a1512;
  border: 1px solid #7a2a22;
  color: #ffd9d4;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}

/* --- Status board strip --- */
.status-board {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  background: #14141c;
  border: 1px solid #23232e;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  color: #c9c6d2;
}

/* --- Log --- */
.log-section { margin-top: 22px; }
.log-section h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  margin: 0 0 10px;
  color: #f2f0ec;
}
.log-list { list-style: none; margin: 0; padding: 0; }
.log-entry, .log-empty {
  background: #14141c;
  border: 1px solid #23232e;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 8px;
}
.log-entry p { margin: 0; font-size: 14px; line-height: 1.45; color: #d8d5de; }
.log-entry .log-time { margin-top: 4px; font-size: 12px; color: #8a8794; }
.log-empty { color: #8a8794; font-size: 14px; }

.page-foot {
  margin-top: 18px;
  color: #8a8794;
  font-size: 13px;
  text-align: center;
}

.status-error {
  margin-top: 12px;
  background: #3a1512;
  border: 1px solid #7a2a22;
  color: #ffd9d4;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  text-align: center;
}
.status-error button {
  margin-top: 8px;
  background: #ff3b30;
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
}
