:root { font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
body { margin: 0; background: #0e0f12; color: #e9e9ee; }
header { display:flex; justify-content:space-between; align-items:center; padding:12px 14px; border-bottom:1px solid #242532; }
.title { font-weight:700; letter-spacing:0.2px; }
.status { font-size: 14px; opacity: 0.9; }
main {
  display: grid;
  grid-template-columns: 940px 300px;
  gap: 12px;
  padding: 12px;

  justify-content: center;
  align-content: center;
  min-height: calc(100vh - 48px);
}
.stage {
  width: 940px;
  height: 640px;
  background: #0f111a;
  border: 1px solid #242532;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.panel { background:#161823; border:1px solid #242532; border-radius: 12px; padding: 12px; }
.row { display:flex; gap:10px; padding: 6px 0; }
.label { width: 70px; opacity: 0.7; }
/* Log panel stays the same size; content scrolls inside */
/* Chat panel (Log + input). Fixed height; history scrolls inside. */
.panel.log{
  height: 220px;
  min-height: 220px;

  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* keep title tight */
.logTitle{
  font-weight: 700;
  margin: 0;
}

#log{
  margin: 0; /* IMPORTANT: <pre> has default margins sometimes */
  flex: 1 1 auto;

  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.35;

  white-space: pre-wrap;   /* prevents horizontal blowouts; still preserves newlines */
  word-break: break-word;

  overflow-y: auto;
  overflow-x: hidden;

  padding-right: 6px;
}

.chatbar{
  display: flex;
  gap: 8px;
}

#chatInput{
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #242532;
  background: #0f111a;
  color: #e9e9ee;
  outline: none;
}

#chatInput:focus{
  border-color: #4e4376;
}

@media (max-width: 900px) {
  main { grid-template-columns: 1fr; }
}

/* =========================
   PART 2B: HABBO LAYOUT
========================= */

main {
  align-items: start;
}

#game {
  width: 100%;
  height: 100%;
  display: block;
}

/* =========================
   HOTEL SCREEN
========================= */

.hotel-bg {
  width: 1240px;
  height: 860px;
  border-radius: 12px;
  border: 1px solid #242532;
  position: relative;
  overflow: hidden;

  background-image: url("../assets/hotel/voidhotel_postapoc_bg5.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  box-shadow: inset 0 0 140px rgba(0,0,0,0.55);
}

.hotel-ui {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 2; /* add this */
}

.hotel-ui {
  position: absolute;
  right: 16px;
  bottom: 16px;
}

.primary {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  background: #ffcc66;
  color: #111;
  font-weight: 700;
  cursor: pointer;
}
/* =========================
   PART 4: NAVIGATOR WINDOW
========================= */

.window {
  position: absolute;
  top: 200px;     /* move down into skyline zone */
  right: 150px;   /* push it in from the right edge */
  left: auto;     /* IMPORTANT: disable the old anchor */
  width: 300px;
  background: #161823;
  border: 1px solid #242532;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  z-index: 10;
}

.window-header {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  background: #1f2230;
  border-bottom: 1px solid #242532;
  font-weight: 700;
}

.window-header button {
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
}

.window-tabs {
  display: flex;
  border-bottom: 1px solid #242532;
}

.window-tabs .tab {
  flex: 1;
  padding: 8px;
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
}

.window-tabs .tab.active {
  background: #24263a;
  color: #fff;
}

.window-body {
  padding: 8px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.nav-item {
  padding: 6px 8px;
  margin-bottom: 4px;
  background: #202235;
  border-radius: 6px;
  cursor: pointer;
}

.nav-item:hover {
  background: #2b2e48;
}
/* =========================
   PART 5: LOGIN SCREEN
========================= */

.login-box {
  width: 360px;
  padding: 20px;
  background: #161823;
  border: 1px solid #242532;
  border-radius: 12px;
  text-align: center;
}

.login-box h2 {
  margin-bottom: 12px;
}

.login-box input {
  width: 100%;
  padding: 8px;
  margin-bottom: 8px;
  border-radius: 6px;
  border: 1px solid #242532;
  background: #0f111a;
  color: #fff;
}

.secondary {
  margin-top: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: #2b2e48;
  color: #fff;
  cursor: pointer;
}
/* =========================
   SCREENS (CENTER CONTENT)
========================= */

.screen { display: none; }
.hidden { display: none; }

.screen:not(.hidden) {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 48px);
}

/* =========================
   ROOM LAYOUT (CENTERED)
========================= */

.room-shell {
  display: grid;
  grid-template-columns: 940px 300px;
  grid-template-rows: auto auto;
  gap: 12px;
  justify-content: center;
  align-items: start;
}

/* Put log under the stage (left column) */
.room-shell .log {
  grid-column: 1 / 2;
}

.room-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: center;
}

/* Log sits under the stage like Habbo */
.room-shell .log {
  width: 940px;
}

/* 👇 ADD THIS RIGHT HERE */
#screen-room:not(.hidden),
#screen-login:not(.hidden),
#screen-hotel:not(.hidden) {
  grid-column: 1 / -1;
}
.lookButtons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.lookBtn {
  padding: 6px 10px;
  border-radius: 8px;
  border: none;
  background: #2b2e48;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  user-select: none;
}

.lookBtn.active {
  outline: 2px solid #ffcc66;
}
/* =========================
   LOOK PICKER (AVATAR COLORS)
========================= */

#lookPicker {
  display: grid;
  grid-template-columns: repeat(auto-fill, 28px);
  gap: 8px;
  padding: 6px 0;
}

.look-swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;

  border: 2px solid rgba(255, 255, 255, 0.25);
  box-sizing: border-box;

  transition:
    transform 0.08s ease,
    border-color 0.08s ease,
    box-shadow 0.08s ease;
}

.look-swatch:hover {
  transform: scale(1.08);
  border-color: rgba(255, 255, 255, 0.6);
}

.look-swatch.active {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.6);
}

/* Always do this first */
*, *::before, *::after { box-sizing: border-box; }

:root{
  --stageW: 940px;     /* your game box width */
  --sidebarW: 300px;   /* make it slimmer */
  --gap: 16px;
}

#app, .app, .shell {
  display: grid;
  grid-template-columns: var(--stageW) var(--sidebarW);
  grid-template-rows: auto auto;
  gap: var(--gap);
  align-items: start;
  justify-content: center;
}

/* Put the stage in left column row 1 */
#stage, .stage, canvas.stage {
  grid-column: 1;
  grid-row: 1;
  width: var(--stageW);
}

/* Put the log in left column row 2 */
#logPanel, .logPanel, #logWrap {
  grid-column: 1;
  grid-row: 2;
  width: var(--stageW);     /* key: forces exact match */
  max-width: var(--stageW);
}

/* Sidebar in right column */
#sidebar, .sidebar, #infoPanel {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: var(--sidebarW);
  min-width: 0;             /* allow shrink if needed */
}



/* =========================
   FURNITURE v0.5: BUILD PANEL (admin/owner only)
   Movable widget: mount location can change later.
========================= */
#buildPanelMount{ margin-top: 10px; }
.build-panel{
  border-top: 1px solid #242532;
  margin-top: 10px;
  padding-top: 10px;
}
.build-panel .buildTitle{
  font-weight: 700;
  margin: 0 0 8px 0;
  opacity: 0.95;
}
.build-panel .buildRow{
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 6px 0;
}
.build-panel label{
  font-size: 12px;
  opacity: 0.8;
}
.build-panel select,
.build-panel input[type="number"]{
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #242532;
  background: #0f111a;
  color: #e9e9ee;
  outline: none;
}
.build-panel select:focus,
.build-panel input[type="number"]:focus{
  border-color: #4e4376;
}
.build-panel .buildHint{
  font-size: 12px;
  opacity: 0.75;
  line-height: 1.35;
  margin-top: 6px;
}
.build-panel .pill{
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #202235;
  border: 1px solid #242532;
  font-size: 12px;
  opacity: 0.9;
}
.build-panel .toggleBtn{
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #242532;
  background: #202235;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}
.build-panel .toggleBtn.active{
  outline: 2px solid #ffcc66;
}
