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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #0d0c0a;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  color: #eee;
  -webkit-user-select: none; user-select: none;
  touch-action: none;
}

#scene { position: fixed; inset: 0; display: block; }

.hidden { display: none !important; }

/* ---------- Écran d'accueil ---------- */
#overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, #2a2620 0%, #0d0c0a 75%);
  transition: opacity .6s ease;
}
#overlay.fade { opacity: 0; pointer-events: none; }

#overlay-content { text-align: center; max-width: 560px; padding: 24px; }

#gallery-name {
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 300; letter-spacing: .35em; text-transform: uppercase;
  color: #e8ddc8;
}
#gallery-subtitle {
  margin-top: 10px; font-size: .95rem; letter-spacing: .25em;
  text-transform: uppercase; color: #8a8071;
}

#progress-wrap {
  margin: 36px auto 0; width: 260px; height: 2px;
  background: #3a352c; border-radius: 2px; overflow: hidden;
}
#progress-bar {
  width: 0%; height: 100%;
  background: #c8a96a; transition: width .25s ease;
}

#enter-btn {
  margin-top: 28px; padding: 14px 48px;
  font-size: 1rem; letter-spacing: .2em; text-transform: uppercase;
  background: transparent; color: #c8a96a;
  border: 1px solid #c8a96a; border-radius: 2px;
  cursor: pointer; transition: all .25s;
}
#enter-btn:disabled { opacity: .35; cursor: default; }
#enter-btn:not(:disabled):hover { background: #c8a96a; color: #1a1712; }

#instructions { margin-top: 34px; font-size: .85rem; color: #7a7264; line-height: 1.9; }
#instructions b { color: #b3a68d; }

#back-link {
  display: inline-block; margin-top: 26px;
  font-size: .82rem; letter-spacing: .08em;
  color: #8a8071; text-decoration: none;
  border-bottom: 1px solid rgba(138, 128, 113, .4);
  padding-bottom: 2px;
  transition: color .25s, border-color .25s;
}
#back-link:hover { color: #c8a96a; border-color: #c8a96a; }

/* ---------- Viseur ---------- */
#crosshair {
  position: fixed; left: 50%; top: 50%; z-index: 10;
  width: 6px; height: 6px; margin: -3px 0 0 -3px;
  border-radius: 50%; background: rgba(255,255,255,.75);
  box-shadow: 0 0 6px rgba(0,0,0,.6);
  pointer-events: none;
}

/* ---------- Indication tableau visé ---------- */
#hover-hint {
  position: fixed; left: 50%; bottom: 9%; z-index: 10;
  transform: translateX(-50%);
  padding: 9px 22px; border-radius: 3px;
  background: rgba(15,13,10,.78); backdrop-filter: blur(6px);
  border: 1px solid rgba(200,169,106,.4);
  font-size: .9rem; letter-spacing: .06em; color: #e8ddc8;
  pointer-events: none; white-space: nowrap;
}
#hover-hint small { color: #9a8f7a; }

/* ---------- Fiche d'œuvre ---------- */
#info-panel {
  position: fixed; z-index: 60;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; gap: 0;
  width: min(880px, 94vw); max-height: 88vh;
  background: #16130e; border: 1px solid #3a342a;
  border-radius: 6px; overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,.75);
}
#info-image-wrap {
  flex: 0 0 46%;
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: #0c0a08; padding: 22px;
  touch-action: none;
  cursor: zoom-in;
}
#info-image-wrap.zoomed { cursor: grab; }
#info-image-wrap.dragging { cursor: grabbing; }
#info-image {
  max-width: 100%; max-height: 72vh;
  box-shadow: 0 8px 40px rgba(0,0,0,.8);
  transition: transform .18s ease-out;
  will-change: transform;
  -webkit-user-drag: none; user-select: none;
}
#info-image.no-anim { transition: none; }

#zoom-controls {
  position: absolute; right: 12px; bottom: 12px; z-index: 3;
  display: flex; flex-direction: column; gap: 6px;
}
#zoom-controls button {
  width: 36px; height: 36px;
  background: rgba(15,13,10,.72); color: #d6cbb6;
  border: 1px solid rgba(200,169,106,.45); border-radius: 50%;
  font-size: 1.15rem; line-height: 1; cursor: pointer;
  backdrop-filter: blur(4px);
}
#zoom-controls button:hover { background: rgba(200,169,106,.3); color: #fff; }

#zoom-hint {
  position: absolute; left: 14px; bottom: 14px; z-index: 3;
  font-size: .72rem; letter-spacing: .05em; color: #b3a68d;
  background: rgba(15,13,10,.55); padding: 4px 10px; border-radius: 3px;
  pointer-events: none;
  transition: opacity .8s ease 2.6s;   /* s'efface quelques secondes après l'ouverture */
}
#info-panel.hint-fade #zoom-hint { opacity: 0; }

#info-text { flex: 1; padding: 34px 30px; overflow-y: auto; }
#info-title { font-size: 1.5rem; font-weight: 400; color: #e8ddc8; line-height: 1.3; }
#info-artist { margin-top: 8px; font-size: 1.02rem; color: #c8a96a; letter-spacing: .04em; }
#info-meta { margin-top: 14px; font-size: .85rem; color: #8a8071; line-height: 1.7; }
#info-desc { margin-top: 18px; font-size: .93rem; color: #c5bcac; line-height: 1.75; }

#info-footer {
  margin-top: 24px; padding-top: 18px; border-top: 1px solid #2c2720;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
#info-price { font-size: 1.25rem; color: #e8ddc8; font-weight: 500; }
#info-status { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; padding: 5px 12px; border-radius: 2px; }
#info-status.dispo { color: #8fce91; border: 1px solid #3c5a3d; }
#info-status.vendu { color: #ce8f8f; border: 1px solid #5a3c3c; }

#info-close {
  position: absolute; top: 10px; right: 12px; z-index: 2;
  width: 38px; height: 38px;
  background: rgba(0,0,0,.35); color: #c5bcac;
  border: none; border-radius: 50%;
  font-size: 1.5rem; line-height: 1; cursor: pointer;
}
#info-close:hover { background: rgba(200,169,106,.25); color: #fff; }

/* ---------- Joystick mobile ---------- */
#joystick {
  position: fixed; left: 26px; bottom: 30px; z-index: 20;
  width: 118px; height: 118px; border-radius: 50%;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.18);
}
#joystick-knob {
  position: absolute; left: 50%; top: 50%;
  width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: rgba(200,169,106,.45);
  border: 1px solid rgba(200,169,106,.7);
}

/* ---------- Responsive ---------- */
.mobile-only { display: none; }
@media (pointer: coarse) {
  .desktop-only { display: none; }
  .mobile-only { display: block; }
}
@media (max-width: 700px) {
  #info-panel { flex-direction: column; max-height: 92vh; }
  #info-image-wrap { flex: 0 0 auto; max-height: 38vh; padding: 14px; }
  #info-image { max-height: 33vh; }
  #info-text { padding: 20px 18px; }
}
