:root {
  --ink: #2b1d14;
  --paper: #fff4e2;
  --amber: #f2b45c;
  --ember: #d9672f;
  --shadow: rgba(30, 14, 4, 0.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #2a1a2e;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  color: var(--paper);
  -webkit-font-smoothing: antialiased;
}

#scene {
  position: fixed;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#scene.dragging { cursor: grabbing; }

/* ---------- landmark labels ---------- */
#labels {
  position: fixed;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.label {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -100%);
  opacity: 0;
  transition: opacity 0.6s ease;
  text-align: center;
  white-space: nowrap;
  will-change: transform, opacity;
}
.label.visible { opacity: 1; }
.label span {
  display: inline-block;
  padding: 0.4em 1em 0.45em;
  border-radius: 14px;
  background: rgba(35, 20, 12, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 214, 150, 0.35);
  box-shadow: 0 6px 18px rgba(20, 8, 2, 0.3);
}
.label b {
  display: block;
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0.03em;
}
.label em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
}
.label::after {
  content: "";
  display: block;
  width: 1px;
  height: 18px;
  margin: 0 auto;
  background: linear-gradient(rgba(255, 214, 150, 0.9), rgba(255, 214, 150, 0));
}

/* ---------- HUD ---------- */
body::before {
  content: "";
  position: fixed;
  z-index: 1;
  inset: 0 0 auto 0;
  height: 170px;
  background: linear-gradient(rgba(25, 12, 6, 0.42), rgba(25, 12, 6, 0));
  pointer-events: none;
}

.hud {
  position: fixed;
  z-index: 3;
  top: 22px;
  left: 26px;
  pointer-events: none;
  text-shadow: 0 2px 10px rgba(20, 8, 2, 0.5);
  transition: opacity 0.8s ease;
}
.hud h1 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(22px, 3.4vw, 34px);
  letter-spacing: 0.02em;
}
.hud p {
  margin: 4px 0 0;
  font-style: italic;
  font-size: 15px;
  color: #ffd9a6;
}

.controls {
  position: fixed;
  z-index: 3;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  padding: 9px 16px;
  border-radius: 14px;
  background: rgba(35, 20, 12, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 13px;
  white-space: nowrap;
  transition: opacity 0.8s ease;
  max-width: calc(100vw - 32px);
}
.controls kbd, .fine kbd {
  font-family: inherit;
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid rgba(255, 214, 150, 0.5);
  background: rgba(255, 244, 226, 0.12);
}

.tour-status {
  position: fixed;
  z-index: 3;
  top: 22px;
  right: 26px;
  font-size: 14px;
  color: #ffd9a6;
  text-align: right;
  text-shadow: 0 1px 4px rgba(20, 8, 2, 0.6);
}
.tour-bar {
  margin-top: 6px;
  width: 160px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 244, 226, 0.25);
  overflow: hidden;
}
.tour-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--amber);
}

body.touring .hud,
body.touring .controls { opacity: 0.35; }

/* ---------- start card ---------- */
.start {
  position: fixed;
  z-index: 4;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 50% 40%, rgba(40, 18, 10, 0.25), rgba(20, 8, 4, 0.7));
  transition: opacity 0.9s ease;
  padding: 16px;
}
.start.hidden { opacity: 0; pointer-events: none; }
.start-card {
  max-width: 420px;
  padding: 30px 32px 26px;
  border-radius: 18px;
  background: rgba(38, 20, 12, 0.72);
  border: 1px solid rgba(255, 214, 150, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  text-align: center;
}
.start-card h2 {
  margin: 0 0 8px;
  font-weight: 400;
  font-size: 28px;
}
.start-card p {
  margin: 0 0 16px;
  line-height: 1.5;
  color: #ffe6c2;
}
.start-card .fine {
  font-size: 13px;
  margin: 16px 0 0;
  color: #e8c49a;
}
#enter {
  font: inherit;
  font-size: 17px;
  padding: 11px 26px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  color: var(--ink);
  background: linear-gradient(180deg, #ffd27e, var(--amber));
  box-shadow: 0 6px 20px rgba(242, 180, 92, 0.35);
}
#enter:hover { filter: brightness(1.06); }
#enter:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  .hud { top: 14px; left: 16px; }
  .tour-status { top: 14px; right: 16px; }
  .controls { font-size: 12px; gap: 6px 12px; bottom: 10px; }
  .controls span:nth-child(n+5) { display: none; }
  .label span { font-size: 13px; }
}
