:root {
  --ink: #f5efe4;
  --ink-dim: rgba(245, 239, 228, 0.68);
  --panel: rgba(18, 28, 23, 0.74);
  --panel-solid: #16231c;
  --line: rgba(214, 186, 132, 0.28);
  --gold: #d2b07a;
  --gold-hi: #f0d9a8;
  --gold-deep: #9c7a45;
  --sage: #9db3a1;
  --taken: #c9786a;
  --free: #9dc7a5;
  --mine: #e9c98d;
  --radius: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font-ui: 'Vazirmatn', 'Jost', system-ui, sans-serif;
  --font-brand: 'Cormorant Garamond', 'Times New Roman', serif;
}
html[lang='en'] {
  --font-ui: 'Jost', 'Vazirmatn', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  height: 100%;
  background: #0f1713;
  color: var(--ink);
  font-family: var(--font-ui);
  overflow: hidden;
  overscroll-behavior: none;
}
#app {
  position: fixed;
  inset: 0;
  height: 100dvh;
}
#view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline: none;
  cursor: grab;
}
#view.dragging {
  cursor: grabbing;
}
#view.pointer {
  cursor: pointer;
}
.hidden {
  display: none !important;
}
button {
  font: inherit;
  color: inherit;
}

/* ---------------- loader */
.screen {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 50;
  background: radial-gradient(120% 90% at 50% 10%, #26382d 0%, #111a15 55%, #0b110e 100%);
  transition:
    opacity 0.9s ease,
    visibility 0.9s;
}
.screen.gone {
  opacity: 0;
  visibility: hidden;
}
.loader-card {
  width: min(440px, calc(100vw - 32px));
  text-align: center;
  padding: 40px 28px 30px;
}
.brand-mark {
  font-family: var(--font-brand);
  font-weight: 500;
  font-size: clamp(54px, 13vw, 84px);
  letter-spacing: 0.28em;
  margin-inline-start: 0.28em;
  color: var(--gold-hi);
  background: linear-gradient(180deg, #f6e4bd 0%, #d2b07a 55%, #a88350 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  direction: ltr;
}
.brand-sub {
  font-family: 'Jost', sans-serif;
  letter-spacing: 0.5em;
  font-size: 11px;
  color: var(--ink-dim);
  margin-top: 4px;
  direction: ltr;
}
.loader-lead {
  color: var(--ink-dim);
  line-height: 1.9;
  font-size: 14.5px;
  margin: 22px 0 26px;
}
.progress {
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-hi));
  transition: width 0.3s ease;
}
.progress-label {
  font-size: 12px;
  color: var(--ink-dim);
  margin: 10px 0 24px;
}
.loader-tips {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
  font-size: 12.5px;
  color: var(--ink-dim);
  line-height: 1.8;
}

.btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  padding: 12px 22px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14.5px;
  transition:
    transform 0.15s,
    background 0.2s,
    opacity 0.2s;
  min-height: 44px;
}
.btn:hover {
  background: rgba(255, 255, 255, 0.09);
}
.btn:active {
  transform: scale(0.97);
}
.btn.gold {
  background: linear-gradient(180deg, #e8cf9c, #c39d62);
  color: #1c1a12;
  border-color: transparent;
  font-weight: 500;
  box-shadow:
    0 8px 26px rgba(201, 164, 106, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn.gold:hover {
  background: linear-gradient(180deg, #f0d9ab, #cca76c);
}
.btn:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
}
.btn.ghost {
  background: transparent;
}
#enterBtn {
  min-width: 220px;
  font-size: 16px;
  padding: 14px 30px;
}

/* ---------------- hud */
.hud {
  position: absolute;
  z-index: 10;
}
#topbar {
  top: calc(12px + var(--safe-t));
  inset-inline: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}
.tb-brand {
  pointer-events: auto;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
}
.tb-brand b {
  font-family: var(--font-brand);
  font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--gold-hi);
  font-size: 17px;
  direction: ltr;
}
.tb-brand span {
  font-size: 12px;
  color: var(--ink-dim);
}
.tb-actions {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 500;
}
.icon-btn:hover {
  border-color: var(--gold);
}

#minimap {
  top: calc(66px + var(--safe-t));
  inset-inline-end: 16px;
  padding: 10px 10px 8px;
  border-radius: 16px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
}
#minimapCanvas {
  display: block;
  width: 180px;
  height: 164px;
  cursor: pointer;
}
.mm-legend {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 10.5px;
  color: var(--ink-dim);
  margin-top: 6px;
  padding: 0 2px;
}
.mm-legend span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.mm-legend em {
  font-style: normal;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.dot.free {
  background: var(--free);
}
.dot.taken {
  background: var(--taken);
}
.dot.mine {
  background: var(--mine);
  box-shadow: 0 0 8px var(--mine);
}

#hint {
  bottom: calc(24px + var(--safe-b));
  left: 50%;
  transform: translateX(-50%);
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  font-size: 13.5px;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.3s;
  pointer-events: none;
}
#hint.pulse {
  border-color: var(--gold);
  box-shadow: 0 0 0 0 rgba(210, 176, 122, 0.5);
  animation: hintPulse 1.8s infinite;
}
@keyframes hintPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(210, 176, 122, 0.45);
  }
  100% {
    box-shadow: 0 0 0 14px rgba(210, 176, 122, 0);
  }
}

#toast {
  position: absolute;
  z-index: 40;
  top: calc(70px + var(--safe-t));
  left: 50%;
  transform: translate(-50%, -12px);
  opacity: 0;
  pointer-events: none;
  padding: 11px 18px;
  border-radius: 14px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  font-size: 13.5px;
  transition:
    opacity 0.25s,
    transform 0.25s;
  max-width: calc(100vw - 32px);
  text-align: center;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------------- labels */
#labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}
.tlabel {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  background: rgba(18, 28, 23, 0.66);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(214, 186, 132, 0.32);
  font-size: 12px;
  white-space: nowrap;
  will-change: transform, opacity;
  transition:
    border-color 0.2s,
    background 0.2s;
  direction: inherit;
}
.tlabel .num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-brand);
  font-size: 14px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
}
.tlabel .st::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-inline-end: 6px;
  background: var(--free);
  vertical-align: 1px;
}
.tlabel.taken .st::before {
  background: var(--taken);
}
.tlabel.mine .st::before {
  background: var(--mine);
  box-shadow: 0 0 6px var(--mine);
}
.tlabel.mine {
  border-color: var(--gold);
}
.tlabel:hover,
.tlabel.hover {
  background: rgba(30, 44, 36, 0.9);
  border-color: var(--gold);
}
.tlabel.sign-tip {
  padding: 8px 14px;
  gap: 8px;
  background: linear-gradient(180deg, rgba(232, 207, 156, 0.95), rgba(195, 157, 98, 0.95));
  color: #1c1a12;
  border-color: transparent;
  font-weight: 500;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.25);
  animation: tipBob 2.2s ease-in-out infinite;
}
.tlabel.sign-tip::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 12px;
  height: 12px;
  transform: translateX(-50%) rotate(45deg);
  background: #c9a26a;
  z-index: -1;
}
@keyframes tipBob {
  0%,
  100% {
    margin-top: 0;
  }
  50% {
    margin-top: -5px;
  }
}

/* ---------------- joystick */
#joy {
  position: absolute;
  z-index: 9;
  width: 124px;
  height: 124px;
  border-radius: 50%;
  margin: -62px 0 0 -62px;
  border: 1.5px solid rgba(240, 217, 168, 0.5);
  background: radial-gradient(circle, rgba(18, 28, 23, 0.2), rgba(18, 28, 23, 0.55));
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: none;
  color: rgba(240, 217, 168, 0.75);
  transform: scale(1);
  opacity: 1;
  transition:
    transform 0.22s cubic-bezier(0.2, 1.3, 0.4, 1),
    opacity 0.2s,
    left 0.14s ease-out,
    top 0.14s ease-out;
}
#joy.rest {
  transform: scale(0.62);
  opacity: 0.82;
}
#joy.active {
  transition:
    transform 0.22s cubic-bezier(0.2, 1.3, 0.4, 1),
    opacity 0.2s;
}
#joy.idle {
  animation: joyGlow 2.4s ease-in-out infinite;
}
#joy.idle #joyKnob {
  animation: joyNudge 2.4s ease-in-out infinite;
}
@keyframes joyGlow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(210, 176, 122, 0);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(210, 176, 122, 0.18);
  }
}
@keyframes joyNudge {
  0%,
  100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(0, -14px);
  }
  50% {
    transform: translate(0, 0);
  }
  75% {
    transform: translate(12px, 0);
  }
}
.joy-arrows {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#joyKnob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f3dfb4, #c39d62 70%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* language picker on the welcome screen */
.lang-pick {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}
.lang-pick button {
  border: 0;
  background: transparent;
  padding: 8px 20px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-dim);
  min-height: 38px;
  transition:
    background 0.2s,
    color 0.2s;
}
.lang-pick button[lang='fa'] {
  font-family: 'Vazirmatn', sans-serif;
}
.lang-pick button[lang='en'] {
  font-family: 'Jost', sans-serif;
  letter-spacing: 0.04em;
}
.lang-pick button.on {
  background: linear-gradient(180deg, #e8cf9c, #c39d62);
  color: #1c1a12;
  font-weight: 500;
}

/* ---------------- sheets */
.sheet-wrap {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(6, 10, 8, 0.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
}
.sheet {
  position: relative;
  width: min(560px, calc(100vw - 24px));
  max-height: min(88dvh, 820px);
  overflow: auto;
  background: linear-gradient(180deg, rgba(27, 40, 33, 0.97), rgba(19, 29, 24, 0.98));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 26px 24px 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  animation: sheetIn 0.35s cubic-bezier(0.2, 0.9, 0.25, 1.1);
  scrollbar-width: thin;
  scrollbar-color: rgba(214, 186, 132, 0.35) transparent;
}
.sheet.small {
  width: min(420px, calc(100vw - 24px));
}
@keyframes sheetIn {
  from {
    transform: translateY(18px) scale(0.98);
    opacity: 0;
  }
}
.sheet h2 {
  font-family: var(--font-brand);
  font-weight: 500;
  font-size: 30px;
  margin: 4px 0 4px;
  color: var(--gold-hi);
}
html[lang='fa'] .sheet h2 {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 22px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
}
html[lang='fa'] .eyebrow {
  letter-spacing: 0.05em;
  font-size: 12px;
}
.muted {
  color: var(--ink-dim);
  font-size: 13px;
  line-height: 1.8;
}
.close {
  position: absolute;
  top: 12px;
  inset-inline-end: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}
.sheet-head {
  margin-bottom: 14px;
  padding-inline-end: 34px;
}
.field {
  margin: 16px 0;
}
.field > label,
.field .slot-cap,
.field.two label {
  display: block;
  font-size: 12.5px;
  color: var(--ink-dim);
  margin-bottom: 8px;
}
.field.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.field.row > label {
  margin: 0;
}
.field.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.chips {
  display: flex;
  gap: 8px;
}
.chips.wrap {
  flex-wrap: wrap;
}
.chips.scroll {
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.chips.scroll::-webkit-scrollbar {
  display: none;
}
.chip {
  flex: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
  scroll-snap-align: start;
  min-height: 38px;
}
.chip:hover:not(:disabled) {
  border-color: var(--gold);
}
.chip.on {
  background: linear-gradient(180deg, #e8cf9c, #c39d62);
  color: #1c1a12;
  border-color: transparent;
  font-weight: 500;
}
.chip:disabled {
  opacity: 0.3;
  text-decoration: line-through;
  cursor: not-allowed;
}
.chip.date {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 66px;
  padding: 8px 10px;
  gap: 2px;
}
.chip.date small {
  font-size: 11px;
  opacity: 0.75;
}
.chip.date b {
  font-size: 18px;
  font-weight: 500;
}
.slot-group {
  margin-bottom: 10px;
}
.slot-group .chip {
  min-width: 64px;
  text-align: center;
  direction: ltr;
}
.stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}
.stepper button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  font-size: 18px;
}
.stepper output {
  min-width: 34px;
  text-align: center;
  font-size: 16px;
}
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
  color: var(--ink);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}
input:focus,
textarea:focus {
  border-color: var(--gold);
}
textarea {
  resize: none;
}
.form-error {
  color: #f0a796;
  font-size: 13px;
  min-height: 18px;
  margin: 4px 0;
}
.sheet-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 8px;
}
.sheet-actions .btn.gold {
  min-width: 150px;
}
#bkDone {
  text-align: center;
}
.done-seal {
  width: 64px;
  height: 64px;
  margin: 6px auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 28px;
  color: #1c1a12;
  background: radial-gradient(circle at 35% 30%, #f6e4bd, #c39d62 70%);
  box-shadow: 0 10px 30px rgba(201, 164, 106, 0.35);
  animation: seal 0.6s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes seal {
  from {
    transform: scale(0.3) rotate(-30deg);
    opacity: 0;
  }
}
#doneList {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  text-align: start;
  margin: 18px auto;
  max-width: 360px;
  font-size: 14px;
}
#doneList dt {
  color: var(--ink-dim);
}
#doneList dd {
  margin: 0;
}
#bkDone .sheet-actions {
  justify-content: center;
}
.help-grid {
  display: grid;
  gap: 12px;
  margin: 16px 0;
  font-size: 14px;
}
.help-grid > div {
  display: flex;
  align-items: center;
  gap: 8px;
}
kbd {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 7px;
  font-family: 'Jost', sans-serif;
  font-size: 12px;
}
.pill {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--gold);
}

/* ---------------- camera menu, drone, cinema */
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
  font-size: 13px;
}
#tourBtn {
  background: linear-gradient(180deg, rgba(232, 207, 156, 0.95), rgba(195, 157, 98, 0.95));
  color: #1c1a12;
  border-color: transparent;
  font-weight: 500;
}
#camMenu {
  top: calc(62px + var(--safe-t));
  inset-inline-end: 16px;
  width: 280px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(16, 25, 20, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  z-index: 20;
  animation: fadeIn 0.18s ease;
}
#camMenu .cm-title {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--gold);
  padding: 6px 10px 8px;
  text-transform: uppercase;
}
#camMenu button {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: start;
  padding: 10px;
  border: 0;
  background: transparent;
  border-radius: 12px;
  cursor: pointer;
}
#camMenu button:hover,
#camMenu button.on {
  background: rgba(255, 255, 255, 0.07);
}
#camMenu button.on b {
  color: var(--gold-hi);
}
#camMenu i {
  font-style: normal;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(214, 186, 132, 0.12);
  color: var(--gold-hi);
  flex: none;
}
#camMenu b {
  display: block;
  font-weight: 500;
  font-size: 14px;
}
#camMenu small {
  display: block;
  color: var(--ink-dim);
  font-size: 11.5px;
  margin-top: 2px;
  line-height: 1.5;
}
#camMenu .cm-sep {
  height: 1px;
  background: var(--line);
  margin: 6px 10px;
}
#flyPad {
  inset-inline: auto;
  right: 16px;
  bottom: calc(240px + var(--safe-b));
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#flyPad button {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(240, 217, 168, 0.5);
  background: rgba(18, 28, 23, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--gold-hi);
  font-size: 18px;
  touch-action: none;
}
#flyPad button.down {
  background: rgba(195, 157, 98, 0.6);
  color: #1c1a12;
}
#landBtn {
  top: calc(66px + var(--safe-t));
  left: 50%;
  transform: translateX(-50%);
}
#cine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 25;
}
#cine .bar {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  background: #070a08;
  transition: height 0.9s cubic-bezier(0.6, 0, 0.2, 1);
}
#cine .bar.top {
  top: 0;
}
#cine .bar.bottom {
  bottom: 0;
}
/* no letterbox bars */
#caption {
  position: absolute;
  inset-inline-start: 5vw;
  bottom: calc(80px + var(--safe-b));
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.8s,
    transform 0.8s;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}
#caption.show {
  opacity: 1;
  transform: none;
}
#caption b {
  display: block;
  font-family: var(--font-brand);
  font-weight: 500;
  font-size: clamp(26px, 4vw, 46px);
  letter-spacing: 0.12em;
  color: var(--gold-hi);
}
html[lang='fa'] #caption b {
  font-family: var(--font-ui);
  letter-spacing: 0;
}
#caption span {
  display: block;
  margin-top: 4px;
  font-size: clamp(12px, 1.4vw, 15px);
  color: rgba(245, 239, 228, 0.85);
  letter-spacing: 0.06em;
}
.cine-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  opacity: 0;
  transition: opacity 0.6s;
}
.cine-progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-hi));
  transform-origin: left;
  transform: scaleX(0);
}
body.cinema .cine-progress {
  opacity: 0.8;
}
#stopBtn {
  position: absolute;
  z-index: 26;
  left: 50%;
  bottom: calc(22px + var(--safe-b));
  transform: translateX(-50%);
  display: none;
  background: rgba(18, 28, 23, 0.8);
}
body.cinema #stopBtn {
  display: inline-flex;
}
body.cinema #topbar,
body.cinema #minimap,
body.cinema #hint,
body.cinema #labels,
body.cinema #joy,
body.cinema #camMenu,
body.cinema #flyPad,
body.cinema #landBtn {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}
@media (max-width: 760px) {
  .pill-btn {
    height: 38px;
    padding: 0 12px;
  }
  #tourBtn span {
    display: none;
  }
  #camMenu {
    inset-inline: 12px;
    width: auto;
  }
  #caption {
    bottom: calc(76px + var(--safe-b));
  }
}

/* device-specific */
body.touch .only-desktop,
body:not(.touch) .only-touch {
  display: none !important;
}

@media (max-width: 760px) {
  #topbar {
    inset-inline: 12px;
  }
  .tb-brand span {
    display: none;
  }
  /* keep the left side free for the joystick, whatever the text direction */
  #minimap {
    top: auto;
    bottom: calc(86px + var(--safe-b));
    inset-inline: auto;
    right: 12px;
    padding: 8px;
  }
  #minimapCanvas {
    width: 128px;
    height: 116px;
  }
  .mm-legend {
    display: none;
  }
  #hint {
    bottom: calc(18px + var(--safe-b));
    font-size: 12.5px;
    padding: 10px 16px;
  }
  .sheet-wrap {
    place-items: end center;
  }
  .sheet {
    width: 100vw;
    max-height: 90dvh;
    border-radius: 24px 24px 0 0;
    padding: 22px 18px calc(18px + var(--safe-b));
    animation: sheetUp 0.38s cubic-bezier(0.2, 0.9, 0.25, 1);
  }
  @keyframes sheetUp {
    from {
      transform: translateY(40%);
      opacity: 0.3;
    }
  }
  .sheet.small {
    width: 100vw;
  }
  .field.two {
    grid-template-columns: 1fr;
  }
  .sheet-actions .btn {
    flex: 1;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  #minimap {
    top: calc(62px + var(--safe-t));
    bottom: auto;
    inset-inline: auto;
    right: 12px;
  }
  #minimapCanvas {
    width: 110px;
    height: 100px;
  }
  .sheet-wrap {
    place-items: center;
  }
  .sheet {
    border-radius: 20px;
    max-height: 94dvh;
    width: min(620px, 94vw);
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
.noscript {
  padding: 40px;
  text-align: center;
}
