:root {
  --ink: #18231f;
  --ink-soft: #34463e;
  --paper: #eee7d4;
  --paper-deep: #d8ccb0;
  --gold: #c99a4a;
  --cinnabar: #9f3f31;
  --moss: #506a57;
  --night: #10241d;
  --white: #fffaf0;
  --shadow: 0 18px 50px rgb(10 23 18 / 28%);
  font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif CJK SC", serif;
  color: var(--ink);
  background: var(--night);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background:
    radial-gradient(circle at 70% 20%, rgb(120 140 105 / 25%), transparent 36%),
    linear-gradient(145deg, #13271f, #0b1512);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid #e2b866;
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

#game-shell {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 420px;
  isolation: isolate;
  background: #8fa68c;
  user-select: none;
}

#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

#scene-3d-canvas {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  touch-action: none;
}

#game-canvas {
  z-index: 1;
}

.paper-grain {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.22;
  mix-blend-mode: soft-light;
  box-shadow:
    inset 0 0 110px rgb(12 8 5 / 34%),
    inset 0 -80px 110px rgb(9 7 5 / 24%);
  background-image:
    repeating-linear-gradient(0deg, transparent 0 2px, rgb(30 20 10 / 5%) 2px 3px),
    repeating-linear-gradient(90deg, transparent 0 4px, rgb(255 255 255 / 5%) 4px 5px);
}

.hud {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: max(18px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) 0
    max(22px, env(safe-area-inset-left));
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--white);
  text-shadow: 0 2px 16px rgb(0 0 0 / 38%);
}

.brand-seal {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgb(255 250 240 / 60%);
  border-radius: 50%;
  color: #f4d9a4;
  background: rgb(86 43 29 / 78%);
  box-shadow: inset 0 0 0 4px rgb(255 255 255 / 7%);
  font-size: 20px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-copy strong {
  font-size: clamp(22px, 2.4vw, 31px);
  font-weight: 500;
  letter-spacing: 0.16em;
}

.brand-copy small {
  font-size: 11px;
  letter-spacing: 0.4em;
  opacity: 0.74;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 9px;
  pointer-events: auto;
}

.language-control {
  display: flex;
  align-items: center;
  gap: 4px;
}

.language-button {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgb(255 255 255 / 25%);
  border-radius: 999px;
  color: #fffaf0;
  background: rgb(17 34 28 / 72%);
  box-shadow: 0 8px 26px rgb(0 0 0 / 18%);
  backdrop-filter: blur(12px);
  font: inherit;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.language-button:hover {
  border-color: rgb(244 217 154 / 72%);
  background: rgb(35 54 45 / 92%);
  transform: translateY(-1px);
}

.language-button.active {
  border-color: #f4d99a;
  color: #1c2b24;
  background: #e3bd73;
  box-shadow: 0 7px 18px rgb(0 0 0 / 18%);
}

.language-button:focus-visible {
  outline: 2px solid #f6d79a;
  outline-offset: 2px;
}

.join-fields .language-control {
  width: 100%;
  gap: 6px;
}

.join-fields .language-button {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  border-radius: 5px;
  border-color: rgb(239 218 173 / 30%);
  background: rgb(10 25 19 / 52%);
  font-size: 12px;
}

.join-fields .language-button.active {
  border-color: rgb(244 217 154 / 84%);
  color: #fff8e8;
  background: rgb(126 91 39 / 76%);
}

.meditation-duration-card,
.reader-level-chip,
.online-pill,
.place-pill,
.round-button {
  min-height: 42px;
  border: 1px solid rgb(255 255 255 / 25%);
  background: rgb(17 34 28 / 72%);
  color: var(--white);
  box-shadow: 0 8px 26px rgb(0 0 0 / 18%);
  backdrop-filter: blur(12px);
}

.meditation-duration-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 15px;
  border-radius: 999px;
}

.meditation-duration-card span {
  color: #dfcb9f;
  font-size: 12px;
  letter-spacing: 0.15em;
}

.meditation-duration-card strong {
  min-width: 34px;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.reader-level-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
}

.reader-level-chip span {
  color: #dfcb9f;
  font-size: 10px;
  letter-spacing: 0.1em;
}

.reader-level-chip strong {
  color: #f2d394;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.online-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 180ms ease;
}

.online-pill span:not(.online-dot) {
  color: #dfcb9f;
  font-size: 10px;
  letter-spacing: 0.1em;
}

.online-pill strong {
  min-width: 12px;
  color: #d9e5c7;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.online-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--player-color, #9db87d);
  box-shadow: 0 0 9px rgb(157 184 125 / 65%);
}

.online-pill.offline {
  border-color: rgb(203 131 104 / 38%);
}

.online-pill.offline .online-dot {
  background: #bc826a;
  box-shadow: none;
}

.place-pill {
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: 0.12em;
}

.round-button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
}

.round-button.muted {
  color: #9fae9f;
  text-decoration: line-through;
}

.rank-card {
  position: absolute;
  z-index: 5;
  top: 76px;
  left: max(22px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 13px;
  border-left: 2px solid rgb(230 191 112 / 65%);
  color: rgb(255 250 240 / 82%);
  background: linear-gradient(90deg, rgb(17 34 28 / 54%), transparent);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 8px rgb(0 0 0 / 45%);
  pointer-events: none;
}

.rank-divider {
  width: 1px;
  height: 11px;
  background: rgb(255 255 255 / 28%);
}

.quest-card {
  position: absolute;
  z-index: 7;
  top: 108px;
  left: max(22px, env(safe-area-inset-left));
  width: min(342px, calc(100vw - 44px));
  overflow: hidden;
  border: 1px solid rgb(236 205 137 / 32%);
  border-radius: 5px 5px 13px 5px;
  color: #f8eed8;
  background:
    linear-gradient(135deg, rgb(117 67 43 / 30%), transparent 48%),
    rgb(17 36 29 / 88%);
  box-shadow:
    0 16px 38px rgb(0 0 0 / 26%),
    inset 0 1px rgb(255 255 255 / 7%);
  backdrop-filter: blur(13px);
  pointer-events: auto;
}

.quest-card::after {
  position: absolute;
  right: -14px;
  bottom: -17px;
  width: 76px;
  height: 76px;
  border: 1px solid rgb(225 190 112 / 13%);
  border-radius: 50%;
  content: "";
  box-shadow:
    0 0 0 9px rgb(225 190 112 / 4%),
    0 0 0 18px rgb(225 190 112 / 3%);
  pointer-events: none;
}

.quest-toggle {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid rgb(235 206 144 / 19%);
  color: #e9cf98;
  background: rgb(13 28 23 / 52%);
  font-size: 12px;
  letter-spacing: 0.13em;
  text-align: left;
  cursor: pointer;
}

.quest-toggle strong {
  color: #fff5df;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.quest-body {
  position: relative;
  z-index: 1;
  padding: 13px 15px 15px;
}

.quest-card.is-collapsed .quest-body {
  display: none;
}

.quest-card.is-collapsed .quest-toggle {
  border-bottom: 0;
}

.quest-card .eyebrow {
  margin: 0 0 4px;
  color: #caa96b;
  font-size: 9px;
  letter-spacing: 0.23em;
}

.quest-card h2 {
  margin: 0;
  color: #fff7e7;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.14em;
}

.quest-card p:not(.eyebrow) {
  margin: 7px 0 11px;
  color: rgb(248 238 216 / 69%);
  font-size: 11px;
  line-height: 1.65;
}

.quest-track {
  height: 2px;
  overflow: hidden;
  background: rgb(255 255 255 / 10%);
}

#quest-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #9f5a3c, #e3c27e);
  box-shadow: 0 0 10px rgb(227 194 126 / 52%);
  transition: width 420ms ease;
}

.quest-guide {
  margin-top: 12px;
  padding: 7px 12px;
  border: 1px solid rgb(231 198 127 / 37%);
  border-radius: 3px;
  color: #f7e7c5;
  background: rgb(139 74 50 / 55%);
  font-size: 11px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.quest-guide:hover,
.quest-guide:focus-visible {
  border-color: rgb(240 211 147 / 72%);
  background: rgb(158 82 54 / 72%);
}

.quick-meditate {
  position: absolute;
  z-index: 6;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(28px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 7px 13px 7px 8px;
  border: 1px solid rgb(239 213 157 / 28%);
  border-radius: 999px;
  color: #fff6e3;
  background:
    linear-gradient(120deg, rgb(133 70 46 / 34%), transparent 65%),
    rgb(17 35 28 / 82%);
  box-shadow: 0 10px 30px rgb(0 0 0 / 24%);
  text-align: left;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.quick-meditate:hover,
.quick-meditate:focus-visible {
  border-color: rgb(239 205 132 / 62%);
  background:
    linear-gradient(120deg, rgb(149 78 51 / 48%), transparent 68%),
    rgb(25 47 38 / 90%);
  transform: translateY(-2px);
}

.quick-meditate-glyph {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgb(233 199 128 / 38%);
  border-radius: 50%;
  color: #efd397;
  background: rgb(80 51 32 / 42%);
  font-size: 16px;
}

.quick-meditate-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.quick-meditate-copy strong {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.quick-meditate-copy small {
  color: rgb(255 246 227 / 52%);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.street-mindful-hint {
  position: absolute;
  z-index: 5;
  bottom: max(28px, env(safe-area-inset-bottom));
  left: max(22px, env(safe-area-inset-left));
  display: flex;
  width: min(360px, calc(100vw - 44px));
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid rgb(237 213 164 / 19%);
  border-radius: 5px 5px 15px 5px;
  color: #f7ecd5;
  background:
    linear-gradient(105deg, rgb(102 65 43 / 22%), transparent 58%),
    rgb(16 33 27 / 74%);
  box-shadow: 0 10px 28px rgb(0 0 0 / 18%);
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.street-mindful-mark {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgb(229 195 124 / 36%);
  border-radius: 50%;
  color: #efd498;
  background: rgb(89 52 34 / 35%);
  font-size: 16px;
}

.street-mindful-copy {
  min-width: 0;
  flex: 1;
}

.street-mindful-copy > span {
  color: #c8a96c;
  font-size: 9px;
  letter-spacing: 0.2em;
}

.street-mindful-copy p {
  margin: 3px 0 0;
  overflow: hidden;
  color: rgb(255 247 231 / 76%);
  font-size: 11px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.street-mindful-hint.advance .street-mindful-copy p,
.street-mindful-hint.advance .street-mindful-mark {
  animation: mindful-advance 520ms ease both;
}

.street-mindful-hint button {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid rgb(228 196 131 / 28%);
  border-radius: 3px;
  color: #f3dfb6;
  background: rgb(128 70 46 / 36%);
  font-size: 10px;
  cursor: pointer;
}

.street-mindful-hint button:hover,
.street-mindful-hint button:focus-visible {
  border-color: rgb(238 207 145 / 60%);
  background: rgb(151 81 51 / 54%);
}

@keyframes mindful-advance {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.location-banner {
  position: absolute;
  z-index: 5;
  top: 22%;
  left: 50%;
  width: min(78vw, 480px);
  padding: 9px 20px;
  color: #fff8e9;
  font-size: clamp(19px, 3vw, 29px);
  letter-spacing: 0.3em;
  text-align: center;
  text-shadow: 0 4px 22px rgb(0 0 0 / 58%);
  transform: translate(-50%, -12px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 350ms ease,
    transform 500ms ease;
}

.location-banner.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.scene-transition {
  position: absolute;
  z-index: 90;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  color: #fff6df;
  background:
    radial-gradient(circle at 50% 50%, rgb(213 177 101 / 14%), transparent 22%),
    radial-gradient(circle at 50% 50%, rgb(11 25 19 / 84%), rgb(5 10 8 / 96%) 66%);
  text-align: center;
  opacity: 0;
  pointer-events: auto;
  transition: opacity 260ms ease;
  backdrop-filter: blur(8px);
}

.scene-transition.visible {
  opacity: 1;
}

.scene-transition::before,
.scene-transition::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(54vw, 520px);
  aspect-ratio: 1;
  border: 1px solid rgb(232 201 132 / 20%);
  border-radius: 50%;
  content: "";
  transform: translate(-50%, -50%);
}

.scene-transition::after {
  width: min(34vw, 330px);
  border-color: rgb(232 201 132 / 10%);
}

.scene-transition.visible::before {
  animation: scene-ink-ring 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.scene-transition.visible::after {
  animation: scene-ink-ring 1.2s 100ms cubic-bezier(0.2, 0.7, 0.2, 1) both reverse;
}

.scene-transition-seal {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 1px solid rgb(237 206 143 / 48%);
  border-radius: 50%;
  color: #f0d59a;
  background: rgb(111 56 38 / 48%);
  box-shadow:
    inset 0 0 0 6px rgb(255 255 255 / 4%),
    0 0 38px rgb(220 177 93 / 12%);
  font-size: 31px;
}

.scene-transition p {
  margin: 17px 0 0;
  font-size: clamp(24px, 3.5vw, 38px);
  letter-spacing: 0.2em;
  text-shadow: 0 5px 26px rgb(0 0 0 / 58%);
}

.scene-transition small {
  margin-top: 7px;
  color: rgb(249 237 212 / 52%);
  font-size: 11px;
  letter-spacing: 0.23em;
}

@keyframes scene-ink-ring {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.68) rotate(-16deg);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(8deg);
  }
}

.toast {
  position: absolute;
  z-index: 70;
  top: 17%;
  left: 50%;
  max-width: min(88vw, 520px);
  padding: 10px 18px;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 999px;
  color: var(--white);
  background: rgb(22 40 32 / 86%);
  box-shadow: 0 8px 28px rgb(0 0 0 / 22%);
  font-size: 14px;
  text-align: center;
  transform: translate(-50%, -8px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 220ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.ritual-fx {
  position: absolute;
  z-index: 12;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 350ms ease;
}

.ritual-fx.show {
  opacity: 1;
}

.ritual-fx.above-modal {
  z-index: 65;
}

.ritual-fx::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    radial-gradient(ellipse at 50% 74%, transparent 0 28%, rgb(4 10 8 / 30%) 66%, rgb(2 6 5 / 58%) 100%),
    radial-gradient(circle at 50% 49%, var(--ritual-glow, rgb(229 183 96 / 20%)), transparent 28%),
    linear-gradient(0deg, rgb(11 21 16 / 24%), transparent 42%);
  mix-blend-mode: screen;
  animation: ritual-breathe 2.4s ease-in-out infinite;
}

.ritual-aura {
  position: absolute;
  top: 47%;
  left: 50%;
  width: min(78vw, 760px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    conic-gradient(from 18deg, transparent 0 8deg, var(--ritual-ray, rgb(255 228 158 / 18%)) 9deg 10deg, transparent 11deg 34deg),
    radial-gradient(circle, var(--ritual-glow, rgb(229 183 96 / 23%)) 0 8%, transparent 54%);
  filter: blur(1px) saturate(1.18);
  transform: translate(-50%, -50%);
  opacity: 0;
}

.ritual-fx.show .ritual-aura {
  animation: ritual-aura 2.8s ease-in-out infinite;
}

.ritual-column {
  position: absolute;
  top: -8%;
  left: 50%;
  width: min(35vw, 330px);
  height: 91%;
  background: linear-gradient(
    90deg,
    transparent,
    var(--ritual-ray, rgb(255 232 173 / 3%)) 24%,
    var(--ritual-core, rgb(255 239 192 / 13%)) 50%,
    var(--ritual-ray, rgb(255 232 173 / 3%)) 76%,
    transparent
  );
  clip-path: polygon(44% 0, 56% 0, 100% 100%, 0 100%);
  filter: blur(9px);
  mix-blend-mode: screen;
  transform: translateX(-50%);
  opacity: 0;
}

.ritual-fx.show .ritual-column {
  animation: ritual-column 3.2s ease-in-out infinite;
}

.ritual-halo {
  position: absolute;
  top: 41%;
  left: 50%;
  width: min(33vw, 310px);
  aspect-ratio: 1;
  border: 1px solid var(--ritual-line, rgb(239 205 132 / 48%));
  border-radius: 50%;
  box-shadow:
    0 0 18px var(--ritual-glow, rgb(229 183 96 / 16%)),
    inset 0 0 28px var(--ritual-glow, rgb(229 183 96 / 12%));
  transform: translate(-50%, -50%);
  opacity: 0;
}

.ritual-halo::before,
.ritual-halo::after {
  position: absolute;
  border-radius: 50%;
  content: "";
}

.ritual-halo::before {
  inset: -9%;
  border: 1px dashed var(--ritual-line, rgb(239 205 132 / 32%));
  mask: conic-gradient(from 0deg, #000 0 11deg, transparent 11deg 28deg);
}

.ritual-halo::after {
  inset: 16%;
  border: 1px solid var(--ritual-line, rgb(239 205 132 / 25%));
  box-shadow: 0 0 26px var(--ritual-glow, rgb(229 183 96 / 14%));
}

.ritual-fx.show .ritual-halo {
  animation: ritual-halo 2.6s ease-in-out infinite;
}

.ritual-rings {
  position: absolute;
  top: 58%;
  left: 50%;
  width: min(62vw, 570px);
  aspect-ratio: 1;
  border: 1px solid var(--ritual-line, rgb(239 205 132 / 45%));
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 3deg,
    var(--ritual-line, rgb(239 205 132 / 32%)) 0deg 1deg,
    transparent 1deg 13deg
  );
  mask: radial-gradient(circle, transparent 0 61%, #000 62% 68%, transparent 69% 100%);
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 42px var(--ritual-glow, rgb(229 183 96 / 15%)),
    inset 0 0 46px var(--ritual-glow, rgb(229 183 96 / 10%));
  opacity: 0;
}

.ritual-fx.show .ritual-rings {
  animation: ritual-ring 2.1s cubic-bezier(0.18, 0.75, 0.25, 1) infinite;
}

.ritual-rings::before,
.ritual-rings::after {
  position: absolute;
  border: 1px solid var(--ritual-line, rgb(239 205 132 / 30%));
  border-radius: 50%;
  content: "";
}

.ritual-rings::before {
  inset: 13%;
}

.ritual-rings::after {
  inset: 28%;
}

.ritual-glyph {
  position: absolute;
  top: 43%;
  left: 50%;
  color: var(--ritual-text, #f1d294);
  font-family: "STKaiti", "KaiTi", "Noto Serif CJK SC", serif;
  font-size: clamp(78px, 13vw, 156px);
  line-height: 1;
  text-shadow:
    0 0 8px var(--ritual-core, rgb(255 242 205 / 70%)),
    0 0 30px var(--ritual-glow, rgb(229 183 96 / 38%)),
    0 0 72px var(--ritual-glow, rgb(229 183 96 / 20%)),
    0 10px 40px rgb(0 0 0 / 38%);
  transform: translate(-50%, -50%);
  opacity: 0;
}

.ritual-fx.show .ritual-glyph {
  animation: ritual-glyph 1.7s ease-out both;
}

.ritual-motes {
  position: absolute;
  inset: 0;
}

.ritual-motes span {
  position: absolute;
  top: var(--mote-y, 62%);
  left: var(--mote-x, 50%);
  width: var(--mote-size, 5px);
  height: var(--mote-size, 5px);
  border-radius: 50%;
  background: var(--ritual-text, #f1d294);
  box-shadow:
    0 0 9px var(--ritual-text, #f1d294),
    0 0 24px var(--ritual-line, #e4bf77);
  opacity: 0;
  animation: ritual-mote var(--mote-speed, 2.4s) ease-out var(--mote-delay, 0s) forwards;
}

.ritual-fx.incense {
  --ritual-glow: rgb(255 161 64 / 28%);
  --ritual-line: rgb(255 211 130 / 68%);
  --ritual-ray: rgb(255 173 72 / 22%);
  --ritual-core: rgb(255 236 188 / 63%);
  --ritual-text: #ffe1a1;
}

.ritual-fx.meditate {
  --ritual-glow: rgb(244 221 153 / 23%);
  --ritual-line: rgb(249 229 173 / 52%);
  --ritual-ray: rgb(255 239 190 / 9%);
  --ritual-core: rgb(255 247 218 / 37%);
  --ritual-text: #f8e8ad;
}

.ritual-fx.scripture {
  --ritual-glow: rgb(246 216 145 / 22%);
  --ritual-line: rgb(255 233 177 / 52%);
  --ritual-text: #fff0be;
}

.ritual-fx.incense .ritual-aura {
  background:
    conic-gradient(from 12deg, transparent 0 8deg, rgb(255 224 159 / 32%) 9deg 10deg, transparent 11deg 26deg),
    radial-gradient(circle, rgb(255 202 112 / 25%) 0 7%, transparent 57%);
}

.ritual-fx.incense .ritual-halo {
  border-width: 2px;
  box-shadow:
    0 0 24px rgb(255 194 92 / 34%),
    inset 0 0 32px rgb(255 194 92 / 20%);
}

.ritual-fx.incense .ritual-glyph {
  animation: incense-glyph 3.6s cubic-bezier(0.2, 0.7, 0.25, 1) both;
}

.ritual-fx.milestone {
  --ritual-glow: rgb(210 222 183 / 25%);
  --ritual-line: rgb(246 226 173 / 66%);
  --ritual-ray: rgb(236 225 185 / 15%);
  --ritual-core: rgb(255 247 216 / 60%);
  --ritual-text: #fff2c7;
}

.ritual-fx.milestone .ritual-column {
  width: min(46vw, 440px);
  filter: blur(5px);
}

.ritual-fx.milestone .ritual-halo {
  width: min(44vw, 420px);
  border-width: 2px;
  border-style: double;
  animation: milestone-halo 3.5s cubic-bezier(0.18, 0.72, 0.24, 1) both;
}

.ritual-fx.milestone .ritual-rings {
  top: 50%;
  width: min(72vw, 720px);
  animation-duration: 3.2s;
}

.ritual-fx.milestone .ritual-glyph {
  top: 43%;
  font-family: ui-serif, "Noto Serif", "Times New Roman", serif;
  font-size: clamp(88px, 18vw, 200px);
  font-weight: 300;
  letter-spacing: 0.04em;
  animation: milestone-glyph 3.8s cubic-bezier(0.16, 0.8, 0.24, 1) both;
}

.ritual-caption {
  --caption-accent: #e9ca88;
  position: absolute;
  z-index: 14;
  top: 68%;
  left: 50%;
  width: min(88vw, 620px);
  padding: 17px 28px 19px;
  overflow: hidden;
  border: 1px solid rgb(240 220 176 / 35%);
  border-radius: 14px;
  color: #fff8e7;
  background:
    linear-gradient(115deg, rgb(16 32 25 / 90%), rgb(24 37 29 / 86%)),
    radial-gradient(circle at 50% 0, rgb(237 205 138 / 18%), transparent 70%);
  box-shadow:
    0 20px 55px rgb(0 0 0 / 32%),
    0 0 42px color-mix(in srgb, var(--caption-accent) 12%, transparent);
  text-align: center;
  transform: translate(-50%, 12px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(15px);
  transition:
    opacity 420ms ease,
    transform 520ms cubic-bezier(0.2, 0.72, 0.28, 1);
}

.ritual-caption::before {
  position: absolute;
  inset: 6px;
  border: 1px solid rgb(240 220 176 / 10%);
  border-radius: 9px;
  content: "";
}

.ritual-caption.visible {
  transform: translate(-50%, 0) scale(1);
  opacity: 1;
}

.ritual-caption.speaking {
  border-color: color-mix(in srgb, var(--caption-accent) 72%, white 10%);
  box-shadow:
    0 20px 55px rgb(0 0 0 / 32%),
    0 0 32px color-mix(in srgb, var(--caption-accent) 24%, transparent);
}

.ritual-caption > span,
.ritual-caption > p {
  position: relative;
  z-index: 1;
}

.ritual-caption > span {
  display: block;
  color: var(--caption-accent);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.ritual-caption > p {
  margin: 8px 0 0;
  font-size: clamp(13px, 1.6vw, 17px);
  line-height: 1.8;
  text-wrap: balance;
}

.ritual-caption[data-kind="incense"] {
  --caption-accent: #f2c878;
  border-color: rgb(245 195 111 / 44%);
  background:
    linear-gradient(115deg, rgb(41 30 20 / 91%), rgb(42 38 26 / 87%)),
    radial-gradient(circle at 50% 0, rgb(249 181 82 / 22%), transparent 72%);
}

.ritual-caption[data-kind="meditate"] {
  --caption-accent: #e9d9a7;
}

.ritual-caption[data-kind="milestone"] {
  --caption-accent: #f4e2af;
  border-color: rgb(236 222 177 / 48%);
  background:
    linear-gradient(115deg, rgb(23 34 29 / 91%), rgb(36 42 32 / 88%)),
    radial-gradient(circle at 50% 0, rgb(235 220 169 / 24%), transparent 72%);
}

@keyframes ritual-aura {
  0%,
  100% {
    opacity: 0.34;
    transform: translate(-50%, -50%) scale(0.9) rotate(-3deg);
  }
  48% {
    opacity: 0.82;
    transform: translate(-50%, -50%) scale(1.05) rotate(4deg);
  }
}

@keyframes ritual-column {
  0%,
  100% {
    opacity: 0.26;
    transform: translateX(-50%) scaleX(0.82);
  }
  50% {
    opacity: 0.76;
    transform: translateX(-50%) scaleX(1.08);
  }
}

@keyframes ritual-halo {
  0%,
  100% {
    opacity: 0.28;
    transform: translate(-50%, -50%) scale(0.92) rotate(-2deg);
  }
  50% {
    opacity: 0.78;
    transform: translate(-50%, -50%) scale(1.06) rotate(2deg);
  }
}

@keyframes ritual-breathe {
  0%,
  100% {
    opacity: 0.65;
  }
  50% {
    opacity: 1;
  }
}

@keyframes ritual-ring {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.52) rotate(-8deg);
  }
  25% {
    opacity: 0.68;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.2) rotate(16deg);
  }
}

@keyframes ritual-glyph {
  0% {
    opacity: 0;
    filter: blur(12px);
    transform: translate(-50%, -38%) scale(0.72);
  }
  35% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    filter: blur(1px);
    transform: translate(-50%, -62%) scale(1.08);
  }
}

@keyframes ritual-mote {
  0% {
    opacity: 0;
    transform: translate(0, 18px) scale(0.6);
  }
  24% {
    opacity: 0.86;
  }
  100% {
    opacity: 0;
    transform: translate(var(--mote-drift, 10px), -90px) scale(1.25);
  }
}

@keyframes incense-glyph {
  0% {
    opacity: 0;
    filter: blur(16px);
    transform: translate(-50%, -32%) scale(0.68);
  }
  28% {
    opacity: 0.98;
    filter: blur(0);
  }
  76% {
    opacity: 0.88;
    transform: translate(-50%, -52%) scale(1.04);
  }
  100% {
    opacity: 0;
    filter: blur(3px);
    transform: translate(-50%, -65%) scale(1.12);
  }
}

@keyframes milestone-halo {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.58) rotate(-16deg);
  }
  34% {
    opacity: 0.92;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.28) rotate(12deg);
  }
}

@keyframes milestone-glyph {
  0% {
    opacity: 0;
    filter: blur(14px);
    transform: translate(-50%, -42%) scale(0.72);
  }
  28% {
    opacity: 0.98;
    filter: blur(0);
    transform: translate(-50%, -50%) scale(1.04);
  }
  68% {
    opacity: 0.86;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    filter: blur(5px);
    transform: translate(-50%, -58%) scale(1.16);
  }
}

.interaction-prompt {
  position: absolute;
  z-index: 6;
  bottom: 128px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 9px;
  color: var(--white);
  background: rgb(20 34 29 / 78%);
  box-shadow: 0 10px 30px rgb(0 0 0 / 24%);
  font-size: 14px;
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.interaction-prompt:hover,
.interaction-prompt:focus-visible {
  border-color: rgb(235 198 123 / 65%);
  background: rgb(35 54 45 / 92%);
  transform: translateX(-50%) translateY(-2px);
}

.interaction-prompt .interaction-arrow {
  color: #e8c579;
  font-size: 22px;
  line-height: 1;
}

kbd {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  place-items: center;
  border: 1px solid rgb(24 35 31 / 22%);
  border-bottom-width: 2px;
  border-radius: 5px;
  color: var(--ink);
  background: #f8f1df;
  font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.interaction-prompt kbd {
  color: #f7eed9;
  border-color: rgb(255 255 255 / 30%);
  background: rgb(255 255 255 / 10%);
}

.temple-actions {
  position: absolute;
  z-index: 6;
  bottom: max(28px, env(safe-area-inset-bottom));
  left: 50%;
  display: flex;
  gap: 9px;
  transform: translateX(-50%);
}

.action-button {
  display: flex;
  min-width: 146px;
  align-items: center;
  gap: 10px;
  padding: 9px 13px 9px 9px;
  border: 1px solid rgb(255 250 235 / 20%);
  border-radius: 12px;
  color: var(--white);
  background: rgb(24 39 33 / 82%);
  box-shadow: 0 10px 28px rgb(0 0 0 / 22%);
  text-align: left;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.action-button:hover {
  border-color: rgb(230 191 112 / 58%);
  background: rgb(35 55 46 / 90%);
  transform: translateY(-2px);
}

.action-button.near {
  border-color: rgb(237 199 121 / 72%);
  box-shadow:
    0 10px 28px rgb(0 0 0 / 22%),
    0 0 22px rgb(225 181 91 / 12%);
}

.action-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.action-glyph {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid rgb(229 187 108 / 45%);
  border-radius: 50%;
  color: #f2d9a6;
  background: rgb(140 61 42 / 34%);
  font-size: 19px;
}

.action-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.action-copy strong {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.action-copy small {
  color: rgb(255 250 240 / 58%);
  font-size: 10px;
  white-space: nowrap;
}

.meditation-panel {
  position: absolute;
  z-index: 9;
  bottom: max(28px, env(safe-area-inset-bottom));
  left: 50%;
  width: min(90vw, 570px);
  padding: 15px 18px;
  border: 1px solid rgb(246 224 182 / 24%);
  border-radius: 16px;
  color: var(--white);
  background: rgb(16 31 25 / 88%);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  backdrop-filter: blur(14px);
}

.meditation-panel.recording-area-mode {
  z-index: 76;
}

.meditation-panel.woodfish-strike {
  animation: woodfish-panel 680ms ease-out;
}

.meditation-panel.woodfish-strike .breathing-dot {
  animation:
    breathe 4s ease-in-out infinite,
    woodfish-dot 680ms ease-out;
}

@keyframes woodfish-panel {
  0% {
    border-color: rgb(246 224 182 / 24%);
    box-shadow: var(--shadow);
  }
  12% {
    border-color: rgb(247 210 129 / 72%);
    box-shadow:
      var(--shadow),
      0 0 34px rgb(230 188 98 / 18%);
    transform: translateX(-50%) scale(1.006);
  }
  100% {
    border-color: rgb(246 224 182 / 24%);
    box-shadow: var(--shadow);
    transform: translateX(-50%) scale(1);
  }
}

@keyframes woodfish-dot {
  0% {
    background: #f4dc9c;
    box-shadow:
      0 0 0 0 rgb(231 199 126 / 58%),
      0 0 22px rgb(238 203 121 / 76%);
    transform: scale(1.5);
  }
  100% {
    background: #e7c77e;
    box-shadow: 0 0 0 0 rgb(231 199 126 / 0%);
    transform: scale(1);
  }
}

.meditation-center-clock {
  position: absolute;
  z-index: 10;
  top: 47%;
  left: 50%;
  display: grid;
  min-width: min(76vw, 430px);
  place-items: center;
  padding: 20px 34px 22px;
  border: 1px solid rgb(238 213 158 / 16%);
  border-radius: 50%;
  color: #fff5de;
  background:
    radial-gradient(circle, rgb(19 37 29 / 52%), rgb(14 28 22 / 18%) 56%, transparent 72%);
  text-align: center;
  text-shadow: 0 3px 22px rgb(0 0 0 / 66%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: meditation-clock-in 520ms ease both;
}

.meditation-clock-resize {
  position: absolute;
  z-index: 2;
  right: 8px;
  bottom: 8px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: nwse-resize;
  touch-action: none;
}

.meditation-clock-resize::before,
.meditation-clock-resize::after {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 12px;
  height: 2px;
  border-radius: 2px;
  background: rgb(245 221 163 / 74%);
  content: "";
  transform: rotate(-45deg);
}

.meditation-clock-resize::after {
  right: 6px;
  bottom: 9px;
  width: 7px;
  opacity: 0.72;
}

.meditation-center-clock::before {
  position: absolute;
  inset: 10%;
  border: 1px solid rgb(232 203 137 / 12%);
  border-radius: 50%;
  box-shadow:
    0 0 0 12px rgb(232 203 137 / 3%),
    0 0 35px rgb(221 183 101 / 7%);
  content: "";
}

.meditation-remaining {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 9px;
  margin-bottom: 3px;
}

.meditation-remaining strong {
  color: #f5dda3;
  font: 400 clamp(78px, 13vw, 156px) / 0.9 "STKaiti", "KaiTi", serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
}

.meditation-remaining span {
  color: rgb(245 221 163 / 66%);
  font-size: clamp(13px, 1.5vw, 18px);
  letter-spacing: 0.2em;
}

.meditation-now {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: rgb(255 247 230 / 64%);
  font-size: clamp(10px, 1.2vw, 13px);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

.meditation-now time {
  color: #fff4da;
  font-size: 1.12em;
}

.meditation-now i {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: rgb(235 207 145 / 45%);
}

@keyframes meditation-clock-in {
  from {
    opacity: 0;
    transform: translate(-50%, -46%) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.meditation-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 11px;
}

.meditation-heading strong {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.meditation-heading span:last-child {
  margin-left: auto;
  color: #e7cea1;
  font-size: 13px;
}

#meditation-time {
  color: rgb(255 250 240 / 56%);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.breathing-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e7c77e;
  box-shadow: 0 0 0 0 rgb(231 199 126 / 50%);
  animation: breathe 4s ease-in-out infinite;
}

.meditation-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(255 255 255 / 12%);
}

.meditation-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a9763d, #ebcd8b);
  box-shadow: 0 0 14px rgb(235 205 139 / 45%);
  transition: width 250ms linear;
}

.meditation-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
  color: rgb(255 250 240 / 60%);
  font-size: 11px;
}

.meditation-footer button {
  padding: 5px 10px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 999px;
  color: var(--white);
  background: transparent;
  cursor: pointer;
}

.meditation-capture-tools {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgb(255 255 255 / 9%);
}

.capture-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.capture-copy span {
  color: #ead4a6;
  font-size: 10px;
  letter-spacing: 0.13em;
}

.capture-copy small {
  overflow: hidden;
  color: rgb(255 250 240 / 43%);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meditation-capture-tools button,
.camera-secure-link {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid rgb(232 204 146 / 23%);
  border-radius: 4px;
  color: rgb(255 247 231 / 76%);
  background: rgb(255 255 255 / 4%);
  font-size: 9px;
  cursor: pointer;
}

.camera-secure-link {
  color: #fff0ce;
  background: rgb(140 75 48 / 54%);
  text-decoration: none;
}

.meditation-capture-tools button:disabled {
  opacity: 0.35;
  cursor: default;
}

.meditation-capture-tools button.is-active {
  border-color: rgb(231 191 112 / 62%);
  color: #fff3d9;
  background: rgb(144 75 48 / 54%);
}

.meditation-capture-tools #camera-toggle:not(:disabled) {
  border-color: rgb(234 199 128 / 55%);
  color: #fff0cf;
  background: rgb(137 73 47 / 52%);
}

.meditation-capture-tools button.is-recording {
  border-color: rgb(220 112 88 / 66%);
  background: rgb(143 51 39 / 64%);
}

.meditation-scripture-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 0.72fr);
  gap: 7px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid rgb(255 255 255 / 9%);
}

.meditation-scripture-controls label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.meditation-scripture-controls label > span {
  color: rgb(255 246 225 / 46%);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.meditation-scripture-controls select {
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid rgb(235 205 145 / 22%);
  border-radius: 4px;
  color: #f7ecd5;
  background: rgb(10 24 18 / 72%);
  font: inherit;
  font-size: 9px;
}

.meditation-scripture-controls button {
  align-self: end;
  padding: 6px 10px;
  border: 1px solid rgb(235 204 143 / 30%);
  border-radius: 4px;
  color: #fff2d7;
  background: rgb(138 75 48 / 55%);
  font-size: 9px;
  cursor: pointer;
}

.meditation-scripture-controls button:disabled {
  opacity: 0.38;
  cursor: default;
}

html.is-meditating .hud,
html.is-meditating .rank-card,
html.is-meditating #quest-card {
  display: none !important;
}
html.recording-clean-mode #game-shell > :not(canvas):not(.paper-grain):not(#meditation-panel):not(#meditation-capture-bar):not(#meditation-scripture-window):not(#meditation-center-clock):not(#camera-preview):not(#ritual-fx):not(#ritual-caption) {
  display: none !important;
}

html.recording-clean-mode #meditation-panel .meditation-footer,
html.recording-clean-mode #meditation-panel .meditation-scripture-controls,
html.recording-clean-mode #meditation-scripture-window > button,
html.recording-clean-mode #meditation-scripture-window .meditation-scripture-resize,
html.recording-clean-mode .meditation-clock-resize,
html.recording-clean-mode .paper-grain {
  display: none !important;
}
.meditation-scripture-window {
  position: absolute;
  z-index: 54;
  top: 72px;
  left: max(14px, env(safe-area-inset-left));
  width: 360px;
  padding: 8px;
  border: 1px solid rgb(238 209 148 / 48%);
  border-radius: 9px;
  color: #fff3db;
  background: rgb(10 24 18 / 92%);
  box-shadow: 0 18px 44px rgb(0 0 0 / 34%);
  cursor: grab;
  touch-action: none;
  backdrop-filter: blur(10px);
}

.meditation-scripture-window:active {
  cursor: grabbing;
}

.meditation-scripture-window.is-playing {
  touch-action: auto;
}

.meditation-scripture-window > button {
  position: absolute;
  z-index: 2;
  top: 5px;
  right: 5px;
  display: grid;
  width: 22px;
  height: 22px;
  padding: 0;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 50%;
  color: #fff4dd;
  background: rgb(14 27 21 / 76%);
  cursor: pointer;
}

.meditation-scripture-thumbnail {
  position: relative;
  display: grid;
  aspect-ratio: 16 / 9;
  place-items: center;
  overflow: hidden;
  border-radius: 5px;
  background:
    radial-gradient(circle at 50% 50%, rgb(195 158 86 / 24%), transparent 45%),
    #16251e;
  background-position: center;
  background-size: cover;
}

.meditation-scripture-preview-play {
  padding: 8px 12px;
  border: 1px solid rgb(255 255 255 / 60%);
  border-radius: 20px;
  color: #fff;
  background: rgb(7 13 10 / 76%);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.meditation-scripture-window.is-playing .meditation-scripture-preview-play {
  display: none;
}

.meditation-scripture-copy {
  display: flex;
  padding: 7px 3px 5px;
  flex-direction: column;
  gap: 2px;
}

.meditation-scripture-copy span {
  color: #c7a86c;
  font-size: 8px;
  letter-spacing: 0.15em;
}

.meditation-scripture-copy strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meditation-scripture-copy small {
  color: rgb(247 235 212 / 46%);
  font-size: 8px;
}

.meditation-scripture-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
}

.meditation-scripture-actions[hidden] {
  display: none;
}

.meditation-scripture-actions button,
.meditation-scripture-actions a {
  padding: 3px 6px;
  border: 1px solid rgb(238 209 148 / 35%);
  border-radius: 4px;
  color: #f3d99f;
  background: rgb(255 255 255 / 5%);
  font: inherit;
  font-size: 9px;
  text-decoration: none;
  cursor: pointer;
}

.meditation-video-frame {
  height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.meditation-video-frame iframe {
  width: 1px;
  height: 1px;
}

.meditation-scripture-window.is-playing .meditation-scripture-thumbnail {
  display: none;
}

.meditation-scripture-window.is-playing .meditation-video-frame {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 5px;
  opacity: 1;
  pointer-events: auto;
}

.meditation-scripture-window.is-playing .meditation-video-frame > div,
.meditation-scripture-window.is-playing .meditation-video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.meditation-video-audio-controls {
  display: none;
}

.meditation-scripture-window.is-playing .meditation-video-audio-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 2px 1px;
  color: #fff3db;
  font-size: 11px;
}

.meditation-video-audio-controls button {
  padding: 4px 8px;
  border: 1px solid rgb(238 209 148 / 35%);
  border-radius: 4px;
  color: #f3d99f;
  background: rgb(255 255 255 / 5%);
  font: inherit;
  cursor: pointer;
}

.meditation-video-audio-controls input {
  width: 100%;
  min-width: 0;
  accent-color: #d9b66e;
  cursor: pointer;
}
.meditation-scripture-window.is-playing .meditation-scripture-resize {
  right: -7px;
  bottom: -7px;
}

.meditation-scripture-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 24px;
  height: 24px;
  cursor: nwse-resize;
}

.meditation-scripture-resize::before,
.meditation-scripture-resize::after {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 11px;
  height: 1px;
  background: rgb(245 220 164 / 72%);
  content: "";
  transform: rotate(-45deg);
}

.meditation-scripture-resize::after {
  right: 7px;
  bottom: 8px;
  width: 6px;
}

.camera-preview {
  position: absolute;
  z-index: 55;
  width: 240px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgb(243 211 148 / 52%);
  border-radius: 10px;
  background: #080d0b;
  box-shadow:
    0 20px 50px rgb(0 0 0 / 42%),
    0 0 0 3px rgb(255 255 255 / 4%);
  cursor: grab;
  touch-action: none;
}

.camera-preview:active {
  cursor: grabbing;
}

.camera-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.camera-preview-bar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 7px;
  color: rgb(255 248 233 / 72%);
  background: linear-gradient(rgb(6 12 9 / 70%), transparent);
  font-size: 8px;
  letter-spacing: 0.08em;
  opacity: 0;
  transition: opacity 160ms ease;
}

.camera-preview:hover .camera-preview-bar,
.camera-preview:focus-within .camera-preview-bar {
  opacity: 1;
}

.camera-preview-bar button {
  display: grid;
  width: 20px;
  height: 20px;
  padding: 0;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: 50%;
  color: #fff5e2;
  background: rgb(20 25 22 / 58%);
  cursor: pointer;
}

.camera-resize-handle {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
  opacity: 0;
  transition: opacity 160ms ease;
}

.camera-resize-handle::before,
.camera-resize-handle::after {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 10px;
  height: 1px;
  background: rgb(255 244 218 / 72%);
  content: "";
  transform: rotate(-45deg);
}

.camera-resize-handle::after {
  right: 5px;
  bottom: 7px;
  width: 6px;
}

.camera-preview:hover .camera-resize-handle,
.camera-preview:focus-within .camera-resize-handle {
  opacity: 1;
}

.camera-preview.is-recording {
  border-color: transparent;
  border-radius: 5px;
  box-shadow: none;
}

.camera-preview.is-recording .camera-preview-bar,
.camera-preview.is-recording .camera-resize-handle {
  display: none;
}

.recording-area {
  position: absolute;
  z-index: 72;
  border: 2px solid #e7c476;
  border-radius: 7px;
  box-shadow:
    0 0 0 100vmax rgb(4 9 7 / 56%),
    0 0 30px rgb(231 196 118 / 24%);
  cursor: grab;
  touch-action: none;
}

.recording-area:active {
  cursor: grabbing;
}

.recording-area-bar {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 5px;
  color: #fff2d4;
  background: rgb(12 25 19 / 78%);
  font-size: 9px;
  letter-spacing: 0.08em;
  backdrop-filter: blur(8px);
}

.recording-area-bar button {
  padding: 4px 7px;
  border: 1px solid rgb(235 202 132 / 30%);
  border-radius: 3px;
  color: #f7e6c3;
  background: rgb(139 76 48 / 48%);
  font: inherit;
  font-size: 8px;
  cursor: pointer;
}

.recording-area-size {
  position: absolute;
  right: 10px;
  bottom: 9px;
  padding: 4px 7px;
  border-radius: 3px;
  color: rgb(255 245 226 / 72%);
  background: rgb(10 21 16 / 66%);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.recording-area-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  min-width: 230px;
  flex-direction: column;
  gap: 6px;
  padding: 13px 18px;
  border: 1px dashed rgb(240 210 146 / 58%);
  border-radius: 8px;
  color: #fff3d5;
  background: rgb(8 18 13 / 74%);
  text-align: center;
  text-shadow: 0 2px 12px rgb(0 0 0 / 60%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.recording-area-hint strong {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.recording-area-hint span {
  color: rgb(255 245 224 / 62%);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.recording-area-resize {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 25px;
  height: 25px;
  cursor: nwse-resize;
}

.recording-area-resize::before,
.recording-area-resize::after {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 13px;
  height: 2px;
  border-radius: 2px;
  background: #f0d293;
  content: "";
  transform: rotate(-45deg);
}

.recording-area-resize::after {
  right: 7px;
  bottom: 9px;
  width: 7px;
}

.recording-result {
  position: absolute;
  z-index: 68;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background: rgb(4 10 7 / 84%);
  backdrop-filter: blur(12px);
}

.recording-result-card {
  position: relative;
  width: min(92vw, 760px);
  max-height: 90dvh;
  padding: 28px;
  overflow: auto;
  border: 1px solid rgb(238 207 143 / 30%);
  border-radius: 12px;
  color: #f8efdb;
  background: rgb(19 34 27 / 97%);
  box-shadow: 0 35px 100px rgb(0 0 0 / 60%);
}

.recording-result-card h2 {
  margin: 5px 0 16px;
  font-size: 25px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.recording-result-card video {
  display: block;
  width: 100%;
  max-height: 58dvh;
  border-radius: 6px;
  background: #000;
}

.recording-result-card > p:not(.eyebrow) {
  color: rgb(246 235 215 / 52%);
  font-size: 10px;
  line-height: 1.6;
}

.recording-result-actions {
  display: flex;
  gap: 9px;
}

.recording-result-actions a,
.recording-result-actions button {
  padding: 9px 16px;
  border: 1px solid rgb(235 203 139 / 30%);
  border-radius: 4px;
  color: #fff4df;
  background: rgb(140 74 48 / 62%);
  font: inherit;
  font-size: 11px;
  text-decoration: none;
  cursor: pointer;
}

.recording-result-actions button {
  background: transparent;
}

@keyframes breathe {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgb(231 199 126 / 35%);
    opacity: 0.65;
  }
  50% {
    box-shadow: 0 0 0 9px rgb(231 199 126 / 0%);
    opacity: 1;
  }
}

.mobile-controls {
  position: absolute;
  z-index: 7;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  left: max(18px, env(safe-area-inset-left));
  display: none;
  align-items: flex-end;
  justify-content: space-between;
  pointer-events: none;
}

.dpad {
  display: grid;
  width: 154px;
  height: 154px;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  pointer-events: auto;
}

.dpad-button,
.dpad-center {
  display: grid;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 18%);
  color: rgb(255 250 240 / 82%);
  background: rgb(20 38 31 / 44%);
  backdrop-filter: blur(6px);
}

.dpad-button {
  width: 50px;
  height: 50px;
  border-radius: 13px;
  font-size: 18px;
  touch-action: none;
}

.dpad-button:active {
  background: rgb(229 199 139 / 30%);
  transform: scale(0.95);
}

.dpad-button.up {
  grid-area: 1 / 2;
}

.dpad-button.left {
  grid-area: 2 / 1;
}

.dpad-button.down {
  grid-area: 3 / 2;
}

.dpad-button.right {
  grid-area: 2 / 3;
}

.dpad-center {
  width: 30px;
  height: 30px;
  align-self: center;
  justify-self: center;
  grid-area: 2 / 2;
  border-radius: 50%;
  opacity: 0.48;
}

.mobile-action {
  display: flex;
  width: 72px;
  height: 72px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(238 204 137 / 58%);
  border-radius: 50%;
  color: var(--white);
  background: rgb(116 58 41 / 66%);
  box-shadow: 0 8px 25px rgb(0 0 0 / 25%);
  pointer-events: auto;
  backdrop-filter: blur(8px);
  touch-action: manipulation;
}

.mobile-action span {
  font: 600 22px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.mobile-action small {
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: 0.12em;
}

.help-toggle {
  position: absolute;
  z-index: 6;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(118px, calc(env(safe-area-inset-bottom) + 118px));
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 50%;
  color: rgb(255 250 240 / 72%);
  background: rgb(15 30 24 / 46%);
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.paper-panel {
  color: var(--ink);
  background:
    linear-gradient(rgb(239 231 211 / 96%), rgb(225 213 185 / 97%)),
    repeating-linear-gradient(0deg, transparent 0 28px, rgb(60 45 25 / 4%) 28px 29px);
  box-shadow: var(--shadow);
}

.help-panel {
  position: absolute;
  z-index: 20;
  top: 50%;
  left: 50%;
  width: min(88vw, 590px);
  max-height: 82vh;
  padding: 30px;
  overflow: auto;
  border: 1px solid rgb(72 55 33 / 22%);
  border-radius: 18px;
  transform: translate(-50%, -50%);
}

.help-panel h2 {
  margin: 3px 0 22px;
  font-size: clamp(25px, 3vw, 35px);
  font-weight: 500;
  letter-spacing: 0.08em;
}

.eyebrow {
  margin: 0;
  color: #7b5434;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.panel-close,
.video-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgb(28 38 32 / 16%);
  border-radius: 50%;
  color: inherit;
  background: rgb(255 255 255 / 24%);
  font-size: 23px;
  cursor: pointer;
}

.help-grid {
  display: grid;
  gap: 13px;
}

.help-grid > div {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgb(60 45 25 / 10%);
}

.help-grid > div span {
  margin-left: auto;
  color: #526056;
  font-size: 13px;
}

.paper-note {
  padding: 14px;
  border-left: 3px solid var(--cinnabar);
  color: #50594f;
  background: rgb(255 255 255 / 26%);
  font-size: 13px;
  line-height: 1.7;
}

.paper-button {
  padding: 9px 13px;
  border: 1px solid rgb(92 57 42 / 24%);
  border-radius: 8px;
  color: #7b4337;
  background: rgb(255 255 255 / 20%);
  font-size: 12px;
  cursor: pointer;
}

.start-screen {
  position: absolute;
  z-index: 30;
  inset: 0;
  display: grid;
  overflow: hidden;
  place-items: center;
  color: var(--white);
  background:
    linear-gradient(90deg, rgb(8 20 16 / 88%), rgb(12 25 20 / 48%) 58%, rgb(9 20 16 / 82%)),
    url("./street-title.png") center 42% / cover;
  transition: opacity 550ms ease;
}

.start-screen::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at 25% 70%, rgb(210 167 87 / 20%), transparent 28%),
    linear-gradient(0deg, rgb(8 18 14 / 72%), transparent 42%);
  pointer-events: none;
}

.start-screen.leaving {
  opacity: 0;
  pointer-events: none;
}

.start-screen.is-loading .start-card {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.start-card {
  transition: opacity 220ms ease, transform 220ms ease;
}

.start-loading {
  position: absolute;
  z-index: 3;
  display: grid;
  justify-items: center;
  gap: 12px;
  color: #fff7e8;
  text-align: center;
  animation: entry-loading-appear 300ms ease both;
}

.start-loading[hidden] {
  display: none;
}

.start-loading strong {
  font-size: clamp(18px, 4vw, 24px);
  font-weight: 400;
  letter-spacing: 0.16em;
}

.start-loading-caption {
  color: rgb(255 247 232 / 68%);
  font-size: 13px;
  letter-spacing: 0.12em;
}

.start-loading-orbit {
  position: relative;
  width: 56px;
  height: 56px;
  border: 2px solid rgb(239 218 173 / 24%);
  border-top-color: #efd8aa;
  border-right-color: #efd8aa;
  border-radius: 50%;
  animation: entry-loading-spin 1.15s linear infinite;
}

.start-loading-orbit i {
  position: absolute;
  inset: 9px;
  border: 1px solid rgb(239 218 173 / 55%);
  border-bottom-color: transparent;
  border-radius: 50%;
  animation: entry-loading-spin 1.8s linear infinite reverse;
}

@keyframes entry-loading-spin {
  to { transform: rotate(360deg); }
}

@keyframes entry-loading-appear {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .start-loading,
  .start-loading-orbit,
  .start-loading-orbit i {
    animation-duration: 3s;
  }
}

.start-card {
  position: relative;
  z-index: 2;
  width: min(88vw, 720px);
  padding: 46px clamp(24px, 6vw, 74px);
  text-align: center;
}

.ensō {
  display: grid;
  width: 100px;
  height: 100px;
  margin: 0 auto 22px;
  place-items: center;
  border: 4px solid rgb(239 218 173 / 65%);
  border-right-color: transparent;
  border-radius: 50%;
  transform: rotate(-18deg);
  box-shadow:
    inset 0 0 28px rgb(236 207 146 / 8%),
    0 0 40px rgb(233 202 134 / 8%);
}

.ensō span {
  color: #f1d9aa;
  font-size: 35px;
  transform: rotate(18deg);
}

.start-card .eyebrow {
  color: #ddc28a;
}

.start-card h1 {
  margin: 13px 0 12px;
  font-size: clamp(54px, 10vw, 102px);
  font-weight: 400;
  letter-spacing: 0.11em;
  line-height: 1;
  text-shadow: 0 8px 40px rgb(0 0 0 / 36%);
}

.start-card h1 span {
  display: block;
  margin-top: 8px;
  color: #d8bd84;
  font-size: 0.31em;
  letter-spacing: 0.62em;
  transform: translateX(0.28em);
}

.start-intro {
  max-width: 530px;
  margin: 0 auto;
  color: rgb(255 250 240 / 76%);
  font-size: clamp(14px, 1.7vw, 17px);
  line-height: 1.9;
}

.join-fields {
  display: grid;
  max-width: 520px;
  margin: 20px auto 0;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  text-align: left;
}

.network-warning {
  display: flex;
  max-width: 520px;
  margin: 14px auto 0;
  padding: 10px 13px;
  flex-direction: column;
  gap: 3px;
  border: 1px solid rgb(237 176 125 / 45%);
  border-radius: 7px;
  color: #ffe4c3;
  background: rgb(106 48 35 / 54%);
  text-align: left;
}

.network-warning strong {
  font-size: 12px;
  font-weight: 500;
}

.network-warning span {
  color: rgb(255 239 218 / 72%);
  font-size: 10px;
  line-height: 1.5;
}

.network-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 5px;
}

.network-actions a {
  padding: 6px 9px;
  border: 1px solid rgb(255 222 173 / 32%);
  border-radius: 5px;
  color: #fff1d7;
  background: rgb(85 39 29 / 38%);
  font-size: 10px;
  text-decoration: none;
}

.network-actions a:hover {
  border-color: rgb(255 222 173 / 65%);
  background: rgb(117 53 38 / 58%);
}

.join-fields label,
.join-fields .join-language-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.join-fields label > span,
.join-fields .join-language-field > span {
  padding-left: 2px;
  color: rgb(255 247 232 / 62%);
  font-size: 10px;
  letter-spacing: 0.13em;
}

.join-fields input,
.join-fields select {
  width: 100%;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid rgb(239 218 173 / 30%);
  border-radius: 5px;
  outline: 0;
  color: #fff8e8;
  background: rgb(10 25 19 / 52%);
  font: 13px "STKaiti", "KaiTi", "Songti SC", serif;
  backdrop-filter: blur(8px);
}

.join-fields select {
  appearance: none;
  padding-right: 28px;
  background-image:
    linear-gradient(45deg, transparent 50%, #e2ca98 50%),
    linear-gradient(135deg, #e2ca98 50%, transparent 50%);
  background-position:
    calc(100% - 15px) 50%,
    calc(100% - 10px) 50%;
  background-repeat: no-repeat;
  background-size: 5px 5px;
  cursor: pointer;
}

.join-fields select option,
.join-fields select optgroup {
  color: #f5ead5;
  background: #1d3028;
}

.join-fields input::placeholder {
  color: rgb(255 247 232 / 32%);
}

.join-fields input:focus,
.join-fields select:focus {
  border-color: rgb(236 208 151 / 70%);
  box-shadow: 0 0 0 3px rgb(236 208 151 / 8%);
}

#player-name {
  background-color: rgb(10 25 19 / 52%);
  color-scheme: dark;
}

#player-name:-webkit-autofill,
#player-name:-webkit-autofill:hover,
#player-name:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff8e8;
  -webkit-box-shadow: 0 0 0 1000px #14251d inset;
  caret-color: #fff8e8;
}

.city-temples {
  margin: 8px auto 0;
  color: rgb(239 215 167 / 72%);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-align: center;
}

.start-button {
  display: inline-flex;
  min-width: 220px;
  margin-top: 28px;
  padding: 11px 30px 12px;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 1px solid rgb(239 218 173 / 64%);
  border-radius: 3px;
  color: #fff7e8;
  background: rgb(147 61 43 / 76%);
  box-shadow:
    inset 0 0 0 4px rgb(255 255 255 / 5%),
    0 12px 35px rgb(0 0 0 / 22%);
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease;
}

.start-button:hover {
  background: rgb(165 73 52 / 90%);
  transform: translateY(-2px);
}

.start-button span {
  font-size: 17px;
  letter-spacing: 0.24em;
  transform: translateX(0.12em);
}

.start-button small {
  color: rgb(255 247 232 / 55%);
  font-size: 10px;
  letter-spacing: 0.07em;
}

.save-note {
  margin-top: 13px;
  color: rgb(255 250 240 / 46%);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.account-panel {
  width: min(420px, 100%);
  margin: 22px auto 0;
  padding-top: 14px;
  border-top: 1px solid rgb(255 247 232 / 18%);
  color: rgb(255 247 232 / 82%);
  text-align: left;
}

.account-panel-heading,
.account-input-row,
.account-mode,
.account-conflict-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-panel-heading {
  justify-content: space-between;
  margin-bottom: 10px;
}

.account-panel > summary {
  min-height: 28px;
  margin-bottom: 0;
  cursor: pointer;
  list-style: none;
}

.account-panel > summary::-webkit-details-marker {
  display: none;
}

.account-panel > summary::after {
  content: "+";
  color: rgb(255 247 232 / 55%);
}

.account-panel[open] > summary::after {
  content: "−";
}

.account-panel-heading strong {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.account-panel-heading span,
.account-message {
  margin: 0;
  color: rgb(255 247 232 / 62%);
  font-size: 11px;
}

.account-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.account-mode button,
.account-input-row button {
  min-height: 34px;
  border: 1px solid rgb(239 218 173 / 35%);
  border-radius: 3px;
  color: #fff7e8;
  background: rgb(16 29 24 / 42%);
  cursor: pointer;
}

.account-mode button {
  flex: 1;
  min-width: 68px;
  padding: 6px 10px;
  font-size: 11px;
}

.account-mode button[aria-pressed="true"] {
  border-color: rgb(239 218 173 / 75%);
  background: rgb(147 61 43 / 48%);
}

.account-email-form > label {
  display: block;
  margin-bottom: 5px;
  color: rgb(255 247 232 / 66%);
  font-size: 11px;
}

.account-auth-hint {
  margin: 7px 0 0;
  color: rgb(255 247 232 / 58%);
  font-size: 10px;
  line-height: 1.5;
}

.account-input-row + .account-input-row {
  margin-top: 7px;
}

.account-input-row input {
  min-width: 0;
  min-height: 36px;
  flex: 1;
  padding: 7px 10px;
  border: 1px solid rgb(239 218 173 / 32%);
  border-radius: 3px;
  color: #fff7e8;
  background: rgb(11 22 18 / 58%);
}

.account-input-row button {
  padding: 6px 12px;
  white-space: nowrap;
}

.account-message {
  min-height: 16px;
  margin-top: 8px;
  line-height: 1.5;
}

.account-panel button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.account-modal {
  position: fixed;
  z-index: 110;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(10 18 14 / 72%);
  backdrop-filter: blur(5px);
}

.account-modal[hidden] {
  display: none;
}

.account-modal-card {
  width: min(440px, 100%);
  max-height: min(90dvh, 680px);
  overflow: auto;
  padding: 20px;
  border: 1px solid rgb(239 218 173 / 35%);
  color: #fff7e8;
  background: #15251f;
  box-shadow: 0 22px 72px rgb(0 0 0 / 35%);
}

.account-modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.account-modal-heading h2 {
  margin: 0;
  font-size: 18px;
}

.account-modal-card .account-panel {
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
}

.account-conflict {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(10 18 14 / 72%);
  backdrop-filter: blur(5px);
}

.account-conflict[hidden] {
  display: none;
}

.account-conflict-card {
  width: min(440px, 100%);
  padding: 24px;
  color: #27362d;
  background: #eee5d1;
  border: 1px solid rgba(115, 86, 49, 0.46);
  box-shadow: 0 22px 72px rgba(0, 0, 0, 0.35);
}

.account-conflict-card h2 {
  margin: 0 0 12px;
  font-size: 21px;
}

.account-conflict-card > p:not(.eyebrow) {
  margin: 0;
  line-height: 1.65;
}

.account-conflict-actions {
  display: grid;
  margin-top: 18px;
}

.account-conflict-actions button {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #8e7653;
  border-radius: 3px;
  color: #27362d;
  background: transparent;
  cursor: pointer;
}

.account-conflict-actions button:first-child {
  color: #fff8e8;
  background: #586c5d;
}

.start-mist {
  position: absolute;
  z-index: 1;
  width: 64vw;
  height: 18vw;
  min-height: 120px;
  border-radius: 50%;
  background: rgb(214 226 207 / 13%);
  filter: blur(38px);
  animation: mist-drift 16s ease-in-out infinite alternate;
}

.mist-one {
  top: 17%;
  left: -24%;
}

.mist-two {
  right: -28%;
  bottom: 8%;
  animation-delay: -6s;
}

@keyframes mist-drift {
  from {
    transform: translateX(-3%) scale(0.96);
  }
  to {
    transform: translateX(8%) scale(1.05);
  }
}

.video-modal {
  position: absolute;
  z-index: 40;
  inset: 0;
  display: grid;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  place-items: center;
  background: rgb(5 13 10 / 78%);
  backdrop-filter: blur(12px);
}

.video-card {
  position: relative;
  width: min(94vw, 980px);
  max-height: 94vh;
  padding: 12px;
  overflow: auto;
  border: 1px solid rgb(239 219 177 / 25%);
  border-radius: 18px;
  color: var(--ink);
  background: #e7ddc6;
  box-shadow: 0 30px 90px rgb(0 0 0 / 55%);
}

.video-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding-top: min(56.25%, 54vh);
  border-radius: 10px;
  background: #09120e;
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-close {
  z-index: 2;
  color: var(--white);
  border-color: rgb(255 255 255 / 20%);
  background: rgb(20 34 28 / 78%);
}

.video-meta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 12px 8px;
}

.video-meta h2 {
  margin: 4px 0 7px;
  font-size: clamp(22px, 3vw, 31px);
  font-weight: 500;
}

.video-meta > div > p:last-child {
  margin: 0;
  color: #5e685e;
  font-size: 13px;
  line-height: 1.6;
}

.video-meta a {
  flex: 0 0 auto;
  padding-bottom: 3px;
  color: #7f4437;
  font-size: 12px;
}

.source-note {
  margin: 4px 12px 8px;
  color: #7b776c;
  font-size: 10px;
}

.source-note a {
  color: #784538;
  text-underline-offset: 2px;
}

.library-modal {
  position: absolute;
  z-index: 40;
  inset: 0;
  display: grid;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  place-items: center;
  background: rgb(5 13 10 / 82%);
  backdrop-filter: blur(12px);
}

.library-card {
  position: relative;
  display: flex;
  width: min(96vw, 1320px);
  height: min(94vh, 920px);
  min-height: 520px;
  padding: 22px;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid rgb(239 219 177 / 32%);
  border-radius: 20px;
  color: var(--ink);
  background:
    linear-gradient(rgb(237 228 205 / 98%), rgb(219 207 180 / 98%)),
    repeating-linear-gradient(0deg, transparent 0 28px, rgb(60 45 25 / 4%) 28px 29px);
  box-shadow: 0 30px 90px rgb(0 0 0 / 58%);
}

.library-card .video-close {
  top: 19px;
  right: 19px;
  color: var(--ink);
  border-color: rgb(36 45 37 / 18%);
  background: rgb(255 255 255 / 28%);
}

.library-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  padding: 2px 54px 15px 2px;
  border-bottom: 1px solid rgb(75 58 34 / 15%);
}

.library-header h2 {
  margin: 4px 0 7px;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 500;
  letter-spacing: 0.09em;
}

.library-header > div:first-child > p:last-child {
  margin: 0;
  color: #60675c;
  font-size: 13px;
}

.reader-rank-card {
  display: grid;
  min-width: 230px;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 2px 12px;
  padding: 12px 15px;
  border: 1px solid rgb(89 63 34 / 20%);
  border-radius: 13px;
  background: rgb(255 255 255 / 20%);
}

.reader-rank-card > span {
  color: #7b5434;
  font-size: 10px;
  letter-spacing: 0.13em;
}

.reader-rank-card > strong {
  color: #8d4436;
  font-size: 22px;
  font-weight: 500;
  text-align: right;
}

.reader-rank-card > small {
  color: #3f5046;
  font-size: 12px;
}

.xp-track {
  height: 3px;
  overflow: hidden;
  grid-column: 1 / -1;
  margin-top: 6px;
  border-radius: 99px;
  background: rgb(52 53 42 / 12%);
}

#xp-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a26839, #d0a65c);
  transition: width 300ms ease;
}

.reader-rank-card > em {
  grid-column: 1 / -1;
  margin-top: 4px;
  color: #77756b;
  font-size: 9px;
  font-style: normal;
}

.series-progress {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 13px 2px 14px;
  border-bottom: 1px solid rgb(75 58 34 / 12%);
}

.series-progress-item > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
  color: #4e594f;
  font-size: 11px;
}

.series-progress-item strong {
  color: #764438;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.series-track {
  height: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: rgb(74 61 39 / 11%);
}

#zh-progress-fill,
#en-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8b4e3b, #c5914c);
  transition: width 280ms ease;
}

#en-progress-fill {
  background: linear-gradient(90deg, #3e5f53, #9aaf7d);
}

.library-body {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: minmax(300px, 38%) minmax(0, 1fr);
  gap: 18px;
  padding-top: 16px;
}

.library-index,
.library-reader {
  min-height: 0;
}

.library-index {
  display: flex;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid rgb(79 59 34 / 14%);
  border-radius: 13px;
  background: rgb(255 255 255 / 16%);
}

.clue-card {
  padding: 14px 15px 13px;
  border-bottom: 1px solid rgb(79 59 34 / 13%);
  background:
    radial-gradient(circle at 100% 0, rgb(166 102 61 / 12%), transparent 42%),
    rgb(255 250 237 / 18%);
}

.clue-card h3 {
  margin: 4px 0 5px;
  color: #523f30;
  font-size: 17px;
  font-weight: 500;
}

.clue-card > p:not(.eyebrow) {
  margin: 0;
  color: #667067;
  font-size: 11px;
  line-height: 1.55;
}

.clue-card > span {
  display: block;
  margin-top: 7px;
  color: #8a6541;
  font-size: 9px;
  letter-spacing: 0.04em;
}

.clue-card.ready {
  background:
    radial-gradient(circle at 100% 0, rgb(228 182 94 / 27%), transparent 48%),
    rgb(255 250 237 / 22%);
}

.clue-card.found {
  border-left: 3px solid #7d934f;
}

.clue-meter {
  height: 3px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: rgb(66 54 37 / 10%);
}

.clue-meter > div {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #a67b43;
  transition: width 220ms ease;
}

.library-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid rgb(79 59 34 / 12%);
}

.playlist-directory-title {
  min-width: 0;
  flex: 1;
  color: #5e4633;
  font-size: 12px;
  font-weight: 600;
}

.playlist-directory-back {
  padding: 6px 8px;
  border: 1px solid rgb(75 58 34 / 17%);
  border-radius: 6px;
  color: #5e4633;
  background: rgb(255 255 255 / 30%);
  font-size: 10px;
  cursor: pointer;
}

.playlist-directory-back:not([hidden]) {
  display: inline-flex;
}

.series-tabs,
.series-tabs[hidden],
.scripture-search[hidden] {
  display: none;
}

.playlist-card {
  position: relative;
  display: grid;
  width: 100%;
  gap: 5px;
  margin-bottom: 8px;
  padding: 13px 34px 13px 12px;
  border: 1px solid rgb(79 59 34 / 14%);
  border-radius: 7px;
  color: #34433a;
  background: rgb(255 255 255 / 24%);
  text-align: left;
  cursor: pointer;
}

.playlist-card:hover,
.playlist-card.is-default {
  border-color: rgb(141 77 56 / 40%);
  background: rgb(255 250 237 / 55%);
}

.playlist-card strong {
  color: #523f30;
  font-size: 13px;
  font-weight: 600;
}

.playlist-card .playlist-language,
.playlist-card small {
  color: #72766c;
  font-size: 10px;
}

.playlist-arrow {
  position: absolute;
  top: 50%;
  right: 12px;
  color: #8d4d38;
  font-size: 22px;
  transform: translateY(-55%);
}

.series-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 8px;
  background: rgb(62 51 35 / 9%);
}

.series-tabs button {
  min-width: 52px;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  color: #5d6258;
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.series-tabs button.active {
  color: #fff9ea;
  background: #6d4938;
}

.scripture-search {
  min-width: 0;
  flex: 1;
}

.scripture-search input {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid rgb(75 58 34 / 17%);
  border-radius: 7px;
  outline: 0;
  color: var(--ink);
  background: rgb(255 255 255 / 30%);
  font: 11px "STKaiti", "KaiTi", serif;
}

.scripture-search input:focus {
  border-color: #9a7048;
  box-shadow: 0 0 0 2px rgb(154 112 72 / 12%);
}

.scripture-list {
  min-height: 0;
  flex: 1;
  padding: 8px;
  overflow: auto;
  scrollbar-color: rgb(110 83 52 / 38%) transparent;
  scrollbar-width: thin;
}

.volume-group + .volume-group {
  margin-top: 8px;
}

.volume-heading {
  position: sticky;
  z-index: 1;
  top: -8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 7px;
  color: #745a40;
  background: #ded3ba;
  font-size: 10px;
}

.volume-heading small {
  color: #8b877b;
  font-size: 8px;
}

.lecture-item {
  display: grid;
  width: 100%;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 7px;
  border: 0;
  border-bottom: 1px solid rgb(81 62 38 / 8%);
  color: #34433a;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.lecture-item:hover:not(:disabled),
.lecture-item.active {
  background: rgb(143 100 58 / 10%);
}

.lecture-item.active {
  box-shadow: inset 3px 0 #8d4d38;
}

.lecture-item:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.lecture-item .lecture-label {
  color: #7c4d37;
  font-size: 11px;
}

.lecture-item .lecture-title {
  overflow: hidden;
  color: #5a655b;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lecture-item .lecture-state {
  color: #8a7e6c;
  font-size: 8px;
  white-space: nowrap;
}

.lecture-item.is-watched .lecture-state {
  color: #5e744d;
}

.lecture-item.is-watched .lecture-label::before {
  margin-right: 4px;
  color: #668050;
  content: "✓";
}

.library-reader {
  display: flex;
  overflow: auto;
  padding: 12px;
  flex-direction: column;
  border: 1px solid rgb(79 59 34 / 14%);
  border-radius: 13px;
  background: rgb(255 255 255 / 17%);
}

.library-back {
  display: none;
  align-self: flex-start;
  margin-bottom: 9px;
  padding: 6px 10px;
  border: 1px solid rgb(79 59 34 / 18%);
  border-radius: 6px;
  color: #5e4633;
  background: rgb(255 255 255 / 30%);
  font-size: 11px;
  cursor: pointer;
}

.library-reader .video-frame {
  display: none;
  flex: 0 0 auto;
}

.library-reader.has-video .video-frame {
  display: block;
}

.library-reader.has-video .video-empty {
  display: none;
}

.library-reader:not(.has-video) .video-meta,
.library-reader:not(.has-video) .reader-actions,
.library-reader:not(.has-video) .login-help {
  display: none;
}

.video-empty {
  display: flex;
  min-height: 300px;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #6f756a;
  text-align: center;
}

.video-empty > span {
  display: grid;
  width: 84px;
  height: 84px;
  margin-bottom: 18px;
  place-items: center;
  border: 1px solid rgb(91 70 40 / 22%);
  border-radius: 50%;
  color: #8c6840;
  font-size: 33px;
}

.video-empty strong {
  color: #4b594f;
  font-size: 19px;
  font-weight: 500;
}

.video-empty p {
  max-width: 360px;
  margin: 8px 20px 0;
  font-size: 12px;
  line-height: 1.65;
}

.library-reader .video-meta {
  padding: 14px 4px 6px;
}

.library-reader .video-meta h2 {
  font-size: clamp(19px, 2.2vw, 27px);
}

.video-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.video-links a {
  white-space: nowrap;
}

.video-links a:first-child {
  padding: 7px 10px;
  border-radius: 6px;
  color: #fff9ea;
  background: #7d4b39;
  text-decoration: none;
}

.video-links a:first-child:hover {
  background: #925743;
}

.video-links a:last-child {
  color: #657462;
}

.video-status {
  min-height: 17px;
  margin-top: 5px !important;
  color: #8a5c3f !important;
  font-size: 10px !important;
}

.reader-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding: 10px 4px 0;
}

.reader-actions button {
  padding: 8px 13px;
  border: 1px solid rgb(74 55 35 / 19%);
  border-radius: 7px;
  color: #4e5b50;
  background: rgb(255 255 255 / 22%);
  font-size: 11px;
  cursor: pointer;
}

.reader-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.reader-actions .mark-watched {
  flex: 1;
  color: #fff9ea;
  background: #7d4b39;
}

.reader-actions .mark-watched.is-watched {
  color: #546549;
  background: rgb(108 133 81 / 18%);
}

.reader-actions #favorite-scripture {
  border-color: rgb(177 132 68 / 35%);
  color: #785f3b;
}

.reader-actions #favorite-scripture.is-favorite {
  color: #fff6df;
  background: #967047;
}

.login-help {
  margin: 8px 4px 0;
  color: #827c6f;
  font-size: 9px;
  line-height: 1.55;
}

.library-footer {
  padding-top: 8px;
}

.library-footer .source-note {
  margin: 0;
}

.level-overlay {
  position: absolute;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 45%, rgb(226 188 108 / 22%), transparent 24%),
    rgb(5 14 10 / 84%);
  backdrop-filter: blur(10px);
}

.level-up-card {
  width: min(88vw, 440px);
  padding: 35px;
  border: 1px solid rgb(237 208 147 / 36%);
  border-radius: 18px;
  color: #f9efd9;
  background:
    radial-gradient(circle at 50% 22%, rgb(211 166 78 / 18%), transparent 35%),
    rgb(26 43 34 / 95%);
  box-shadow: 0 30px 90px rgb(0 0 0 / 55%);
  text-align: center;
}

.level-up-card .eyebrow {
  color: #d7b777;
}

.level-up-card h2 {
  margin: 6px 0 18px;
  font-size: 25px;
  font-weight: 400;
  letter-spacing: 0.18em;
}

.level-up-number {
  color: #e2be76;
  font: 400 52px/1 "STKaiti", "KaiTi", serif;
}

.level-up-number strong {
  font-weight: 400;
}

.level-up-card h3 {
  margin: 12px 0 6px;
  color: #fff5df;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.level-up-card > p:not(.eyebrow) {
  margin: 0 0 22px;
  color: rgb(249 239 217 / 62%);
  font-size: 12px;
  line-height: 1.6;
}

.level-up-card button {
  padding: 9px 22px;
  border: 1px solid rgb(239 211 153 / 40%);
  border-radius: 3px;
  color: #fff4df;
  background: rgb(145 66 47 / 74%);
  cursor: pointer;
}

.npc-dialog {
  position: absolute;
  z-index: 64;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 50% 48%, rgb(212 178 104 / 17%), transparent 31%),
    rgb(5 14 10 / 72%);
  backdrop-filter: blur(9px);
  opacity: 0;
  transition: opacity 180ms ease;
}

.npc-dialog.visible {
  opacity: 1;
}

.npc-card {
  position: relative;
  width: min(92vw, 580px);
  max-height: min(84vh, 700px);
  padding: 30px 32px 25px;
  overflow: auto;
  border: 1px solid rgb(236 207 146 / 34%);
  border-radius: 7px 7px 22px 7px;
  color: #f9efda;
  background:
    linear-gradient(145deg, rgb(122 69 43 / 20%), transparent 36%),
    radial-gradient(circle at 84% 18%, rgb(205 167 92 / 12%), transparent 29%),
    rgb(24 40 32 / 97%);
  box-shadow:
    0 34px 100px rgb(0 0 0 / 58%),
    inset 0 1px rgb(255 255 255 / 7%);
}

.npc-card .panel-close {
  top: 17px;
  right: 18px;
}

.npc-card .eyebrow {
  margin: 0 0 16px;
  color: #c6a568;
  font-size: 10px;
  letter-spacing: 0.2em;
}

.npc-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-right: 36px;
}

.npc-seal {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgb(231 198 127 / 40%);
  border-radius: 50%;
  color: #f1d79c;
  background:
    radial-gradient(circle, rgb(160 82 50 / 62%), rgb(77 48 31 / 42%));
  box-shadow:
    inset 0 0 0 5px rgb(255 255 255 / 4%),
    0 0 24px rgb(218 177 96 / 10%);
  font-size: 26px;
}

.npc-heading h2 {
  margin: 0 0 4px;
  color: #fff7e8;
  font-size: 27px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.npc-heading p {
  margin: 0;
  color: #bba97f;
  font-size: 11px;
  letter-spacing: 0.12em;
}

.npc-speak {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 7px 10px;
  border: 1px solid rgb(230 199 132 / 26%);
  border-radius: 999px;
  color: rgb(249 237 213 / 72%);
  background: rgb(255 255 255 / 4%);
  cursor: pointer;
}

.npc-speak span {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 50%;
  color: #ebcf92;
  background: rgb(136 77 49 / 42%);
  font-size: 10px;
}

.npc-speak strong {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.npc-speak.is-speaking {
  border-color: rgb(234 202 134 / 64%);
  color: #fff5de;
  background: rgb(137 75 49 / 44%);
}

.npc-speak.is-speaking span {
  animation: npc-speaking 900ms ease-in-out infinite alternate;
}

@keyframes npc-speaking {
  from {
    box-shadow: 0 0 0 0 rgb(233 198 123 / 12%);
  }
  to {
    box-shadow: 0 0 0 5px rgb(233 198 123 / 18%);
  }
}

#npc-text {
  min-height: 76px;
  margin: 24px 0 18px;
  padding: 18px 20px;
  border: 0;
  border-left: 2px solid rgb(223 190 119 / 62%);
  color: rgb(255 247 230 / 86%);
  background: linear-gradient(90deg, rgb(255 255 255 / 5%), transparent);
  font-size: 15px;
  line-height: 1.9;
}

#npc-text.is-changing {
  animation: npc-answer 320ms ease both;
}

.npc-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.npc-options button {
  min-height: 43px;
  padding: 9px 12px;
  border: 1px solid rgb(235 208 151 / 20%);
  border-radius: 3px;
  color: rgb(250 240 219 / 78%);
  background: rgb(255 255 255 / 3%);
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
}

.npc-options button:hover,
.npc-options button:focus-visible,
.npc-options button.active {
  border-color: rgb(231 197 125 / 54%);
  color: #fff5df;
  background: rgb(141 76 51 / 42%);
}

.npc-disclaimer {
  margin: 18px 0 0;
  color: rgb(232 220 195 / 36%);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-align: right;
}

@keyframes npc-answer {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (pointer: coarse), (max-width: 820px) {
  .mobile-controls {
    display: flex;
  }

  .quick-meditate {
    right: max(18px, env(safe-area-inset-right));
    bottom: max(104px, calc(env(safe-area-inset-bottom) + 104px));
  }

  .street-mindful-hint {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(174px, calc(env(safe-area-inset-bottom) + 174px));
    left: max(12px, env(safe-area-inset-left));
    width: auto;
  }

  .npc-card {
    width: min(94vw, 560px);
    max-height: 86dvh;
    padding: 27px 25px 22px;
  }

  .help-toggle {
    top: max(70px, calc(env(safe-area-inset-top) + 70px));
    right: max(12px, env(safe-area-inset-right));
    bottom: auto;
    width: 30px;
    height: 30px;
    opacity: 0.72;
  }

  .temple-actions {
    bottom: max(158px, calc(env(safe-area-inset-bottom) + 158px));
    width: min(82vw, 390px);
    gap: 6px;
    justify-content: center;
  }

  .action-button {
    min-width: 0;
    flex: 1;
    justify-content: center;
    padding: 6px;
    border-radius: 10px;
  }

  .action-glyph {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    font-size: 16px;
  }

  .action-copy small {
    display: none;
  }

  .action-copy strong {
    font-size: 13px;
  }

  .interaction-prompt {
    bottom: max(218px, calc(env(safe-area-inset-bottom) + 218px));
    max-width: min(76vw, 320px);
    min-height: 42px;
    padding: 7px 13px;
    border-radius: 999px;
    font-size: 13px;
    line-height: 1.25;
    white-space: nowrap;
  }

  .interaction-prompt .interaction-arrow {
    font-size: 19px;
  }

  .meditation-panel {
    bottom: max(158px, calc(env(safe-area-inset-bottom) + 158px));
    width: calc(100vw - 24px);
  }

  .mobile-action {
    margin-bottom: 18px;
  }

  .library-modal {
    padding: 6px;
  }

  .library-card {
    width: 100%;
    height: calc(100vh - 12px);
    min-height: 0;
    padding: 15px;
    border-radius: 14px;
  }

  .library-header {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 2px 42px 11px 2px;
  }

  .library-header h2 {
    margin: 2px 0 4px;
    font-size: 29px;
  }

  .reader-rank-card {
    min-width: 0;
    grid-template-columns: auto auto 1fr;
    padding: 8px 10px;
  }

  .reader-rank-card > small {
    text-align: right;
  }

  .series-progress {
    gap: 10px;
    padding: 9px 1px 10px;
  }

  .library-body {
    display: block;
    overflow: auto;
    padding-top: 10px;
  }

  .library-index {
    height: 46vh;
    min-height: 280px;
  }

  .library-reader {
    min-height: 360px;
    margin-top: 10px;
  }

  .video-empty {
    min-height: 260px;
  }

  .video-links {
    align-items: flex-start;
  }

  .library-footer {
    padding-top: 6px;
  }

  .library-card.is-watching {
    padding: 8px;
  }

  .library-card.is-watching .library-header,
  .library-card.is-watching .series-progress,
  .library-card.is-watching .library-index,
  .library-card.is-watching .library-footer {
    display: none;
  }

  .library-card.is-watching .library-body {
    height: 100%;
    padding-top: 0;
    overflow: hidden;
  }

  .library-card.is-watching .library-reader {
    height: 100%;
    min-height: 0;
    margin-top: 0;
    padding: 8px;
  }

  .library-card.is-watching .library-back {
    display: inline-flex;
  }
}

@media (max-width: 620px) {
  .hud {
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 0
      max(12px, env(safe-area-inset-left));
  }

  .brand-seal {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }

  .brand-copy strong {
    font-size: 20px;
  }

  .brand-copy {
    display: none;
  }

  .reader-level-chip {
    min-height: 36px;
    padding: 5px 10px;
  }

  .reader-level-chip span {
    display: none;
  }

  .online-pill {
    min-height: 36px;
    padding: 5px 9px;
  }

  .online-pill span:not(.online-dot) {
    display: none;
  }

  .place-pill {
    display: none;
  }

  .meditation-duration-card {
    min-height: 36px;
    padding: 5px 9px;
  }

  .meditation-duration-card span {
    display: none;
  }

  .round-button {
    width: 36px;
    min-height: 36px;
    height: 36px;
  }

  .language-control {
    gap: 3px;
  }

  .ritual-caption {
    top: clamp(116px, 16vh, 144px);
    width: min(92vw, 560px);
    padding: 12px 18px 14px;
  }

  .ritual-caption > span {
    font-size: 9px;
  }

  .ritual-caption > p {
    font-size: 13px;
    line-height: 1.7;
  }

  .language-button {
    min-height: 36px;
    padding: 0 8px;
    font-size: 9px;
  }

  .join-fields .language-button {
    min-height: 38px;
    padding: 0 6px;
    font-size: 11px;
  }

  .rank-card {
    display: none;
  }

  .npc-dialog {
    align-items: end;
    padding: 12px max(10px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }

  .npc-card {
    width: 100%;
    max-height: min(78dvh, 660px);
    padding: 25px 19px 20px;
    border-radius: 8px 8px 18px 8px;
  }

  .npc-heading h2 {
    font-size: 23px;
  }

  .npc-seal {
    width: 50px;
    height: 50px;
    font-size: 23px;
  }

  #npc-text {
    margin: 18px 0 14px;
    padding: 14px 15px;
    font-size: 14px;
  }

  .npc-options {
    grid-template-columns: 1fr;
  }

  .npc-options button {
    min-height: 40px;
  }

  .meditation-center-clock {
    top: 43%;
    min-width: calc(100vw - 32px);
    padding: 17px 20px 20px;
  }

  .meditation-remaining strong {
    font-size: clamp(74px, 25vw, 112px);
  }

  .meditation-now {
    max-width: 270px;
    gap: 7px;
  }

  .meditation-capture-tools {
    flex-wrap: wrap;
  }

  .capture-copy {
    min-width: calc(100% - 4px);
    flex-basis: 100%;
  }

  .meditation-capture-tools button,
  .camera-secure-link {
    flex: 1;
    text-align: center;
  }

  .meditation-scripture-controls {
    grid-template-columns: 1fr 1fr;
  }

  .meditation-scripture-controls label:first-child {
    grid-column: 1 / -1;
  }

  .meditation-scripture-window {
    top: max(62px, calc(env(safe-area-inset-top) + 54px));
    width: 320px;
  }

  .camera-preview {
    width: 180px;
  }

  .recording-result-card {
    padding: 24px 18px 20px;
  }

  #temple-progress,
  #scripture-progress-summary {
    display: none;
  }

  .rank-card .rank-divider {
    display: none;
  }

  .dpad {
    width: 126px;
    height: 126px;
  }

  .dpad-button {
    width: 42px;
    height: 42px;
  }

  .mobile-action {
    width: 58px;
    height: 58px;
  }

  html[data-scene="temple"] .interaction-prompt {
    bottom: max(204px, calc(env(safe-area-inset-bottom) + 204px));
    max-width: min(74vw, 286px);
    background: rgb(13 25 20 / 90%);
    box-shadow:
      0 10px 28px rgb(0 0 0 / 32%),
      inset 0 0 0 1px rgb(231 198 127 / 10%);
  }

  .help-toggle {
    right: max(14px, env(safe-area-inset-right));
  }

  .help-panel {
    padding: 26px 20px 20px;
  }

  .help-grid > div {
    flex-wrap: wrap;
  }

  .help-grid > div span {
    width: 100%;
    margin: 3px 0 5px;
  }

  .start-card {
    padding: 24px 20px;
  }

  .join-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 9px;
    margin-top: 10px;
  }

  .join-fields label,
  .join-fields .join-language-field {
    gap: 3px;
  }

  .join-fields input,
  .join-fields select {
    padding: 7px 8px;
    font-size: 12px;
  }

  .ensō {
    width: 78px;
    height: 78px;
  }

  .video-card {
    padding: 8px;
  }

  .video-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    padding: 15px 7px 6px;
  }

  .library-card {
    padding: 12px;
  }

  .library-header {
    padding-right: 38px;
  }

  .library-header > div:first-child > p:last-child {
    display: none;
  }

  .series-progress {
    grid-template-columns: 1fr;
  }

  .library-index {
    height: 44vh;
  }

  .library-card.is-watching .video-frame {
    padding-top: min(56.25%, 58vh);
  }

  .library-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
  }

  .series-tabs button {
    flex: 1;
  }

  .lecture-item {
    grid-template-columns: 64px minmax(0, 1fr) auto;
  }

  .reader-actions {
    flex-wrap: wrap;
  }

  .reader-actions .mark-watched {
    min-width: 100%;
    order: -1;
  }

  .level-up-card {
    padding: 28px 22px;
  }
}

@media (max-height: 540px) and (orientation: landscape) {
  .rank-card,
  .help-toggle {
    display: none;
  }

  .npc-card {
    max-height: 92dvh;
    padding-top: 22px;
  }

  .npc-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .meditation-center-clock {
    top: 45%;
    padding: 10px 22px 13px;
  }

  .meditation-remaining strong {
    font-size: 66px;
  }

  .meditation-now {
    font-size: 10px;
  }

  .quick-meditate {
    top: 50%;
    right: max(10px, env(safe-area-inset-right));
    bottom: auto;
    min-height: 42px;
    padding: 5px;
    transform: translateY(-50%);
  }

  .quick-meditate:hover,
  .quick-meditate:focus-visible {
    transform: translateY(calc(-50% - 2px));
  }

  .quick-meditate-copy {
    display: none;
  }

  .street-mindful-hint {
    right: auto;
    bottom: max(152px, calc(env(safe-area-inset-bottom) + 152px));
    left: 50%;
    width: min(430px, calc(100vw - 120px));
    transform: translateX(-50%);
  }

  .ensō {
    display: none;
  }

  .start-card {
    padding: 18px;
  }

  .join-fields {
    margin-top: 10px;
  }

  .start-card h1 {
    margin-top: 4px;
    font-size: 49px;
  }

  .start-intro {
    display: none;
  }

  .start-button {
    margin-top: 15px;
  }

  .dpad {
    width: 126px;
    height: 126px;
  }

  .dpad-button {
    width: 42px;
    height: 42px;
  }

  .temple-actions {
    bottom: 166px;
  }

  .mobile-controls {
    align-items: end;
  }

  .interaction-prompt {
    bottom: 226px;
    max-width: min(420px, calc(100vw - 270px));
  }

  .meditation-panel {
    bottom: 166px;
  }
}

@media (pointer: coarse), (max-width: 820px) {
  .quest-card {
    top: max(68px, calc(env(safe-area-inset-top) + 58px));
  }
}

@media (max-width: 620px) {
  .quest-card {
    top: max(58px, calc(env(safe-area-inset-top) + 48px));
    left: max(12px, env(safe-area-inset-left));
    width: min(310px, calc(100vw - 24px));
  }

  .quest-toggle {
    padding: 9px 12px;
  }

  .quest-body {
    padding: 12px 13px 14px;
  }
}

@media (max-height: 540px) and (orientation: landscape) {
  .quest-card {
    top: max(54px, calc(env(safe-area-inset-top) + 48px));
    width: 280px;
  }

  .quest-card:not(.is-collapsed) .quest-body {
    max-height: 176px;
    overflow: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

:root {
  --glass-ink: rgb(16 31 25 / 82%);
  --glass-border: rgb(255 248 228 / 20%);
  --brass-light: #efd293;
}

button,
select {
  touch-action: manipulation;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--brass-light);
  outline-offset: 4px;
  box-shadow: 0 0 0 6px rgb(239 210 147 / 14%);
}

#game-canvas {
  cursor: grab;
}

#game-canvas:active {
  cursor: grabbing;
}

#game-canvas[data-interaction="ready"] {
  cursor: pointer;
}

.brand-seal {
  position: relative;
  border-color: rgb(239 210 147 / 78%);
  box-shadow:
    inset 0 0 0 4px rgb(255 255 255 / 6%),
    0 8px 24px rgb(0 0 0 / 24%);
}

.brand-seal::after {
  position: absolute;
  inset: 4px;
  border: 1px solid rgb(239 210 147 / 28%);
  border-radius: inherit;
  content: "";
  pointer-events: none;
}

.meditation-duration-card,
.reader-level-chip,
.online-pill,
.place-pill,
.round-button {
  border-color: var(--glass-border);
  background-color: var(--glass-ink);
  box-shadow:
    inset 0 1px rgb(255 255 255 / 7%),
    0 10px 28px rgb(0 0 0 / 18%);
  backdrop-filter: blur(16px) saturate(1.15);
}

.status-row button {
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.status-row button:hover {
  border-color: rgb(239 210 147 / 52%);
  background-color: rgb(35 53 43 / 94%);
  box-shadow: 0 10px 28px rgb(0 0 0 / 24%), 0 0 18px rgb(239 210 147 / 10%);
  transform: translateY(-1px);
}

.quest-card {
  border-color: rgb(239 210 147 / 24%);
  background: linear-gradient(145deg, rgb(21 39 31 / 91%), rgb(13 27 22 / 86%));
  box-shadow:
    inset 0 1px rgb(255 255 255 / 7%),
    0 16px 42px rgb(0 0 0 / 28%);
  backdrop-filter: blur(16px) saturate(1.1);
}

.interaction-prompt {
  min-height: 44px;
  border-color: rgb(239 210 147 / 48%);
  border-radius: 999px;
  background: linear-gradient(135deg, rgb(32 49 39 / 94%), rgb(14 29 23 / 94%));
  box-shadow:
    inset 0 1px rgb(255 255 255 / 9%),
    0 12px 32px rgb(0 0 0 / 30%),
    0 0 24px rgb(232 197 121 / 10%);
  letter-spacing: 0.035em;
}

.interaction-prompt:not([hidden]) {
  animation: prompt-arrive 240ms ease-out both;
}

.interaction-prompt .interaction-arrow {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid rgb(232 197 121 / 28%);
  border-radius: 50%;
  background: rgb(232 197 121 / 9%);
  transition: transform 160ms ease;
}

.interaction-prompt:hover .interaction-arrow {
  transform: translateX(2px);
}

.temple-actions {
  gap: 11px;
}

.action-button {
  min-height: 62px;
  border-color: rgb(239 210 147 / 24%);
  background: linear-gradient(145deg, rgb(29 47 38 / 94%), rgb(14 29 23 / 94%));
  box-shadow:
    inset 0 1px rgb(255 255 255 / 8%),
    0 12px 30px rgb(0 0 0 / 26%);
}

.action-button.near {
  border-color: rgb(239 210 147 / 78%);
  box-shadow:
    inset 0 1px rgb(255 255 255 / 10%),
    0 12px 30px rgb(0 0 0 / 26%),
    0 0 22px rgb(225 181 91 / 16%);
}

.action-glyph {
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 8%), 0 4px 12px rgb(0 0 0 / 18%);
}

.dpad {
  filter: drop-shadow(0 10px 22px rgb(0 0 0 / 24%));
}

.dpad-button,
.dpad-center {
  border-color: rgb(239 210 147 / 30%);
  background: linear-gradient(145deg, rgb(30 49 39 / 76%), rgb(15 30 24 / 76%));
  box-shadow: inset 0 1px rgb(255 255 255 / 9%);
}

.dpad-button {
  transition:
    transform 120ms ease,
    background-color 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease;
}

.dpad-button:active {
  border-color: var(--brass-light);
  box-shadow: inset 0 2px 8px rgb(0 0 0 / 20%), 0 0 16px rgb(239 210 147 / 18%);
}

.dpad-center {
  color: rgb(239 210 147 / 78%);
  font-size: 10px;
}

.dpad-center::after {
  content: "静";
}

.mobile-action {
  position: relative;
  border-color: rgb(239 210 147 / 64%);
  background: linear-gradient(145deg, rgb(145 72 48 / 92%), rgb(87 43 34 / 94%));
  box-shadow:
    inset 0 1px rgb(255 255 255 / 17%),
    0 10px 28px rgb(0 0 0 / 30%);
  transition:
    transform 140ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.mobile-action:active {
  transform: scale(0.94);
}

.mobile-action.is-ready {
  border-color: var(--brass-light);
  background: linear-gradient(145deg, rgb(170 105 53 / 96%), rgb(111 57 37 / 96%));
  box-shadow:
    inset 0 1px rgb(255 255 255 / 20%),
    0 10px 30px rgb(0 0 0 / 34%),
    0 0 0 4px rgb(239 210 147 / 13%),
    0 0 25px rgb(239 210 147 / 24%);
}

.mobile-action.is-walking {
  border-color: rgb(239 210 147 / 45%);
  background: linear-gradient(145deg, rgb(73 84 59 / 90%), rgb(36 50 39 / 94%));
}

.mobile-action span {
  text-shadow: 0 2px 8px rgb(0 0 0 / 28%);
}

.start-screen {
  background-image:
    radial-gradient(ellipse at 50% 42%, transparent 8%, rgb(8 18 14 / 24%) 100%),
    linear-gradient(90deg, rgb(8 20 16 / 72%), rgb(12 25 20 / 26%) 58%, rgb(9 20 16 / 70%)),
    url("./street-title.png");
}

.start-screen.is-loading {
  background: #15251f;
}

.start-card {
  max-height: min(92dvh, 900px);
  overflow: auto;
  border: 1px solid rgb(239 210 147 / 34%);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgb(24 42 33 / 82%), rgb(10 25 19 / 83%));
  box-shadow:
    inset 0 1px rgb(255 255 255 / 9%),
    inset 0 0 0 5px rgb(255 255 255 / 2%),
    0 26px 80px rgb(0 0 0 / 42%);
  backdrop-filter: blur(14px) saturate(0.9);
  scrollbar-color: rgb(239 210 147 / 38%) transparent;
  scrollbar-width: thin;
}

.ensō {
  border-color: rgb(239 218 173 / 74%);
  border-right-color: transparent;
  box-shadow:
    inset 0 0 28px rgb(236 207 146 / 10%),
    0 0 36px rgb(233 202 134 / 13%);
}

.start-button {
  min-height: 58px;
  border-radius: 6px;
  background: linear-gradient(145deg, rgb(164 75 51 / 96%), rgb(112 47 37 / 96%));
  box-shadow:
    inset 0 1px rgb(255 255 255 / 18%),
    inset 0 0 0 4px rgb(255 255 255 / 5%),
    0 12px 35px rgb(0 0 0 / 30%);
}

.start-button:hover {
  background: linear-gradient(145deg, #b85d40, #8f4535);
  box-shadow:
    inset 0 1px rgb(255 255 255 / 20%),
    0 16px 38px rgb(0 0 0 / 34%),
    0 0 24px rgb(239 210 147 / 12%);
}

@keyframes prompt-arrive {
  from {
    opacity: 0;
    filter: blur(3px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}

@media (max-width: 620px) {
  .start-card {
    width: min(92vw, 540px);
    max-height: min(90dvh, 820px);
    padding: 30px 20px;
    border-radius: 16px;
  }

  .temple-actions {
    gap: 7px;
  }

  .action-button {
    min-width: 0;
  }
}

/* Keep the seated figure in a clear visual lane while meditation UI uses the right rail. */
.meditation-panel {
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  left: auto;
  width: min(360px, 31vw);
  min-width: 300px;
  max-height: min(42vh, 360px);
  overflow: auto;
  transform: none;
  scrollbar-color: rgb(233 203 139 / 34%) transparent;
  scrollbar-width: thin;
}

@keyframes woodfish-panel {
  0% {
    border-color: rgb(246 224 182 / 24%);
    box-shadow: var(--shadow);
    transform: scale(1);
  }
  12% {
    border-color: rgb(247 210 129 / 72%);
    box-shadow:
      var(--shadow),
      0 0 34px rgb(230 188 98 / 18%);
    transform: scale(1.006);
  }
  100% {
    border-color: rgb(246 224 182 / 24%);
    box-shadow: var(--shadow);
    transform: scale(1);
  }
}

.meditation-center-clock {
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  top: max(7vh, calc(env(safe-area-inset-top) + 28px));
  right: auto;
  bottom: auto;
  left: 50%;
  display: grid;
  width: min(760px, 86vw);
  min-width: 0;
  padding: calc(24px * var(--clock-scale, 1)) calc(36px * var(--clock-scale, 1)) calc(20px * var(--clock-scale, 1));
  place-items: center;
  border: 1px solid rgb(238 213 158 / 24%);
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgb(17 33 26 / 78%), rgb(12 26 20 / 72%)),
    radial-gradient(ellipse at 50% 0, rgb(235 204 137 / 19%), transparent 72%);
  text-align: center;
  text-shadow: 0 3px 22px rgb(0 0 0 / 78%);
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
  animation: meditation-clock-in 420ms ease both;
}

.meditation-center-clock::before {
  inset: 8px;
  border-radius: 25px;
}

.meditation-remaining {
  justify-content: center;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 4px;
}

.meditation-remaining strong {
  font-size: clamp(144px, 19vw, 236px);
  font-size: calc(clamp(144px, 19vw, 236px) * var(--clock-scale, 1));
  letter-spacing: -0.035em;
}

.meditation-remaining span {
  font-size: clamp(24px, 3vw, 40px);
  font-size: calc(clamp(24px, 3vw, 40px) * var(--clock-scale, 1));
  letter-spacing: 0.12em;
}

.meditation-now {
  justify-content: center;
  gap: 10px;
  max-width: none;
  line-height: 1.55;
  letter-spacing: 0.035em;
}

@keyframes meditation-clock-in {
  from {
    opacity: 0;
    transform: translate(-50%, -7px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

.is-meditating .ritual-caption {
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  top: 254px;
  right: max(22px, env(safe-area-inset-right));
  bottom: auto;
  left: auto;
  width: min(360px, 31vw);
  padding: 14px 18px 15px;
  text-align: left;
  transform: translateY(10px) scale(0.98);
}

.is-meditating .ritual-caption.visible {
  transform: none;
}

.is-meditating .is-dragging {
  cursor: grabbing !important;
  animation: none !important;
  transition: none !important;
}

.is-meditating .ritual-caption > p {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.68;
}

.camera-preview {
  contain: paint;
}

.camera-preview video {
  contain: strict;
}

.is-camera-preview .meditation-panel,
.is-camera-preview .ritual-caption,
.is-camera-preview .meditation-center-clock {
  backdrop-filter: none;
}

@media (max-width: 820px) {
  .is-meditating .quest-card {
    display: none;
  }

  .meditation-center-clock {
    top: max(5vh, calc(env(safe-area-inset-top) + 16px));
    right: auto;
    left: 50%;
    width: min(680px, calc(100vw - 24px));
    padding: 18px 20px 14px;
    border-radius: 24px;
    transform: translateX(-50%);
  }

  .meditation-remaining {
    gap: 12px;
  }

  .meditation-remaining strong {
    font-size: clamp(112px, 20vw, 188px);
    font-size: calc(clamp(112px, 20vw, 188px) * var(--clock-scale, 1));
  }

  .meditation-remaining span {
    font-size: clamp(22px, 5vw, 32px);
    font-size: calc(clamp(22px, 5vw, 32px) * var(--clock-scale, 1));
  }

  .meditation-now {
    font-size: 9px;
  }

  .is-meditating .ritual-caption {
    top: max(182px, calc(env(safe-area-inset-top) + 172px));
    right: auto;
    left: max(12px, env(safe-area-inset-left));
    width: min(290px, calc(100vw - 24px));
    padding: 11px 14px 12px;
  }

  .is-meditating .ritual-caption > p {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.55;
  }

  .meditation-panel {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    left: auto;
    width: min(268px, 66vw);
    min-width: 0;
    max-height: 47vh;
    padding: 11px 12px;
    overflow: auto;
  }

  .meditation-heading {
    gap: 6px;
    margin-bottom: 8px;
  }

  .meditation-heading strong {
    font-size: 13px;
  }

  .meditation-heading span:last-child {
    font-size: 10px;
  }

  #meditation-time {
    display: none;
  }

  .meditation-footer {
    gap: 8px;
    margin-top: 7px;
    font-size: 9px;
  }

  .meditation-capture-tools,
  .meditation-scripture-controls {
    margin-top: 7px;
    padding-top: 7px;
  }
}

@media (max-width: 620px) {
  .meditation-center-clock {
    top: max(4vh, calc(env(safe-area-inset-top) + 12px));
    width: calc(100vw - 20px);
    padding: 16px 10px 12px;
  }

  .meditation-remaining {
    gap: 8px;
  }

  .meditation-remaining strong {
    font-size: clamp(104px, 27vw, 156px);
    font-size: calc(clamp(104px, 27vw, 156px) * var(--clock-scale, 1));
  }

  .meditation-remaining span {
    font-size: clamp(20px, 6vw, 28px);
    font-size: calc(clamp(20px, 6vw, 28px) * var(--clock-scale, 1));
  }

  .meditation-now {
    font-size: 10px;
    gap: 5px;
  }

  .meditation-now {
    gap: 4px;
  }

  .is-meditating .ritual-caption {
    top: max(168px, calc(env(safe-area-inset-top) + 158px));
    width: calc(100vw - 24px);
  }

  .meditation-panel {
    width: calc(100vw - 24px);
    max-height: 42vh;
  }

  .camera-preview {
    width: 160px;
  }
}

/* Meditation focus mode: keep only the clock, capture controls and optional media windows. */
html.is-meditating #game-shell > :not(canvas):not(.paper-grain):not(#meditation-panel):not(#meditation-capture-bar):not(#meditation-center-clock):not(#meditation-scripture-window):not(#camera-preview):not(#recording-area):not(#recording-result) {
  display: none !important;
}

html.is-meditating .meditation-panel {
  display: none !important;
}

html.is-meditating .meditation-panel .meditation-heading,
html.is-meditating .meditation-panel .meditation-track,
html.is-meditating .meditation-panel .meditation-footer {
  display: none !important;
}

.meditation-command-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  padding: 0 4px;
}

.meditation-command-head > span {
  color: rgb(255 244 218 / 68%);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.meditation-command-head button {
  padding: 7px 13px;
  border: 1px solid rgb(244 221 171 / 36%);
  border-radius: 999px;
  color: #fff1cf;
  background: rgb(31 32 27 / 76%);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  backdrop-filter: blur(12px);
}

html.is-meditating .meditation-capture-tools,
html.is-meditating .meditation-scripture-controls {
  cursor: grab;
  touch-action: none;
  border: 1px solid rgb(240 215 161 / 28%);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgb(18 34 27 / 92%), rgb(22 28 23 / 86%)),
    radial-gradient(circle at 20% 0, rgb(233 198 119 / 16%), transparent 62%);
  box-shadow:
    0 18px 48px rgb(0 0 0 / 36%),
    inset 0 1px rgb(255 255 255 / 5%);
  backdrop-filter: blur(16px);
}

html.is-meditating .meditation-capture-tools {
  gap: 12px;
  margin: 0;
  padding: 12px 14px;
}

.meditation-capture-tools .capture-copy {
  min-width: 126px;
  flex: 0 1 190px;
}

.meditation-capture-tools .capture-copy span {
  color: #f3dca7;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.meditation-capture-tools .capture-copy small {
  color: rgb(255 247 230 / 52%);
  font-size: 10px;
  line-height: 1.45;
  white-space: normal;
}

.meditation-capture-tools #camera-toggle,
.meditation-capture-tools #recording-toggle {
  min-width: 150px;
  min-height: 46px;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.05em;
  box-shadow: 0 8px 22px rgb(0 0 0 / 22%);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.meditation-capture-tools #camera-toggle {
  border-color: rgb(238 210 144 / 58%);
  color: #fff3d6;
  background: linear-gradient(135deg, rgb(139 91 46 / 92%), rgb(89 68 39 / 86%));
}

.meditation-capture-tools #recording-toggle {
  border-color: rgb(244 188 138 / 58%);
  color: #fff7e8;
  background: linear-gradient(135deg, #a9543b, #722f2e);
}

.meditation-capture-tools #camera-toggle:hover,
.meditation-capture-tools #recording-toggle:hover {
  transform: translateY(-1px);
}

.meditation-capture-tools #recording-toggle.is-recording {
  background: linear-gradient(135deg, #c43e37, #7f1f26);
  box-shadow: 0 0 0 5px rgb(199 61 50 / 12%);
}

.meditation-capture-tools .camera-secure-link {
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 12px;
}

html.is-meditating .meditation-scripture-controls {
  grid-template-columns: minmax(210px, 1fr) auto auto;
  gap: 12px;
  margin-top: 8px;
  padding: 12px 14px;
}

.meditation-scripture-controls .meditation-scripture-picker > span,
.export-orientation-field > span {
  color: #f3dca7;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.meditation-scripture-controls select {
  min-height: 42px;
  padding: 9px 12px;
  border-color: rgb(238 211 147 / 36%);
  border-radius: 10px;
  font-size: 12px;
}

.meditation-scripture-controls #meditation-scripture-toggle {
  align-self: end;
  min-width: 126px;
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 650;
  background: linear-gradient(135deg, rgb(151 93 46 / 94%), rgb(104 66 36 / 92%));
}

.export-orientation-step {
  display: flex;
  align-items: end;
  gap: 8px;
}

.export-orientation-step[hidden] {
  display: none !important;
}

.export-orientation-field select {
  min-width: 122px;
}

.export-orientation-step > button {
  min-height: 42px;
  padding-inline: 14px;
  border-radius: 999px;
}

@media (max-width: 820px) {
  html.is-meditating .meditation-panel {
    bottom: max(10px, env(safe-area-inset-bottom));
    width: calc(100vw - 20px);
  }

  html.is-meditating .meditation-capture-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px;
  }

  .meditation-capture-tools .capture-copy {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .meditation-capture-tools #camera-toggle,
  .meditation-capture-tools #recording-toggle {
    min-width: 0;
    width: 100%;
    min-height: 44px;
    padding: 9px 10px;
    font-size: 12px;
  }

  .meditation-capture-tools .camera-secure-link {
    grid-column: 1 / -1;
    text-align: center;
  }

  html.is-meditating .meditation-scripture-controls {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px;
  }

  .meditation-scripture-controls #meditation-scripture-toggle {
    min-width: 104px;
  }

  .export-orientation-step {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .export-orientation-field {
    flex: 1;
  }

  .export-orientation-field select {
    width: 100%;
  }
}

html.recording-clean-mode.is-meditating .meditation-command-head,
html.recording-clean-mode.is-meditating .meditation-capture-tools .capture-copy,
html.recording-clean-mode.is-meditating .meditation-capture-tools #camera-toggle,
html.recording-clean-mode.is-meditating .meditation-scripture-controls,
html.recording-clean-mode.is-meditating .camera-secure-link {
  display: none !important;
}

html.recording-clean-mode.is-meditating .meditation-capture-tools {
  width: max-content;
  margin-inline: auto;
  padding: 8px;
  border-color: rgb(244 188 138 / 48%);
}

html.recording-clean-mode.is-meditating .meditation-capture-tools #recording-toggle {
  min-width: 142px;
}


@media (orientation: portrait) and (max-width: 620px) {
  .hud {
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 0
      max(8px, env(safe-area-inset-left));
  }

  .brand-seal {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }

  .status-row {
    gap: 4px;
  }

  .meditation-duration-card,
  .reader-level-chip,
  .online-pill,
  .round-button {
    min-height: 30px;
    padding: 4px 7px;
    font-size: 10px;
  }

  .round-button {
    width: 30px;
    height: 30px;
  }

  .language-button {
    min-height: 30px;
    padding-inline: 6px;
    font-size: 8px;
  }

  .quest-card {
    top: max(46px, calc(env(safe-area-inset-top) + 42px));
    left: max(8px, env(safe-area-inset-left));
    width: min(216px, 57vw);
  }

  .quest-toggle {
    gap: 6px;
    padding: 7px 9px;
    font-size: 10px;
  }

  .quest-body {
    padding: 8px 10px 10px;
  }

  .quest-card h2 {
    font-size: 15px;
  }

  .quest-card p:not(.eyebrow) {
    margin: 4px 0 7px;
    font-size: 10px;
    line-height: 1.45;
  }

  .temple-actions {
    bottom: max(98px, calc(env(safe-area-inset-bottom) + 98px));
    width: min(82vw, 330px);
    gap: 5px;
  }

  .action-button {
    min-height: 46px;
    gap: 5px;
    padding: 5px;
    border-radius: 9px;
  }

  .action-glyph {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    font-size: 14px;
  }

  .action-copy strong {
    font-size: 11px;
  }

  .interaction-prompt {
    bottom: max(152px, calc(env(safe-area-inset-bottom) + 152px));
    min-height: 38px;
    padding: 6px 10px;
    font-size: 11px;
  }

  .quick-meditate {
    right: max(10px, env(safe-area-inset-right));
    bottom: max(90px, calc(env(safe-area-inset-bottom) + 90px));
    min-height: 44px;
    padding: 6px 9px;
  }

  .quick-meditate-glyph {
    width: 28px;
    height: 28px;
  }

  .quick-meditate-copy small {
    display: none;
  }

  .mobile-controls {
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    left: max(10px, env(safe-area-inset-left));
  }

  .dpad {
    width: 126px;
    height: 126px;
  }

  .dpad-button {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    font-size: 15px;
  }

  .dpad-center {
    width: 24px;
    height: 24px;
  }

  .mobile-action {
    width: 58px;
    height: 58px;
    margin-bottom: 8px;
  }

  .mobile-action span {
    font-size: 19px;
  }

  .mobile-action small {
    margin-top: 2px;
    font-size: 8px;
  }

  .help-toggle {
    right: max(10px, env(safe-area-inset-right));
    bottom: max(83px, calc(env(safe-area-inset-bottom) + 83px));
    width: 30px;
    height: 30px;
  }
}


@media (orientation: portrait) and (max-width: 820px) {
  html.is-meditating .meditation-panel {
    right: auto;
    bottom: max(24px, calc(env(safe-area-inset-bottom) + env(safe-area-inset-bottom)));
    left: max(12px, calc(env(safe-area-inset-left) + env(safe-area-inset-left)));
    width: calc(200vw - 48px);
    zoom: 0.5;
  }

  html.is-meditating .meditation-command-head {
    gap: 6px;
    margin-bottom: 4px;
    padding-inline: 2px;
  }

  html.is-meditating .meditation-command-head > span {
    font-size: 8px;
    letter-spacing: 0.12em;
  }

  html.is-meditating .meditation-command-head button {
    min-height: 28px;
    padding: 4px 9px;
    font-size: 10px;
  }

  html.is-meditating .meditation-capture-tools {
    gap: 5px;
    padding: 6px;
    border-radius: 12px;
  }

  .meditation-capture-tools .capture-copy span {
    font-size: 9px;
  }

  .meditation-capture-tools .capture-copy small {
    font-size: 8px;
    line-height: 1.25;
  }

  .meditation-capture-tools #camera-toggle,
  .meditation-capture-tools #recording-toggle {
    min-height: 34px;
    padding: 5px 6px;
    border-radius: 999px;
    font-size: 10px;
    letter-spacing: 0;
  }

  .meditation-capture-tools .camera-secure-link {
    min-height: 28px;
    padding: 6px 8px;
    font-size: 9px;
  }

  html.is-meditating .meditation-scripture-controls {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px;
    margin-top: 5px;
    padding: 6px;
    border-radius: 12px;
  }

  .meditation-scripture-controls .meditation-scripture-picker > span {
    font-size: 8px;
    letter-spacing: 0.08em;
  }

  .meditation-scripture-controls select {
    min-height: 32px;
    padding: 5px 8px;
    font-size: 10px;
  }

  .meditation-scripture-controls #meditation-scripture-toggle {
    min-width: 0;
    min-height: 32px;
    padding: 5px 8px;
    font-size: 10px;
  }
}

/* Final meditation controls: standalone floating actions, no enclosing information panel. */
html.is-meditating #meditation-capture-bar {
  position: absolute;
  z-index: 78;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 50%;
  display: grid !important;
  width: min(920px, calc(100vw - 32px));
  gap: 10px;
  color: #fff4dc;
  transform: translateX(-50%);
  pointer-events: none;
}

html.is-meditating #meditation-capture-bar[hidden] {
  display: none !important;
}

#meditation-capture-bar > * {
  pointer-events: auto;
}

.meditation-primary-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

#meditation-capture-bar .meditation-primary-action {
  min-width: 172px;
  min-height: 54px;
  padding: 12px 24px;
  border: 1px solid rgb(244 219 161 / 56%);
  border-radius: 999px;
  color: #fff7e8;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow:
    0 14px 34px rgb(0 0 0 / 36%),
    inset 0 1px rgb(255 255 255 / 14%);
  transition:
    transform 150ms ease,
    filter 150ms ease;
}

#meditation-capture-bar #camera-toggle {
  background: linear-gradient(135deg, #a66f31, #70502b);
}

#meditation-capture-bar #recording-toggle {
  border-color: rgb(245 173 150 / 62%);
  background: linear-gradient(135deg, #b9543d, #772f32);
}

#meditation-capture-bar .meditation-primary-action::before {
  display: inline-block;
  margin-right: 8px;
  content: "◉";
  font-size: 12px;
  vertical-align: 1px;
}

#meditation-capture-bar #recording-toggle::before {
  color: #ffd1c4;
  content: "●";
}

#meditation-capture-bar .meditation-primary-action:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

#meditation-capture-bar .meditation-primary-action:disabled {
  opacity: 0.48;
  cursor: default;
  filter: saturate(0.7);
  transform: none;
}

#meditation-capture-bar #recording-toggle.is-recording {
  background: linear-gradient(135deg, #cb3d38, #861f2a);
  box-shadow:
    0 0 0 6px rgb(204 62 53 / 12%),
    0 14px 34px rgb(0 0 0 / 36%);
}

#meditation-capture-bar .meditation-capture-tools {
  display: contents;
}

#meditation-capture-bar .meditation-capture-tools[hidden] {
  display: none;
}

#meditation-capture-bar .camera-secure-link {
  justify-self: center;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid rgb(240 207 139 / 54%);
  border-radius: 999px;
  color: #fff0ce;
  background: rgb(124 73 39 / 88%);
  font-size: 12px;
  text-decoration: none;
  pointer-events: auto;
}

#meditation-capture-bar .meditation-scripture-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(0, auto);
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: default;
  touch-action: auto;
  backdrop-filter: none;
}

#meditation-capture-bar .meditation-scripture-picker,
#meditation-capture-bar .export-orientation-field {
  display: grid;
  min-width: 0;
  min-height: 50px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border: 1px solid rgb(239 211 148 / 34%);
  border-radius: 999px;
  background: rgb(15 31 24 / 88%);
  box-shadow: 0 10px 26px rgb(0 0 0 / 24%);
  backdrop-filter: blur(12px);
}

#meditation-capture-bar .meditation-scripture-picker > span,
#meditation-capture-bar .export-orientation-field > span {
  color: #efd79f;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

#meditation-capture-bar .meditation-scripture-controls select {
  min-width: 0;
  min-height: 36px;
  padding: 6px 28px 6px 8px;
  border: 0;
  color: #fff4df;
  background: transparent;
  font-size: 12px;
}

#meditation-capture-bar #meditation-scripture-toggle {
  min-width: 122px;
  min-height: 50px;
  padding: 9px 18px;
  border: 1px solid rgb(237 201 126 / 46%);
  border-radius: 999px;
  color: #fff3d6;
  background: rgb(137 80 43 / 88%);
  font-size: 13px;
  font-weight: 650;
  box-shadow: 0 10px 26px rgb(0 0 0 / 24%);
  cursor: pointer;
  touch-action: manipulation;
}

#meditation-capture-bar #meditation-scripture-toggle:disabled {
  opacity: 0.42;
  cursor: default;
}

#meditation-capture-bar .export-orientation-step {
  display: flex;
  align-items: center;
  gap: 8px;
}

#meditation-capture-bar .export-orientation-step[hidden] {
  display: none !important;
}

#meditation-capture-bar .export-orientation-field {
  min-width: 178px;
}

#meditation-capture-bar #export-orientation-confirm {
  min-height: 50px;
  padding: 9px 16px;
  border: 1px solid rgb(237 201 126 / 46%);
  border-radius: 999px;
  color: #fff3d6;
  background: rgb(82 67 38 / 88%);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  touch-action: manipulation;
}

.meditation-capture-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  pointer-events: none;
}

#meditation-capture-bar #capture-status {
  overflow: hidden;
  max-width: min(560px, 68vw);
  color: rgb(255 247 229 / 66%);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-align: center;
  text-overflow: ellipsis;
  text-shadow: 0 2px 10px #000;
  white-space: nowrap;
}

#meditation-capture-bar #end-meditation {
  padding: 7px 14px;
  border: 1px solid rgb(255 248 230 / 30%);
  border-radius: 999px;
  color: #fff8e9;
  background: rgb(20 27 23 / 78%);
  font-size: 11px;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}

html.recording-clean-mode.is-meditating #meditation-capture-bar #camera-toggle,
html.recording-clean-mode.is-meditating #meditation-capture-bar .meditation-scripture-controls,
html.recording-clean-mode.is-meditating #meditation-capture-bar #capture-status,
html.recording-clean-mode.is-meditating #meditation-capture-bar .camera-secure-link {
  display: none !important;
}

html.recording-clean-mode.is-meditating #meditation-capture-bar {
  width: max-content;
}

@media (max-width: 820px) {
  html.is-meditating #meditation-capture-bar {
    bottom: max(10px, env(safe-area-inset-bottom));
    width: calc(100vw - 20px);
    gap: 7px;
  }

  .meditation-primary-actions {
    gap: 8px;
  }

  #meditation-capture-bar .meditation-primary-action {
    min-width: 0;
    min-height: 50px;
    flex: 1;
    padding: 10px 12px;
    font-size: 13px;
  }

  #meditation-capture-bar .meditation-scripture-controls {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
  }

  #meditation-capture-bar .meditation-scripture-picker,
  #meditation-capture-bar .export-orientation-field {
    min-height: 44px;
    padding: 4px 9px;
  }

  #meditation-capture-bar .meditation-scripture-picker > span,
  #meditation-capture-bar .export-orientation-field > span {
    font-size: 9px;
  }

  #meditation-capture-bar #meditation-scripture-toggle,
  #meditation-capture-bar #export-orientation-confirm {
    min-width: 0;
    min-height: 44px;
    padding: 7px 10px;
    font-size: 11px;
  }

  #meditation-capture-bar .export-orientation-step {
    grid-column: 1 / -1;
  }

  #meditation-capture-bar .export-orientation-field {
    flex: 1;
  }

  #meditation-capture-bar .camera-secure-link {
    min-height: 38px;
    font-size: 10px;
  }

  .meditation-capture-meta {
    gap: 7px;
  }

  #meditation-capture-bar #capture-status {
    max-width: 68vw;
    font-size: 9px;
  }
}


#quest-card {
  display: none !important;
}

.guestbook-dialog {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: rgba(12, 18, 15, 0.58);
  backdrop-filter: blur(4px);
}

.guestbook-dialog[hidden] {
  display: none;
}

.guestbook-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(520px, 100%);
  max-height: min(720px, 92dvh);
  padding: 26px;
  overflow: hidden;
  color: #27362d;
  background: #eee5d1;
  border: 1px solid rgba(115, 86, 49, 0.46);
  box-shadow: 0 22px 72px rgba(0, 0, 0, 0.35);
}

.guestbook-card h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

.guestbook-card > .eyebrow {
  margin: 0 42px 6px 0;
  color: #746446;
}

.guestbook-list {
  display: grid;
  gap: 10px;
  min-height: 110px;
  margin: 0 0 16px;
  padding: 0 6px 0 0;
  overflow: auto;
  list-style: none;
}

.guestbook-entry {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.45);
  border-left: 2px solid #9c7950;
}

.guestbook-entry p {
  margin: 0 0 6px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.guestbook-entry small {
  color: #746c59;
}

.guestbook-empty {
  align-self: center;
  margin: auto;
  color: #746c59;
  text-align: center;
}

.guestbook-form {
  display: grid;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid rgba(84, 72, 51, 0.2);
}

.guestbook-form label {
  font-size: 14px;
  font-weight: 600;
}

.guestbook-form textarea {
  width: 100%;
  min-height: 76px;
  padding: 10px;
  resize: vertical;
  color: #27362d;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(84, 72, 51, 0.32);
  border-radius: 3px;
  font: inherit;
}

.guestbook-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.guestbook-form-footer span {
  color: #746c59;
  font-size: 12px;
}

.guestbook-form-footer button {
  min-height: 40px;
  padding: 0 16px;
  color: #fff8e8;
  background: #43584b;
  border: 0;
  border-radius: 3px;
  font: inherit;
  cursor: pointer;
}

@media (max-width: 560px) {
  .guestbook-card {
    max-height: 88dvh;
    padding: 20px 16px 16px;
  }
}

#meditation-capture-bar button,
#start-button {
  touch-action: manipulation;
}


@media (orientation: portrait) and (max-width: 820px) {
  html.is-meditating #meditation-capture-bar {
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 50%;
    width: calc(200vw - 40px);
    gap: 14px;
    transform: translateX(-50%) scale(0.5);
    transform-origin: bottom center;
  }

  #meditation-capture-bar .meditation-primary-actions {
    gap: 16px;
  }
}
