@import url("/fonts/fonts.css");
:root {
  --safe-area-top: env(safe-area-inset-top, 0px);
  color-scheme: dark;
  --ink: #e9e7d5;
  --muted: #b7c7b5;
  --gold: #d9ba77;
  --green: #203e37;
  --line: #d9ba7740;
  font-family: "Be Vietnam Pro", Arial, sans-serif;
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
html {
  touch-action: pan-x pan-y;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  overflow: hidden;
  background: #99afa0;
  color: var(--ink);
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
input,
textarea,
[contenteditable]:not([contenteditable="false"]) {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}
button,
input,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
  border: 1px solid var(--line);
  background: #24483e;
  min-height: 46px;
  padding: 11px 17px;
  border-radius: 5px;
  transition:
    background 0.18s,
    transform 0.18s;
}
button:hover {
  background: #36594a;
}
button:active {
  transform: translateY(1px);
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.active {
  background: var(--gold);
  color: #263b31;
}
button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
button[hidden],
[hidden] {
  display: none !important;
}
#world {
  display: block;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    #102b304d,
    transparent 22%,
    transparent 70%,
    #122e3840
  );
}
.hud {
  position: fixed;
  inset: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  pointer-events: none;
  z-index: 5;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-shadow: 0 1px 10px #183b37;
}
.brand > svg {
  width: 45px;
  height: 45px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.8;
}
.brand strong {
  display: block;
  font:
    600 21px "Noto Serif",
    Georgia,
    serif;
  letter-spacing: 4px;
}
.brand span {
  display: block;
  font-size: 11px;
  margin-top: 5px;
  color: #f0eedb;
}
.brand span::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #9dce94;
  border-radius: 50%;
  margin-right: 7px;
}
.hud nav {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}
.player-resources { position: fixed; left: 32px; top: 88px; display:flex; align-items:center; gap:8px; padding:7px 11px; border:1px solid #d9ba7744; border-radius:18px; background:#173c34c9; backdrop-filter:blur(10px); color:#f1e6c4; font-size:11px; pointer-events:auto; text-shadow:0 1px 6px #132d27; }
.player-resources span { white-space:nowrap; }
.player-resources .resource-level { color:#d9ba77; padding-right:3px; }
.player-resources b { font-variant-numeric:tabular-nums; font-weight:600; }
.icon-button {
  width: 45px;
  height: 45px;
  padding: 11px;
  background: #1c3a35d9;
  backdrop-filter: blur(10px);
  border-color: #d9ba7755;
  display: grid;
  place-items: center;
}
.icon-button[data-label],.camera-tools button[data-label] { position:relative; padding-bottom:16px; }
.icon-button[data-label]::after,.camera-tools button[data-label]::after { content:attr(data-label); position:absolute; bottom:3px; left:0; width:100%; font-size:8px; line-height:1.2; font-weight:400; white-space:nowrap; color:#e5dfc8; }
.control-tip { padding:12px 0; border-bottom:1px solid var(--line); }
.control-tip .control-tip-title { color:var(--gold); font-weight:600; margin-bottom:6px; }
.shop-section-title { color:var(--gold); margin-top:24px; letter-spacing:.06em; font-size:12px; }
.shop-item { flex-wrap:wrap; }
.pet-shop-icon { display:grid; place-items:center; font-size:26px; }
.purchase-confirm { flex-basis:100%; padding:12px; border:1px solid var(--line); border-radius:6px; }
.purchase-confirm button { margin-right:8px; margin-top:8px; }
@media(max-width:600px) {
  .icon-button[data-label],.camera-tools button[data-label] { min-height:52px; height:52px; padding-top:4px; padding-bottom:17px; }
  .hud nav { row-gap:8px; }
  body.tools-open .quick-tools { top:calc(264px + var(--safe-area-top)); }
}
.location {
  position: fixed;
  top: 135px;
  left: 34px;
  text-shadow: 0 2px 10px #203e37;
}
.smallcaps {
  display: block;
  font-size: 9px;
  letter-spacing: 2px;
  color: #eee6ca;
}
.location strong {
  display: block;
  font:
    500 19px "Noto Serif",
    Georgia,
    serif;
  margin-top: 5px;
}
.welcome {
  position: fixed;
  left: 6%;
  bottom: 15%;
  width: min(560px, 88%);
  text-shadow: 0 2px 22px #173b34;
  z-index: 6;
}
.welcome::before {
  content: "";
  position: absolute;
  inset: -100px -150px -100px -150px;
  background: radial-gradient(ellipse, #173b34a8, transparent 72%);
  z-index: -1;
  pointer-events: none;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 3px;
  color: #efd397;
  margin-bottom: 20px;
}
h1 {
  font:
    500 clamp(32px, 4.3vw, 60px)/1.28 "Noto Serif",
    Georgia,
    serif;
  margin: 0 0 22px;
  letter-spacing: -1px;
}
.welcome p {
  font-size: 14px;
  line-height: 1.9;
  color: #e9eadb;
  margin-bottom: 28px;
}
.welcome form {
  display: flex;
  max-width: 530px;
  gap: 8px;
}
.welcome input {
  min-width: 0;
  flex: 1;
  border: 1px solid #e2d4a875;
  background: #173d35c9;
  color: var(--ink);
  padding: 14px 16px;
  border-radius: 5px;
  backdrop-filter: blur(8px);
}
input::placeholder {
  color: #c4cfbd;
}
input,
textarea {
  color: var(--ink);
  background: #142f2a;
  border: 1px solid #c9cfa43d;
  border-radius: 5px;
  padding: 13px;
  width: 100%;
}
.primary {
  background: var(--gold);
  color: #213b30;
  border-color: var(--gold);
  font-weight: 600;
}
.primary:hover {
  background: #e9cd90;
}
.primary span {
  margin-left: 12px;
}
.load-status {
  font-size: 11px;
  margin-top: 16px;
  color: #d7dfcd;
}
.welcome-extras { display:flex; align-items:center; flex-wrap:wrap; gap:8px 18px; margin-top:20px; }
.install-entry { display:inline-flex; align-items:center; justify-content:center; gap:10px; min-height:46px; padding:10px 17px; border-radius:24px; border:1px solid #c4d5b845; background:#1b3d34e6; color:#f1ead5; font-size:12px; font-weight:500; box-shadow:0 4px 18px #102b2326; }
.install-entry::before { content:""; width:18px; height:18px; flex-shrink:0; background:url('/brand/install.svg') center / contain no-repeat; }
.install-entry:hover { background:#315247; border-color:#d9ba7780; }
.privacy-link, .privacy-link:visited { display:inline-flex; align-items:center; min-height:44px; padding:8px 0; color:#d5dfce; font-size:11px; font-weight:400; text-decoration:none; text-shadow:0 1px 5px #163a30; }
.privacy-link:hover { color:#f2ead4; text-decoration:underline; text-underline-offset:4px; }
.privacy-link:focus-visible { outline:2px solid var(--gold); outline-offset:4px; border-radius:3px; }
@media(max-width:420px) { .welcome-extras { gap:2px 16px; } .privacy-link { font-size:10px; } }
.edition {
  position: fixed;
  bottom: 24px;
  left: 32px;
  font-size: 10px;
  letter-spacing: 1px;
  color: #e1e2cb;
}
.edition span {
  margin: 0 12px;
  color: var(--gold);
}
.toast {
  position: fixed;
  top: 110px;
  left: 50%;
  transform: translate(-50%, -12px);
  max-width: min(520px, 90vw);
  padding: 14px 22px;
  background: #1d3d35f0;
  border: 1px solid #d5bc7360;
  border-radius: 5px;
  opacity: 0;
  transition:
    opacity 0.25s,
    transform 0.25s;
  z-index: 30;
  pointer-events: none;
  text-align: center;
  line-height: 1.6;
  box-shadow: 0 8px 30px #0b292a38;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.joystick {
  position: fixed;
  bottom: max(34px, env(safe-area-inset-bottom));
  left: 34px;
  width: 118px;
  height: 118px;
  border: 1px solid #eee5c95c;
  border-radius: 50%;
  background: #2446382b;
  touch-action: none;
  backdrop-filter: blur(4px);
}
.joystick-ring {
  position: absolute;
  inset: 16px;
  border: 1px solid #e9dfb943;
  border-radius: 50%;
}
.stick {
  position: absolute;
  left: 36px;
  top: 36px;
  width: 46px;
  height: 46px;
  border: 1px solid #f2e6ba80;
  background: #e6d8b759;
  border-radius: 50%;
  box-shadow: 0 2px 12px #203e3730;
}
.bottom-hint {
  position: fixed;
  bottom: 35px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  white-space: nowrap;
  color: #f3efdb;
  text-shadow: 0 2px 8px #102d2a;
}
.action {
  position: fixed;
  right: 32px;
  bottom: 100px;
  display: flex;
  align-items: center;
  gap: 13px;
  background: #254a3fef;
  backdrop-filter: blur(10px);
  padding: 15px 19px;
  border-color: #d9ba7799;
  box-shadow: 0 8px 30px #183e3440;
}
.action > span:first-child {
  font-size: 26px;
  color: var(--gold);
}
.action kbd {
  border: 1px solid #d4cda859;
  border-radius: 3px;
  padding: 3px 5px;
  font-size: 10px;
  color: var(--gold);
}
dialog {
  width: min(510px, calc(100% - 28px));
  max-height: 82dvh;
  padding: 34px;
  border: 1px solid #b9aa736b;
  border-radius: 9px;
  background: #1c3830f7;
  color: var(--ink);
  box-shadow: 0 25px 100px #081f2766;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
dialog::backdrop {
  background: #102b274f;
  backdrop-filter: blur(5px);
}
.close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 42px;
  height: 42px;
  padding: 0;
  min-height: 42px;
  font-size: 25px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.panel-eyebrow {
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 2px;
  margin: 4px 0 13px;
}
h2 {
  font:
    500 30px/1.3 "Noto Serif",
    Georgia,
    serif;
  margin: 0 30px 14px 0;
}
h3 {
  font:
    500 20px "Noto Serif",
    Georgia,
    serif;
  margin: 0 0 7px;
}
.body-copy {
  line-height: 1.9;
  color: #c9d3c0;
  font-size: 13px;
}
.fine {
  font-size: 10px;
  color: #a6bda8;
  line-height: 1.8;
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.badge {
  font-size: 10px;
  color: #e5c47e;
  border: 1px solid #c7ab665a;
  padding: 5px 8px;
  border-radius: 3px;
  display: inline-block;
}
.chance {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.chance b {
  font:
    500 38px "Noto Serif",
    Georgia,
    serif;
  color: var(--gold);
}
.chance span {
  font-size: 11px;
  line-height: 1.8;
  color: var(--muted);
}
.wide {
  width: 100%;
  margin-top: 12px;
}
.wish-list {
  margin-top: 24px;
  border-top: 1px solid var(--line);
}
.wish-item {
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.wish-item small {
  display: block;
  color: #9eb69e;
  font-size: 10px;
  margin-top: 4px;
}
.field-label {
  display: block;
  color: #c9d3c0;
  font-size: 12px;
  margin: 20px 0 9px;
}
textarea {
  resize: vertical;
  min-height: 95px;
  line-height: 1.7;
}
.creature-card {
  padding: 15px 0;
  border-top: 1px solid var(--line);
}
.creature-card button {
  font-size: 11px;
  min-height: 40px;
  padding: 8px 10px;
}
.creature-card .body-copy {
  margin: 6px 0;
}
.pet-glyph {
  font-size: 34px;
  filter: saturate(0.6);
  width: 50px;
  text-align: center;
}
.creature-head {
  display: flex;
  align-items: center;
  gap: 13px;
}
.settings-row {
  margin: 19px 0;
}
.settings-row label {
  color: #d5dec8;
  font-size: 13px;
}
.settings-row select {
  background: #24483e;
  color: var(--ink);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.map-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 7px;
  margin: 22px 0;
}
.map-grid button {
  font-size: 11px;
  line-height: 1.7;
  min-height: 95px;
  background: #2f4b3a;
}
.map-grid .middle {
  background: #4d5236;
  border-color: #d2b67188;
}
.map-grid button span {
  display: block;
  font-size: 22px;
  margin-bottom: 5px;
}
.map-grid button:hover {
  background: #5c6647;
}
.map-entry {
  text-align: center;
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 2px;
  margin-top: 15px;
}
.practice {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  width: 310px;
  text-align: center;
  padding: 21px;
  background: #193d34e8;
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 8px;
  z-index: 7;
}
.practice-title {
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--gold);
}
.breath-orb {
  width: 95px;
  height: 95px;
  border: 1px solid #dfca8e80;
  box-shadow:
    0 0 0 10px #b5cca00a,
    0 0 0 23px #b5cca006;
  border-radius: 50%;
  margin: 23px auto 20px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, #9bbd7e22, transparent);
  animation: breath 8s ease-in-out infinite;
}
.breath-orb span {
  font-size: 12px;
  color: #e5d9ae;
}
#practice-time {
  font:
    400 23px "Noto Serif",
    Georgia,
    serif;
  font-variant-numeric: tabular-nums;
}
.practice-tabs {
  display: flex;
  gap: 7px;
  justify-content: center;
  margin-top: 15px;
}
.practice-tabs button {
  font-size: 11px;
  min-height: 36px;
  padding: 8px 17px;
}
.practice p {
  font-size: 10px;
  color: var(--muted);
}
.secondary {
  background: transparent;
}
.practice .secondary {
  width: 100%;
  font-size: 12px;
}
#bead-touch {
  margin-top: 14px;
  width: 100%;
  border-color: var(--gold);
  color: var(--gold);
}
#bead-touch b {
  padding-left: 15px;
}
body.seated .joystick,
body.seated .action,
body.seated .bottom-hint {
  display: none !important;
}
@keyframes breath {
  0%,
  100% {
    transform: scale(0.85);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}
#bead-space {
  height: 172px;
  margin: 7px auto 10px;
  position: relative;
}
#bead-canvas {
  width: 250px;
  height: 150px;
  max-width: 100%;
  touch-action: none;
  cursor: grab;
}
#bead-space > span {
  display: block;
  font-size: 9px;
  color: #c9d1b3;
  margin-top: 3px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
@media (max-width: 600px) {
  .hud {
    padding: calc(14px + var(--safe-area-top)) 15px 12px;
  }
  .brand {
    gap: 7px;
  }
  .brand > svg {
    width: 31px;
    height: 31px;
  }
  .brand strong {
    font-size: 14px;
    letter-spacing: 2px;
  }
  .brand span {
    font-size: 9px;
  }
  .player-resources { left:15px; top:calc(76px + var(--safe-area-top)); font-size:10px; gap:6px; padding:6px 9px; }
  .hud nav {
    gap: 5px;
  }
  .icon-button {
    width: 42px;
    height: 44px;
    padding: 10px;
  }
  .location {
    left: 19px;
    top: calc(127px + var(--safe-area-top));
  }
  .location strong {
    font-size: 16px;
  }
  .welcome {
    left: 7%;
    bottom: 15%;
    width: 86%;
  }
  .welcome form {
    flex-direction: column;
    max-width: 350px;
  }
  .welcome input {
    min-height: 49px;
  }
  .welcome .primary {
    min-height: 49px;
  }
  h1 {
    font-size: 36px;
  }
  .welcome p {
    font-size: 12px;
  }
  .eyebrow {
    font-size: 9px;
    letter-spacing: 2px;
    margin-bottom: 17px;
  }
  .edition {
    left: 7%;
    bottom: calc(24px + env(safe-area-inset-bottom));
    font-size: 8px;
    letter-spacing: 0;
  }
  .joystick {
    left: 22px;
    bottom: calc(28px + env(safe-area-inset-bottom));
    width: 112px;
    height: 112px;
  }
  .stick {
    left: 33px;
    top: 33px;
  }
  .action {
    right: 18px;
    bottom: 105px;
    gap: 8px;
    padding: 10px 13px;
    max-width: 220px;
    font-size: 12px;
    min-height: 53px;
  }
  .action kbd {
    display: none;
  }
  .bottom-hint {
    display: none;
  }
  .toast {
    top: 90px;
    font-size: 12px;
    padding: 12px 16px;
  }
  .practice {
    bottom: calc(18px + env(safe-area-inset-bottom));
    width: min(300px, 90%);
  }
  dialog {
    padding: 28px 23px;
    max-height: 83dvh;
  }
  h2 {
    font-size: 26px;
  }
  .map-grid button {
    padding: 10px 4px;
    font-size: 10px;
    min-height: 87px;
  }
  .pet-glyph {
    font-size: 28px;
    width: 36px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
.quick-tools {
  position: fixed;
  right: 32px;
  top: 90px;
  display: flex;
  gap: 8px;
}
.camera-tools {
  position: fixed;
  right: 32px;
  top: 42%;
  display: grid;
  gap: 4px;
}
.camera-tools button {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 5px;
  background: #1c3a35d9;
  font-size: 22px;
}
.inventory-tabs {
  display: flex;
  gap: 6px;
  margin: 12px 0;
}
.inventory-tabs button {
  flex: 1;
  padding: 8px;
  font-size: 12px;
}
.wardrobe-stage {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  background: radial-gradient(ellipse at 30% 80%, #7b8a6350, transparent 70%);
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
#wardrobe-preview {
  position: sticky;
  top: 0;
  width: 180px;
  height: 230px;
  flex-shrink: 0;
  max-width: 48%;
}
.wardrobe-fields {
  flex: 1;
  min-width: 0;
}
.wardrobe-fields label {
  display: block;
  font-size: 11px;
  margin: 8px 0;
  color: var(--muted);
}
select {
  font: inherit;
  border: 1px solid var(--line);
  background: #1e3e36;
  color: var(--ink);
  border-radius: 4px;
  padding: 9px;
  min-height: 44px;
}
.wardrobe-fields select {
  display: block;
  width: 100%;
  margin-top: 5px;
  font-size: 12px;
}
.wardrobe-fields .wardrobe-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 2px 0;
}
.wardrobe-toggle input { width: 20px; height: 20px; accent-color: var(--gold); }
.journey-entry {
  border-left: 2px solid var(--gold);
  padding-left: 16px;
  margin: 20px 0;
}
.journey-entry p {
  margin: 6px 0;
}
.practice-length {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 10px;
  color: var(--muted);
  margin-top: 12px;
}
.practice-length select {
  min-height: 36px;
  padding: 5px;
  font-size: 11px;
}
@media (max-width: 600px) {
  .quick-tools {
    right: 15px;
    top: calc(75px + var(--safe-area-top));
    gap: 5px;
  }
  .camera-tools {
    right: 15px;
    top: 38%;
  }
  .wardrobe-stage {
    gap: 8px;
  }
  .practice {
    max-height: calc(100dvh - 115px);
    overflow-y: auto;
  }
}
.chat-dock {
  position: fixed;
  left: 22px;
  bottom: 26px;
  width: min(350px, calc(100vw - 32px));
  z-index: 35;
  background: #19382fef;
  border: 1px solid #d5bd7955;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 16px 50px #0004;
  backdrop-filter: blur(18px);
}
.chat-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: 0.12em;
  font-size: 10px;
  color: var(--gold);
}
.chat-close,
.chat-mute,
.chat-block {
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  min-height: 36px;
}
.chat-close {
  font-size: 24px;
  min-width: 36px;
}
.chat-mute {
  font-size: 11px;
}
.chat-block {
  font-size: 10px;
  padding: 0 6px;
  opacity: 0.7;
}
.chat-messages {
  height: 180px;
  overflow-y: auto;
  overscroll-behavior: contain;
  font-size: 12px;
  line-height: 1.6;
  margin: 8px 0;
}
.chat-message {
  margin: 7px 0;
  overflow-wrap: anywhere;
}
.chat-message strong {
  color: var(--gold);
}
.chat-dock form {
  display: flex;
  gap: 8px;
}
.chat-dock input {
  min-width: 0;
  width: 100%;
  font-size: 16px;
}
.chat-dock form button {
  padding: 9px 12px;
  font-size: 12px;
}
.wallet {
  color: var(--gold);
  font-size: 19px;
  letter-spacing: 0.03em;
}
.shop-item {
  display: flex;
  gap: 15px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.shop-item > div {
  flex: 1;
}
.shop-item p {
  margin: 5px 0;
}
.robe-swatch {
  display: block;
  width: 46px;
  height: 57px;
  border-radius: 20px 20px 8px 8px;
  border: 2px solid #ead8ad88;
}
progress {
  width: 100%;
  height: 8px;
  accent-color: var(--gold);
}
.inventory-tabs {
  flex-wrap: wrap;
}
#woodblock-touch {
  background: #a06f3b;
  color: #fff2d2;
  border: 1px solid #d5ba73;
  padding: 14px 20px;
  border-radius: 50px;
  min-height: 52px;
  font: inherit;
  cursor: pointer;
  margin: 12px auto;
}
#woodblock-touch:active {
  transform: scale(0.96);
}
@media (max-width: 600px) {
  .chat-dock {
    left: 16px;
    bottom: calc(160px + env(safe-area-inset-bottom));
    max-height: 45dvh;
  }
  .chat-messages {
    height: 120px;
  }
  .quick-tools .icon-button {
    width: 40px;
    height: 40px;
  }
  .quick-tools {
    max-width: calc(100vw - 120px);
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .shop-item {
    gap: 10px;
  }
  .shop-item button {
    padding: 10px;
    font-size: 12px;
  }
}
.audio-field {
  display: block;
  margin: 20px 0;
  font-size: 12px;
  color: var(--muted);
}
.audio-field select {
  display: block;
  width: 100%;
  margin-top: 8px;
}
.audio-field input[type="range"] {
  display: block;
  width: 100%;
  margin-top: 12px;
  accent-color: var(--gold);
  min-height: 32px;
}
.audio-check {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  font-size: 12px;
}
.audio-check input {
  width: 22px;
  height: 22px;
  accent-color: var(--gold);
}
.sutra {
  border-block-end: 1px solid var(--line);
  padding: 18px 0;
}
.sutra summary {
  cursor: pointer;
  color: var(--gold);
  min-height: 32px;
}
.sutra-text {
  white-space: pre-line;
  font-family: "Noto Serif", serif;
  font-size: 15px;
  line-height: 1.95;
}
.sutra a {
  color: var(--gold);
  font-size: 11px;
}
.practice {
  left: 22px;
  transform: none;
  bottom: 28px;
}
@media (max-width: 600px) {
  .practice {
    left: 16px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: calc(100vw - 32px);
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    max-height: 42dvh;
  }
  .practice[hidden] {
    display: none;
  }
  .practice-title,
  .practice > p {
    display: none;
  }
  .practice-length {
    grid-column: 1/-1;
    margin: 0;
    justify-content: space-between;
  }
  .practice-length select {
    min-height: 32px;
  }
  .practice-tabs {
    grid-column: 1/-1;
    margin: 0;
    display: flex;
    gap: 6px;
  }
  .practice-tabs button {
    flex: 1;
    min-height: 36px;
    padding: 6px;
    font-size: 11px;
  }
  #practice-time {
    margin: 0;
    font-size: 18px;
    align-self: center;
  }
  .breath-orb {
    width: 60px;
    height: 60px;
    margin: 0 auto;
    grid-row: 2;
  }
  .breath-orb span {
    font-size: 10px;
  }
  #bead-space {
    grid-column: 1/-1;
    height: 140px;
  }
  #bead-space canvas {
    height: 120px;
  }
  #woodblock-touch,
  #bead-touch {
    margin: 0;
    min-height: 44px;
    font-size: 12px;
  }
  #leave-seat {
    min-height: 40px;
    padding: 7px;
    font-size: 12px;
    grid-column: 2;
    grid-row: auto;
  }
  .practice:has(#woodblock-touch:not([hidden])) #practice-time {
    grid-column: 1/-1;
  }
  .practice:has(#breath-orb:not([hidden])) #leave-seat {
    grid-column: 1/-1;
  }
}
.learning-button {
  position: fixed;
  left: 24px;
  top: 196px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #263f35e8;
  color: var(--gold);
  border: 1px solid #c9af6a66;
  border-radius: 8px;
  padding: 12px 16px;
  min-height: 44px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  box-shadow: 0 8px 24px #152c231a;
}
.lesson-list {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}
.lesson-card {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 0 0 14px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}
.lesson-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 145px;
  flex-shrink: 0;
  aspect-ratio: 16/10;
  background:
    radial-gradient(ellipse at 50% 90%, #a8976333, transparent),
    linear-gradient(135deg, #4b6752, #1c3a32);
  border: 1px solid #aa945144;
  border-radius: 6px;
}
.lesson-art > span {
  font-family: Georgia, serif;
  font-size: 50px;
  color: #d5bf7b;
}
.lesson-art > small {
  position: absolute;
  right: 5px;
  bottom: 4px;
  background: #132b25e0;
  color: #e7d39a;
  font-size: 9px;
  padding: 3px 4px;
  border-radius: 3px;
}
.lesson-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lesson-copy > small {
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--gold);
}
.lesson-copy > strong {
  font:
    17px "Noto Serif",
    serif;
  line-height: 1.5;
}
.lesson-copy > span {
  font-size: 10px;
  color: var(--muted);
}
.lesson-player {
  margin: 20px 0;
  aspect-ratio: 16/9;
  background: #132d27;
  border-radius: 6px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.lesson-player iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.lesson-player button {
  width: auto;
}
.video-link {
  color: var(--gold);
  font-size: 12px;
  display: block;
  margin: 12px 0;
}
@media (max-width: 600px) {
  .learning-button {
    left: 16px;
    top: calc(182px + var(--safe-area-top));
    padding: 10px 12px;
    font-size: 11px;
    max-width: 155px;
  }
  .lesson-card {
    gap: 12px;
  }
  .lesson-art {
    width: 112px;
  }
  .lesson-copy > strong {
    font-size: 14px;
  }
  .lesson-copy > small {
    font-size: 8px;
  }
  .lesson-copy > span {
    font-size: 9px;
  }
  body.seated .learning-button {
    display: none;
  }
}

.mobile-tools {
  display: none;
}
@media (max-width: 600px) {
  .mobile-tools {
    display: grid;
    place-items: center;
    pointer-events: auto;
    width: 46px;
    height: 46px;
    padding: 8px;
    font-size: 22px;
    background: #1c3a35ed;
  }
  .hud nav {
    display: none;
    position: fixed;
    right: 16px;
    top: calc(76px + var(--safe-area-top));
    grid-template-columns: repeat(2, 46px);
    gap: 6px;
  }
  body.tools-open .hud nav {
    display: grid;
  }
  .quick-tools {
    display: grid;
    grid-template-columns: repeat(2, 46px);
    gap: 6px;
    top: calc(76px + var(--safe-area-top));
  }
  .quick-tools .icon-button,
  .hud nav .icon-button {
    width: 46px;
    height: 46px;
    min-height: 46px;
  }
  .quick-tools #profile-button,
  .quick-tools #social-button {
    display: none;
  }
  body.tools-open .quick-tools {
    top: calc(180px + var(--safe-area-top));
  }
  body.tools-open .quick-tools #profile-button,
  body.tools-open .quick-tools #social-button {
    display: grid;
  }
  .camera-tools {
    top: auto;
    bottom: calc(178px + env(safe-area-inset-bottom));
    gap: 6px;
  }
  .camera-tools button {
    width: 46px;
    height: 46px;
  }
  .practice-tabs button,
  .practice-length select,
  #leave-seat {
    min-height: 44px;
  }
  .practice {
    overscroll-behavior: contain;
  }
  dialog {
    width: calc(100vw - 24px);
    max-height: calc(
      100dvh - var(--safe-area-top) - env(safe-area-inset-bottom) - 24px
    );
    overscroll-behavior: contain;
  }
}
@media (max-height: 500px) and (pointer: coarse) {
  .learning-button,
  .location,
  .camera-tools {
    display: none;
  }
  .joystick {
    width: 100px;
    height: 100px;
    bottom: 16px;
  }
  .stick {
    left: 27px;
    top: 27px;
  }
  .quick-tools {
    top: 68px;
  }
  .practice {
    max-height: calc(100dvh - 22px);
  }
}

@media (max-width: 600px) {
  body.seated .camera-tools {
    display: none;
  }
}
@media (max-width: 600px) and (max-height: 740px) {
  .practice {
    max-height: 50dvh;
    gap: 6px;
  }
  #bead-space {
    height: 90px;
  }
  #bead-space canvas {
    height: 75px;
  }
  #bead-space > span {
    font-size: 9px;
  }
  .location {
    top: calc(116px + var(--safe-area-top));
  }
  .learning-button {
    top: calc(170px + var(--safe-area-top));
  }
}

@media (max-width: 600px) {
  .toast {
    top: calc(200px + var(--safe-area-top));
    width: max-content;
    max-width: calc(100vw - 36px);
    padding: 10px 14px;
    font-size: 11px;
  }
}

@media (max-width: 600px) {
  #bead-space {
    margin: 0 auto;
    overflow: hidden;
  }
  #bead-space > span {
    pointer-events: none;
  }
  #bead-canvas {
    display: block;
  }
}

/* Model previews expose camera controls; movement and gameplay stay in play mode. */
body.view-only #joystick,
body.view-only #focus-player,
body.view-only #action,
body.view-only #practice,
body.view-only #hint,
body.view-only .quick-tools,
body.view-only #learning-button {
  display: none !important;
}

/* Short sessions: one clear activity, with secondary controls opened on demand. */
.lesson-video {
  margin: 22px 0 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.lesson-video summary {
  cursor: pointer;
  min-height: 44px;
  display: list-item;
  align-content: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.practice-guide {
  position: fixed;
  left: 24px;
  top: 196px;
  width: min(300px, calc(100vw - 104px));
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 12px;
  background: #203e37f0;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.7;
  z-index: 5;
}
.practice-guide button { flex: 0 0 44px; padding: 8px; }
body.guided-practice .learning-button { display: none; }
body.view-only .practice-guide,
.practice-guide[hidden] { display: none; }
#practice {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  width: 320px;
  max-height: calc(100dvh - 110px);
  overflow-y: auto;
}
#practice[hidden], #practice [hidden] { display: none; }
#practice .practice-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
}
#practice-heading { font-size: 13px; font-weight: 500; color: var(--ink); }
#practice-options-toggle {
  width: auto;
  min-height: 44px;
  padding: 8px 10px;
  flex-shrink: 0;
  font-size: 11px;
  color: var(--gold);
}
#practice-options { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
#practice .practice-length { display: flex; justify-content: space-between; margin: 0 0 8px; }
#practice .practice-tabs { margin: 0; display: flex; gap: 6px; }
#practice .practice-tabs button { flex: 1; min-height: 44px; padding: 8px 4px; font-size: 12px; }
#practice .breath-orb { width: 64px; height: 64px; margin: 8px auto; }
#practice #practice-time { margin: 0; font-size: 12px; color: var(--muted); }
#practice > p { margin: 0; font-size: 11px; line-height: 1.7; }
#practice #practice-status { display: block; text-align: left; }
#practice .practice-permission { display: block; font-size: 10px; color: var(--muted); }
#practice #bead-space { width: 100%; height: auto; margin: 0; flex-shrink: 0; }
#practice #bead-canvas { width: 100%; height: 140px; }
#practice #bead-space > span { font-size: 10px; }
#practice #woodblock-touch, #practice #bead-touch {
  width: 100%; min-height: 48px; margin: 0; padding: 8px; font-size: 13px;
}
#practice #bead-touch b { padding-left: 4px; font-variant-numeric: tabular-nums; }
#practice #leave-seat { width: 100%; min-height: 44px; margin: 0; padding: 8px; }
#practice .practice-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#practice .practice-footer #leave-seat { grid-column: auto; }
#practice[data-mode="rest"] #leave-seat,
#practice[data-mode="meditate"] #leave-seat { grid-column: 1/-1; }
#practice[data-mode="beads"] #practice-time,
#practice[data-mode="woodblock"] #practice-time { display: none; }
body.seated:not(.tools-open) .quick-tools { display: none; }
@media (max-width: 600px) {
  .practice-guide { left: 16px; top: calc(182px + var(--safe-area-top)); font-size: 11px; }
  #practice { width: calc(100vw - 32px); max-height: min(62dvh, calc(100dvh - 100px)); gap: 7px; }
  body.seated .location { display: none; }
}
@media (max-width: 600px) and (max-height: 740px) {
  .practice-guide { top: calc(170px + var(--safe-area-top)); }
  #practice #bead-canvas { height: 106px; }
  #practice .breath-orb { width: 60px; height: 60px; margin: 8px auto; }
  #practice { gap: 6px; padding: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .breath-orb { animation: none; }
}
.profile-wallet { border-block: 1px solid var(--line); margin: 20px 0; padding: 8px 0; }
.profile-wallet summary { cursor: pointer; min-height: 44px; align-content: center; color: var(--gold); font-size: 12px; }
.profile-wallet .wallet { margin-top: 12px; }
#practice .practice-tabs button.suggested { border-color: var(--gold); color: var(--gold); background: #365143; }

/* iOS zooms focused controls with text below 16px, including dynamic dialogs. */
.insight-field { display: grid; gap: 8px; margin: 16px 0; }
.insight-form textarea { min-height: 92px; }
.insight-result { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; }
.insight-title { color: var(--gold); font-size: 20px; }
.hexagram-lines { text-align: center; letter-spacing: 2px; color: var(--gold); line-height: 1.8; }
.insight-answer-text { white-space: pre-wrap; line-height: 1.9; }
.sutra-reader { position: fixed; z-index: 15; top: calc(150px + var(--safe-area-top)); right: 16px; width: min(420px, calc(100vw - 32px)); padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #173c34f2; }
.sutra-reader > strong { display: block; color: var(--gold); font-size: 13px; }
.sutra-reader-text { max-height: 18dvh; overflow-y: auto; white-space: pre-wrap; line-height: 1.9; font-size: 15px; margin: 8px 0; }
.sutra-reader button { padding: 6px 8px; min-height: 44px; font-size: 11px; margin-right: 4px; }
#practice-library { width: auto; min-height: 44px; padding: 8px; font-size: 11px; flex-shrink: 0; }
#practice .practice-heading { flex-wrap: nowrap; }
#practice .practice-heading strong { flex: 1; min-width: 0; }
body.seated .sutra-reader { top: calc(96px + var(--safe-area-top)); }
@media (max-width: 700px), (pointer: coarse) {
  :root input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
  :root textarea,
  :root select {
    font-size: 16px;
  }
}

/* Insight stages: lightweight 3D feedback for portrait mobile */
.insight-stage { perspective: 560px; transform-style: preserve-3d; }
.hexagram-lines { position: relative; padding: 14px 10px; border-radius: 18px; background: radial-gradient(circle, rgba(214,177,92,.18), transparent 68%); box-shadow: 0 0 28px rgba(214,177,92,.16); }
.hexagram-lines > div { animation: insight-halo 2.8s ease-in-out infinite; animation-delay: var(--step, 0ms); transform-origin: center; }
.numerology-stage { display: grid; place-items: center; width: 108px; height: 108px; margin: 12px auto; border-radius: 50%; color: var(--gold); font-size: 42px; font-weight: 700; background: radial-gradient(circle, rgba(214,177,92,.28), rgba(214,177,92,.04) 54%, transparent 56%); border: 1px solid rgba(214,177,92,.5); box-shadow: 0 0 0 10px rgba(214,177,92,.06), 0 0 30px rgba(214,177,92,.18); position: relative; }
@keyframes insight-halo { 0%,100% { transform: rotateX(0deg) translateZ(0); opacity: .78; } 50% { transform: rotateX(16deg) translateZ(8px); opacity: 1; } }
.numerology-stage::before { content: ""; position: absolute; inset: -12px; border: 1px dashed rgba(214,177,92,.6); border-radius: 50%; animation: insight-orbit 12s linear infinite; transform: rotateX(28deg); }
@keyframes insight-orbit { to { transform: rotateX(28deg) rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .insight-stage, .insight-stage::before, .hexagram-lines > div { animation: none !important; } }

/* Shared temple moments: neon lotus floats above the world without taking input. */
.lotus-announcement {
  position: fixed; inset: auto; top: max(110px, 23dvh); left: 50%;
  width: min(84vw, 410px); margin: 0; padding: 16px 22px 22px;
  transform: translateX(-50%); border: 0; color: #edfff7;
  background: radial-gradient(ellipse at 50% 58%, #102f29f2 0%, #102f29d4 40%, transparent 73%);
  text-align: center; pointer-events: none; z-index: 500;
  overflow: visible; isolation: isolate;
}
.lotus-announcement[hidden] { display: none; }
.lotus-announcement::backdrop { background: transparent; pointer-events: none; }
.lotus-announcement-art { width: 116px; margin: 0 auto 10px; filter: drop-shadow(0 0 6px #8fffe5a0) drop-shadow(0 0 18px #8fffe554); }
.lotus-announcement-art svg { display: block; width: 100%; }
.lotus-announcement strong { display: block; font-size: 14px; line-height: 1.7; color: #afffe4; text-shadow: 0 0 12px #9affdb66; overflow-wrap: anywhere; }
.lotus-announcement p { font-size: 15px; line-height: 1.75; margin: 8px 0 0; color: #fff1c9; overflow-wrap: anywhere; white-space: pre-wrap; }
.lotus-announcement.is-floating { animation: lotus-ascend var(--lotus-duration, 5200ms) ease-in-out both; }
@keyframes lotus-ascend {
  0% { opacity: 0; transform: translate(-50%, 42px) scale(.94); }
  14%, 75% { opacity: 1; }
  34% { transform: translate(-50%, 0) scale(1); }
  80% { transform: translate(-50%, -12px); }
  100% { opacity: 0; transform: translate(-50%, -54px); }
}
@media (max-height: 660px) { .lotus-announcement { top: max(86px, 18dvh); padding: 8px 15px 16px; } .lotus-announcement-art { width: 86px; } }
@media (prefers-reduced-motion: reduce) { .lotus-announcement.is-floating { animation: none; } }

.sutra-title { font-size: 15px; line-height: 1.65; color: var(--gold); margin: 0 0 10px; }
.sutra-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }
.sutra-actions button { min-height: 44px; flex: 1 1 130px; font-size: 12px; padding: 10px; }
.sutra-actions .speech-status { flex-basis: 100%; line-height: 1.6; color: var(--muted); }
.sutra-actions .speech-status:empty { display: none; }
.sutra summary { font-size: 12px; color: var(--muted); }
.sutra-reader .sutra-actions { margin-bottom: 6px; }

.speech-speed-label { display: flex; align-items: center; gap: 12px; flex: 1 1 100%; color: var(--muted); font-size: 12px; }
.speech-speed { flex: 1; width: auto; min-height: 44px; padding: 8px 12px; font-size: 16px; color: var(--ink); background: #203e37; border: 1px solid var(--line); border-radius: 5px; }

.install-steps { padding-left: 22px; line-height: 1.85; }
.install-steps li { padding-left: 4px; margin-bottom: 12px; }

/* Labelled touch controls keep one consistent size and do not cover the resource strip. */
@media(max-width:600px) {
 .hud nav .icon-button[data-label], .quick-tools .icon-button[data-label], .camera-tools button[data-label] { height:52px; min-height:52px; }
 body.tools-open .quick-tools { top:calc(252px + var(--safe-area-top)); }
}
