: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;
}

/* Navigator search (v1.28 safe, client-only) */
.nav-search{
  width: 100%;
  padding: 8px 10px;
  margin: 0 0 8px;
  border-radius: 8px;
  border: 1px solid #242532;
  background: #0f111a;
  color: #e9e9ee;
  outline: none;
}
.nav-search:focus{ border-color:#4e4376; }

/* =========================
   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;
}

/* ✅ Let the right panel span both rows so the log can sit directly under the stage */
.room-shell .panel.info {
  grid-row: 1 / span 2;
  align-self: start;
}
.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;
}
/* Room meta badges */
.room-badge{
  display:inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #242532;
  background:#202235;
  font-size: 12px;
  line-height: 1.6;
  opacity: 0.95;
}
.room-badge.ok{
  outline: 2px solid #2ecc71;
}
.room-badge.locked{
  outline: 2px solid #e67e22;
}

/* Build locked placeholder (when not owner/admin) */
.build-locked{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #242532;
  font-size: 12px;
  opacity: 0.85;
  line-height: 1.35;
}
.build-locked b{ opacity: 0.95; }


/* =========================
   UI POLISH: TOASTS + LOGIN
========================= */

.login-sub{
  margin: 0 0 14px;
  font-size: 13px;
  opacity: 0.85;
  line-height: 1.35;
}

button:disabled{
  opacity: 0.5;
  cursor: not-allowed;
}

.toast-host{
  position: fixed;
  right: 14px;
  bottom: 14px;
  display: grid;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}

.toast{
  pointer-events: none;
  background: rgba(22,24,35,0.96);
  border: 1px solid #242532;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.45);
  max-width: 320px;
}

.toast .t-title{
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 4px;
}

.toast .t-msg{
  font-size: 13px;
  opacity: 0.92;
  line-height: 1.3;
}
/* =========================
   NAVIGATOR VISUAL UPGRADE
   Cosmetic only – no logic changes
========================= */

/* Window shell polish */
.window {
  background: linear-gradient(180deg, #1b1e2d 0%, #121420 100%);
  border: 1px solid #2b2e42;
  border-radius: 14px;
  box-shadow:
    0 18px 50px rgba(0,0,0,0.55),
    inset 0 1px 0 rgba(255,255,255,0.05);
  overflow: hidden;
}

/* Header polish */
.window-header {
  background: linear-gradient(180deg, #24263a 0%, #1b1e2d 100%);
  font-size: 14px;
  letter-spacing: 0.4px;
}

/* Tabs */
.window-tabs .tab {
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s ease;
}

.window-tabs .tab.active {
  background: #2d314a;
  color: #fff;
  box-shadow: inset 0 -2px 0 #ffcc66;
}

/* Body tighter spacing */
.window-body {
  padding: 10px;
}

/* Nav items */
.nav-item {
  padding: 8px 10px;
  border-radius: 8px;
  transition:
    background 0.15s ease,
    transform 0.08s ease;
}

.nav-item:hover {
  background: #32355a;
  transform: translateX(2px);
}

/* Active/current room highlight */
.nav-item.active-room {
  outline: 2px solid #ffcc66;
  background: #2b2e48;
}

/* Scroll area smoother */
.tab-panel {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

.tab-panel::-webkit-scrollbar {
  width: 6px;
}
.tab-panel::-webkit-scrollbar-thumb {
  background: #2b2e48;
  border-radius: 6px;
}

/* ===== Compact shop/inventory friendliness (SAFE) ===== */

.invList { display:flex; flex-direction:column; gap:2px; }

.invRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  font-size: 12px;
}

.invName{ opacity: 0.88; }
.invQty{ opacity: 0.75; }
.invQty b{ opacity: 1; }

.shopHint{
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.72;
  line-height: 1.25;
}

/* affordability cue (no layout changes) */
.shopSel.afford-ok{ border-color: #2ecc71 !important; }
.shopSel.afford-no{ border-color: #e74c3c !important; }
