* { margin: 0; padding: 0; box-sizing: border-box; }
body { overflow: hidden; background: #000; font-family: 'Georgia', serif; }
canvas { display: block; }

/* ── Loading Screen ──────────────────────────────────────────────────────── */
#loading-screen {
  position: fixed; inset: 0; z-index: 200;
  background: #0a0a0a;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0;
  transition: opacity 0.9s ease;
}
#loading-screen.hidden { opacity: 0; pointer-events: none; }

.loading-name {
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  margin-bottom: 32px;
}
.loading-title {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: normal;
  letter-spacing: 0.08em;
  color: #f0ece0;
  margin-bottom: 40px;
}
.loading-bar-track {
  width: 120px; height: 1px;
  background: rgba(255,255,255,0.08);
  position: relative; overflow: hidden;
}
.loading-bar-fill {
  position: absolute; top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, #c8a050, transparent);
  animation: loading-sweep 1.4s ease-in-out infinite;
}
@keyframes loading-sweep {
  0%   { left: -100%; }
  100% { left: 100%; }
}
.loading-hint {
  margin-top: 28px;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.15);
}

#vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 5;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%);
}

#crosshair {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 20px; height: 20px;
  pointer-events: none; z-index: 10;
}
#crosshair::before, #crosshair::after {
  content: ''; position: absolute; background: rgba(255,255,255,0.6);
}
#crosshair::before { width: 1px; height: 100%; left: 50%; transform: translateX(-50%); }
#crosshair::after  { width: 100%; height: 1px; top: 50%; transform: translateY(-50%); }
#crosshair .dot {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: rgba(255,255,255,0.8);
  top: 50%; left: 50%; transform: translate(-50%,-50%);
}

#hover-prompt {
  display: none;
  position: fixed; top: 55%; left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.85);
  font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase;
  pointer-events: none; z-index: 10;
}

#info-card {
  display: none;
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: #111;
  border: 1px solid #333;
  color: #f0ece0;
  width: min(500px, 92vw);
  max-height: 90dvh;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 30px 80px rgba(0,0,0,0.9);
}
#card-image-strip {
  width: 100%; height: 6px;
  background: linear-gradient(90deg, #c8a050, #e8c870, #c8a050);
}
#info-card-inner { padding: 32px 36px 36px; }
#info-card h2 {
  font-size: 1.55rem; margin-bottom: 3px; color: #fff; letter-spacing: 0.02em;
}
#info-card .artist {
  font-size: 0.88rem; color: #888; margin-bottom: 18px;
  font-style: italic; letter-spacing: 0.04em;
}
#info-card .divider { width: 36px; height: 1px; background: #444; margin-bottom: 18px; }
#info-card .description {
  font-size: 0.88rem; line-height: 1.75; color: #bbb; margin-bottom: 22px;
}
#info-card .price {
  font-size: 1.15rem; color: #c8a050; margin-bottom: 24px;
  font-weight: bold; letter-spacing: 0.04em;
}
#info-card .actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  padding: 11px 22px; border: none; cursor: pointer;
  font-family: 'Georgia', serif; font-size: 0.85rem;
  letter-spacing: 0.06em; text-transform: uppercase; transition: all 0.2s;
}
.btn-primary { background: #c8a050; color: #000; }
.btn-primary:hover { background: #e0b860; }
.btn-secondary { background: transparent; color: #aaa; border: 1px solid #444; }
.btn-secondary:hover { border-color: #888; color: #fff; }

#info-card .close-btn {
  position: absolute; top: 14px; right: 18px;
  background: none; border: none; color: #555;
  font-size: 1.2rem; cursor: pointer; z-index: 2;
}
#info-card .close-btn:hover { color: #fff; }

#gallery-title {
  position: fixed;
  top: max(24px, env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.35);
  font-size: 0.72rem; letter-spacing: 0.28em; text-transform: uppercase;
  pointer-events: none; z-index: 10; white-space: nowrap;
}

#back-btn {
  position: fixed;
  top: max(20px, env(safe-area-inset-top, 0px));
  left: max(28px, env(safe-area-inset-left, 0px));
  color: rgba(255,255,255,0.35); font-size: 0.72rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  text-decoration: none; z-index: 10;
  transition: color 0.2s;
}
#back-btn:hover { color: rgba(255,255,255,0.8); }

#hint {
  position: fixed; bottom: 80px; left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.35); font-size: 0.75rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  pointer-events: none; text-align: center; transition: opacity 1.5s;
}

#mobile-controls {
  display: none;
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%); z-index: 50;
}
.ctrl-grid {
  display: grid;
  grid-template-areas: ". up ." "left . right" ". down .";
  gap: 6px;
}
.ctrl-btn {
  width: 48px; height: 48px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7); font-size: 1.1rem;
  border-radius: 4px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  user-select: none; -webkit-user-select: none;
  backdrop-filter: blur(4px);
}
.ctrl-btn:active { background: rgba(255,255,255,0.25); }
#btn-up    { grid-area: up; }
#btn-left  { grid-area: left; }
#btn-right { grid-area: right; }
#btn-down  { grid-area: down; }

@media (pointer: coarse) {
  #mobile-controls { display: block; }
  #hint { bottom: 140px; }
}

/* ── Artist card ─────────────────────────────────────────────────────────── */
#artist-card {
  display: none;
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: #0e0e0e;
  border: 1px solid #2a2a2a;
  color: #f0ece0;
  width: min(760px, 94vw);
  max-height: 90dvh;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 30px 80px rgba(0,0,0,0.95);
}
#artist-card-inner {
  position: relative;
  padding: 40px 40px 44px;
}
#artist-card .close-btn {
  position: absolute; top: 16px; right: 20px;
  background: none; border: none; color: #555;
  font-size: 1.2rem; cursor: pointer; z-index: 2;
  font-family: 'Georgia', serif;
}
#artist-card .close-btn:hover { color: #fff; }
#artist-card-body {
  display: flex;
  gap: 36px;
  align-items: flex-start;
}
#artist-photo-wrap {
  flex-shrink: 0;
  width: 200px;
}
#artist-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  border: 1px solid #2a2a2a;
  filter: grayscale(12%);
}
#artist-text { flex: 1; min-width: 0; }
#artist-card-label {
  font-size: 0.65rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #c8a050;
  margin-bottom: 10px;
}
#artist-card-name {
  font-size: 1.7rem;
  font-weight: normal;
  letter-spacing: 0.03em;
  color: #fff;
  margin-bottom: 4px;
}
#artist-card-title {
  font-size: 0.85rem;
  color: #888;
  font-style: italic;
  margin-bottom: 20px;
  letter-spacing: 0.04em;
}
#artist-card-divider {
  width: 36px; height: 1px;
  background: #333;
  margin-bottom: 20px;
}
#artist-card-bio {
  font-size: 0.88rem;
  line-height: 1.8;
  color: #bbb;
  margin-bottom: 28px;
}
#artist-card-message-label {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #555;
  margin-bottom: 12px;
}
#artist-card-message {
  font-size: 0.88rem;
  line-height: 1.85;
  color: #998870;
  font-style: italic;
  white-space: pre-line;
}
#artist-card-contact {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid #222;
}
#artist-card-contact-label {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #555;
  margin-bottom: 14px;
}
#artist-contact-items { display: flex; flex-direction: column; gap: 10px; }
.artist-contact-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.artist-contact-key {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #555;
  min-width: 72px;
  flex-shrink: 0;
}
.artist-contact-val {
  font-size: 0.88rem;
  color: #c8a050;
  text-decoration: none;
  transition: color 0.2s;
}
.artist-contact-val:hover { color: #e0c070; }

@media (max-width: 600px) {
  #artist-card-body { flex-direction: column; }
  #artist-photo-wrap { width: 100%; max-width: 200px; }
  #artist-card-inner { padding: 28px 20px 32px; }
  #artist-card-name { font-size: 1.35rem; }
}

@media (max-width: 480px) {
  #info-card-inner { padding: 20px 18px 24px; }
  #info-card h2 { font-size: 1.25rem; }
  #info-card .description { font-size: 0.82rem; }
  #info-card .actions { gap: 8px; }
  .btn { padding: 10px 16px; font-size: 0.8rem; }
}
