@charset "UTF-8";

:root {
  font: 15px/1.45 "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-synthesis: none;
  color: #243d32;
  background: #e7eddf;
  --ink: #243d32;
  --muted: #536352;
  --paper: #fffaf0;
  --surface: #fffaf2f0;
  --pine: #315943;
  --line: #d9dccc;
  --gold: #ae8140;
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
h2 { font-size: 21px; line-height: 1.35; }
button, select, input { font: inherit; }
button, .primary {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
  min-height: 44px;
  padding: 8px 12px;
}
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
.primary { background: var(--pine); color: var(--paper); border-color: transparent; font-weight: 700; }
@media (hover: hover) {
  button:not(:disabled):hover { background: #eeeee0; }
  button.primary:not(:disabled):hover { background: #254634; }
}
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.icon {
  display: block;
  flex: none;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#stage { position: relative; width: 100%; height: 100dvh; overflow: hidden; }
#scene { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }

#park-ui {
  --edge: 20px;
  --hud-left: max(var(--edge), env(safe-area-inset-left));
  --hud-right: max(var(--edge), env(safe-area-inset-right));
  --hud-top: max(16px, env(safe-area-inset-top));
  --hud-bottom: max(18px, calc(env(safe-area-inset-bottom) + 10px));
  --stick-size: 108px;
  --dock-height: 59px;
  --context-bottom: calc(var(--hud-bottom) + var(--dock-height) + 10px);
  animation: park-controls-in .55s ease both;
}

@keyframes park-controls-in { from { opacity: 0; } to { opacity: 1; } }

.park-header {
  position: absolute;
  top: var(--hud-top);
  left: var(--hud-left);
  right: var(--hud-right);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}
.park-identity { padding: 9px 12px; border-radius: 10px; background: var(--surface); min-width: 0; }
.park-name { display: flex; align-items: center; gap: 6px; }
.park-name .icon { width: 18px; height: 18px; color: #8c6731; }
.park-name h1 { font-size: 19px; font-weight: 750; line-height: 1.35; white-space: nowrap; }
#connection-status { color: var(--ink); font-size: 13px; margin-top: 3px; overflow-wrap: anywhere; }
#clock { color: var(--muted); font-size: 12px; margin-top: 3px; }
.park-tools { display: flex; gap: 5px; pointer-events: auto; flex: none; }
.park-tools .tool-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--surface);
  font-size: 13px;
}
.park-tools .invite-tool { flex-direction: row; padding-inline: 10px; white-space: nowrap; }
#sound:not([data-muted="true"]) .sound-off, #sound[data-muted="true"] .sound-on { display: none; }
#park-ui:is([data-seated="true"], [data-photo="true"]) .park-tools #photo { display: none; }

#first-help, #review-note, #toast {
  position: absolute;
  margin: 0;
  pointer-events: none;
  border-radius: 7px;
  padding: 6px 9px;
  background: var(--surface);
  color: var(--ink);
}
#first-help {
  display: flex;
  align-items: center;
  gap: 5px;
  bottom: calc(var(--hud-bottom) + var(--stick-size) + 9px);
  left: var(--hud-left);
  max-width: calc(100% - var(--hud-left) - var(--hud-right));
  font-size: 12px;
  padding: 3px 4px 3px 10px;
  pointer-events: auto;
}
#first-help button { font-size: 12px; padding: 5px 7px; min-width: 44px; border: 0; background: transparent; flex: none; }
#first-help #walk-help-action { color: var(--pine); font-weight: 750; background: #e8eddc; }
#walk-help-text { min-width: 0; }
.menu-visitor { color: var(--muted); font-size: 13px; margin: 2px 0 9px; }
#photo-home, #photo-home #photo { width: 100%; }
#review-note {
  top: calc(var(--hud-top) + 88px);
  left: var(--hud-left);
  color: #75542a;
  font-size: 11px;
}
#toast {
  z-index: 9;
  left: 50%;
  bottom: calc(var(--context-bottom) + 59px);
  transform: translateX(-50%);
  padding: 9px 13px;
  background: #263e33f2;
  color: var(--paper);
  font-size: 13px;
  width: max-content;
  max-width: calc(100% - var(--hud-left) - var(--hud-right));
  text-align: center;
}
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.person-label {
  position: absolute;
  left: 0;
  top: 0;
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
  padding: 2px 5px;
  background: #f5f4dfdc;
  color: #374c39;
  border-radius: 3px;
}
.person-label.self { color: #fffdf2; background: #55704c; }
.person-label.staff { color: #ecf2dd; background: #35664c; font-size: 12px; padding: 1px 4px; }

#joystick {
  position: absolute;
  left: var(--hud-left);
  bottom: var(--hud-bottom);
  width: var(--stick-size);
  height: var(--stick-size);
  background: #f7f5e5cd;
  border-radius: 50%;
  padding: 0;
  touch-action: none;
  user-select: none;
}
#stick { position: absolute; inset: 0; margin: auto; width: 43%; height: 43%; background: #5c795c; border-radius: 50%; pointer-events: none; }
.stick-caption { position: absolute; left: 0; right: 0; bottom: 7px; color: #415644; font-size: 11px; pointer-events: none; }
#actions {
  position: absolute;
  right: var(--hud-right);
  bottom: var(--hud-bottom);
  display: flex;
  gap: 6px;
  align-items: flex-end;
}
.dock-group {
  display: flex;
  gap: 2px;
  background: var(--surface);
  padding: 4px;
  border-radius: 11px;
}
#actions button, #ride-actions button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 50px;
  min-height: 50px;
  padding: 3px 7px;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
}
#actions button[aria-expanded="true"] { background: #e5ebdb; color: #254634; }
#actions button .icon, #ride-actions button .icon { width: 18px; height: 18px; }
#actions button:active, #ride-actions button:active { background: #e8ecd9; }

.context-panel {
  position: absolute;
  right: var(--hud-right);
  bottom: var(--context-bottom);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 5px 5px 10px;
  max-width: min(292px, calc(100% - var(--hud-left) - var(--hud-right)));
  border-radius: 10px;
  background: var(--surface);
}
.context-panel p { font-size: 13px; font-weight: 600; line-height: 1.4; min-width: 0; }
.context-panel button { padding: 6px 10px; font-size: 13px; flex: none; white-space: nowrap; }
.place-buttons { display: flex; gap: 4px; flex: none; }
#park-ui[data-boarding-near="false"][data-mounted="false"] #ride-panel { display: none; }
#park-ui:not([data-mounted]) #ride-panel { display: none; }
#park-ui:is([data-seated="true"], [data-photo="true"]) #place-panel {
  top: calc(var(--hud-top) + 90px);
  bottom: auto;
  flex-wrap: wrap;
}
#park-ui:has(#place-panel:not([hidden]), #park-menu:not([hidden])) #first-help,
#park-ui[data-boarding-near="true"] #first-help { display: none; }
#park-ui:is([data-seated="true"], [data-photo="true"]) #review-note { display: none; }

#ride-transition { position: absolute; inset: 0; pointer-events: none; background: #172820; }
#ride-actions {
  position: absolute;
  left: 50%;
  bottom: var(--hud-bottom);
  transform: translateX(-50%);
  width: min(314px, calc(100% - var(--hud-left) - var(--hud-right)));
  display: grid;
  grid-template-columns: 1.35fr repeat(3, 1fr);
  gap: 3px;
  padding: 4px;
  background: var(--surface);
  border-radius: 11px;
}
#ride-actions #ride { background: var(--pine); color: var(--paper); }
#park-ui[data-mounted="true"] .park-header,
#park-ui[data-mounted="true"] #first-help,
#park-ui[data-mounted="true"] #review-note,
#park-ui[data-mounted="true"] #place-panel { display: none; }
#park-ui[data-mounted="true"] #ride-panel { left: 50%; right: auto; top: var(--hud-top); bottom: auto; transform: translateX(-50%); width: max-content; }
#ride-view { color: var(--ink); background: #edf0e5; }
#park-ui[data-mounted="true"] #toast { bottom: calc(var(--hud-bottom) + 64px); }

#park-menu {
  position: absolute;
  z-index: 6;
  right: var(--hud-right);
  bottom: var(--context-bottom);
  width: min(224px, calc(100% - var(--hud-left) - var(--hud-right)));
  max-height: calc(100% - var(--context-bottom) - var(--hud-top) - 10px);
  padding: 13px 11px 7px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: auto;
}
#park-menu h2 { padding: 0 3px; font-size: 16px; }
#park-menu label { display: block; margin: 10px 3px 5px; font-size: 12px; color: var(--muted); }
#hoodie-color {
  display: block;
  width: 100%;
  min-height: 44px;
  background: #f3f0e5;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
}
.menu-links { margin-top: 7px; }
.menu-links button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 7px 3px;
  font-size: 14px;
}
.menu-links .icon { color: #617453; width: 16px; height: 16px; }
#connection-action { color: #755138; border-top: 1px solid var(--line); border-radius: 0; }
#time-debug { font-size: 12px; padding: 8px 3px; }

dialog {
  margin: auto;
  width: min(468px, calc(100% - 26px));
  max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 22px);
  overflow: auto;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper);
  color: var(--ink);
}
dialog::backdrop { background: #172f25a0; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 9px; }
.quiet-button { background: transparent; border-color: transparent; flex: none; color: var(--muted); font-size: 14px; }
.dialog-hint, #invite-note, #photo-status, #sound-status { color: var(--muted); font-size: 13px; }
.dialog-hint { margin-top: 4px; }
#place-destinations { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 12px 0; }
#place-destinations button { font-size: 14px; text-align: left; padding: 6px 9px; }
#map { display: block; width: min(100%, 46dvh); height: auto; margin-inline: auto; touch-action: none; background: #d4dfc4; border-radius: 7px; }

.mount-tabs { display: flex; gap: 3px; margin: 8px 0 10px; padding: 3px; background: #eeeee0; border-radius: 8px; }
.mount-tabs button {
  display: flex;
  flex: 1 1 0;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 6px 3px;
  font-size: 13px;
  font-weight: 650;
  border: 0;
  background: transparent;
  white-space: nowrap;
}
.mount-tabs .icon { width: 16px; height: 16px; }
.mount-tabs button[aria-selected="true"] { background: var(--pine); color: var(--paper); }
#mount-options { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mount-option {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0,1fr);
  grid-template-rows: auto auto;
  align-items: center;
  justify-content: center;
  gap: 1px 5px;
  min-width: 0;
  min-height: 60px;
  padding: 7px;
  text-align: left;
}
.mount-option img { grid-row: 1 / 3; width: 28px; height: 28px; object-fit: contain; }
.mount-option span { font-size: 14px; font-weight: 650; }
.mount-option small { color: var(--muted); font-size: 11px; }
.mount-option[aria-checked="true"] { border-color: #ac8346; background: #f0ead8; }
.mount-footer { display: grid; gap: 7px; margin-top: 10px; }
#mount-status { min-height: 18px; color: var(--muted); font-size: 12px; }
#mount-confirm { width: 100%; }

#sound-dialog { width: min(350px, calc(100% - 26px)); }
.sound-choice {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  gap: 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 11px 2px;
  background: transparent;
}
.sound-choice:last-of-type { border-bottom: 0; }
.sound-choice strong, .sound-choice small { display: block; }
.sound-choice strong { font-size: 15px; }
.sound-choice small { color: var(--muted); font-size: 12px; margin-top: 1px; }
.sound-switch { min-width: 45px; padding: 4px 7px; border-radius: 6px; background: #e8e9df; color: #415443; text-align: center; font-size: 12px; }
.sound-choice[aria-pressed="true"] .sound-switch { background: var(--pine); color: var(--paper); }
#sound-status { margin-top: 8px; }

#invite-dialog label { display: block; font-size: 13px; margin: 12px 0 5px; }
#invite-url {
  display: block;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  color: var(--ink);
  background: #fffdf6;
}
.invite-buttons { display: flex; gap: 7px; margin-top: 10px; }
.invite-buttons button { flex: 1; }
#photo-image { display: block; width: 100%; max-height: 55dvh; object-fit: contain; margin: 8px 0 10px; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 5px; }
#photo-download { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 10px; border-radius: 9px; text-align: center; text-decoration: none; font-size: 13px; color: var(--ink); }
#photo-download.primary { color: var(--paper); }
#photo-share { flex: 1 0 100%; }
#photo-invite { font-size: 13px; }
#photo-status:not(:empty) { margin-top: 8px; }

@media (max-width: 600px) {
  #park-ui { --edge: 13px; --dock-height: 114px; --stick-size: clamp(85px, 24vw, 106px); }
  .park-name h1 { font-size: 17px; }
  .park-identity { padding: 8px 9px; }
  #connection-status { font-size: 12px; }
  .park-tools .tool-button { flex-direction: column; justify-content: center; gap: 1px; min-width: 45px; padding: 4px; font-size: 11px; }
  .park-tools .invite-tool { flex-direction: row; gap: 5px; padding-inline: 8px; font-size: 12px; }
  .park-tools .tool-button .icon { width: 17px; height: 17px; }
  #actions { flex-direction: column; gap: 4px; }
  #actions .dock-group:last-child button { min-height: 44px; min-width: 50px; }
  #first-help { bottom: calc(var(--context-bottom) + 2px); }
  dialog { padding: 13px; }
  .context-panel { max-width: min(258px, calc(100% - var(--hud-left) - var(--hud-right))); }
}

@media (max-height: 520px) {
  #park-ui { --hud-top: max(10px, env(safe-area-inset-top)); --stick-size: 80px; --dock-height: 52px; }
  #actions { flex-direction: row; }
  #actions button, #actions .dock-group:last-child button { min-height: 44px; min-width: 45px; }
  #review-note { display: none; }
  #park-ui:is([data-seated="true"], [data-photo="true"]) #place-panel { top: var(--hud-top); right: auto; left: 50%; transform: translateX(-50%); }
}
@media (max-width: 340px) {
  .mount-tabs .icon { display: none; }
  .park-name h1 { font-size: 16px; }
  .park-tools .invite-tool .icon { display: none; }
}
@media (max-width: 360px) and (max-height: 520px) {
  #park-ui { --dock-height: 108px; }
  #actions { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  #park-ui { animation: none; }
}
