:root {
  --sky: #9fdcff;
  --grass-1: #87cf68;
  --grass-2: #5aa845;
  --sand: #f7eed2;
  --card: rgba(255, 248, 237, 0.92);
  --ink: #243341;
  --muted: #61727f;
  --accent: #ff8e5e;
  --accent-deep: #ec6d32;
  --line: rgba(36, 51, 65, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Trebuchet MS", "Avenir Next", sans-serif;
  overflow: hidden;
  background:
    radial-gradient(circle at 10% 14%, rgba(255, 240, 178, 0.95) 0 6%, transparent 6.2%),
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.75) 0 4%, transparent 4.2%),
    radial-gradient(circle at 78% 16%, rgba(255, 232, 166, 0.9) 0 5%, transparent 5.2%),
    radial-gradient(circle at 84% 74%, rgba(255, 255, 255, 0.45) 0 7%, transparent 7.2%),
    radial-gradient(circle at 50% 50%, rgba(172, 228, 118, 0.9) 0 32%, rgba(116, 193, 76, 0.96) 55%, rgba(68, 143, 44, 0.98) 100%),
    linear-gradient(180deg, #80d15e 0, var(--grass-1) 60%, var(--grass-2) 100%);
}

.shell {
  max-width: none;
  margin: 0 auto;
  padding: 8px 10px 10px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#worldView {
  display: flex;
  flex: 1;
  min-height: 0;
}

.topbar,
.hero,
.card-head,
.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar {
  display: none;
}

.eyebrow,
.subtle {
  color: rgba(36, 51, 65, 0.74);
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 32px;
}

h2 {
  font-size: 24px;
}

.hero {
  display: none;
}

.uid-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.uid-picker input {
  width: 180px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  width: 100%;
  min-height: 0;
}

.stack,
.grid-2,
.grid-3 {
  display: grid;
  gap: 18px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.card {
  padding: 16px;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 16px 40px rgba(24, 51, 70, 0.08);
}

.scene-card {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.scene-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(236, 109, 50, 0.25);
}

.user-chip,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 248, 237, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
}

.meadow {
  position: relative;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  touch-action: none;
  background:
    linear-gradient(180deg, rgba(66, 115, 34, 0.12), rgba(66, 115, 34, 0.18)),
    url("/assets/meadow-bg.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.meadow-overlay {
  position: absolute;
  left: 14px;
  right: 14px;
  z-index: 8;
  pointer-events: none;
}

.meadow-overlay > * {
  pointer-events: auto;
}

.meadow-overlay-top {
  top: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.meadow-overlay-bottom {
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: grid;
  gap: 10px;
}

.meadow-title-box {
  max-width: 52%;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255, 248, 237, 0.86);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 20px rgba(24, 51, 70, 0.12);
}

.meadow-title-box h3 {
  font-size: 20px;
}

.meadow-status {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.meadow-controls-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.meadow::after {
  content: none;
}

.meadow::before {
  content: none;
}

.avatar,
.location {
  position: absolute;
  transform: translate(-50%, -50%);
  text-align: center;
}

.avatar {
  width: 88px;
  transition: left 220ms ease, top 220ms ease, transform 220ms ease;
  cursor: pointer;
}

.avatar.me {
  z-index: 4;
}

.avatar.me .avatar-face {
  background: linear-gradient(180deg, #ffcf84, #ff8f63);
  box-shadow: 0 12px 22px rgba(236, 109, 50, 0.28);
}

.avatar.is-near {
  transform: translate(-50%, -50%) scale(1.06);
}

.avatar.location-near .avatar-name,
.location.location-near .avatar-name {
  background: #fff2bf;
}

.location.location-near {
  filter: drop-shadow(0 0 18px rgba(255, 243, 180, 0.95));
}

.avatar.online-user .avatar-face {
  background: linear-gradient(180deg, #ffe1b8, #ffb475);
}

.avatar-face {
  display: block;
  width: 54px;
  height: 54px;
  margin: 0 auto 8px;
  border-radius: 50%;
  border: 3px solid rgba(0, 0, 0, 0.08);
}

.avatar-face {
  background: linear-gradient(180deg, #ffd39e, #ffb067);
}

.avatar.resting .avatar-face {
  background: linear-gradient(180deg, #d7c6ff, #ad97e8);
}

.avatar-name {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  font-weight: 700;
}

.location {
  width: 138px;
  transition: transform 220ms ease;
}

.location-art {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 16px 20px rgba(53, 77, 24, 0.24));
}

.approach-hint {
  min-height: 0;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255, 248, 237, 0.86);
  backdrop-filter: blur(8px);
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.75);
}

.interaction-panel {
  margin-top: 14px;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.75);
  min-height: 0;
}

.interaction-panel.is-empty {
  display: none;
}

.proximity-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 20px;
  background: rgba(255, 248, 237, 0.86);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.75);
}

.proximity-text {
  flex: 1;
  color: var(--muted);
  font-weight: 700;
}

.room-view {
  margin-top: 18px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 248, 236, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 40px rgba(24, 51, 70, 0.12);
}

.room-hidden {
  display: none;
}

.room-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.room-content {
  display: grid;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.room-object-layer {
  position: relative;
  min-height: 180px;
  margin-bottom: 14px;
}

.room-object {
  position: absolute;
  border: 0;
  border-radius: 18px;
  padding: 12px 14px;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 12px 22px rgba(24, 51, 70, 0.12);
}

.room-object small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 400;
}

.room-object.is-active {
  background: #fff2b5;
}

.room-object.object-shelf {
  width: 170px;
  height: 86px;
}

.room-object.object-table {
  width: 170px;
  height: 76px;
}

.room-object.object-board {
  width: 180px;
  height: 94px;
}

.room-object.object-stage {
  width: 190px;
  height: 92px;
}

.room-object.object-window {
  width: 150px;
  height: 78px;
}

.room-hotspots {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.room-hotspot {
  border: 0;
  border-radius: 18px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
  min-width: 140px;
  box-shadow: 0 10px 18px rgba(24, 51, 70, 0.08);
}

.room-hotspot.is-active {
  background: #fff1b8;
}

.room-detail {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.room-entry-list {
  display: grid;
  gap: 8px;
}

.room-entry {
  border: 0;
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  text-align: left;
  font: inherit;
  box-shadow: 0 8px 16px rgba(24, 51, 70, 0.08);
}

.room-entry strong {
  display: block;
  margin-bottom: 4px;
}

.room-form {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.room-form textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  border: 1px solid rgba(36, 51, 65, 0.12);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font: inherit;
}

.room-status {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
}

.room-occupants {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 14px;
}

.room-occupant {
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 16px rgba(24, 51, 70, 0.08);
}

.room-detail-title {
  margin: 0 0 8px;
  font-size: 18px;
}

.room-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.room-block {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.room-block strong {
  display: block;
  margin-bottom: 6px;
}

.room-scene {
  position: relative;
  overflow: hidden;
  min-height: 620px;
  padding: 22px;
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,0.7);
}

.room-decor {
  position: absolute;
  border-radius: 24px;
  opacity: 0.65;
}

.room-decor-left {
  left: 20px;
  bottom: 22px;
  width: 160px;
  height: 120px;
}

.room-decor-right {
  right: 24px;
  top: 24px;
  width: 180px;
  height: 140px;
}

.room-view.room-library .room-scene {
  background: linear-gradient(180deg, #f7e6c4 0 30%, #d29b6a 30% 36%, #9c6238 36% 100%);
}

.room-view.room-library .room-decor-left,
.room-view.room-library .room-decor-right {
  background: linear-gradient(180deg, #7f4f2a, #5a371f);
  box-shadow: inset 0 0 0 8px rgba(255,255,255,0.08);
}

.room-view.room-showcase .room-scene {
  background: linear-gradient(180deg, #ffeec8 0 32%, #f3c57b 32% 38%, #d68e4b 38% 100%);
}

.room-view.room-showcase .room-decor-left,
.room-view.room-showcase .room-decor-right {
  background: linear-gradient(180deg, #fff7df, #ffdfaa);
}

.room-view.room-barter .room-scene {
  background: linear-gradient(180deg, #efe6db 0 30%, #c9ab8f 30% 36%, #8e674e 36% 100%);
}

.room-view.room-barter .room-decor-left,
.room-view.room-barter .room-decor-right {
  background: linear-gradient(180deg, #ad7e57, #815b3d);
}

.room-view.room-cocreation .room-scene {
  background: linear-gradient(180deg, #fff0c8 0 30%, #ffc97a 30% 36%, #ef8a5d 36% 100%);
}

.room-view.room-cocreation .room-decor-left,
.room-view.room-cocreation .room-decor-right {
  background: linear-gradient(180deg, #ff9e74, #ffcf93);
}

.room-view.room-events .room-scene {
  background: linear-gradient(180deg, #eed9ff 0 30%, #c09ae8 30% 36%, #6e4b91 36% 100%);
}

.room-view.room-events .room-decor-left,
.room-view.room-events .room-decor-right {
  background: linear-gradient(180deg, #ffe8a6, #f3c05f);
}

.room-view.room-magnet .room-scene {
  background: linear-gradient(180deg, #dff7ff 0 30%, #9ddcf0 30% 36%, #4687a4 36% 100%);
}

.room-view.room-magnet .room-decor-left,
.room-view.room-magnet .room-decor-right {
  background: linear-gradient(180deg, #ffffff, #a8e7ff);
}

.room-view.room-user .room-scene {
  background: linear-gradient(180deg, #ffe8cb 0 30%, #f5b982 30% 36%, #bb7b49 36% 100%);
}

.room-view.room-user .room-decor-left,
.room-view.room-user .room-decor-right {
  background: linear-gradient(180deg, #ffcf8b, #ff9f66);
}

.room-view.room-rest .room-scene {
  background: linear-gradient(180deg, #d8d4ff 0 34%, #bfa8e9 34% 40%, #8d68b6 40% 100%);
}

.room-view.room-rest .room-decor-left,
.room-view.room-rest .room-decor-right {
  background: linear-gradient(180deg, #f3ecff, #d6c3ff);
}

.interaction-empty {
  color: var(--muted);
}

.interaction-title {
  margin: 0 0 6px;
  font-size: 18px;
}

.interaction-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.ghost-btn {
  border: 0;
  border-radius: 999px;
  padding: 9px 12px;
  background: #fff2dd;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.interaction-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.interaction-item {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.dpad {
  display: grid;
  grid-template-columns: repeat(3, 38px);
  grid-template-rows: repeat(2, 38px);
  gap: 6px;
  grid-template-areas:
    ". up ."
    "left down right";
}

.dpad-btn {
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.34);
  color: rgba(32, 45, 30, 0.9);
  font: inherit;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.38);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 12px rgba(24, 51, 70, 0.08);
}

.dpad-btn.up { grid-area: up; }
.dpad-btn.left { grid-area: left; }
.dpad-btn.down { grid-area: down; }
.dpad-btn.right { grid-area: right; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 248, 237, 0.82);
  backdrop-filter: blur(8px);
}

.world-extras {
  display: none;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}

.dot.online {
  background: #41b96d;
}

.dot.resting {
  background: #9e88de;
}

.profile-grid,
.list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.profile-row,
.list-item {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.list-item h4 {
  margin: 0 0 6px;
  font-size: 16px;
}

.muted {
  color: var(--muted);
}

@media (max-width: 980px) {
  .layout,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .topbar,
  .hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .proximity-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .room-grid {
    grid-template-columns: 1fr;
  }

  .meadow {
    min-height: 0;
  }

  .shell {
    padding: 0;
  }

  .topbar {
    padding: 10px 12px 6px;
  }

  h1 {
    font-size: 20px;
  }

  .eyebrow {
    font-size: 11px;
  }

  .scene-card {
    padding: 0;
  }

  #worldView,
  .layout,
  .scene-card {
    min-height: 0;
    height: 100%;
  }

  .meadow {
    min-height: 100dvh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }

  .scene-actions {
    gap: 6px;
  }

  .pill,
  .ghost-btn {
    padding: 7px 10px;
    font-size: 13px;
  }

  .meadow-title-box {
    max-width: 58%;
    padding: 8px 10px;
  }

  .meadow-title-box h3 {
    font-size: 17px;
  }

  .meadow-status {
    font-size: 12px;
  }

  .approach-hint,
  .proximity-text,
  .interaction-panel {
    font-size: 13px;
  }

  .dpad {
    grid-template-columns: repeat(3, 32px);
    grid-template-rows: repeat(2, 32px);
    gap: 4px;
  }

  .location {
    width: 108px;
  }

  .avatar {
    width: 64px;
  }

  .avatar-face {
    width: 42px;
    height: 42px;
  }

  .avatar-name {
    font-size: 10px;
    padding: 4px 7px;
  }

  .meadow-overlay-top {
    top: 10px;
    left: 10px;
    right: 10px;
    gap: 8px;
  }

  .meadow-overlay-bottom {
    left: 8px;
    right: 8px;
    bottom: 8px;
    gap: 8px;
  }

  .meadow-controls-row {
    align-items: flex-end;
    gap: 8px;
  }

  .legend {
    gap: 10px;
    font-size: 11px;
    padding: 8px 10px;
  }
}
