/* style.css — Galeria Gzowo. Atmospheric wood-museum UI overlays. */

:root {
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --gold: #c8a45c;
  --ink: #ece6db;
  --bg: #000;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  overflow: hidden;
}

canvas { display: block; position: fixed; inset: 0; }
.hidden { display: none !important; }

#map-canvas { z-index: 1; }
#world-canvas { z-index: 1; }

/* ---------------- L1 Loading screen (G2: MODERN MINIMAL) ----------------
   Flat near-black, clean sans-serif, generous negative space. No gothic
   serif / gold ornament / radial glow. A single hairline progress bar. */
#loading-screen {
  position: fixed; inset: 0; z-index: 80;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #000;
  transition: opacity 0.5s ease;
}
#loading-screen.fade-out { opacity: 0; pointer-events: none; }
#loading-title {
  font-family: var(--sans); font-weight: 300;
  font-size: clamp(26px, 5vw, 52px); line-height: 1.05; color: #f2f2f4;
  letter-spacing: 0.04em;
}
#loading-sub {
  margin-top: 22px; font-size: 11px; letter-spacing: 0.34em; text-transform: uppercase;
  color: #6a6a70; font-weight: 400;
}
#loading-bar {
  margin-top: 30px; width: min(280px, 64vw); height: 1px;
  background: rgba(255,255,255,0.12); border-radius: 0; overflow: hidden;
}
#loading-bar-fill {
  height: 100%; width: 0%; background: #f2f2f4;
  box-shadow: none; transition: width 0.25s ease;
}
#loading-pct {
  margin-top: 16px; font-family: var(--sans); font-size: 11px;
  letter-spacing: 0.28em; color: #6a6a70; font-weight: 400;
}

/* ---------------- Dedication (G2: MODERN MINIMAL) ----------------
   Lots of room to breathe, light heading, restrained body, one quiet
   outlined button. No serif, no gold, no glow, no ornamental frame. */
#dedication {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 8vh 40px;
  background: #000;
  transition: opacity 0.6s ease;
}
#dedication.fade-out { opacity: 0; }
#ded-heading {
  font-family: var(--sans); font-weight: 200;
  font-size: clamp(40px, 8vw, 86px); line-height: 1.04;
  letter-spacing: 0.01em; color: #f2f2f4;
  text-shadow: none;
}
#ded-body {
  max-width: 560px; margin: 30px auto 48px;
  font-size: clamp(14px, 1.8vw, 17px); line-height: 1.75;
  color: #8e8e96; font-weight: 300;
}
#ded-button {
  font-family: var(--sans); font-weight: 400;
  font-size: 14px; letter-spacing: 0.16em; text-transform: uppercase;
  color: #f2f2f4; background: none;
  border: 1px solid rgba(255,255,255,0.3); padding: 15px 46px; border-radius: 0; cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  box-shadow: none;
}
#ded-button:hover { transform: none; background: #f2f2f4; color: #000; border-color: #f2f2f4; box-shadow: none; }
#ded-mp {
  margin-top: 30px; background: none; border: none; cursor: pointer;
  color: #6a6a70; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  text-decoration: none; font-weight: 400;
  transition: color 0.18s ease;
}
#ded-mp:hover { color: #f2f2f4; }

/* ---------------- Map pill ---------------- */
#map-pill {
  position: fixed; z-index: 30; pointer-events: none;
  min-width: 190px; max-width: 280px;
  background: rgba(26,20,14,0.94); border: 1px solid rgba(200,164,92,0.45);
  border-radius: 8px; padding: 12px 15px;
  backdrop-filter: blur(8px);
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), inset 0 1px 0 rgba(200,164,92,0.15);
}
#map-pill.show { opacity: 1; transform: translateY(0); }
.pill-title { font-family: var(--serif); font-size: 24px; line-height: 1.1; color: var(--ink); }
.pill-desc { font-size: 13px; color: #b9a890; margin: 6px 0 8px; line-height: 1.4; }
.pill-count { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }

/* ---------------- Map section tabs ---------------- */
#map-tabs {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 25;
  display: flex; gap: 6px; padding: 5px;
  background: rgba(20,18,24,0.78); border: 1px solid rgba(200,164,92,0.28);
  border-radius: 30px; backdrop-filter: blur(8px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
.map-tab {
  font-family: var(--sans); font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase;
  color: #b3aca0; background: none; border: none; cursor: pointer;
  padding: 9px 26px; border-radius: 24px; transition: background 0.16s, color 0.16s;
}
.map-tab:hover { color: var(--ink); }
.map-tab.active { background: var(--gold); color: #1a140c; }

/* ---------------- HUD ---------------- */
#hud { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
#crosshair {
  position: fixed; left: 50%; top: 50%; width: 6px; height: 6px;
  margin: -3px 0 0 -3px; border-radius: 50%;
  background: rgba(255,255,255,0.6); box-shadow: 0 0 6px rgba(0,0,0,0.7);
}
#view-prompt, #animal-prompt {
  position: fixed; left: 50%; top: calc(50% + 24px); transform: translateX(-50%);
  font-size: 13px; letter-spacing: 0.1em; color: var(--ink);
  background: rgba(0,0,0,0.5); padding: 4px 12px; border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.18);
}
#animal-prompt { white-space: nowrap; }

.hud-cluster {
  position: fixed; top: 18px; right: 18px; z-index: 22;
  display: flex; gap: 10px; align-items: center; pointer-events: auto;
}
.hud-btn {
  font-family: var(--sans); font-size: 13px; letter-spacing: 0.06em;
  color: var(--ink); background: rgba(20,18,24,0.8);
  border: 1px solid rgba(255,255,255,0.18); border-radius: 6px;
  padding: 8px 14px; cursor: pointer; backdrop-filter: blur(6px);
  transition: background 0.15s, border-color 0.15s;
}
.hud-btn:hover { background: rgba(40,36,46,0.9); border-color: var(--gold); }
.hud-btn.muted { color: #8a8276; }
#mp-info {
  font-size: 12px; color: var(--gold); letter-spacing: 0.05em;
  background: rgba(20,18,24,0.8); border: 1px solid rgba(200,164,92,0.3);
  border-radius: 6px; padding: 8px 12px; backdrop-filter: blur(6px);
}

/* mute button is also visible on the map (top-left) */
#mute-btn { position: relative; }

/* ---------------- Room banner ---------------- */
#room-banner {
  position: fixed; left: 0; right: 0; top: 64px; z-index: 21;
  text-align: center; pointer-events: none;
  opacity: 0; transform: translateY(-18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
#room-banner.show { opacity: 1; transform: translateY(0); }
#banner-title {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(34px, 6vw, 64px); line-height: 1;
  color: var(--ink); text-shadow: 0 4px 30px rgba(0,0,0,0.8);
  letter-spacing: 0.02em;
}
#banner-desc {
  margin-top: 10px; font-size: clamp(14px, 2vw, 18px); font-weight: 300;
  color: #c9c2b6; text-shadow: 0 2px 14px rgba(0,0,0,0.9);
  max-width: 640px; margin-left: auto; margin-right: auto;
}

/* ---------------- Image panel ---------------- */
#image-panel {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center; padding: 40px;
  background: rgba(4,4,6,0.82); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.22s ease;
}
#image-panel.show { opacity: 1; }
.panel-card {
  display: flex; gap: 0;
  width: min(1100px, 92vw); max-width: 92vw; max-height: 88vh;
  background: #14121a; border: 1px solid rgba(200,164,92,0.3);
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,0.7);
  transform: scale(0.96); transition: transform 0.22s ease;
}
#image-panel.show .panel-card { transform: scale(1); }
/* image column: flexible, never pushes the info column out. The <img> fits
   inside via object-fit, so any aspect (tall/wide) shows whole, never stretched. */
.panel-media {
  flex: 1 1 auto; min-width: 0; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  background: #000; padding: 0;
}
#panel-img {
  display: block; max-width: 100%; max-height: 88vh;
  width: auto; height: auto; object-fit: contain;
}
/* info column: fixed-ish width, scrolls internally so long titles/descriptions
   are never clipped. */
.panel-info {
  flex: 0 0 320px; width: 320px; max-width: 38vw;
  padding: 30px 28px; overflow-y: auto; min-height: 0;
}
#panel-title { font-family: var(--serif); font-size: 34px; line-height: 1.12; color: var(--ink); margin-bottom: 14px; overflow-wrap: anywhere; }
#panel-desc { font-size: 15px; line-height: 1.6; color: #c0b9ad; font-weight: 300; overflow-wrap: anywhere; white-space: pre-wrap; }
#panel-meta { margin-top: 22px; display: flex; flex-direction: column; gap: 8px; }
.meta-row { font-size: 13px; color: #9a9286; }
.meta-row b { color: var(--gold); font-weight: 600; margin-right: 8px; letter-spacing: 0.05em; }
#panel-close {
  position: absolute; top: 20px; right: 24px; z-index: 41;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(20,18,24,0.85); border: 1px solid rgba(255,255,255,0.2);
  color: var(--ink); font-size: 22px; cursor: pointer; line-height: 1;
}
#panel-close:hover { background: rgba(60,50,40,0.9); border-color: var(--gold); }

/* Portrait / narrow viewports: stack image over text so a tall photo and the
   full title+description both stay visible (no side column squeeze, no clip). */
@media (max-width: 820px), (max-aspect-ratio: 1/1) {
  .panel-card { flex-direction: column; width: 94vw; max-height: 90vh; }
  .panel-media { flex: 1 1 auto; }
  #panel-img { max-height: 56vh; max-width: 100%; }
  .panel-info {
    flex: 0 0 auto; width: 100%; max-width: 100%;
    max-height: 34vh; padding: 22px 22px;
    border-top: 1px solid rgba(200,164,92,0.18);
  }
  #panel-title { font-size: 27px; }
}

/* ---------------- Lock prompt ---------------- */
#lock-prompt {
  position: fixed; left: 50%; bottom: 56px; transform: translateX(-50%); z-index: 23;
  font-size: 14px; letter-spacing: 0.08em; color: var(--ink);
  background: rgba(10,9,14,0.8); padding: 10px 22px; border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.18); pointer-events: none;
}

/* ---------------- Toasts ---------------- */
#toasts {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.toast {
  background: rgba(20,18,24,0.95); color: var(--ink);
  border: 1px solid rgba(200,164,92,0.35); border-radius: 8px;
  padding: 10px 18px; font-size: 14px;
  opacity: 0; transform: translateY(10px); transition: opacity 0.3s, transform 0.3s;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ---------------- MP menu (MODERN MINIMAL — matches the dedication screen) ----
   Flat black, white text, DM Sans, hairline borders, square outlined buttons.
   No serif, no gold, no rounded card, no glow. Same visual family as #dedication. */
#mp-menu {
  position: fixed; inset: 0; z-index: 55;
  display: flex; align-items: center; justify-content: center; padding: 30px;
  background: #000;
}
#mp-menu-body {
  width: 420px; max-width: 100%; max-height: 90vh; overflow-y: auto;
  background: #000; border: 1px solid rgba(255,255,255,0.12);
  border-radius: 0; padding: 40px 38px;
}
#mp-menu-body h2 {
  font-family: var(--sans); font-weight: 200; font-size: clamp(28px, 4vw, 40px);
  letter-spacing: 0.01em; margin-bottom: 28px; color: #f2f2f4;
}
#mp-menu-body hr { border: none; border-top: 1px solid rgba(255,255,255,0.12); margin: 26px 0; }
.fld { display: block; margin-bottom: 20px; }
.fld > span {
  display: block; font-family: var(--sans); font-size: 11px; letter-spacing: 0.2em;
  text-transform: uppercase; color: #6a6a70; margin-bottom: 10px;
}
.fld input[type=text] {
  width: 100%; padding: 12px 14px; font-family: var(--sans); font-size: 15px;
  background: #000; border: 1px solid rgba(255,255,255,0.2); border-radius: 0; color: #f2f2f4;
}
.fld input[type=text]:focus { outline: none; border-color: rgba(255,255,255,0.5); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.swatch.active { border-color: #f2f2f4; transform: scale(1.12); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 8px 16px; font-family: var(--sans); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; border-radius: 0; cursor: pointer;
  background: none; border: 1px solid rgba(255,255,255,0.2); color: #9a9aa0;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.chip:hover { color: #f2f2f4; border-color: rgba(255,255,255,0.4); }
.chip.active { background: #f2f2f4; color: #000; border-color: #f2f2f4; }
.btn-primary {
  width: 100%; padding: 15px; font-family: var(--sans); font-weight: 400; font-size: 14px;
  letter-spacing: 0.16em; text-transform: uppercase;
  background: none; color: #f2f2f4; border: 1px solid rgba(255,255,255,0.3);
  border-radius: 0; cursor: pointer; margin-bottom: 14px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn-primary:hover { background: #f2f2f4; color: #000; border-color: #f2f2f4; }
.join-row { display: flex; gap: 10px; margin-bottom: 14px; }
.join-row input {
  flex: 1; padding: 12px 14px; background: #000; border: 1px solid rgba(255,255,255,0.2);
  border-radius: 0; color: #f2f2f4; text-transform: uppercase; letter-spacing: 0.2em;
  font-family: var(--sans);
}
.join-row input:focus { outline: none; border-color: rgba(255,255,255,0.5); }
.btn {
  padding: 12px 20px; font-family: var(--sans); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; background: none; color: #f2f2f4;
  border: 1px solid rgba(255,255,255,0.3); border-radius: 0; cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn:hover { background: #f2f2f4; color: #000; border-color: #f2f2f4; }
.btn-ghost {
  width: 100%; padding: 12px; background: none; border: none; color: #6a6a70; cursor: pointer;
  font-family: var(--sans); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  transition: color 0.18s ease;
}
.btn-ghost:hover { color: #f2f2f4; }

/* MB1 LOBBY (ready-up) — same MODERN MINIMAL family as the dedication screen. */
#mp-lobby {
  position: fixed; inset: 0; z-index: 56;
  display: flex; align-items: center; justify-content: center; padding: 30px;
  background: #000;
}
#mp-lobby-body {
  width: 440px; max-width: 100%; max-height: 90vh; overflow-y: auto;
  background: #000; border: 1px solid rgba(255,255,255,0.12);
  border-radius: 0; padding: 44px 40px;
}
#mp-lobby-body h2 {
  font-family: var(--sans); font-weight: 200; font-size: clamp(30px, 5vw, 46px);
  letter-spacing: 0.01em; margin-bottom: 10px; color: #f2f2f4;
}
#mp-lobby-code {
  font-family: var(--sans); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: #6a6a70; margin-bottom: 26px;
}
#mp-lobby-list { display: flex; flex-direction: column; gap: 0; margin-bottom: 28px; }
.lobby-row {
  display: flex; align-items: center; gap: 14px;
  background: none; border: none; border-bottom: 1px solid rgba(255,255,255,0.12);
  border-radius: 0; padding: 14px 2px;
}
.lobby-row:first-child { border-top: 1px solid rgba(255,255,255,0.12); }
.lobby-dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
.lobby-name { flex: 1; color: #f2f2f4; font-family: var(--sans); font-size: 15px; font-weight: 300; }
.lobby-state {
  font-family: var(--sans); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: #6a6a70;
}
.lobby-state.ready { color: #f2f2f4; }
#mp-lobby-actions { display: flex; flex-direction: column; gap: 12px; }
#mp-ready.on { background: #f2f2f4; color: #000; border-color: #f2f2f4; }
#mp-start:disabled { opacity: 0.3; cursor: not-allowed; }
#mp-start:disabled:hover { background: none; color: #f2f2f4; border-color: rgba(255,255,255,0.3); }
#mp-lobby-hint {
  margin-top: 18px; font-family: var(--sans); font-size: 11px; letter-spacing: 0.04em;
  color: #6a6a70; text-align: center;
}
