:root {
  color-scheme: light;
  --ivory:#f7f4ec;
  --pine:#183f35;
  --line:rgba(255,255,255,.29);
  font-family:
    "Malgun Gothic",
    "Apple SD Gothic Neo",
    Arial,
    sans-serif;
}
* {
  box-sizing: border-box;
}
html,
body,
main {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}
body {
  background: #393c30;
  color: var(--ivory);
}
main {
  position: relative;
  isolation: isolate;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button:disabled {
  cursor: wait;
}
button:focus-visible,
canvas:focus-visible {
  outline: 3px solid #e0be75;
  outline-offset: 3px;
}
button:active {
  transform: translateY(1px);
}
[hidden] {
  display: none !important;
}
#world {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline: none;
  cursor: grab;
}
#world:active {
  cursor: grabbing;
}
.shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(24, 28, 23, .42) 0,
      transparent 19%,
      transparent 72%,
      rgba(24, 28, 23, .35) 100%);
}
.topbar,
.controls {
  position: absolute;
  left: max(28px, env(safe-area-inset-left));
  right: max(28px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.topbar {
  top: max(23px, env(safe-area-inset-top));
  align-items: flex-start;
}
.identity,
.tools {
  display: flex;
  align-items: center;
}
.identity {
  gap: 13px;
  text-shadow: 0 1px 9px #1c241dcc;
}
.brand {
  display: grid;
  place-items: center;
  background: #f4f1ea;
  width: 61px;
  height: 57px;
  box-shadow: 0 2px 12px #0b211126;
  border-radius: 3px;
}
.brand img {
  width: 49px;
  height: 36px;
  object-fit: contain;
}
.place span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
}
.place h1 {
  margin: 3px 0 0;
  font-family:
    "Noto Serif KR",
    Batang,
    serif;
  font-size: 26px;
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: .07em;
}
.tools {
  gap: 7px;
  pointer-events: auto;
}
.tool {
  height: 40px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #192f29d9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}
.tool:hover,
#seat-action:hover {
  background: #245045;
}
.help {
  width: 40px;
  padding: 0;
  font-family: Georgia, serif;
  font-size: 20px;
}
.camera-icon {
  position: relative;
  width: 15px;
  height: 11px;
  border: 1.3px solid currentColor;
  border-radius: 3px;
}
.camera-tools { position: relative; }
.camera-tools summary { cursor: pointer; list-style: none; user-select: none; }
.camera-tools summary::-webkit-details-marker { display: none; }
.camera-panel {
  position: absolute; right: 0; top: calc(100% + 7px); min-width: 128px;
  display: grid; gap: 2px; padding: 6px; border-radius: 8px;
  background: #19332df5; box-shadow: 0 4px 18px #14291c55;
}
.camera-panel button {
  display: flex; justify-content: space-between; align-items: center;
  border: 0; border-radius: 4px; padding: 8px; background: transparent; text-align: left;
}
.camera-panel button:hover, .camera-panel button:focus-visible { background: #34564c; }
.move-tools { display: flex; align-items: center; gap: 10px; }
.gait {
  display: flex; align-items: center; gap: 2px; padding: 3px;
  border: 1px solid var(--line); border-radius: 20px; background: #19332dde;
  pointer-events: auto; touch-action: manipulation;
}
.gait button {
  padding: 6px 11px; border-radius: 18px; border: 0;
  background: transparent; color: #f7f4ec; font-weight: 600; font-size: 13px;
}
.gait button[aria-pressed=true] { background: #f1ead9; color: #183f35; }
.wave { pointer-events: auto; }
.camera-icon:before {
  content: "";
  position: absolute;
  top: -4px;
  left: 3px;
  width: 6px;
  height: 3px;
  background: currentColor;
  border-radius: 2px;
}
.camera-icon:after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  top: 2px;
  left: 4px;
  border: 1px solid currentColor;
  border-radius: 100%;
}
.controls {
  bottom: max(25px, env(safe-area-inset-bottom));
  min-height: 64px;
  align-items: flex-end;
}
.control-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 1px 6px #172218;
  background: #1b2923bf;
  border: 1px solid #ffffff24;
  border-radius: 18px;
  padding: 6px 11px;
  font-size: 12px;
  color: #fff;
}
.keys {
  font-family: Arial, sans-serif;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: .09em;
}
.control-hint i {
  height: 11px;
  border-left: 1px solid #ffffff59;
}
.action-wrap {
  text-align: right;
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 7px;
  pointer-events: auto;
}
#status {
  background: #182922b8;
  color: white;
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 12px;
  line-height: 1.45;
}
#seat-action {
  border-radius: 6px;
  background: var(--pine);
  border: 1px solid #f0e6c774;
  box-shadow: 0 3px 14px #0f292733;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 19px;
  font-size: 15px;
  font-weight: 650;
}
kbd {
  font: 600 12px/19px Arial, sans-serif;
  text-align: center;
  display: inline-block;
  width: 21px;
  height: 21px;
  border: 1px solid #b7bc9b;
  border-radius: 4px;
  color: #f1dfba;
}
.joystick {
  display: none;
  position: relative;
  width: 96px;
  height: 96px;
  border: 1px solid #fff8;
  border-radius: 50%;
  background: #1b2d275e;
  touch-action: none;
  pointer-events: auto;
}
.stick {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 39px;
  height: 39px;
  margin: -19.5px 0 0 -19.5px;
  background: #f2efddc9;
  border: 1px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px #17221845;
}
.loading {
  position: absolute;
  inset: 0;
  background: linear-gradient(#10251dbf, #10251dd9), url(/assets/arrival.jpg) center/cover;
  display: grid;
  place-items: center;
}
.loading-inner {
  text-align: center;
  max-width: 30em;
  padding: 24px;
}
.loading-inner img {
  width: 86px;
  border-radius: 3px;
}
.loading p {
  line-height: 1.6;
  font-size: 15px;
}
.load-line {
  display: block;
  width: 42px;
  height: 2px;
  margin: 14px auto;
  background: #d1b67d;
  animation: pulse 1.4s infinite alternate;
}
@keyframes pulse {
  to {
    opacity: .27;
    transform: scaleX(.45);
  }
}
#retry {
  border: 1px solid var(--ivory);
  border-radius: 4px;
  background: transparent;
  padding: 8px 14px;
}
dialog {
  padding: 0;
  max-width: min(380px, 90vw);
  width: 100%;
  border: 0;
  background: var(--ivory);
  color: #203b31;
  border-radius: 10px;
  box-shadow: 0 24px 75px #0a241c75;
}
dialog::backdrop {
  background: #14291ec0;
}
dialog article {
  padding: 24px;
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.dialog-heading h2 {
  margin: 0;
  font-family: Batang, serif;
  font-size: 22px;
}
.dialog-heading button {
  background: transparent;
  border: 1px solid #c5cabc;
  border-radius: 50%;
  width: 33px;
  height: 33px;
  font-size: 21px;
}
dl {
  margin: 17px 0 0;
}
dl div {
  display: flex;
  gap: 15px;
  justify-content: space-between;
  border-top: 1px solid #d7dacd;
  padding: 11px 0;
  font-size: 13px;
  line-height: 1.65;
}
dt {
  font-weight: bold;
}
dd {
  text-align: right;
  margin: 0;
}
@media (pointer: coarse) {
  .move-tools { display: grid; grid-template-columns: auto auto; align-items: end; gap: 7px; }
  .move-tools .gait { grid-row: 1; grid-column: 1; }
  .move-tools .joystick { grid-row: 2; grid-column: 1; justify-self: center; }
  .move-tools .wave { grid-row: 2; grid-column: 2; }
  .joystick {
    display: block;
  }
  .control-hint,
  kbd {
    display: none;
  }
}
@media (max-width: 375px) {
  .tools { gap: 3px; }
  .tool .camera-icon { display: none; }
}
@media (max-width: 600px) {
  .topbar,
  .controls {
    left: max(15px, env(safe-area-inset-left));
    right: max(15px, env(safe-area-inset-right));
  }
  .topbar {
    top: max(15px, env(safe-area-inset-top));
  }
  .controls {
    bottom: max(18px, env(safe-area-inset-bottom));
  }
  .brand {
    width: 48px;
    height: 47px;
  }
  .brand img {
    width: 41px;
    height: auto;
  }
  .identity {
    gap: 9px;
  }
  .place h1 {
    font-size: 22px;
  }
  .tool {
    height: 37px;
    padding: 0 11px;
  }
  .help {
    width: 37px;
    padding: 0;
  }
  .control-hint {
    display: none;
  }
  .action-wrap {
    margin-left: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  .load-line {
    animation: none;
  }
}
