:root {
  --ink: #f3e6c8;
  --ink-deep: #1a1520;
  --muted: #b8a88a;
  --paper: #1c2433;
  --gold: #d4a84b;
  --gold-bright: #f0d78c;
  --gold-deep: #8a6a28;
  --mist: #8fa4b8;
  --sky-dusk: #2a3348;
  --stone: #cfc6b4;
  --stone-deep: #6a6358;
  --leaf: #c9a227;
  --leaf-deep: #8a6a28;
  --sun: #f0d78c;
  --coral: #e0896a;
  --panel: rgba(22, 28, 40, 0.78);
  --line: rgba(212, 168, 75, 0.28);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --font-display: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  --font-body: "Noto Serif SC", "Songti SC", serif;
  --palace: url("assets/palace-ref.jpg");
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  color: var(--ink);
  font-family: var(--font-body);
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(12, 14, 22, 0.55) 0%, rgba(18, 22, 34, 0.72) 45%, rgba(10, 12, 18, 0.88) 100%),
    var(--palace) center top / cover no-repeat fixed,
    linear-gradient(180deg, #1a2030, #0c1018);
}

#app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 20px 32px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(160deg, var(--gold-bright), var(--gold) 45%, var(--gold-deep));
  color: #1a1520;
  font-family: var(--font-display);
  font-size: 28px;
  border: 1px solid rgba(255, 236, 180, 0.55);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 10px 28px rgba(212, 168, 75, 0.35);
}

.brand h1 {
  font-family: var(--font-display);
  font-size: 30px;
  letter-spacing: 0.06em;
  line-height: 1.15;
  color: var(--gold-bright);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}

.subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
  letter-spacing: 0.08em;
}

.stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow);
  font-size: 14px;
  backdrop-filter: blur(10px);
}

.stat strong { font-size: 18px; font-weight: 800; color: var(--gold-bright); }
.stat .label, .stat .unit { color: var(--muted); font-size: 12px; }
.stat .unit { margin-right: 2px; }
.stat .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.stat.coin .dot { background: var(--gold); }
.stat.fame .dot { background: var(--coral); }
.stat.kids .dot { background: var(--mist); }

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.85fr);
  gap: 16px;
  min-height: 560px;
}

.campus {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(212, 168, 75, 0.4);
  box-shadow:
    var(--shadow),
    inset 0 0 0 1px rgba(255, 236, 180, 0.08);
  background:
    linear-gradient(180deg, rgba(42, 48, 68, 0.35), rgba(18, 22, 34, 0.55)),
    radial-gradient(ellipse at 50% 20%, rgba(240, 215, 140, 0.22), transparent 55%),
    linear-gradient(180deg, #3a455c 0%, #2a3348 40%, #1a2030 100%);
  min-height: 520px;
}

.sky {
  position: absolute;
  inset: 0 0 40% 0;
  background:
    radial-gradient(ellipse at 50% 70%, rgba(240, 180, 80, 0.35) 0%, transparent 55%),
    radial-gradient(circle at 18% 30%, rgba(255,255,255,0.12) 0 28px, transparent 30px),
    radial-gradient(circle at 78% 22%, rgba(255,255,255,0.1) 0 22px, transparent 24px);
  animation: drift 22s linear infinite;
}

.hill {
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: 26%;
  height: 48%;
  background:
    radial-gradient(120% 90% at 18% 100%, #2c3344 0 42%, transparent 43%),
    radial-gradient(100% 80% at 55% 100%, #3a4256 0 48%, transparent 49%),
    radial-gradient(90% 70% at 88% 100%, #252b3a 0 40%, transparent 41%);
  filter: drop-shadow(0 -20px 40px rgba(180, 200, 220, 0.12));
}

.plaza {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 8%;
  height: 26%;
  border-radius: 40% 40% 14px 14px / 40% 40% 14px 14px;
  background: linear-gradient(180deg, #b8ad96, #7a7162);
  box-shadow:
    inset 0 8px 18px rgba(255, 236, 180, 0.18),
    0 0 40px rgba(212, 168, 75, 0.15);
  border: 1px solid rgba(212, 168, 75, 0.25);
}

.campus-tag {
  position: absolute;
  top: 14px;
  left: 16px;
  z-index: 2;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-bright);
  background: rgba(18, 22, 34, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  letter-spacing: 0.06em;
  backdrop-filter: blur(8px);
}

.rooms {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-content: end;
  gap: 12px;
  padding: 0 6% 18%;
}

.room {
  position: relative;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: center;
  color: var(--ink);
  font: inherit;
  transition: transform 0.18s ease;
}

.room:hover { transform: translateY(-4px); }
.room:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; border-radius: 12px; }

.room-body {
  height: 88px;
  border-radius: 12px 12px 6px 6px;
  border: 1px solid rgba(212, 168, 75, 0.45);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.room-body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 12px;
  background: linear-gradient(180deg, rgba(240, 215, 140, 0.55), rgba(212, 168, 75, 0.2));
  border-radius: 0 0 8px 8px;
}

.room.locked .room-body {
  filter: grayscale(0.5) brightness(0.75);
  opacity: 0.7;
}

.room-icon { font-size: 28px; position: relative; z-index: 1; }
.room-name {
  margin-top: 8px;
  font-weight: 700;
  font-size: 14px;
  color: var(--gold-bright);
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.room-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.room.lv1 .room-body { background: linear-gradient(160deg, #e8d9b0, #a89058); }
.room.lv2 .room-body { background: linear-gradient(160deg, #d8e4f0, #6a7f98); }
.room.lv3 .room-body { background: linear-gradient(160deg, #f0d4c0, #b07858); }
.room.lv0 .room-body { background: linear-gradient(160deg, #6a6570, #3a3842); }

.floaters {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.floater {
  position: absolute;
  bottom: 12%;
  font-size: 22px;
  animation: walk 9s linear forwards;
  filter: drop-shadow(0 4px 2px rgba(0,0,0,0.35));
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.panel-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.panel-block h2 {
  font-family: var(--font-display);
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--gold-bright);
  letter-spacing: 0.06em;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 12px;
}

.actions {
  display: grid;
  gap: 8px;
}

.actions button,
.facility button,
.overlay button {
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

.actions button:hover,
.facility button:hover,
.overlay button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.actions button:disabled,
.facility button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold) 50%, var(--gold-deep));
  color: #1a1520;
  box-shadow: 0 8px 22px rgba(212, 168, 75, 0.28);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  border: 1px solid var(--line) !important;
}
.btn-warn {
  background: linear-gradient(135deg, #e8a060, #c46a38);
  color: #1a1520;
}

.btn-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  text-align: left;
}

.btn-row small {
  display: block;
  font-weight: 500;
  opacity: 0.85;
  margin-top: 2px;
}

.facility-list {
  display: grid;
  gap: 8px;
}

.facility {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(212, 168, 75, 0.18);
}

.facility h3 { font-size: 14px; color: var(--ink); }
.facility p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.facility button {
  padding: 8px 10px;
  background: rgba(212, 168, 75, 0.12);
  border: 1px solid var(--line) !important;
  color: var(--gold-bright);
  white-space: nowrap;
}

.log-block { flex: 1; min-height: 140px; display: flex; flex-direction: column; }

.log {
  list-style: none;
  overflow: auto;
  max-height: 160px;
  display: grid;
  gap: 6px;
}

.log li {
  font-size: 12px;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid var(--gold);
}

.overlay {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 10, 16, 0.35) 0%, rgba(8, 10, 16, 0.72) 100%),
    var(--palace) center / cover no-repeat;
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 1000;
  pointer-events: auto;
}

.overlay .card {
  pointer-events: auto;
  position: relative;
  z-index: 1001;
}

.overlay.hidden { display: none; }

.card {
  width: min(460px, 100%);
  background:
    linear-gradient(165deg, rgba(36, 42, 58, 0.92), rgba(18, 22, 34, 0.94));
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(212, 168, 75, 0.45),
    inset 0 1px 0 rgba(240, 215, 140, 0.2);
  text-align: center;
  color: var(--ink);
}

.eyebrow {
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.16em;
  font-size: 12px;
  margin-bottom: 8px;
}

.card h2 {
  font-family: var(--font-display);
  font-size: 34px;
  margin-bottom: 10px;
  color: var(--gold-bright);
  letter-spacing: 0.04em;
}

.card > p {
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}

.card strong { color: var(--gold-bright); }

.goals {
  text-align: left;
  margin: 16px 0 20px;
  padding-left: 18px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.75;
}

.goals li::marker { color: var(--gold); }

.overlay button {
  width: 100%;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold) 55%, var(--gold-deep));
  color: #1a1520;
  padding: 14px;
  font-size: 16px;
  letter-spacing: 0.08em;
  box-shadow: 0 10px 28px rgba(212, 168, 75, 0.35);
}

.start-tip {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.start-tip a {
  color: var(--gold-bright) !important;
}

@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(36px); }
}

@keyframes walk {
  from { transform: translateX(-40px); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  to { transform: translateX(110vw); opacity: 0; }
}

#view-fp {
  background: #0c1018;
  display: flex;
  flex-direction: column;
}

#view-fp.hidden { display: none; }

#stage:fullscreen,
#stage:-webkit-full-screen,
body.fp-maximized #stage {
  width: 100vw;
  height: 100vh;
  max-width: none;
  border-radius: 0;
  margin: 0;
}

body.fp-maximized #app {
  max-width: none;
  padding: 0;
  height: 100vh;
}

body.fp-maximized .topbar,
body.fp-maximized .view-tabs,
body.fp-maximized .panel,
body.fp-maximized .subtitle {
  display: none !important;
}

body.fp-maximized .layout {
  grid-template-columns: 1fr;
  height: 100vh;
  min-height: 100vh;
  gap: 0;
}

body.fp-maximized #stage,
body.fp-maximized #view-fp {
  min-height: 100vh;
  height: 100vh;
}

.fp-talk-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

#fp-canvas {
  width: 100%;
  height: calc(100% - 0px);
  flex: 1;
  display: block;
  cursor: crosshair;
  touch-action: none;
  background: #2a3348;
}

#fp-canvas:active { cursor: grabbing; }

.fp-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 14px 14px;
  z-index: 5;
}

.fp-top, .fp-prompt, .fp-talk, .fp-role, .role-btn, .btn-chip,
.mobile-controls, .mobile-controls * {
  pointer-events: auto;
}

.fp-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.fp-role { display: flex; gap: 6px; flex-wrap: wrap; }

.role-btn {
  border: 1px solid rgba(212, 168, 75, 0.4);
  background: rgba(18, 22, 34, 0.65);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.role-btn.active {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-deep));
  color: #1a1520;
  border-color: transparent;
}

#btn-voice-test {
  background: linear-gradient(135deg, var(--gold-bright), #e08a1e);
  border-color: transparent;
  color: #1a1520;
  font-weight: 900;
  animation: voicePulse 1.2s ease-in-out infinite;
}

@keyframes voicePulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(212, 168, 75, 0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 18px rgba(212, 168, 75, 0.45); }
}

.fp-keys {
  color: rgba(243, 230, 200, 0.9);
  font-size: 12px;
  background: rgba(8, 10, 16, 0.55);
  border: 1px solid rgba(212, 168, 75, 0.25);
  border-radius: 999px;
  padding: 7px 12px;
  backdrop-filter: blur(8px);
}

.fp-prompt {
  align-self: center;
  margin-bottom: 8px;
  background: rgba(18, 22, 34, 0.88);
  color: var(--gold-bright);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  max-width: 90%;
  text-align: center;
  backdrop-filter: blur(10px);
}

.fp-talk {
  align-self: center;
  width: min(560px, 96%);
  background: rgba(18, 22, 34, 0.92);
  border: 1px solid rgba(212, 168, 75, 0.45);
  border-radius: 16px;
  padding: 14px 14px 12px;
  display: grid;
  gap: 8px;
  margin-bottom: 4px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
}

.fp-talk.hidden { display: none; }

.fp-talk-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.1em;
}

.fp-talk .bubble {
  font-size: 14px;
  line-height: 1.55;
  max-width: 100%;
}

.fp-talk .btn-chip { justify-self: end; }

.view-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.view-tab {
  border: 1px solid var(--line);
  background: rgba(18, 22, 34, 0.65);
  border-radius: 999px;
  padding: 8px 16px;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  color: var(--muted);
  backdrop-filter: blur(8px);
}

.view-tab.active {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-deep));
  color: #1a1520;
  border-color: transparent;
}

.view-pane {
  position: absolute;
  inset: 0;
}

.view-pane.hidden { display: none; }

.interior, .desk-scene {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

.room-bg {
  flex: 1;
  margin: 18px 18px 0;
  border-radius: 18px;
  border: 1px solid rgba(212, 168, 75, 0.3);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #3a4256 0%, #2a3142 55%, #1e2433 100%);
}

.room-bg::before {
  content: attr(data-label);
  position: absolute;
  top: 14px;
  left: 16px;
  font-weight: 800;
  font-size: 14px;
  color: var(--gold-bright);
  background: rgba(18, 22, 34, 0.75);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 999px;
}

.room-bg.theme-lobby { background: linear-gradient(180deg, #4a4550, #2a2832); }
.room-bg.theme-hotline { background: linear-gradient(180deg, #3a4a5c, #243040); }
.room-bg.theme-counsel { background: linear-gradient(180deg, #4a4038, #2e2822); }
.room-bg.theme-family { background: linear-gradient(180deg, #463c34, #2c2620); }
.room-bg.theme-sand { background: linear-gradient(180deg, #4a4434, #322e24); }
.room-bg.theme-group { background: linear-gradient(180deg, #3a4638, #262e24); }
.room-bg.theme-calm { background: linear-gradient(180deg, #384450, #242c36); }
.room-bg.theme-stress { background: linear-gradient(180deg, #403850, #2a2436); }
.room-bg.theme-vent { background: linear-gradient(180deg, #4a3834, #302422); }
.room-bg.theme-career { background: linear-gradient(180deg, #384850, #243038); }
.room-bg.theme-legal { background: linear-gradient(180deg, #3a4240, #262c2a); }

.room-bg::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 18%;
  height: 28%;
  border-radius: 16px;
  background: rgba(212, 168, 75, 0.08);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(212, 168, 75, 0.15);
}

.actors {
  position: absolute;
  left: 40px;
  right: 40px;
  bottom: 120px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 2;
}

.actor { text-align: center; }

.actor .avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 36px;
  background: linear-gradient(160deg, #e8d9b0, #8a6a28);
  border: 2px solid rgba(240, 215, 140, 0.7);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.actor .name {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-bright);
  background: rgba(18, 22, 34, 0.8);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
}

.bubbles {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 70px;
  display: grid;
  gap: 8px;
  z-index: 3;
}

.bubble {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.bubble.from-visitor {
  justify-self: start;
  background: rgba(255, 252, 245, 0.95);
  color: #1a1520;
  border: 1px solid rgba(212, 168, 75, 0.35);
  border-bottom-left-radius: 4px;
}

.bubble.from-staff {
  justify-self: end;
  background: linear-gradient(135deg, rgba(212, 168, 75, 0.35), rgba(138, 106, 40, 0.55));
  color: var(--ink);
  border: 1px solid rgba(240, 215, 140, 0.35);
  border-bottom-right-radius: 4px;
}

.scene-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 12px 18px 16px;
  background: rgba(12, 14, 22, 0.72);
  border-top: 1px solid var(--line);
}

.scene-bar label {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

.scene-bar select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  background: rgba(18, 22, 34, 0.9);
  color: var(--ink);
}

.btn-chip {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-deep));
  color: #1a1520;
}

.btn-chip.secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  border: 1px solid var(--line);
}

.desk-scene {
  background: linear-gradient(180deg, #2a3348 0%, #1c2230 40%, #141820 100%);
}

.desk-wall {
  display: flex;
  justify-content: space-between;
  padding: 24px 28px 0;
}

.poster, .board {
  background: rgba(18, 22, 34, 0.85);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--gold-bright);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.board { text-align: right; color: var(--gold); font-size: 13px; }
.board span { display: block; margin-top: 4px; color: var(--ink); font-size: 15px; }

.desk {
  margin: 24px 28px 0;
  background: linear-gradient(180deg, #8a6a40, #4a3824);
  border: 1px solid rgba(212, 168, 75, 0.35);
  border-radius: 16px 16px 8px 8px;
  min-height: 140px;
  padding: 16px;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
}

.phone, .notes {
  background: rgba(18, 22, 34, 0.9);
  border: 1px solid rgba(212, 168, 75, 0.2);
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.notes { font-weight: 500; line-height: 1.5; color: var(--muted); }

.desk-bubbles {
  position: relative;
  bottom: auto;
  left: auto;
  right: auto;
  padding: 12px 28px 0;
}

@media (max-width: 920px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .campus { min-height: 420px; }
  .rooms { padding-bottom: 22%; }
  .room-body { height: 72px; }
  .actors { bottom: 150px; left: 20px; right: 20px; }
  .brand h1 { font-size: 24px; }
}

/* —— 手机适配版（本目录专用） —— */
html, body {
  height: 100%;
  height: 100dvh;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-attachment: scroll;
}

#app {
  max-width: 100%;
  padding: 10px 10px calc(12px + env(safe-area-inset-bottom, 0px));
  gap: 10px;
  min-height: 100dvh;
}

.topbar {
  gap: 8px;
  align-items: flex-start;
}

.brand-mark {
  width: 42px;
  height: 42px;
  font-size: 22px;
  border-radius: 12px;
  flex-shrink: 0;
}

.brand h1 {
  font-size: 18px;
  letter-spacing: 0.04em;
}

.subtitle {
  font-size: 11px;
  letter-spacing: 0.04em;
}

.stats {
  width: 100%;
  justify-content: space-between;
  gap: 6px;
}

.stat {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 12px;
  font-size: 12px;
  justify-content: center;
}

.stat strong { font-size: 15px; }
.stat .label, .stat .unit { font-size: 10px; }

.view-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.view-tab {
  padding: 10px 4px;
  font-size: 11px;
  text-align: center;
  border-radius: 12px;
  white-space: nowrap;
}

.layout {
  grid-template-columns: 1fr;
  min-height: 0;
  gap: 12px;
  flex: 1;
}

.campus {
  min-height: min(62vh, 520px);
  height: min(62vh, 560px);
  border-radius: 16px;
}

#view-fp {
  display: flex;
  flex-direction: column;
}

.fp-hud {
  padding: 8px 8px calc(108px + env(safe-area-inset-bottom, 0px));
}

.fp-top {
  flex-direction: column;
  gap: 6px;
}

.fp-keys {
  font-size: 11px;
  padding: 6px 10px;
  max-width: 100%;
  line-height: 1.35;
  border-radius: 12px;
}

.role-btn {
  padding: 8px 10px;
  font-size: 11px;
}

.fp-prompt {
  font-size: 12px;
  padding: 8px 12px;
  margin-bottom: 4px;
  max-width: 96%;
}

.fp-talk {
  width: min(100%, 96%);
  padding: 10px;
  margin-bottom: 0;
  max-height: 38%;
  overflow-y: auto;
}

.fp-talk .bubble { font-size: 13px; }

.fp-talk-actions {
  justify-content: stretch;
}

.fp-talk-actions .btn-chip {
  flex: 1;
  min-height: 40px;
}

.mobile-controls {
  pointer-events: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 12px calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 8;
  gap: 12px;
}

.mobile-controls .stick,
.mobile-controls .touch-actions {
  pointer-events: auto;
}

.stick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  user-select: none;
}

.stick-base {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: rgba(8, 10, 16, 0.45);
  border: 1px solid rgba(212, 168, 75, 0.35);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.35);
  position: relative;
  touch-action: none;
  backdrop-filter: blur(8px);
}

.stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--gold-bright), var(--gold-deep));
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 236, 180, 0.45);
  transition: box-shadow 0.12s ease;
}

.stick-knob.active {
  box-shadow: 0 0 0 3px rgba(240, 215, 140, 0.35), 0 8px 18px rgba(0, 0, 0, 0.45);
}

.stick-hint {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.touch-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
}

.touch-btn {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(212, 168, 75, 0.4);
  background: rgba(18, 22, 34, 0.78);
  color: var(--gold-bright);
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  touch-action: manipulation;
  user-select: none;
}

.touch-btn.primary {
  width: auto;
  min-width: 72px;
  padding: 0 14px;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-deep));
  color: #1a1520;
  border-color: transparent;
  font-size: 14px;
}

.touch-btn:active {
  transform: scale(0.96);
  filter: brightness(1.08);
}

.panel {
  gap: 10px;
}

.panel-block {
  padding: 12px;
  border-radius: 14px;
}

.panel-block h2 { font-size: 16px; }

.actions button,
.facility button,
.overlay button {
  min-height: 44px;
  padding: 12px;
  font-size: 14px;
}

.overlay .card {
  width: min(92vw, 420px);
  max-height: 88dvh;
  overflow-y: auto;
  padding: 20px 18px;
  margin: 12px;
}

.overlay .card h2 { font-size: 22px; }
.overlay .card p,
.overlay .card li { font-size: 14px; }

.rooms {
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 4% 20%;
}

.room-body { height: 64px; }
.room-icon { font-size: 22px; }
.room-name { font-size: 12px; }
.room-meta { font-size: 11px; }

.scene-bar {
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
}

.scene-bar label,
.scene-bar select,
.scene-bar .btn-chip {
  font-size: 13px;
}

.btn-chip {
  min-height: 40px;
  padding: 8px 12px;
}

body.fp-maximized .fp-hud {
  padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px));
}

body.fp-maximized .mobile-controls {
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 380px) {
  .view-tab { font-size: 10px; padding: 9px 2px; }
  .stick-base { width: 96px; height: 96px; }
  .stick-knob { width: 40px; height: 40px; margin: -20px 0 0 -20px; }
  .touch-btn { width: 44px; height: 44px; }
  .campus {
    min-height: 52vh;
    height: 54vh;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .topbar { display: none; }
  .view-tabs { display: none; }
  .panel { display: none; }
  #app { padding: 0; gap: 0; }
  .layout { gap: 0; min-height: 100dvh; }
  .campus {
    min-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
    border: none;
  }
  .fp-hud {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }
  .stick-base { width: 88px; height: 88px; }
  .mobile-controls {
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }
}
