:root {
  color-scheme: light;
  --ink: #171514;
  --muted: #5b5955;
  --paper: rgba(255, 255, 252, 0.82);
  --line: rgba(24, 22, 20, 0.14);
  --accent: #7b3f2d;
  --accent-dark: #48251e;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: #e9e6df;
  color: var(--ink);
}

#gallery {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#gallery:active {
  cursor: grabbing;
}

body:not(.tour-active) .hud,
body:not(.tour-active) .art-panel,
body:not(.tour-active) .start-tour,
body:not(.tour-active) #crosshair,
body:not(.tour-active) #mini-map {
  display: none;
}

.hud,
.art-panel,
.start-tour,
.loading,
.screen {
  position: fixed;
  z-index: 5;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  box-shadow: 0 20px 70px rgba(24, 22, 20, 0.12);
}

.hud {
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 14px;
  background: var(--paper);
}

.screen {
  left: 50%;
  top: 50%;
  width: min(520px, calc(100vw - 32px));
  padding: 28px;
  background: rgba(255, 255, 252, 0.92);
  transform: translate(-50%, -50%);
}

.home-screen h1 {
  margin-bottom: 12px;
  font-size: clamp(2.4rem, 8vw, 4.8rem);
}

.screen p {
  max-width: 420px;
  font-size: 1rem;
}

.screen button {
  min-height: 46px;
  margin-top: 22px;
  padding: 0 22px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.screen button:hover {
  background: var(--accent-dark);
}

.instruction-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 24px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

.instruction-grid strong {
  color: var(--ink);
  text-align: right;
}

.top-left {
  top: 16px;
  left: 16px;
  max-width: min(300px, calc(100vw - 32px));
}

.top-right {
  top: 16px;
  right: 16px;
  width: 230px;
  display: grid;
  gap: 6px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: "Playfair Display", Georgia, serif;
  letter-spacing: 0;
}

h1 {
  margin: 0 0 6px;
  font-size: clamp(1.45rem, 3vw, 2.45rem);
  line-height: 0.95;
}

h2 {
  margin: 0 0 10px;
  font-size: 1.7rem;
  line-height: 1.05;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
  font-size: 0.9rem;
}

.control-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 0.78rem;
  color: var(--muted);
}

.control-row strong {
  color: var(--ink);
  font-weight: 700;
}

.art-panel {
  right: 24px;
  bottom: 24px;
  width: min(390px, calc(100vw - 32px));
  padding: 22px;
  background: rgba(255, 255, 252, 0.9);
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.art-panel.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.art-panel button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: 700 1rem Inter, sans-serif;
  cursor: pointer;
}

.art-panel a,
.start-tour {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 18px;
  padding: 0 18px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.art-panel a:hover,
.start-tour:hover {
  background: var(--accent-dark);
}

.start-tour {
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  font-size: 0.98rem;
}

.loading {
  left: 50%;
  top: 50%;
  padding: 14px 18px;
  background: var(--paper);
  transform: translate(-50%, -50%);
  color: var(--muted);
}

.loading.hidden,
.start-tour.hidden,
.screen.hidden {
  display: none;
}

#crosshair {
  position: fixed;
  z-index: 4;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(20, 18, 16, 0.45);
  transform: translate(-50%, -50%) rotate(45deg);
  pointer-events: none;
}

#mini-map {
  position: fixed;
  z-index: 4;
  left: 16px;
  bottom: 16px;
  width: 220px;
  height: 170px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 252, 0.86);
  box-shadow: 0 16px 50px rgba(24, 22, 20, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

@media (max-width: 760px) {
  .top-right {
    display: none;
  }

  .top-left {
    left: 16px;
    top: 16px;
  }

  .hud {
    padding: 14px 16px;
  }

  .hud p {
    display: none;
  }

  #mini-map {
    width: 150px;
    height: 116px;
  }
}
