:root {
  font-family: 'Yu Gothic', 'Meiryo', system-ui, sans-serif;
  color: #293f36;
  background: #f5f1e6;
  font-synthesis: none;
  --green: #337a62;
  --ink: #293f36;
  --line: #dddccd;
  --muted: #738076;
  --paper: #fffdf6;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #db9d35;
  outline-offset: 3px;
}
button {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  padding: 11px 17px;
  min-height: 44px;
  font-weight: 700;
  transition:
    background 0.12s,
    transform 0.12s;
}
button:hover:not(:disabled) {
  background: #e9eddf;
  transform: translateY(-1px);
}
button.primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
button.primary:hover {
  background: #28664f;
}
button.quiet {
  border-color: transparent;
  background: transparent;
}
button.danger {
  color: #a34737;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 36px;
  letter-spacing: 0.02em;
}
h2 {
  font-size: 24px;
}
h3 {
  font-size: 17px;
}
.muted {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  font-weight: bold;
  color: var(--green);
  margin-bottom: 12px;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 15px 30px;
  border-bottom: 1px solid var(--line);
  background: #fffdf6;
  min-height: 83px;
}
.brand {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand small {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}
.brand-mark {
  width: 27px;
  height: 32px;
  border: 3px solid var(--green);
  border-bottom: none;
  border-radius: 5px 5px 0 0;
  position: relative;
}
.brand-mark:after {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green);
  position: absolute;
  right: 4px;
  top: 15px;
}
.spacer {
  flex: 1;
}
.profile {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
}
.profile select {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 8px;
  padding: 8px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ede8d6;
  border-radius: 30px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
}
.badge.friend {
  background: #fff0bd;
  color: #865c16;
}
.main {
  max-width: 1200px;
  margin: auto;
  padding: 42px 32px 60px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.between {
  justify-content: space-between;
}
.wrap {
  flex-wrap: wrap;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
}
.page-heading h1 {
  margin-bottom: 10px;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.destination {
  text-align: left;
  padding: 28px 24px;
  min-height: 255px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--paper);
  position: relative;
  overflow: hidden;
}
.destination h2 {
  margin-top: 21px;
  margin-bottom: 8px;
  font-size: 21px;
}
.destination p {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.7;
}
.destination .number {
  position: absolute;
  right: 20px;
  top: 17px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.object-art {
  height: 95px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.door-art {
  width: 63px;
  height: 89px;
  background: #d7a66a;
  border: 4px solid #465545;
  box-shadow:
    7px 0 0 #e9ddbc,
    -7px 0 0 #e9ddbc;
  border-radius: 7px 7px 0 0;
  position: relative;
  transform: rotate(-3deg);
}
.door-art:after {
  content: '';
  position: absolute;
  width: 9px;
  height: 9px;
  background: #f8df8a;
  border-radius: 50%;
  right: 8px;
  top: 48px;
}
.lounge-art {
  font-size: 67px;
  line-height: 1;
}
.map-art {
  display: grid;
  grid-template-columns: repeat(3, 22px);
  grid-template-rows: repeat(3, 22px);
  gap: 6px;
  transform: rotate(-5deg);
}
.map-art i {
  background: #8ca895;
  border-radius: 5px;
}
.map-art i:nth-child(2n) {
  background: #d5b16c;
}
.letter-art {
  font-size: 72px;
  color: #ae8860;
}
.stats {
  display: flex;
  gap: 30px;
  padding: 20px 0;
  font-size: 13px;
  color: var(--muted);
}
.stats strong {
  color: var(--ink);
  font-size: 24px;
  padding-right: 8px;
}
.home-bottom {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
}
.home-bottom h3 {
  margin-bottom: 12px;
}
.home-bottom p {
  font-size: 14px;
  line-height: 1.9;
}
.title-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 50px;
  padding: 8vw;
  position: relative;
  background: radial-gradient(ellipse at 80% 30%, #e0e7d3, transparent 55%), #f5f1e6;
}
.title-copy h1 {
  font-size: clamp(40px, 5vw, 76px);
  line-height: 1.35;
  margin: 24px 0;
}
.title-copy p {
  line-height: 2;
  color: var(--muted);
}
.title-actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
}
.title-actions button {
  min-width: 150px;
}
.title-room {
  height: 370px;
  background: #e8dcc0;
  border: 12px solid #fffdf4;
  border-radius: 22px;
  box-shadow: 0 30px 60px #42574618;
  position: relative;
  overflow: hidden;
  transform: rotate(2deg);
}
.title-room .window {
  position: absolute;
  left: 32px;
  top: 40px;
  width: 130px;
  height: 155px;
  background: #bdd4cb;
  border: 10px solid #fff9e9;
  border-radius: 80px 80px 0 0;
}
.title-room .window:after {
  content: '';
  position: absolute;
  left: 50%;
  height: 100%;
  width: 6px;
  background: #fff9e9;
}
.title-room .door-art {
  position: absolute;
  right: 52px;
  bottom: 45px;
  transform: scale(1.9);
  transform-origin: bottom;
}
.title-room .floor {
  position: absolute;
  bottom: 0;
  height: 45px;
  background: #8c7356;
  width: 100%;
}
.title-room .plant {
  position: absolute;
  left: 40px;
  bottom: 45px;
  font-size: 74px;
}
.title-room .room-caption {
  position: absolute;
  left: 18px;
  top: 15px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #617a63;
}
.title-footer {
  position: absolute;
  bottom: 30px;
  left: 8vw;
  font-size: 12px;
  color: var(--muted);
}
.map-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
}
.department-map {
  min-height: 540px;
  background-image: radial-gradient(#bfc9b8 1px, transparent 1px);
  background-size: 24px 24px;
  position: relative;
  border-radius: 18px;
  background-color: #eeefdf;
  overflow: hidden;
}
.map-lines {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.map-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 135px;
  padding: 16px 12px;
  box-shadow: 0 5px 0 #bcc8b44d;
}
.map-node:hover:not(:disabled) {
  transform: translate(-50%, -51%);
}
.map-node .avatar {
  margin: 0 auto 8px;
}
.map-node strong {
  display: block;
  font-size: 16px;
}
.map-node small {
  font-size: 10px;
  display: block;
  margin-top: 7px;
  font-weight: 400;
}
.map-node.locked {
  background: #e7e9df;
  color: #6b776a;
  border-style: dashed;
}
.map-node.active {
  border: 2px solid var(--green);
}
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--avatar, #337a62);
  color: white;
  font-weight: 900;
  font-size: 20px;
  flex-shrink: 0;
}
.map-aside {
  align-self: start;
}
.map-aside p {
  font-size: 14px;
  line-height: 1.8;
}
.map-aside button {
  width: 100%;
  margin-top: 10px;
}
.friend-progress {
  margin: 18px 0;
}
.meter {
  height: 6px;
  background: #e5e6d9;
  border-radius: 5px;
  overflow: hidden;
  margin: 10px 0;
}
.meter i {
  display: block;
  height: 100%;
  background: #d4a349;
}
.friend-progress small {
  font-size: 12px;
  color: var(--muted);
}
.activity-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.notification {
  display: flex;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}
.notification p {
  margin: 0;
  font-size: 14px;
  flex: 1;
}
.dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  flex-shrink: 0;
}
.dot.read {
  background: #d1d5c8;
}
.notification button {
  padding: 6px 10px;
  font-size: 12px;
  min-height: 32px;
}
.contact {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  text-align: left;
  margin: 8px 0;
}
.contact .info {
  flex: 1;
}
.contact strong {
  display: block;
}
.contact small {
  font-weight: 400;
  color: var(--muted);
}
.studio {
  padding: 14px 22px 20px;
  max-width: 1600px;
  margin: auto;
}
.editor-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.editor-bar button {
  padding: 9px 13px;
  font-size: 13px;
}
.save-state {
  font-size: 12px;
  color: var(--muted);
  margin-right: auto;
}
.studio-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.workbench {
  flex: 1;
  min-width: 0;
}
.stage-wrap {
  position: relative;
  background: #e1d6bc;
  border: 8px solid #fffdf6;
  border-radius: 15px;
  box-shadow: 0 4px 18px #283d3410;
  overflow: hidden;
  touch-action: none;
}
.stage-wrap canvas {
  display: block;
  width: 100%;
  aspect-ratio: 12/7;
  cursor: crosshair;
  transform-origin: center;
}
.stage-wrap.play canvas {
  cursor: default;
}
.stage-scroll {
  overflow: hidden;
}
.stage-info {
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 4px;
  color: var(--muted);
}
.drawer {
  width: 290px;
  flex-shrink: 0;
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 15px;
  max-height: 72vh;
  overflow: auto;
}
.drawer label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-top: 14px;
  margin-bottom: 6px;
}
input,
textarea,
select {
  color: var(--ink);
}
input:not([type='color']),
textarea {
  width: 100%;
  border: 1px solid #cbd0c1;
  border-radius: 8px;
  background: #fffef9;
  padding: 10px;
  font-size: 14px;
}
textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.7;
}
.drawer button {
  margin-top: 12px;
}
.tool-dock {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px;
  margin-top: 4px;
  border-radius: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  flex-wrap: wrap;
}
.tool {
  padding: 8px 12px;
  min-width: 64px;
  font-size: 12px;
  font-weight: 500;
}
.tool b {
  display: block;
  font-size: 19px;
  margin-bottom: 3px;
}
.tool small {
  font-size: 10px;
  color: var(--muted);
  margin-left: 4px;
}
.tool.selected {
  background: #fff0bb;
  border-color: #cfac55;
}
.dock-settings {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.dock-settings select {
  padding: 6px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--paper);
}
.connection-strip {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.connection-node {
  font-size: 12px;
  padding: 8px 12px;
  min-height: 38px;
  border-style: dashed;
  touch-action: none;
}
.connection-node.connected {
  border-style: solid;
  background: #e8eee1;
}
.connection-node.dragging {
  background: #fff0bb;
}
.connection-line {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
.connection-line line {
  stroke: #f7bb43;
  stroke-width: 5;
  stroke-dasharray: 8 5;
}
.play-header {
  padding: 20px 0 16px;
  display: flex;
  gap: 16px;
  align-items: center;
}
.play-header h2 {
  margin: 0;
}
.play-layout {
  max-width: 1200px;
  margin: auto;
  padding: 0 24px;
}
.play-side {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 275px;
  background: #fffdf5f0;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 8px 22px #283d3420;
}
.play-side p {
  font-size: 13px;
  line-height: 1.9;
}
.play-side h3 {
  margin-bottom: 8px;
}
.play-side button {
  font-size: 12px;
  padding: 8px 10px;
}
.play-side .close {
  position: absolute;
  right: 8px;
  top: 7px;
  padding: 3px;
  min-height: 25px;
  border: none;
  background: none;
}
.transition {
  animation: room-enter 0.3s ease-out;
}
@keyframes room-enter {
  from {
    opacity: 0.3;
    transform: translateX(25px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.touch-controls {
  display: flex;
  justify-content: space-between;
  margin: 10px 0;
}
.touch-controls button {
  min-width: 60px;
  user-select: none;
  touch-action: none;
}
.issue {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.7;
}
.issue.error {
  color: #a44839;
}
.issue.warning {
  color: #956b27;
}
.issue.ok {
  color: var(--green);
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 15px);
  padding: 13px 22px;
  border-radius: 12px;
  background: #293f36;
  color: white;
  box-shadow: 0 5px 20px #0002;
  max-width: min(650px, 90vw);
  font-size: 14px;
  line-height: 1.7;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  transition:
    opacity 0.15s,
    transform 0.15s;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  width: min(610px, calc(100vw - 32px));
  background: var(--paper);
  color: var(--ink);
  max-height: 90vh;
  box-shadow: 0 24px 80px #1f38283d;
}
dialog::backdrop {
  background: #21372e66;
  backdrop-filter: blur(3px);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.dialog-head h2 {
  margin: 0;
}
.dialog-head button {
  padding: 4px 12px;
  min-height: 34px;
}
.message-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.message-tabs button {
  font-size: 13px;
}
.message-tabs .selected {
  background: #e4ebd9;
  border-color: #729980;
}
.message-list {
  height: 270px;
  overflow: auto;
  background: #f1f0e5;
  padding: 16px;
  border-radius: 12px;
}
.message {
  margin-bottom: 15px;
  max-width: 86%;
}
.message.own {
  margin-left: auto;
}
.message .bubble {
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.7;
}
.message.own .bubble {
  background: #e0eadb;
}
.message small {
  font-size: 10px;
  color: var(--muted);
}
.message .delete {
  font-size: 10px;
  min-height: 18px;
  border: none;
  background: none;
  padding: 0 5px;
  font-weight: 400;
  color: var(--muted);
}
.compose {
  margin-top: 14px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.compose textarea {
  min-height: 70px;
  max-height: 140px;
}
.compose button {
  flex-shrink: 0;
}
.empty {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  padding: 40px 12px;
}
.helper {
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
  margin-top: 12px;
}
.friends-mini {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.friends-mini button {
  font-size: 13px;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}
.storage-warning {
  background: #fff0cc;
  padding: 12px 30px;
  font-size: 13px;
  color: #82551d;
}
.hidden {
  display: none !important;
}
@media (min-width: 1500px) {
  .play-layout {
    max-width: 1350px;
  }
}
@media (max-width: 1050px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .main {
    padding: 30px 22px;
  }
  .topbar {
    padding: 12px 20px;
    gap: 10px;
  }
  .brand small {
    display: none;
  }
  .drawer {
    width: 250px;
  }
  .studio {
    padding: 14px;
  }
  .tool {
    min-width: 55px;
    padding: 7px;
  }
  .title-screen {
    padding: 6vw;
    gap: 25px;
  }
  .map-layout {
    grid-template-columns: 1fr 260px;
  }
  .map-node {
    width: 110px;
  }
  .map-node strong {
    font-size: 13px;
  }
  .department-map {
    min-height: 470px;
  }
  .profile label {
    display: none;
  }
}
@media (max-width: 720px) {
  .topbar {
    flex-wrap: wrap;
  }
  .brand {
    font-size: 18px;
  }
  .topbar button {
    padding: 8px 11px;
    font-size: 12px;
  }
  .profile {
    margin-left: auto;
  }
  .profile select {
    max-width: 100px;
  }
  .title-screen {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 50px 25px 90px;
  }
  .title-copy h1 {
    font-size: 43px;
  }
  .title-room {
    height: 280px;
  }
  .title-footer {
    left: 25px;
    bottom: 20px;
  }
  .title-room .door-art {
    transform: scale(1.4);
  }
  .page-heading h1 {
    font-size: 28px;
  }
  .cards {
    gap: 10px;
  }
  .destination {
    padding: 20px 16px;
    min-height: 220px;
  }
  .destination h2 {
    font-size: 18px;
  }
  .home-bottom,
  .activity-layout,
  .map-layout {
    grid-template-columns: 1fr;
  }
  .department-map {
    min-height: 440px;
  }
  .map-node {
    width: 105px;
    padding: 10px 6px;
  }
  .map-aside {
    width: 100%;
  }
  .studio-layout {
    display: block;
  }
  .drawer {
    width: 100%;
    max-height: none;
    margin-top: 15px;
  }
  .tool-dock {
    gap: 4px;
    padding: 8px;
  }
  .tool {
    min-width: 50px;
    padding: 6px;
  }
  .dock-settings {
    width: 100%;
    margin: 5px 0 0;
  }
  .editor-bar {
    gap: 5px;
  }
  .editor-bar button {
    font-size: 11px;
    padding: 8px;
  }
  .play-layout {
    padding: 0 10px;
  }
  .play-header {
    flex-wrap: wrap;
  }
  .play-header h2 {
    font-size: 18px;
  }
  .play-side {
    position: relative;
    inset: auto;
    width: 100%;
    border-radius: 0;
  }
  .stage-wrap {
    border-width: 4px;
  }
  .stats {
    gap: 20px;
  }
  .stats strong {
    font-size: 20px;
  }
  .stage-info {
    font-size: 10px;
  }
  .main {
    padding: 25px 16px;
  }
  .connection-node {
    font-size: 11px;
    padding: 6px;
  }
  .touch-controls button {
    min-height: 48px;
  }
  .title-actions button {
    min-width: 125px;
  }
  .map-node .avatar {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
  .map-node .badge {
    font-size: 9px;
    padding: 2px 4px;
  }
  .compose {
    flex-wrap: wrap;
  }
  .compose button {
    margin-left: auto;
  }
}
/* Keep the board and tools together on laptop displays. */
.stage-scroll {
  height: clamp(250px, calc(100dvh - 370px), 700px);
  display: flex;
  justify-content: center;
}
.stage-scroll canvas {
  height: 100%;
  width: auto;
  max-width: 100%;
  aspect-ratio: 12/7;
}
.stage-wrap.play {
  height: clamp(280px, calc(100dvh - 265px), 760px);
  display: flex;
  justify-content: center;
}
.stage-wrap.play canvas {
  height: 100%;
  width: auto;
  max-width: 100%;
  aspect-ratio: 12/7;
}
.stage-wrap.play #employee-card {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.stage-wrap.play #employee-card > * {
  pointer-events: auto;
}
@media (max-width: 720px) {
  .stage-scroll {
    height: auto;
  }
  .stage-scroll canvas {
    width: 100%;
    height: auto;
  }
  .stage-wrap.play {
    height: auto;
    display: block;
  }
  .stage-wrap.play canvas {
    width: 100%;
    height: auto;
  }
  .stage-wrap.play #employee-card {
    position: static;
  }
}

.texture-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.texture-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}
.texture-choice {
  padding: 6px;
  font-size: 11px;
  font-weight: 500;
}
.texture-choice.selected {
  background: #fff0bb;
  border-color: #cda446;
}
.swatch {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 25px;
  background: #e3d3b4;
  margin-bottom: 5px;
}
.swatch-wood {
  background: repeating-linear-gradient(0deg, #a98761 0px, #a98761 6px, #886344 7px, #b5936d 8px);
}
.swatch-books {
  background: repeating-linear-gradient(
    90deg,
    #a6c8b6 0px,
    #a6c8b6 9px,
    #ddaf70 9px,
    #ddaf70 18px,
    #c7806e 18px,
    #c7806e 26px
  );
}
.swatch-music {
  background: #dcb581;
}
.swatch-outdoors {
  background: #abc39e;
}
.swatch-game {
  background: #d3c8e1;
}
.swatch-photo {
  background: #b3d3d2;
}
.swatch-food {
  background: #e7c7a1;
}
.favorite-line {
  font-size: 12px;
  line-height: 1.8;
}
.favorite-teasers {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.favorite-teasers span {
  font-size: 12px;
  border-radius: 7px;
  background: #f1eddf;
  padding: 6px 8px;
}
.favorites-gallery {
  display: grid;
  gap: 16px;
}
.favorite-card {
  display: grid;
  grid-template-columns: 125px 1fr;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.favorite-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8dfc7;
  min-height: 170px;
}
.favorite-cover span {
  font-size: 57px;
}
.favorite-cover img {
  width: 100%;
  height: 100%;
  max-height: 250px;
  object-fit: cover;
}
.category-book {
  background: #dfd9ca;
}
.category-music {
  background: #e4c8ab;
}
.category-photo {
  background: #cfdfda;
}
.category-outdoors,
.category-plant {
  background: #d9e5ce;
}
.category-game {
  background: #e1d8e8;
}
.category-food {
  background: #ecd5bf;
}
.favorite-content {
  padding: 18px;
}
.favorite-content small {
  font-size: 11px;
  color: var(--muted);
}
.favorite-content h3 {
  margin: 7px 0 10px;
}
.favorite-content p {
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.favorite-content button {
  font-size: 12px;
  padding: 8px 12px;
}
.favorite-edit {
  display: flex;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}
.favorite-photo {
  width: 90px;
  height: 90px;
  border-radius: 12px;
  background: #e8dfc7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.favorite-photo span {
  font-size: 40px;
}
.favorite-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.favorite-fields {
  flex: 1;
  min-width: 0;
}
.favorite-fields label {
  font-size: 12px;
  font-weight: bold;
  display: block;
  margin: 7px 0;
}
.favorite-fields select {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  background: #fffef9;
  border-radius: 8px;
}
.favorite-fields textarea {
  min-height: 75px;
}
.photo-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.photo-actions .photo-upload {
  cursor: pointer;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  min-height: 38px;
}
.photo-actions button {
  font-size: 11px;
  padding: 6px 8px;
}
.topic-chip {
  padding: 11px 13px;
  background: #fff0bd;
  border-radius: 10px;
  margin-top: 14px;
  font-size: 13px;
}
.message-topic {
  padding-bottom: 7px;
  margin-bottom: 7px;
  border-bottom: 1px solid #b8c9b0;
  font-size: 11px;
  color: #587257;
}
.home-bottom .card button + button {
  margin: 8px 0 0 8px;
}
@media (max-width: 720px) {
  .favorite-edit {
    display: block;
  }
  .favorite-photo {
    margin-bottom: 12px;
  }
  .favorite-card {
    grid-template-columns: 85px 1fr;
  }
  .favorite-cover span {
    font-size: 37px;
  }
  .favorite-content {
    padding: 12px;
  }
  .favorite-fields {
    width: 100%;
  }
  .home-bottom .card button + button {
    margin-left: 0;
  }
}
.favorite-edit[hidden] {
  display: none;
}
.count-label {
  font-size: 14px;
  font-weight: bold;
  display: block;
  margin: 10px 0;
}
.count-select,
#shelf-count {
  padding: 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--paper);
  max-width: 100%;
}
.trace-home {
  margin-top: 20px;
}
.trace-home h3 {
  margin: 0;
}
.visitor-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}
.visitor-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 13px;
}
.visitor-chip .avatar {
  width: 32px;
  height: 32px;
  font-size: 15px;
}
.visitor-chip strong {
  display: block;
  font-size: 13px;
}
.visitor-chip small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.trace-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.trace-row > div {
  flex: 1;
  min-width: 0;
}
.trace-row strong {
  display: block;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.trace-row small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 6px;
}
.trace-row button {
  padding: 8px 10px;
  font-size: 12px;
  flex-shrink: 0;
}
.exhibit-reactions {
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.stamp-buttons {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.stamp-button {
  font-size: 12px !important;
  padding: 7px 9px !important;
  background: #f4efe0;
  min-height: 38px;
}
.stamp-button.selected {
  background: #ffedb1;
  border-color: #cfaa55;
}
.stamp-button span {
  margin-left: 4px;
  font-weight: 900;
}
.exhibit-reactions > small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}
.stamp-people {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.stamp-people button {
  padding: 3px 0;
  min-height: 26px;
  font-size: 11px;
  font-weight: 500;
}
.stamp-people i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 5px;
}
.stamp-people > span {
  font-size: 11px;
  align-self: center;
  color: var(--muted);
}
@media (max-width: 720px) {
  .trace-home > .row {
    flex-wrap: wrap;
  }
  .trace-row {
    flex-wrap: wrap;
  }
  .trace-row > div {
    min-width: 150px;
  }
  .trace-row button {
    margin-left: auto;
  }
  .stamp-buttons {
    gap: 5px;
  }
}

.auth-shell,
.admin-shell {
  max-width: 1100px;
  margin: 5vh auto;
  padding: 22px;
}
.auth-card {
  max-width: 520px;
  margin: 6vh auto;
  background: #fffef9;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(22px, 5vw, 42px);
  box-shadow: 0 20px 60px #22301b12;
}
.auth-card h1,
.admin-head h1 {
  font-size: clamp(24px, 4vw, 36px);
  margin: 12px 0;
}
.auth-card label,
.admin-shell label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  margin: 14px 0;
}
.auth-card input,
.admin-shell input,
.admin-shell select,
.admin-shell textarea,
.auth-card select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fffefa;
  font: inherit;
}
.auth-card button {
  margin: 8px 8px 8px 0;
}
.auth-tabs,
.admin-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  margin: 20px 0;
}
.auth-tabs button,
.admin-tabs button {
  border: 0;
  background: transparent;
  border-radius: 9px 9px 0 0;
}
.auth-tabs button.selected,
.admin-tabs button.selected {
  background: #e8eee2;
  color: #285b46;
}
.auth-submit {
  width: 100%;
  margin-top: 18px !important;
}
.auth-error {
  color: #8c3027;
  background: #fff0ed;
  padding: 12px;
  border-radius: 9px;
}
.auth-error[hidden] {
  display: none;
}
.notice {
  padding: 12px;
  border-radius: 9px;
  background: #e8f4e9;
  color: #285b46;
}
.assignment-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f4f1e7;
  font-size: 14px;
}
.consent-check {
  display: flex !important;
  align-items: center;
  gap: 10px;
}
.consent-check input {
  width: auto !important;
}
.admin-shell {
  max-width: 1200px;
}
.admin-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}
.admin-actions,
.row.wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-shell footer {
  margin: 30px 0;
  color: var(--muted);
  font-size: 12px;
}
.admin-shell footer button {
  margin-left: 12px;
}
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 430px), 1fr));
  gap: 16px;
}
.admin-shell > .card,
.admin-grid > .card {
  margin: 16px 0;
}
.admin-shell textarea {
  font:
    12px/1.55 ui-monospace,
    Consolas,
    monospace;
  min-height: 160px;
}
.form-grid,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.stats-grid .card strong {
  font-size: 27px;
  display: block;
  margin-top: 8px;
}
.table-wrap {
  width: 100%;
  overflow: auto;
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table-wrap td,
.table-wrap th {
  text-align: left;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table-wrap th {
  background: #f5f2e9;
}
.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.list-row small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
}
.admin-shell .card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffefa;
}
.admin-shell .card h2 {
  margin-top: 0;
}
.admin-shell .card h3 {
  margin: 18px 0 4px;
}
.admin-shell .helper {
  line-height: 1.7;
}
.admin-shell button:disabled {
  opacity: 0.5;
}
.auth-card .helper {
  line-height: 1.75;
}
@media (max-width: 720px) {
  .auth-shell,
  .admin-shell {
    padding: 10px;
  }
  .admin-head {
    display: block;
  }
  .admin-actions {
    margin: 16px 0;
  }
  .admin-shell footer button {
    margin: 10px 0 0;
  }
  .list-row {
    align-items: flex-start;
    flex-direction: column;
  }
}
.map-editor {
  display: grid;
  gap: 6px;
  min-height: 190px;
  max-height: 520px;
  overflow: auto;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background-color: #f1f0e6;
  background-image:
    linear-gradient(#dce1d5 1px, transparent 1px),
    linear-gradient(90deg, #dce1d5 1px, transparent 1px);
  background-size:
    100% 88px,
    88px 100%;
  touch-action: pan-x pan-y;
}
.map-editor-node,
.map-editor-cell {
  width: 100%;
  height: 78px;
  min-width: 0;
  padding: 5px;
  border-radius: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: normal;
  box-shadow: 0 3px 0 #293f3614;
}
.map-editor-node strong {
  font-size: 12px;
}
.map-editor-node small {
  font-size: 10px;
  font-weight: 400;
  margin-top: 5px;
}
.map-editor-node.hub {
  background: #397b64;
  color: white;
}
.map-editor-node.variant-a {
  background: #c77856;
  color: white;
}
.map-editor-node.variant-b {
  background: #657eae;
  color: white;
}
.map-editor-node.variant-free {
  background: #8b79a9;
  color: white;
}
.map-editor-node.blocked {
  background: #89918a;
  color: white;
  border-style: dashed;
}
.map-editor-node.selected {
  outline: 3px solid #edbf56;
  outline-offset: 2px;
}
.map-editor-cell {
  border: 1px dashed #b5bfaf;
  background: #ffffff70;
  color: #8a978c;
  font-size: 23px;
}
.map-editor-cell:hover {
  background: #fff8dc;
}
.map-neighbor-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}
.map-neighbor-list strong {
  grid-column: 1/-1;
  font-size: 13px;
}
.map-neighbor-list span {
  padding: 7px 9px;
  border-radius: 8px;
  background: #e9eee3;
  font-size: 12px;
}
.map-slot-controls {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8f6ed;
  margin-bottom: 16px;
}
.map-slot-controls h3 {
  margin-bottom: 6px;
}
.map-slot-controls select {
  margin: 0;
}
.map-preview-status {
  font-size: 13px;
  line-height: 1.8;
  margin-top: 12px;
}
.map-preview-status p {
  margin: 6px 0;
}
.admin-shell #map-preview {
  display: block;
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f6f4ed;
  margin-top: 12px;
}
.admin-shell details {
  margin: 12px 0;
}
.admin-shell summary {
  cursor: pointer;
  font-weight: 700;
  padding: 8px 0;
}
@media (max-width: 720px) {
  .map-editor {
    grid-auto-columns: minmax(78px, 1fr);
    grid-auto-rows: 82px;
    padding: 8px;
  }
  .map-editor-node,
  .map-editor-cell {
    height: 72px;
  }
  .map-slot-controls .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.config-help {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
  padding-left: 24px;
}
.config-help li {
  margin: 5px 0;
}
.config-help code {
  color: var(--ink);
  background: #f0eee5;
  padding: 2px 4px;
  border-radius: 4px;
}

.map-grid-controls {
  align-items: center;
  margin-top: 14px;
}
.map-grid-controls strong {
  margin-right: auto;
  font-size: 13px;
}
.map-grid-controls button {
  padding: 7px 10px;
  min-height: 36px;
  font-size: 12px;
}
.map-editor {
  justify-content: start;
  align-content: start;
}
.hub-shape-card {
  margin-top: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8f6ed;
}
.hub-shape-card summary {
  cursor: pointer;
  font-weight: 700;
}
.hub-shape-card label {
  max-width: 280px;
}
.hub-shape-grid {
  display: grid;
  grid-template-columns: repeat(24, 14px);
  grid-template-rows: repeat(14, 14px);
  gap: 2px;
  width: max-content;
  max-width: 100%;
  overflow: auto;
  padding: 8px;
  border-radius: 10px;
  background: #e4e0d3;
}
.hub-shape-cell {
  width: 14px;
  height: 14px;
  min-height: 14px;
  padding: 0;
  border: 1px solid #d0d1c6;
  border-radius: 2px;
  background: #f9f8f2;
}
.hub-shape-cell.platform {
  background: #997e5f;
  border-color: #80664d;
}
.hub-shape-cell.base-floor,
.hub-shape-cell.base-floor:disabled {
  background: #587b62;
  border-color: #46634e;
  opacity: 1;
  cursor: default;
}
.hub-shape-legend {
  display: flex;
  gap: 16px;
  margin: 8px 0;
  font-size: 11px;
  color: var(--muted);
}
.hub-shape-legend span:before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  background: #997e5f;
  vertical-align: -1px;
}
.hub-shape-legend span:nth-child(2):before {
  background: #587b62;
}
.hub-shape-legend span:nth-child(3):before {
  background: #f9f8f2;
  border: 1px solid #d0d1c6;
}
.live-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
}
.live-map-scroll {
  overflow: auto;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #eeefdf;
}
.live-map-canvas {
  position: relative;
  min-width: max-content;
  background-image: radial-gradient(#bfc9b8 1px, transparent 1px);
  background-size: 24px 24px;
}
.live-map-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.live-map-lines path {
  fill: none;
  stroke: #91a18c;
  stroke-width: 5;
  stroke-linecap: round;
}
.live-map-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 138px;
  min-height: 92px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  white-space: normal;
  box-shadow: 0 4px 0 #bcc8b44d;
  background: #8b79a9;
  color: white;
}
.live-map-node:hover:not(:disabled) {
  transform: translate(-50%, -52%);
}
.live-map-node .live-map-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: #ffffff35;
  font-size: 16px;
}
.live-map-node strong {
  font-size: 13px;
  line-height: 1.2;
}
.live-map-node small {
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
}
.live-map-node.hub {
  background: #397b64;
}
.live-map-node.self {
  background: #c77856;
}
.live-map-node.empty {
  background: #a7aaa0;
  color: #fff;
}
.live-map-node.selected {
  outline: 3px solid #e8b84b;
  outline-offset: 2px;
}
.live-map-node.cleared {
  box-shadow: 0 4px 0 #c69d43;
}
.live-map-layout .map-aside {
  position: sticky;
  top: 16px;
}
@media (max-width: 800px) {
  .live-map-layout {
    grid-template-columns: 1fr;
  }
  .live-map-layout .map-aside {
    position: static;
  }
  .map-grid-controls strong {
    width: 100%;
  }
}

.hub-shape-cell.reserved,
.hub-shape-cell.reserved:disabled {
  background: #d5b96c;
  border-color: #ac8c49;
  opacity: 1;
  cursor: not-allowed;
}
.live-map-node.blocked {
  background: #777e78;
  color: white;
  border-style: dashed;
}

.door-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #fffdf6cc;
  color: var(--ink);
  font-weight: 700;
  z-index: 5;
}

.tool b {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
}
.tool-icon {
  display: block;
  width: 64px;
  height: 50px;
}
.test-door-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px;
  margin-bottom: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 13px;
}
.test-door-status {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.test-door-status.passed {
  color: #185d38;
  background: #def0df;
  border-color: #25834f;
  font-weight: bold;
}
.art-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 16px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper, #fff8e7);
}
.art-controls label {
  margin: 0;
}
.art-controls .helper {
  flex-basis: 100%;
}
.art-preview,
[data-pixel-canvas] {
  image-rendering: pixelated;
  background-color: #fff;
  background-image: conic-gradient(#ddd 25%, transparent 0 50%, #ddd 0 75%, transparent 0);
  background-size: 20px 20px;
  border: 1px solid #9aa69f;
}
.art-preview {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
}
dialog:has(.pixel-editor) {
  width: min(900px, calc(100vw - 24px));
  max-width: none;
}
.pixel-toolbar,
.pixel-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}
.pixel-editor button[aria-pressed='true'] {
  outline: 3px solid #337a62;
  outline-offset: 1px;
}
.pixel-palette .pixel-swatch {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid #66766b;
  border-radius: 4px;
  color: #263c35;
}
.pixel-workspace {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}
[data-pixel-canvas] {
  width: min(500px, 100%);
  height: auto;
  aspect-ratio: 1;
  touch-action: none;
  cursor: crosshair;
  flex-shrink: 0;
}
[data-pixel-error] {
  color: #a33434;
}
@media (max-width: 760px) {
  .pixel-workspace {
    flex-direction: column;
  }
  [data-pixel-canvas] {
    width: 100%;
  }
}
