@import url("/styles.css");
:root {
  color-scheme: light;
  --ink: #153d3c;
  --paper: #faf9f3;
  --muted: #4f645e;
  --line: #dce4da;
  --accent: #c56c50;
  --mint: #e2eddf;
  font-family: Inter, ui-sans-serif, system-ui, "Noto Sans SC", sans-serif;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 30px;
}
body {
  background: var(--paper);
  color: var(--ink);
  font:
    15px/1.55 system-ui,
    "Noto Sans SC",
    sans-serif;
  margin: 0;
  min-width: 320px;
}
.app-shell {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
}
.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #143c3d;
  color: #eef4df;
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 30px 10px;
  gap: 54px;
}
.rail .brand {
  font: italic 40px Georgia;
  color: #f0e4c5;
  position: relative;
  text-decoration: none;
}
.brand span {
  font-size: 20px;
  position: absolute;
  top: -5px;
  right: -12px;
}
.rail nav {
  display: grid;
  gap: 30px;
}
.rail nav a {
  display: grid;
  text-align: center;
  color: #b8d1c4;
  text-decoration: none;
  font-size: 25px;
}
.rail nav span {
  font-size: 10px;
}
.rail small {
  margin-top: auto;
  font-size: 9px;
  letter-spacing: 0.15em;
  text-align: center;
}
main {
  width: 100%;
  max-width: 1570px;
  padding: 0 clamp(20px, 3.5vw, 58px) 30px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 28px 0;
}
.wordmark {
  font: 32px Georgia;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -1px;
}
.wordmark span {
  display: block;
  font: 11px system-ui;
  letter-spacing: 0;
  color: var(--muted);
}
.top-actions,
.button-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.badge {
  display: inline-block;
  font-size: 9px;
  letter-spacing: 0.12em;
  font-weight: 750;
  border: 1px solid #ccd8c9;
  border-radius: 20px;
  padding: 6px 10px;
  background: #f0f3e7;
  white-space: nowrap;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2 {
  font-family: Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1.1;
}
h1 {
  font-size: clamp(32px, 4vw, 60px);
  margin-bottom: 20px;
}
h2 {
  font-size: 32px;
  margin-bottom: 14px;
}
h3 {
  font-size: 15px;
  letter-spacing: -0.02em;
}
.eyebrow {
  font: 750 9px system-ui;
  letter-spacing: 0.17em;
  color: #4c6653;
  margin-bottom: 14px;
}
.muted {
  color: var(--muted);
  font-size: 12px;
}
.panel {
  margin: 0 0 22px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fffefa;
  box-shadow: 0 10px 30px #19382f04;
}
#notice {
  font-size: 13px;
  padding: 12px 16px;
  background: #e8eee2;
  border-radius: 9px;
  margin-bottom: 24px;
  min-height: 44px;
}
#notice.error {
  background: #fae7dd;
  color: #833c2b;
}
.entry {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 60px;
  padding: clamp(28px, 5vw, 70px);
  background:
    radial-gradient(ellipse at top left, #edf0dd, transparent 60%), #fffefa;
}
.entry h1 {
  font-size: clamp(44px, 5vw, 74px);
}
.entry form {
  align-self: center;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffefa;
}
.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 30px;
}
.entry-tags span {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 5px 9px;
  font-size: 10px;
}
.identity {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}
.identity h2 {
  font-size: 24px;
  margin-bottom: 0;
}
.identity .eyebrow {
  margin-bottom: 6px;
}
.identity form {
  display: flex;
  gap: 12px;
  align-items: end;
  margin-left: auto;
}
.identity #presence-status {
  width: 100%;
  margin: 0;
}
.world-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
}
.scene {
  padding: 0;
  overflow: hidden;
}
.scene .section-heading {
  padding: 26px 26px 4px;
}
.scene h1 {
  font-size: 38px;
  margin-bottom: 16px;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.section-heading .eyebrow {
  margin-bottom: 8px;
}
.scene iframe {
  border: 0;
  width: 100%;
  height: 520px;
  display: block;
  background: #bed8c2;
}
.location-list {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  padding: 18px 22px;
}
.location-list button {
  font-size: 11px;
  padding: 9px;
}
.activity-board {
  padding: 0 22px 15px;
  font-size: 12px;
}
.resident {
  background: linear-gradient(165deg, #edf0df, #faf9f0);
  padding: 24px;
}
.resident-portrait {
  display: grid;
  place-content: center;
  width: 75px;
  height: 75px;
  border: 6px solid #fff9;
  border-radius: 50%;
  font-size: 40px;
  color: #52775a;
  background: #d4e2c1;
  margin-bottom: 18px;
}
.resident h2 {
  font-size: 30px;
  margin-top: 16px;
}
.resident hr {
  border: 0;
  border-top: 1px solid #cfdbc9;
  margin: 24px 0;
}
.reply {
  border-left: 2px solid #a3b68e;
  padding-left: 12px;
  font-size: 12px;
  margin-top: 16px;
}
.social-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 26px;
  margin-top: 24px;
}
.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.card {
  background: #f7f8ef;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  flex: 1;
  min-width: 170px;
}
.card h4 {
  margin: 4px 0;
  font-size: 15px;
}
.card p {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 10px;
}
.card .avatar-dot {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: grid;
  place-content: center;
  font: 18px Georgia;
  background: #dfb19b;
}
.card .teal {
  background: #9fc9b8;
}
.card .violet {
  background: #c6b6d7;
}
.card .gold {
  background: #e6cd8d;
}
.rooms .card {
  min-width: 220px;
}
.stack {
  display: grid;
  gap: 8px;
}
button {
  min-height: 42px;
  background: #f4f6ed;
  color: var(--ink);
  border: 1px solid #cdd9c7;
  border-radius: 8px;
  font: 600 12px system-ui;
  padding: 10px 14px;
  cursor: pointer;
}
button:hover {
  background: #e9efdf;
}
button.primary {
  background: #1e4e47;
  color: #fff7df;
  border-color: #1e4e47;
}
button.primary:hover {
  background: #2f6258;
}
button.quiet {
  background: transparent;
  border: 1px solid var(--line);
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #cc8c60;
  outline-offset: 3px;
}
label {
  display: grid;
  font-size: 11px;
  font-weight: 650;
  gap: 5px;
  margin-bottom: 12px;
}
input,
select {
  min-width: 0;
  width: 100%;
  min-height: 42px;
  border: 1px solid #cfdbcb;
  border-radius: 8px;
  background: #fffefa;
  color: var(--ink);
  padding: 10px;
  font: 14px system-ui;
}
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 400;
}
.check input {
  width: 16px;
  min-height: 16px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.privacy-form {
  display: flex;
  gap: 22px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 20px;
}
.privacy-form label {
  margin-bottom: 0;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}
.chip {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 10px;
  font-size: 11px;
}
.chip button {
  border: 0;
  background: transparent;
  min-height: 28px;
  padding: 3px 6px;
  font-size: 10px;
}
.message-form {
  display: flex;
  gap: 10px;
}
.message-form input {
  flex: 1;
}
#messages {
  list-style: none;
  min-height: 100px;
  max-height: 340px;
  overflow: auto;
  padding: 12px;
  background: #f7f8f1;
  border-radius: 12px;
}
#messages li {
  margin: 10px 0;
  padding: 10px 14px;
  background: #fffefa;
  border: 1px solid #e5eadf;
  border-radius: 10px;
  overflow-wrap: anywhere;
}
#messages strong {
  font-size: 11px;
}
#messages p {
  white-space: pre-wrap;
  margin: 4px 0;
  font-size: 14px;
}
#timer {
  font-variant-numeric: tabular-nums;
  font-size: 18px;
}
#timer-warning {
  color: #aa5837;
}
#invite-form {
  margin-top: 20px;
}
#invite-form label {
  margin: 0;
}
#game {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 36px;
  align-items: center;
  background: linear-gradient(125deg, #e9efdf, #fffefa);
}
.game-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  aspect-ratio: 1;
}
.game-board button {
  font: 42px Georgia;
  aspect-ratio: 1;
  background: #fffefa;
  border: 1px solid #c2d1ba;
}
.game-board button[data-mark="X"] {
  color: #b8674d;
}
.game-board button[data-mark="O"] {
  color: #588f7c;
}
footer {
  padding: 15px 0;
  color: var(--muted);
  font-size: 11px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
[hidden] {
  display: none !important;
}
@media (max-width: 1100px) {
  .world-grid {
    grid-template-columns: 1fr;
  }
  .resident {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 25px;
  }
  .resident .resident-portrait {
    grid-row: span 2;
  }
  .resident hr {
    display: none;
  }
  .social-grid {
    grid-template-columns: 1fr 1fr;
  }
  .social-grid form {
    grid-column: span 2;
  }
  .identity form {
    margin: 0;
    flex-wrap: wrap;
  }
  .scene iframe {
    height: 560px;
  }
}
@media (max-width: 700px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .rail {
    position: static;
    flex-direction: row;
    height: 64px;
    padding: 8px 20px;
    gap: 25px;
  }
  .rail .brand {
    font-size: 30px;
  }
  .rail nav {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
  }
  .rail nav a {
    font-size: 18px;
  }
  .rail small {
    display: none;
  }
  main {
    padding: 0 14px 22px;
  }
  .topbar {
    padding: 20px 0;
  }
  .wordmark {
    font-size: 28px;
  }
  .wordmark span {
    font-size: 9px;
  }
  .top-actions {
    gap: 5px;
  }
  .top-actions .badge {
    display: none;
  }
  .top-actions button {
    padding: 8px;
    font-size: 10px;
  }
  .entry {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .entry form {
    padding: 20px;
  }
  .panel {
    padding: 20px;
  }
  .scene {
    padding: 0;
  }
  .scene .section-heading {
    padding: 20px;
  }
  .scene h1 {
    font-size: 30px;
  }
  .scene iframe {
    height: 430px;
  }
  .section-heading {
    align-items: start;
    flex-wrap: wrap;
  }
  .social-grid {
    grid-template-columns: 1fr;
  }
  .social-grid form {
    grid-column: auto;
  }
  .resident {
    display: block;
  }
  .identity form {
    display: grid;
    width: 100%;
  }
  .identity label {
    width: 100%;
  }
  .identity button {
    width: 100%;
  }
  #game {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .game-board {
    max-width: 300px;
    width: 100%;
    justify-self: center;
  }
  .message-form button {
    padding: 10px;
  }
  .privacy-form {
    gap: 16px;
  }
  .card {
    min-width: 100%;
    flex: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation: none !important;
    transition: none !important;
  }
}

.embedded-world {
  background: #bed8c2;
}
.embedded-world main {
  padding: 0;
  max-width: none;
  width: 100%;
}
.embedded-world .world-panel {
  border: 0;
  box-shadow: none;
  border-radius: 0;
}
.embedded-world .map-heading {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.embedded-world .map-heading h2,
.embedded-world .map-heading .eyebrow,
.embedded-world .touch-controls {
  display: none;
}
.embedded-world .navigation {
  display: block;
  padding: 8px 16px;
}
.embedded-world .destination-list legend {
  font-size: 10px;
}
.embedded-world .status {
  font-size: 11px;
  margin: 6px 16px;
}
.embedded-world .destination-buttons button {
  font-size: 10px;
  min-height: 35px;
  padding: 7px;
}
.embedded-world .mode-toggle {
  font-size: 10px;
  min-height: 32px;
  padding: 7px;
}
.embedded-world .world-panel h2 {
  font-size: 14px;
}

.embedded-world .world-panel {
  margin: 0;
  padding: 0;
}

.directory-frame {
  width: 100%;
  height: 1100px;
  border: 0;
  border-radius: 16px;
}

/* WM03: the 3D host must not widen a small phone to its header's min-content size. */
@media(max-width:700px) {
 body:has(#world-frame) .app-shell { grid-template-columns:minmax(0,1fr); }
 body:has(#world-frame) .app-shell > :is(main,.rail) { min-width:0; max-width:100%; }
 body:has(#world-frame) .topbar { flex-wrap:wrap; gap:12px; }
 body:has(#world-frame) .top-actions { min-width:0; max-width:100%; }
 body:has(#world-frame) .rail { gap:12px; padding:8px 14px; }
 body:has(#world-frame) .rail nav { min-width:0; width:auto; flex:1; gap:8px; }
 body:has(#world-frame) .rail nav a { min-width:0; flex:1; }
 body:has(#world-frame) .panel button { max-width:100%; white-space:normal; overflow-wrap:anywhere; }
}

html:has(#world-frame[data-game-open]) { overflow: hidden; }
#world-frame[data-game-open] {
 position: fixed !important; inset: 0 !important; z-index: 1000 !important;
 display: block !important; width: 100vw !important; height: 100dvh !important;
 max-width: none !important; max-height: none !important; margin: 0 !important; border: 0 !important;
}


/* Keep working app panels above the retained world in the chosen full-screen mode. */
#fullscreen-module{position:fixed;inset:0;width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;border:0;padding:8px;background:var(--background,#f7fafb);color:var(--text,#183e43);overflow:auto}
#fullscreen-module>header{position:sticky;top:-8px;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px;background:#f7fafb;border-bottom:1px solid #b6c9cc}
#fullscreen-module-return{min-height:44px;flex:none}
#fullscreen-module>:is(section,aside){position:static;width:100%;max-width:1200px;margin:8px auto}

#fullscreen-profile{height:calc(100% - 76px);display:flex;flex-direction:column}#fullscreen-profile>h2{margin:0 0 4px;font-size:1rem}#fullscreen-profile>iframe{width:100%;flex:1;min-height:0;border:0}
