.star-room,
.room-editor-preview,
.room-themes label {
  --room-sky: #110e20;
  --room-ink: #080710;
  --room-glow: #b789e8;
  --room-light: #f0c7e7;
  --room-mid: #786393;
  --room-edge: #3b304e;
}
.star-room[data-theme="dawn"],
.room-editor-preview[data-theme="dawn"],
.room-themes [data-theme="dawn"] {
  --room-sky: #271725;
  --room-ink: #100910;
  --room-glow: #eb997d;
  --room-light: #ffdab5;
  --room-mid: #a37183;
  --room-edge: #563643;
}
.star-room[data-theme="tide"],
.room-editor-preview[data-theme="tide"],
.room-themes [data-theme="tide"] {
  --room-sky: #0e1b2b;
  --room-ink: #070c15;
  --room-glow: #83c7f0;
  --room-light: #bceeed;
  --room-mid: #587fa0;
  --room-edge: #2b4057;
}

.star-room {
  --planet-high: #d0dcb1;
  --planet-mid: #8ca484;
  --planet-low: #42576d;
  --planet-glow: #d5d5ba;
  --room-line: color-mix(in srgb, var(--room-light) 23%, transparent);
  --room-muted: #c9c5d8;
  --room-cream: #fff5ea;
  --room-serif: "Noto Serif KR", Georgia, serif;
  --room-gutter: clamp(13px, 3vw, 42px);
  position: fixed;
  inset: 0;
  z-index: 5;
  isolation: isolate;
  overflow: clip;
  color: var(--room-cream);
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--room-sky) 68%, transparent), #02010757 72%);
}
.star-room[data-theme="dawn"] {
  --planet-high: #f2dba2;
  --planet-mid: #a9af7d;
  --planet-low: #6e5564;
  --planet-glow: #ffca9b;
}
.star-room[data-theme="tide"] {
  --planet-high: #c0e0cf;
  --planet-mid: #719e98;
  --planet-low: #3c5871;
  --planet-glow: #98ead7;
}
.star-room [hidden] { display: none; }
.star-room button, .room-editor button { -webkit-tap-highlight-color: transparent; }
.star-room :is(button,summary):focus-visible, .room-editor :is(button,input,select,textarea):focus-visible {
  outline: 2px solid #ffdbab;
  outline-offset: 3px;
}
body:has(.star-room) { overflow: hidden; }
.app-shell:has(.star-room) :is(.dock,.preview-note,.footer-coordinate) { display: none; }
.app-shell:has(.star-room) .app-content { margin-left: 0; }
.stage-my .node[data-route="my/space"] .node-label {
  pointer-events: auto;
  cursor: pointer;
}
.stage-my .node[data-route="my/space"] .node-label small {
  display: inline-flex;
  margin-top: 7px;
  padding: 4px 10px;
  border: 1px solid #f4d2a268;
  border-radius: 999px;
  background: #11101bea;
  color: #ffe0c4;
}
.stage-my .node[data-route="my/space"]:is(:hover,:focus-visible) .node-label small {
  border-color: #f4d2a2;
  background: #342437;
}
.room-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  margin-bottom: 4px;
  padding: 4px 2px;
  color: var(--room-light);
  font-size: 12px;
  font-weight: 650;
}
.room-back:hover { color: var(--room-cream); }
.room-back svg { width: 16px; height: 16px; transform: rotate(180deg); }
.room-header {
  position: absolute;
  z-index: 4;
  inset: max(10px,env(safe-area-inset-top)) var(--room-gutter) auto;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  pointer-events: none;
}
.room-header > * { pointer-events: auto; }
.room-heading { min-width: 0; max-width: min(45vw, 480px); text-shadow: 0 2px 14px #080710; }
.room-eyebrow {
  margin: 0 0 4px;
  color: var(--room-light);
  font-size: 12px;
  font-weight: 650;
}
.room-eyebrow span { margin-inline: 2px; }
.room-header h1 {
  margin: 0;
  font: 600 clamp(24px, 3.2vw, 51px)/1.25 var(--room-serif);
  letter-spacing: -.06em;
  overflow-wrap: anywhere;
}
.room-header-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 7px; padding-top: 8px; }
.room-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 13px;
  border: 1px solid var(--room-line, #ffffff36);
  border-radius: 9px;
  background: #15121d;
  color: #fff4ec;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  line-height: 1.35;
  transition: background-color .18s, border-color .18s, color .18s;
}
.room-action svg { width: 16px; height: 16px; flex: 0 0 16px; }
.room-action:not(:disabled):hover { background: #292033; border-color: var(--room-light, #f0c7e7); }
.room-action[aria-pressed="true"] { border-color: var(--room-light); color: var(--room-light); }
.room-action--strong { background: #f1c9db; border-color: #f1c9db; color: #251425; }
.room-action--strong:not(:disabled):hover { background: #ffe5ef; border-color: #ffe5ef; color: #201020; }
.room-action:disabled { opacity: .55; cursor: wait; }
.room-fullscreen { min-width: 42px; padding-inline: 8px; }
.room-menu { position: relative; }
.room-menu summary { list-style: none; cursor: pointer; }
.room-menu summary::-webkit-details-marker { display: none; }
.room-menu[open] summary { border-color: var(--room-light); }
.room-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 10px;
  width: min(300px, calc(100vw - 2 * var(--room-gutter)));
  max-height: min(64dvh,540px);
  padding: 11px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--room-line);
  border-radius: 14px;
  background: #0d0b17f5;
  box-shadow: 0 14px 40px #0009;
}
.room-spirit-picker {
  min-inline-size: 0;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--room-line);
  border-radius: 10px;
  background: #ffffff06;
}
.room-spirit-picker legend {
  padding-inline: 5px;
  color: var(--room-light);
  font-size: 12px;
  font-weight: 700;
}
.room-spirit-options {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 5px;
}
.room-spirit-options button {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 66px;
  padding: 5px 2px;
  border: 1px solid #ffffff20;
  border-radius: 8px;
  background: #ffffff07;
  color: var(--room-cream);
  font-size: 11px;
  font-weight: 650;
}
.room-spirit-options button:hover { background: #ffffff13; }
.room-spirit-options button[aria-pressed="true"] {
  border-color: var(--room-light);
  background: color-mix(in srgb,var(--room-glow) 22%,#171223);
}
.room-spirit-options button:disabled { opacity: .55; }
.room-spirit-preview { display: block; width: 39px; height: 38px; overflow: hidden; }
.room-spirit-status { margin: 7px 0 0; color: var(--room-muted); font-size: 11px; }
.room-menu-panel nav { display: grid; gap: 4px; }
.room-menu-panel nav button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 6px 9px;
  border-radius: 7px;
  color: var(--room-cream);
  font-size: 13px;
  text-align: left;
}
.room-menu-panel nav button:hover { background: var(--room-sky); }
.room-menu-panel nav svg { width: 14px; height: 14px; color: var(--room-light); }
.room-menu-panel .room-destinations {
  padding: 4px;
  border: 1px solid var(--room-line);
  border-radius: 9px;
  background: var(--room-sky);
}
.room-map {
  position: absolute;
  inset: 0;
}
.room-map:focus-visible { outline: 1px solid var(--room-line); outline-offset: -2px; }
.room-map-art {
  position: absolute;
  inset: 0;
  cursor: crosshair;
  touch-action: manipulation;
}
.room-map-stage {
  position: absolute;
  width: min(104vw, 106dvh);
  aspect-ratio: 1;
  transform-origin: top left;
  pointer-events: none;
}
.room-map-stage > svg { display: block; width: 100%; height: 100%; }
.room-models { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.room-ambience { position: absolute; inset: 0; pointer-events: none; }
.room-ambient {
  position: absolute;
  width: var(--effect-size);
  height: var(--effect-size);
  transform: translate(-50%, -50%) rotate(var(--effect-angle));
}
.room-ambient--lantern { --effect-color: 255 222 145; }
.room-ambient--firepit { --effect-color: 255 163 97; }
.room-ambient--portal { --effect-color: 189 157 255; }
.room-ambient::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(var(--effect-color) / .56), rgb(var(--effect-color) / .16) 36%, transparent 71%);
}
.room-ambient--firepit::before { animation: room-fire-glow 2.1s ease-in-out infinite alternate; }
.room-ambient--portal::before { inset: -22%; animation: room-fire-glow 2.8s ease-in-out infinite alternate; }
.room-ambient--portal i {
  position: absolute;
  top: 2%;
  left: 10%;
  width: clamp(2px, calc(var(--effect-size) * .13), 9px);
  aspect-ratio: 1;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  background: #f3dcff;
  opacity: .45;
  animation: room-portal-spark 2.4s ease-in-out infinite alternate;
}
.room-ambient--portal i:nth-child(2) { top: 68%; left: 91%; animation-delay: -.9s; }
.room-ambient--portal i:nth-child(3) { top: 95%; left: 24%; animation-delay: -1.7s; }
@keyframes room-portal-spark { from { transform: scale(.4); opacity: .16; } to { transform: scale(1); opacity: .9; } }
.room-ambient--firepit i {
  --drift: -.20;
  position: absolute;
  top: 46%;
  left: 49%;
  width: clamp(1px, calc(var(--effect-size) * .055), 3px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffe3a1;
  box-shadow: 0 0 4px #ff986d;
  opacity: 0;
  animation: room-ember-rise 2.4s linear infinite;
}
.room-ambient--firepit i:nth-child(2) { --drift: .16; animation-delay: -.8s; }
.room-ambient--firepit i:nth-child(3) { --drift: -.04; animation-delay: -1.6s; }
@keyframes room-fire-glow { from { opacity: .60; transform: scale(.87); } to { opacity: 1; transform: scale(1.08); } }
@keyframes room-ember-rise {
  0%, 100% { opacity: 0; }
  22% { opacity: .8; }
  100% { transform: translate(calc(var(--effect-size) * var(--drift)), calc(var(--effect-size) * -.72)) scale(.35); }
}
.room-portal-flash {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 58%, #e4d6ff8a 0, #947cfa25 50%, transparent 78%);
}
.room-creature {
  position: absolute;
  transform: translate(-50%, -50%) scaleX(var(--flight-facing, 1));
  pointer-events: none;
}
.room-creature svg { display: block; width: 100%; overflow: visible; }
.room-creature--dragon { filter: drop-shadow(0 2px 2px #151e284d); }
.room-butterfly-wing { transform-origin: 18px 16px; animation: room-butterfly-beat .28s ease-in-out infinite alternate; }
.room-dragon-wing { transform-origin: 55px 37px; animation: room-dragon-beat 1.65s ease-in-out infinite alternate; }
.room-dragon-wing--far { animation-direction: alternate-reverse; }
@keyframes room-butterfly-beat { from { transform: scaleX(.44); } to { transform: scaleX(1); } }
@keyframes room-dragon-beat { from { transform: rotate(-9deg) scaleY(.59); } to { transform: rotate(6deg) scaleY(1.02); } }
.no-motion .room-ambient::before,
.no-motion :is(.room-ambient i, .room-butterfly-wing, .room-dragon-wing) { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .room-ambient i, .room-ambient::before, .room-butterfly-wing, .room-dragon-wing { animation: none; }
}
.room-contours, .room-road-bed, .room-road-edge, .room-lanterns {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.room-contours { stroke: #e1f3d4; stroke-width: 1.5; opacity: .27; }
.room-road-bed { stroke: #152c30; stroke-width: 23; opacity: .24; }
.room-road-edge { stroke: #f0deb1; stroke-width: 16; opacity: .77; }
.room-lanterns {
  stroke: #ffefb8;
  stroke-width: 5;
  stroke-dasharray: 1 28;
  filter: drop-shadow(0 0 5px #ffd28e);
}
.room-pin {
  position: absolute;
  z-index: 3;
  top: var(--pin-y);
  left: var(--pin-x);
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 40px;
  padding: 5px 8px;
  transform: translate(var(--pin-anchor-x,-50%),var(--pin-anchor-y,-50%));
  border: 1px solid #e8d5fc65;
  border-radius: 8px;
  background: #100e1deb;
  color: #f7edf8;
  box-shadow: 0 4px 10px #06051065;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.room-pin:is(:hover,.is-near) {
  border-color: var(--room-light);
  background: color-mix(in srgb, var(--room-sky) 81%, var(--room-glow));
  box-shadow: 0 0 20px color-mix(in srgb, var(--room-glow) 45%, transparent);
}
.room-pin svg { display: block; width: 17px; height: 17px; color: var(--room-light); }
.room-pin--portal { min-height: 34px; border-color: #c8a9fa8c; background: #211830ed; color: #f1deff; }
.room-pin--portal svg { width: 15px; height: 15px; color: #cfb3ff; }
@media (pointer: coarse) { .room-pin--portal { min-height: 44px; } }
.room-camera {
  position: absolute;
  right: var(--room-gutter);
  bottom: max(12px,env(safe-area-inset-bottom));
  z-index: 3;
  display: flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--room-line);
  border-radius: 12px;
  background: #100e1ded;
}
.room-camera .room-action { min-width: 38px; padding-inline: 7px; }
.room-camera .room-camera-mode { min-width: 56px; color: var(--room-light); }
.room-hud {
  position: absolute;
  z-index: 3;
  bottom: max(12px,env(safe-area-inset-bottom));
  left: 50%;
  width: min(510px, calc(100vw - 2 * var(--room-gutter)));
  transform: translateX(-50%);
  padding: 11px clamp(10px, 2vw, 20px);
  border: 1px solid var(--room-line);
  border-radius: 14px;
  background: #100e1ded;
  box-shadow: 0 8px 28px #0006;
}
.room-hud p { margin: 0; color: var(--room-muted); font-size: 11px; line-height: 1.5; }
.room-hud .room-proximity { color: var(--room-light); font-size: 13px; font-weight: 650; }
.room-hud .room-discoveries { margin-top: 2px; color: var(--room-light); }
.room-touch-help, .room-joystick { display: none; }
.room-skill-status {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
}
.room-controls {
  position: absolute;
  z-index: 4;
  right: var(--room-gutter);
  bottom: calc(max(12px,env(safe-area-inset-bottom)) + 68px);
  pointer-events: none;
}
.room-skillbar { display: flex; align-items: end; gap: 7px; pointer-events: auto; }
.room-skill {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  min-width: 56px;
  min-height: 48px;
  padding: 4px 6px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb,var(--skill-ink) 47%,transparent);
  border-radius: 12px;
  color: var(--skill-ink);
  background: radial-gradient(ellipse at 50% 27%,color-mix(in srgb,var(--skill-ink) 22%,#191527),#171326 84%);
  box-shadow: 0 5px 15px #05040e75;
  cursor: pointer;
  touch-action: manipulation;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}
.room-skill svg { width: 19px; height: 19px; }
.room-skill[data-room-skill="charm"] { background: radial-gradient(ellipse at 50% 27%,color-mix(in srgb,var(--skill-ink) 31%,#2b1e37),#171326 84%); }
.room-skill:not([aria-disabled="true"]):active { scale: .94; }
.room-skill[aria-disabled="true"] { opacity: .65; cursor: default; }
.room-skill[aria-disabled="true"]::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: var(--skill-ink);
  transform-origin: left;
  animation: room-skill-recharge var(--skill-cooldown) linear both;
}
@keyframes room-skill-recharge { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.room-pin.is-scanned {
  border-color: var(--scan-ink,#ffda89);
  color: var(--scan-ink,#fff0c7);
  box-shadow: 0 0 0 2px color-mix(in srgb,var(--scan-ink,#ffd98c) 33%,transparent),
   0 0 16px color-mix(in srgb,var(--scan-ink,#ffc96f) 62%,transparent);
}
@media (any-pointer: coarse), (max-width: 820px) {
  .room-controls {
    left: max(var(--room-gutter),env(safe-area-inset-left));
    right: max(var(--room-gutter),env(safe-area-inset-right));
    bottom: max(12px,env(safe-area-inset-bottom));
    display: flex;
    align-items: end;
    justify-content: space-between;
  }
  .room-joystick {
    position: relative;
    display: grid;
    place-items: center;
    width: clamp(78px,23vw,100px);
    aspect-ratio: 1;
    border: 1px solid #ecd8fc72;
    border-radius: 50%;
    background: radial-gradient(circle,#362b4fb0,#181328dd 72%);
    box-shadow: inset 0 0 0 5px #f4dfff12, 0 5px 20px #09051570;
    pointer-events: auto;
    touch-action: none;
    user-select: none;
  }
  .room-joystick::before {
    content: '';
    position: absolute;
    inset: 15%;
    border: 1px dashed #e9d6fa48;
    border-radius: 50%;
  }
  .room-joystick span {
    width: 42%;
    aspect-ratio: 1;
    border: 1px solid #f2dcfab3;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 28%,#ecbfe5,#735587);
    box-shadow: 0 2px 8px #100b1e9c;
    transform: translate(var(--stick-x,0px),var(--stick-y,0px));
    pointer-events: none;
  }
  .room-joystick.is-held { border-color: #f4cfe8; box-shadow: inset 0 0 0 5px #f4dfff21, 0 0 14px #d299d64d; }
  .room-skillbar { gap: clamp(4px,1.3vw,8px); }
  .room-skillbar :is(.room-skill,.room-interact) {
    width: clamp(44px,13vw,60px);
    min-width: 0;
    min-height: 0;
    aspect-ratio: 1;
    padding: 4px 2px;
    border-radius: 50%;
    font-size: clamp(8px,2.35vw,11px);
  }
  .room-skillbar .room-skill { text-align: center; white-space: normal; word-break: keep-all; overflow-wrap: anywhere; }
  .room-skillbar .room-interact { width: clamp(51px,15vw,68px); justify-content: center; }
  .room-skillbar .room-interact kbd, .room-key-help { display: none; }
  .room-touch-help { display: inline; }
  .room-camera { bottom: calc(max(12px,env(safe-area-inset-bottom)) + 76px); }
  .room-hud {
    top: max(78px,calc(env(safe-area-inset-top) + 70px));
    bottom: auto;
    width: max-content;
    max-width: calc(100vw - 2 * var(--room-gutter));
    padding: 7px 11px;
  }
}
@media (max-width: 560px) {
  .room-hud { top: max(143px,calc(env(safe-area-inset-top) + 134px)); }
}
.no-motion .room-skill::after { animation: none; }
@media (prefers-reduced-motion: reduce) { .room-skill::after { animation: none; } }
@media (min-width: 1100px) and (min-aspect-ratio: 19/10) {
  .room-hud { left: var(--room-gutter); width: min(370px,26vw); transform: none; }
}
.room-interact { flex: 0 0 auto; white-space: nowrap; }
.room-interact[aria-disabled="true"] { background: #191422; border-color: var(--room-line); color: #c4afcc; cursor: default; }
.room-interact kbd { padding: 2px 5px; border: 1px solid currentColor; border-radius: 4px; font-size: 11px; }
.room-zone-kicker svg { width: 19px; height: 19px; color: var(--room-light); }
.room-return { margin-top: 12px; }

.room-owner, .room-detail {
  min-width: 0;
  padding: clamp(14px, 2vw, 22px);
  border: 1px solid var(--room-line);
  border-radius: 14px;
  background: linear-gradient(148deg, var(--room-sky), var(--room-ink) 95%);
  overflow-wrap: anywhere;
}
.room-detail {
  position: absolute;
  z-index: 5;
  top: 50%;
  right: var(--room-gutter);
  width: min(340px, calc(100vw - 2 * var(--room-gutter)));
  max-height: min(62dvh,560px);
  overflow: auto;
  overscroll-behavior: contain;
  transform: translateY(-50%);
  box-shadow: 0 14px 48px #000a;
}
.room-owner-lock, .room-zone-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--room-light);
  font-size: 11px;
  font-weight: 680;
  letter-spacing: .03em;
}
.room-owner-lock svg { width: 15px; height: 15px; }
.room-owner > p {
  margin: 9px 0 13px;
  font: 500 clamp(14px, 1.6vw, 19px)/1.57 var(--room-serif);
  white-space: pre-line;
}
.room-owner > .room-visit-note {
  margin: 10px 0 0;
  color: var(--room-muted);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.55;
}
.room-account {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 8px;
  padding-top: 7px;
  border-top: 1px solid var(--room-line);
}
.room-account [data-space-sync] { color: var(--room-muted); font-size: 11px; }
.room-account button {
  min-height: 38px;
  padding: 4px 1px;
  color: var(--room-light);
  font-size: 12px;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.room-account button:hover { color: #fff3df; }
.room-detail { scroll-margin-top: 15px; }
.room-detail h2 { margin: 4px 0 11px; font: 600 clamp(21px, 2.6vw, 29px)/1.48 var(--room-serif); }
.room-zone-content { display: grid; gap: 9px; }
.room-zone-content p { margin: 0; color: var(--room-muted); font-size: 13px; line-height: 1.65; white-space: pre-line; }
.room-zone-content .room-action { justify-content: space-between; }
.room-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-bottom: 3px;
}
.room-profile-mark {
  display: grid;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--room-line);
  border-radius: 50%;
  background: radial-gradient(circle, var(--room-edge), var(--room-ink));
  color: var(--personal, #f0c39a);
  text-shadow: 0 0 10px currentColor;
}
.room-profile strong, .room-profile small { display: block; }
.room-profile strong { color: #fff5ed; font-size: 14px; }
.room-profile small { margin-top: 4px; color: var(--room-muted); font-size: 12px; }
.room-focus, .room-metrics > div, .room-latest {
  padding: 8px 10px;
  border: 1px solid var(--room-line);
  border-radius: 8px;
  background: #0b0a15b0;
}
.room-focus small, .room-focus span, .room-metrics span, .room-latest small {
  display: block;
  line-height: 1.48;
}
.room-focus small, .room-metrics span, .room-latest small { color: var(--room-muted); font-size: 11px; }
.room-focus span { margin-top: 2px; font-size: 13px; }
.room-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.room-metrics strong { color: var(--room-light); font-size: 20px; font-weight: 650; }
.room-latest { display: grid; grid-template-columns: minmax(0, 1fr) 18px; gap: 3px 6px; text-align: left; }
.room-latest strong { color: #fff5ed; font-size: 13px; }
.room-latest svg { grid-area: 1 / 2 / 3; align-self: center; width: 18px; color: var(--room-light); }
.room-latest:hover { border-color: var(--room-light); }
.room-tags { display: flex; flex-wrap: wrap; gap: 5px; list-style: none; margin: 0; padding: 0; }
.room-tags li {
  padding: 3px 7px;
  border: 1px solid var(--room-line);
  border-radius: 5px;
  color: var(--room-light);
  font-size: 11px;
}

.room-editor-preview {
  display: grid;
  place-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 13px;
  border: 1px solid var(--room-edge);
  border-radius: 12px;
  background: radial-gradient(ellipse at 50% 54%, var(--room-sky), var(--room-ink) 80%);
  color: #fff4e7;
  overflow-wrap: anywhere;
  text-align: center;
}
.room-editor-preview > span { max-width: 100%; font-size: 13px; }
.room-preview-planet {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 47px;
  padding: 3px 13px;
  border: 1px solid var(--room-mid);
  border-radius: 50%;
  background: radial-gradient(ellipse, var(--room-mid), var(--room-edge) 70%);
}
.room-preview-planet span { display: grid; place-items: center; width: 25px; height: 25px; }
.room-preview-planet span:nth-child(2) { transform: translateY(-5px); }
.room-preview-planet .has-decor { border-radius: 50%; background: #ffe0a728; }
.room-preview-planet svg { width: 19px; height: 19px; color: #fff0dc; }
.room-editor-preview.has-lights .room-preview-planet svg { filter: drop-shadow(0 0 5px var(--room-light)); }
.room-editor-text { resize: vertical; min-height: 72px; }
.room-editor-fieldset {
  min-width: 0;
  margin: 22px 0 0;
  padding: 9px 0 0;
  border: 0;
  border-top: 1px solid #ffffff2c;
}
.room-editor-fieldset legend { padding-right: 7px; color: #fff1e6; font-size: 14px; font-weight: 650; }
.room-editor-fieldset .field-label { margin-top: 10px; }
.room-editor-help { margin: 0 0 9px; color: #c8cadb; font-size: 12px; line-height: 1.55; }
.room-themes, .room-placement { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.room-themes label { position: relative; cursor: pointer; }
.room-themes input { position: absolute; opacity: 0; }
.room-themes span {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 6px;
  border: 1px solid #ffffff30;
  border-radius: 7px;
  background: var(--room-sky);
  color: #fff5eb;
  font-size: 12px;
}
.room-themes input:checked + span { border-color: var(--room-light); box-shadow: inset 0 0 0 1px var(--room-light); }
.room-themes input:focus-visible + span { outline: 2px solid #ffdbab; outline-offset: 2px; }
.room-themes i { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: var(--room-glow); }
.room-placement label { min-width: 0; color: #ebddea; font-size: 12px; }
.room-placement select { margin-top: 3px; min-height: 41px; padding: 3px; font-size: 12px; }
.room-light-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 38px;
  margin-top: 4px;
  color: #f6e4f2;
  font-size: 13px;
}
.room-light-toggle input { accent-color: #f1c9db; }
.room-decor-toggle small { margin-inline-start: 8px; color: #c6b8cb; font-size: 11px; }
.room-import {
  margin-top: 14px;
  padding: 10px;
  border: 1px solid #e2abd84a;
  border-radius: 8px;
  background: #1e1525;
}
.room-import p { margin: 0 0 6px; color: #e8d6ea; font-size: 13px; }

@media (max-width: 810px) {
  .room-detail { top: auto; bottom: max(12px,env(safe-area-inset-bottom)); transform: none; }
}
@media (max-width: 560px) {
  .room-header { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .room-heading { max-width: 100%; }
  .room-back { min-height: 32px; margin-bottom: 0; }
  .room-header-actions { justify-content: start; padding-top: 0; }
  .room-header-actions .room-action { min-height: 38px; padding-inline: 9px; }
  .room-menu { margin-left: auto; }
  .room-pin { min-height: 34px; padding: 4px 6px; font-size: 10px; gap: 3px; }
  .room-pin svg { width: 13px; height: 13px; }
  .room-interact kbd { display: none; }
  .room-hud .room-proximity { font-size: 11px; }
  .room-detail { width: calc(100vw - 2 * var(--room-gutter)); }
  .room-interact { padding-inline: 8px; font-size: 12px; }
  .room-placement { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .room-action { transition: none; }
}
.no-motion .room-action { transition: none; }

/* ── 조작부 정리 (2026-11-10) ──
   위쪽 오른쪽 = 이 페이지의 동작(내 기록 · 공간 꾸미기 · 메뉴). 아래쪽 오른쪽 = 움직임(스킬 · 상호작용 · 시점 · 전체 화면).
   메뉴 = 제목 붙은 세 묶음의 한 겹 목록(장소 바로가기 · 탐험 모습 · 다른 메뉴) + 공간 정보. 스크롤이 거의 필요 없게 줄였습니다. */
.room-menu-panel { max-height: min(80dvh,640px); gap: 4px; padding: 8px; }
.room-menu-sec { display: grid; gap: 2px; padding-bottom: 6px; border-bottom: 1px solid var(--room-line); }
.room-menu-title, .room-spirit-picker legend {
  margin: 0;
  padding: 6px 8px 4px;
  color: var(--room-muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
}
.room-menu-panel nav button { min-height: 40px; }
.room-menu-panel .room-destinations { padding: 0; border: 0; background: none; }
.room-destinations button { justify-content: flex-start; gap: 12px; }
.room-links { grid-template-columns: repeat(2, minmax(0,1fr)); }
.room-links button { gap: 6px; }
.room-spirit-picker { padding: 0 0 6px; border: 0; border-bottom: 1px solid var(--room-line); border-radius: 0; background: none; }
.room-spirit-options { grid-template-columns: repeat(6, minmax(0,1fr)); gap: 4px; padding: 0 4px; }
.room-spirit-options button { position: relative; min-height: 46px; padding: 3px 1px; }
.room-spirit-options button > span:not(.room-spirit-preview) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.room-spirit-status { padding: 0 8px; }
.room-camera .room-fullscreen { min-width: 42px; margin-left: 3px; padding-inline: 8px; }
.room-menu-panel .room-destinations button { justify-content: flex-start; }
.room-menu-panel .room-owner { padding: 10px 12px; border-radius: 10px; }
.room-menu-panel .room-owner > p { margin: 4px 0 6px; font-size: 13px; line-height: 1.5; }
.room-menu-panel .room-owner .room-owner-lock { font-size: 12px; }
.room-menu-panel .room-account { padding-top: 2px; }
/* 메뉴가 열려 있는 동안에는 메뉴가 아래쪽 조작부 위에 놓입니다(작은 화면에서 겹쳐 보이던 것) */
.room-header:has(.room-menu[open]) { z-index: 6; }

/* ── 동화나라 입구(행성 건물·포털): 문 버튼 + 화면을 채우는 빛 ── */
.room-door{display:flex;align-items:center;gap:12px;min-height:56px;margin:12px 0 16px;padding:8px 16px;border-radius:16px;border:1px solid rgba(244,214,140,.55);background:linear-gradient(135deg,rgba(255,236,190,.16),rgba(166,160,216,.14));color:#fff6e2;text-decoration:none;font-size:14px;font-weight:650}
.room-door>span:first-child{flex:none;display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:rgba(245,217,137,.24);color:#f5d989;font-size:16px}
.room-door>span:last-child{display:flex;flex-direction:column;gap:2px}
.room-door small{font-size:12px;font-weight:500;color:#d9cdfb}
.room-door:hover,.room-door:focus-visible{border-color:#f5d989;background:linear-gradient(135deg,rgba(255,236,190,.26),rgba(166,160,216,.22))}
.room-portal-flash.is-entering{position:fixed;inset:0;z-index:200;background:radial-gradient(ellipse at 50% 55%,#fff6e2 0,#f5d989cc 28%,#a6a0d8 62%,#303b67 100%)}
