:root {
  color-scheme: light;
  --ink: #33281c;
  --gold: #be9e62;
  --paper: #f3e0ba;
  --green: #264432;
  font-family: 'Songti SC', 'STSong', 'Noto Serif CJK SC', Georgia, serif;
  color: var(--ink);
  background: #211b16;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  width: 100%;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid #ffdf7c;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px #392c1c;
  z-index: 20;
}
button:active:not(:disabled) {
  filter: brightness(0.92);
}
.sr,
.skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip:focus {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  background: var(--paper);
  padding: 12px;
}
#scene-layer {
  position: fixed;
  inset: 0;
}
#scene-layer iframe {
  border: 0;
  width: 100%;
  height: 100%;
  display: block;
}
#main-area,
#surface {
  min-height: 100dvh;
}
#main-area:focus {
  outline: 0;
}
.live-world #main-area {
  position: relative;
  pointer-events: none;
}
.gallery {
  display: grid;
  position: relative;
  isolation: isolate;
  place-items: center;
  min-height: 100dvh;
  overflow: hidden;
  background: #241e16;
  pointer-events: auto;
}
.gallery::before {
  content: '';
  position: absolute;
  inset: -10px;
  z-index: -1;
  background:
    linear-gradient(#1f170ca3, #1f170ca3),
    var(--art) center/cover;
  filter: blur(12px);
}
.sheet {
  position: relative;
  container-type: inline-size;
  width: min(100%, calc(100dvh * var(--aspect)));
  aspect-ratio: var(--ratio);
  background: var(--art) center/100% 100% no-repeat;
  box-shadow: 0 0 60px #21170eaa;
}
.hit,
.field,
.region {
  position: absolute;
  margin: 0;
}
.hit {
  border: none;
  background: transparent;
  padding: 0;
  line-height: 1;
  display: grid;
  place-items: center;
  font-weight: 700;
}
.hit:focus-visible {
  border-radius: 5px;
}
.hit:hover:not(:disabled) {
  box-shadow: inset 0 0 14px #ffe8a945;
  border-radius: 6px;
}
.field {
  display: grid;
  place-items: center;
  text-align: center;
  pointer-events: none;
  line-height: 1.05;
  white-space: pre-line;
}
.paper,
.ticket,
.parchment,
.mobile-menu {
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse at 25% 35%, #fff3d455, transparent 75%),
    repeating-linear-gradient(4deg, #9f713807 0 1px, transparent 1px 4px);
}
.paper,
.ticket {
  font-size: 2.6cqw;
  color: #392a19;
  font-weight: 700;
}
.paper.small {
  font-size: 1.9cqw;
}
.red-paper {
  background: #964a34;
  color: #f7e2b2;
  font-size: 3.6cqw;
}
.brass,
.chip,
.mobile-menu button,
.desk-bar button,
.parchment footer button,
.switch {
  border: 2px ridge #cfa96b;
  border-radius: 16px;
  color: #fff0ca;
  background: linear-gradient(170deg, #436248, #183d2d 70%, #263b27);
  box-shadow:
    inset 0 0 0 2px #2a3825,
    0 2px 4px #23150b66;
  font-weight: 650;
  letter-spacing: 0.035em;
}
.chip,
.switch {
  font-size: 2.2cqw;
}
.chair {
  border-radius: 3px;
  background: linear-gradient(#436348, #214734);
  border: 1px solid #a6864b;
  box-shadow: 0 1px 3px #463319;
  color: #ffefc2;
  font:
    700 2cqw/1 Georgia,
    serif;
}
.chair.selected {
  background: linear-gradient(#af5637, #963218);
  color: white;
}
.chair[aria-pressed='true']::after {
  content: '';
  position: absolute;
  inset: -2px;
  border: 1px solid #ffe2a4;
  border-radius: 4px;
}
.tall .chair {
  font-size: 3.7cqw;
}
.sheet button:disabled {
  opacity: 0.65;
}
.seat-board .hit:disabled {
  backdrop-filter: grayscale(1);
}
.world-hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.world-hud button {
  pointer-events: auto;
  font-size: clamp(0.88rem, 1.4vw, 1.3rem);
  padding: 8px 16px;
  min-height: 44px;
}
.hud-left,
.hud-right,
.desk-bar,
.camera-bar {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hud-left {
  left: max(12px, env(safe-area-inset-left));
  top: max(12px, env(safe-area-inset-top));
}
.hud-right {
  right: 12px;
  top: max(12px, env(safe-area-inset-top));
}
.camera-bar {
  left: 12px;
  bottom: 16px;
}
.camera-bar button {
  font-size: 0.85rem;
  padding: 6px 10px;
}
.desk-bar {
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(110deg, #e1c28b, #faebc8 45%, #d9bc88);
  border: 4px double #886b35;
  border-radius: 28px;
  padding: 4px 12px;
  white-space: nowrap;
  box-shadow: 0 3px 8px #26181088;
  font-weight: bold;
}
.desk-bar button:disabled {
  filter: grayscale(0.9);
  opacity: 0.65;
}
.desk-bar b {
  font:
    700 clamp(1.1rem, 2.3vw, 2rem)/1 Georgia,
    serif;
}
.sticker {
  position: absolute;
  right: 2vw;
  bottom: 4.5rem;
  display: grid;
  place-items: center;
  border: 0;
  background: #f2dfb8;
  border-radius: 9px;
}
.sticker img {
  width: clamp(50px, 7vw, 102px);
  height: 65px;
  object-fit: contain;
}
dialog {
  border: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  max-width: min(94vw, 650px);
  max-height: 96dvh;
  overflow: auto;
}
dialog::backdrop {
  background: #201b122f;
}
dialog.illustrated {
  max-width: none;
  max-height: none;
  width: 100vw;
  height: 100dvh;
  margin: 0;
  overflow: auto;
}
dialog.illustrated .gallery {
  min-height: 100dvh;
}
dialog.illustrated::backdrop {
  background: #231b16;
}
#panel-body:empty {
  display: none;
}
.parchment {
  position: relative;
  border: 6px double #86632e;
  outline: 1px solid #4e351a;
  border-radius: 12px;
  box-shadow:
    inset 0 0 18px #a7783c80,
    0 8px 26px #2e1e1466;
  text-align: center;
  padding: clamp(18px, 2.8vw, 44px) clamp(18px, 3vw, 54px);
  min-width: min(370px, 88vw);
  font-weight: 600;
}
.parchment h2 {
  margin: 0 0 0.45em;
  color: #293d2b;
  font-size: clamp(24px, 3vw, 40px);
  letter-spacing: 0.1em;
}
.parchment p {
  margin: 0.5em 0 1em;
  line-height: 1.6;
}
.parchment footer,
.parchment fieldset,
.sound-options,
.slider {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
.parchment footer button,
.parchment fieldset button,
.parchment > button:not(.close) {
  min-height: 44px;
  padding: 6px 15px;
}
.parchment fieldset {
  border: 0;
  border-top: 1px solid #af8e56;
  padding: 0.45em 0 1.1em;
  justify-content: space-between;
  gap: 4px;
}
.parchment legend {
  color: #433a25;
  padding-right: 0.5em;
  text-align: left;
}
.parchment fieldset button,
.sound-options button {
  border: 1px solid #ae8b56;
  border-radius: 5px;
  background: #f6e9ce;
}
.parchment button[aria-pressed='true'],
.sound-options .brass {
  border: 2px solid #294e3a;
  color: #244e35;
  font-weight: bold;
}
.close {
  position: absolute;
  right: 8px;
  top: 8px;
  border: 2px ridge #bd9d60;
  background: #31503a;
  color: #f4e1b4;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font: 22px/1 Georgia;
}
.duration {
  display: block;
  margin: 0 0 1rem;
}
.duration input {
  width: 6em;
  text-align: center;
  padding: 7px;
  background: #fff3d9;
  border: 1px solid #775f39;
  border-radius: 4px;
}
.clock {
  font:
    700 2rem Georgia,
    serif;
}
.receipt-value {
  font-size: 1.15em;
}
.slider,
.sound-options {
  background: #ead7b6;
  flex-wrap: nowrap;
}
.slider input {
  min-height: 44px;
  min-width: 44px;
  width: 72%;
  accent-color: #836133;
}
.slider output,
.sound-options button {
  font-size: 2.3cqw;
}
.sound-options button {
  flex: 1;
  padding: 3px 0;
  white-space: nowrap;
}
.red-paper.small {
  font-size: 2cqw;
}
#notice:not(:empty),
#form-error:not(:empty) {
  background: #303d2d;
  color: #fff2cc;
  padding: 12px 20px;
  border: 1px solid #cfac6c;
  border-radius: 9px;
  box-shadow: 0 4px 18px #211b18aa;
  text-align: center;
}
#notice {
  position: fixed;
  top: max(4.5rem, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  pointer-events: none;
  max-width: 92vw;
}
@media (max-width: 600px) and (orientation: portrait) {
  body:has(.campus-hud) #notice:not(:empty) {
    top: calc(env(safe-area-inset-top) + 11rem);
    width: max-content;
    max-width: calc(100vw - 2rem);
    padding: 8px 14px;
  }
}
#form-error {
  margin: 0;
}
dialog.illustrated #form-error:not(:empty) {
  position: fixed;
  bottom: 2vh;
  left: 50%;
  transform: translateX(-50%);
}
@media (prefers-reduced-motion: no-preference) {
  .motion .sheet,
  .motion .parchment {
    animation: appear 0.18s ease-out;
  }
  @keyframes appear {
    from {
      opacity: 0.75;
    }
    to {
      opacity: 1;
    }
  }
}
@media (orientation: portrait) and (max-width: 850px) {
  .wide-menu {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-menu {
    width: min(94%, 480px);
    padding: 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    border: 4px double #a18152;
    border-radius: 12px;
  }
  .mobile-menu strong {
    grid-column: 1/-1;
    text-align: center;
  }
  .mobile-menu button {
    min-height: 46px;
  }
  .hud-left {
    left: 5px;
    top: 8px;
  }
  .hud-right {
    right: 5px;
    top: 56px;
  }
  .world-hud button {
    padding: 4px 8px;
  }
  .desk-bar {
    max-width: 98vw;
    gap: 5px;
    padding: 3px 6px;
    font-size: 0.82rem;
  }
  .camera-bar {
    bottom: 74px;
  }
  .sticker {
    bottom: 132px;
  }
  .parchment {
    max-width: 94vw;
  }
  .parchment fieldset button {
    padding: 6px 9px;
  }
  .parchment .slider output {
    font-size: 1rem;
  }
  .tall .hit:before {
    content: '';
    position: absolute;
    min-width: 44px;
    min-height: 44px;
    width: 100%;
    height: 100%;
  }
  .seat-board .chair:before {
    min-width: 0;
    min-height: 0;
  }
}
dialog:has(.world-card)::backdrop {
  background: #25190e29;
}
dialog.illustrated:has(.world-card),
.gallery.world-card {
  background: transparent;
}
.world-card::before {
  display: none;
}
.world-card .sheet {
  clip-path: var(--crop);
  box-shadow: none;
}
.card-context {
  font-size: 2.05cqw;
  font-weight: 600;
}
.tall .card-context {
  font-size: 4.2cqw;
}
.choice-face {
  display: grid;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  background: linear-gradient(#f7e8c9, #f4dfb8);
  color: #3c311f;
  border: 1px solid #a98a5c;
  border-radius: 4px;
  font-size: 2cqw;
}
.choice:focus-visible {
  outline: none;
  box-shadow: none;
}
.choice:focus-visible .choice-face {
  outline: 2px solid #1b382b;
  outline-offset: 1px;
}
.choice[aria-pressed='true'] .choice-face {
  border: 2px solid #294832;
  color: #294832;
}
.tall .choice-face {
  font-size: 4cqw;
}
.minutes-entry {
  display: grid;
  place-items: center;
  background: #f0ddb9;
  border: 1px solid #8d724d;
  border-radius: 4px;
}
.minutes-entry label {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  min-height: 44px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  font-size: 2.2cqw;
}
.minutes-entry input {
  min-height: 44px;
  min-width: 44px;
  width: 55%;
  height: 100%;
  font-weight: 700;
  text-align: center;
  color: #244d31;
  background: transparent;
  border: 0;
}
.tall .minutes-entry {
  z-index: 2;
}
.tall .minutes-entry label {
  font-size: 4cqw;
}
.minor-action {
  font-size: 1.9cqw;
  border: 1px solid #aa8554;
  border-radius: 6px;
  background: #eed7ae;
}
.board-heading {
  background: #233c2b;
  color: #f6e4b9;
  letter-spacing: 0.06em;
  font-size: 5.5cqw;
  font-weight: 700;
}
.portrait-room {
  position: relative;
  height: 100dvh;
  isolation: isolate;
  background: #493a28;
  overflow: hidden;
}
.portrait-room::before {
  content: '';
  position: absolute;
  inset: -8% -5%;
  background: var(--room-art) center/cover no-repeat;
  z-index: -1;
}
.portrait-room .hud-right {
  top: 10px;
}
.portrait-room button {
  min-height: 44px;
  padding: 5px 12px;
}
.portrait-controls {
  position: absolute;
  bottom: max(22px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 6px;
  background: #e3c99b;
  border: 4px double #927342;
  border-radius: 22px;
  white-space: nowrap;
}
.portrait-controls button:disabled {
  filter: grayscale(1);
  opacity: 0.8;
}
@media (orientation: portrait) and (max-width: 850px) {
  .seat-board .chair:before {
    min-width: 44px;
    min-height: 44px;
  }
  .seat-board .sheet {
    width: min(100%, calc(100dvh * var(--aspect)));
  }
}
.tall .minutes-entry {
  top: 81.7% !important;
  height: 4.3% !important;
}
.gallery.wide-menu .sheet {
  flex-shrink: 0;
}
.world-hud button,
.portrait-room button,
.collection-empty button {
  min-width: 44px;
  min-height: 44px;
}
.seat-repair {
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  pointer-events: none;
}
.seat-target:focus-visible {
  outline-offset: -2px;
}
.seat-ink {
  font:
    700 1.8cqw/1 Georgia,
    serif;
  border-radius: 3px;
  background: #34523d;
  color: #fff2cc;
  box-shadow: inset 0 0 0 1px #be9c62;
}
.seat-ink.selected {
  background: #953c28;
}
.tall .seat-ink {
  font-size: 3.6cqw;
}
@media (orientation: landscape) {
  .live-world #scene-layer,
  .live-world .world-hud {
    inset: 0;
    margin: auto;
    transform: none;
    width: min(100vw, calc(100dvh * 16 / 9));
    height: min(100dvh, calc(100vw * 9 / 16));
  }
  .room-header-art .art-command {
    position: absolute;
    width: calc(var(--sw) * 100% / 480);
    height: calc(var(--sh) * 100% / 270);
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 100vmax;
    background-color: transparent;
    background-repeat: no-repeat;
  }
  .world-hud .desk-bar {
    min-width: 43%;
    justify-content: center;
  }
}

@media (orientation: landscape) {
  .campus-hud .desk-bar {
    min-width: 0;
    padding: 3px;
    background: #f9efd9;
    border: 1px solid #364d3e;
    box-shadow: 0 2px 4px #23392d52;
  }
  .campus-overview .hud-left {
    top: auto;
    bottom: max(14px, env(safe-area-inset-bottom));
    left: auto;
    right: max(14px, env(safe-area-inset-right));
  }
}

.camera-bar {
  gap: 0;
  overflow: hidden;
  border: 3px double #bda373;
  border-radius: 999px;
  background: linear-gradient(#315541, #1c392b);
  box-shadow: 0 2px 4px #311e0e80;
}
.world-hud .camera-bar button {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-right: 1px solid #baab716b;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 3px 12px;
  color: #f4e6be;
  font:
    600 13px/1.1 'Songti SC',
    serif;
}
.camera-bar button:last-child {
  border-right: 0;
}
.world-hud .camera-bar button[aria-pressed='true'] {
  background: linear-gradient(#f8ebc5, #e6ca94);
  color: #314431;
}
.camera-bar button:focus-visible {
  outline-offset: -4px;
}
.camera-bar button span {
  width: 18px;
  height: 18px;
  background: currentColor;
  mask: url('../design/v1/art/camera-icons.png') left center / 300% 100% no-repeat;
}
.camera-bar [data-action="camera-room"] span {
  mask-position: center;
}
.camera-bar [data-action="camera-overhead"] span {
  mask: none;
  width: 16px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 2px;
  background: linear-gradient(currentColor,currentColor) center / 2px 100% no-repeat,
    linear-gradient(currentColor,currentColor) center / 100% 2px no-repeat;
}
.camera-bar [data-action="camera-near"] span {
  mask-position: right;
}

.study-room-list {
  display: grid;
  gap: .45rem;
  width: min(23rem, 88vw);
  max-height: 85dvh;
  overflow: auto;
  padding: 1rem;
  color: #293f30;
  background: #fff6e2;
  border: 1px solid #a58753;
  border-radius: 14px;
}
.study-room-list button {
  min-height: 44px;
  padding: .4rem .8rem;
  background: #fffaf0;
  border: 1px solid #ab976e;
  border-radius: 8px;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.study-room-list button:hover, .study-room-list button:focus-visible { background: #efe3c3; }
.study-room-list h2 { margin: 0 0 .4rem; }

.world-hud .desk-bar.seat-entry {
  min-width: 0;
  width: max-content;
  max-width: 100%;
  background: transparent;
  border: 0;
  box-shadow: none;
  justify-content: center;
}
.seat-entry > span {
  position: absolute;
  bottom: calc(100% + .35rem);
  padding: .28rem .8rem;
  border-radius: 1rem;
  background: #263a32de;
  color: #fff8e8;
  font-size: .85rem;
  pointer-events: none;
}

html[data-visual-zoom] body :is(.residence-hud,.world-hud,.study-game-host){
  inset:var(--visible-top) auto auto var(--visible-left);
  width:var(--visible-width);
  height:var(--visible-height);
  margin:0;
  transform:none;
  aspect-ratio:auto;
}
html[data-visual-zoom] .residence-dock{right:2%;max-width:96%}
html[data-visual-zoom] .study-game-host iframe{position:absolute}

html[data-visual-zoom] #panel[open]{
  position:fixed;
  inset:var(--visible-top) calc(100% - var(--visible-left) - var(--visible-width)) calc(100% - var(--visible-top) - var(--visible-height)) var(--visible-left);
  margin:auto;
  max-width:calc(var(--visible-width) - 12px);
  max-height:calc(var(--visible-height) - 12px);
}
html[data-visual-zoom] #panel-body>article{max-width:calc(var(--visible-width) - 12px);max-height:calc(var(--visible-height) - 12px);overflow:auto}

html[data-visual-zoom] body :is(.residence-hud,.world-hud){
  width:var(--hud-width);height:var(--hud-height);
  transform-origin:0 0;transform:scale(var(--hud-scale));
}
