/* =========================================================
   3D MUZEY — STYLE.CSS
   ========================================================= */

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

:root {
  --gold: #c9a84c;
  --gold-light: #f0d080;
  --dark: #0a0a0f;
  --dark-2: #12121a;
  --panel-bg: rgba(10, 10, 20, 0.92);
  --panel-border: rgba(201, 168, 76, 0.35);
  --text-primary: #f5f0e8;
  --text-secondary: #a89870;
  --accent: #6a9fd8;
  --radius: 12px;
  --transition: 0.25s ease;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: 'Georgia', serif;
  background: var(--dark);
  color: var(--text-primary);
}

#three-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ── HIDDEN ───────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── LOADING SCREEN ──────────────────────────────────── */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: radial-gradient(ellipse at center, #1a1020 0%, #0a0a0f 70%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.museum-logo {
  font-size: 72px;
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(201,168,76,0.6));
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.loader-content h1 {
  font-size: 2.4rem;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 3px;
}

.loader-content p {
  color: var(--text-secondary);
  font-size: 1rem;
  letter-spacing: 1px;
}

.progress-bar-wrap {
  width: 320px;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 99px;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(201,168,76,0.6);
}

#progress-text {
  color: var(--gold);
  font-size: 0.9rem;
  font-family: monospace;
}

/* ── START SCREEN ────────────────────────────────────── */
#start-screen {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: radial-gradient(ellipse at center, #1a1020 0%, #0a0a0f 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
}

.start-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 600px;
  padding: 40px;
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  box-shadow: 0 0 60px rgba(201,168,76,0.15), inset 0 1px 0 rgba(255,255,255,0.05);
}

.start-content h1 {
  font-size: 2.8rem;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 4px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  font-style: italic;
}

.controls-info {
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: 20px;
}

.controls-info h3 {
  color: var(--gold);
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.control-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

kbd {
  display: inline-block;
  padding: 3px 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 5px;
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--text-primary);
  white-space: nowrap;
}

.btn-enter {
  padding: 14px 48px;
  background: linear-gradient(135deg, var(--gold), #8a6520);
  border: none;
  border-radius: 99px;
  color: #0a0a0f;
  font-family: 'Georgia', serif;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  letter-spacing: 1px;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(201,168,76,0.4);
}

.btn-enter:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(201,168,76,0.55);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
}

/* ── HUD ─────────────────────────────────────────────── */
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
}

/* Crosshair */
#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
}

.ch-line {
  position: absolute;
  background: rgba(255,255,255,0.8);
  border-radius: 1px;
}

.ch-h {
  width: 20px;
  height: 1.5px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.ch-v {
  width: 1.5px;
  height: 20px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.ch-dot {
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Interaction hint */
#interaction-hint {
  position: absolute;
  bottom: 30%;
  left: 50%;
  transform: translateX(-50%);
  animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.hint-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 99px;
  font-size: 0.9rem;
  color: var(--text-primary);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.hint-icon {
  font-size: 1.2rem;
}

/* Top bar */
#top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
  pointer-events: auto;
}

.museum-name {
  font-size: 1rem;
  color: var(--gold);
  letter-spacing: 2px;
  font-style: italic;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#fullscreen-btn,
#pause-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-primary);
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
}

#fullscreen-btn:hover,
#pause-btn:hover {
  background: rgba(212, 175, 55, 0.25);
  border-color: var(--gold);
  color: var(--gold);
}

/* Bottom bar */
#bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
}

#bottom-bar .tip {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
  letter-spacing: 1px;
}

#bottom-bar .tip kbd {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
  font-size: 0.75rem;
}

/* ── PAUSE MENU ──────────────────────────────────────── */
#pause-menu {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.pause-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px 60px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  box-shadow: 0 0 60px rgba(0,0,0,0.8);
}

.pause-content h2 {
  font-size: 1.8rem;
  color: var(--gold);
  margin-bottom: 8px;
}

.btn-primary {
  padding: 12px 40px;
  background: linear-gradient(135deg, var(--gold), #8a6520);
  border: none;
  border-radius: 99px;
  color: #0a0a0f;
  font-family: 'Georgia', serif;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(201,168,76,0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201,168,76,0.5);
}

.btn-secondary {
  padding: 10px 30px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 99px;
  color: var(--text-secondary);
  font-family: 'Georgia', serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  border-color: rgba(255,255,255,0.4);
  color: var(--text-primary);
}

/* ── ARTWORK MODAL ───────────────────────────────────── */
#artwork-modal {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(12px);
  cursor: pointer;
}

/* ── ARTWORK EXHIBITION OVERLAY (TEKIS KATTA RASM + MA'LUMOT) ─ */
#artwork-exhibition {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  pointer-events: auto;
}

.exhibition-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 10, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.exhibition-content {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
}

/* Chap tomon: Surat to'liq, tekis va markazda */
.exhibition-image-zone {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  cursor: zoom-in;
  animation: fadeInZoom 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInZoom {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.image-frame-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: linear-gradient(135deg, #d4af37, #8a6520, #e6ca65, #5a3e10);
  border-radius: 12px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.85), 0 0 35px rgba(212, 175, 55, 0.25);
  max-width: 90%;
  max-height: 88vh;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
}

#exhibition-img {
  max-width: 100%;
  max-height: calc(88vh - 28px);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 4px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* Zoom boshqaruv paneli */
.image-zoom-toolbar {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(18, 14, 16, 0.82);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(212, 175, 55, 0.15);
  z-index: 10;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.zoom-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
}

.zoom-btn:hover {
  background: rgba(212, 175, 55, 0.25);
  border-color: var(--gold);
  color: var(--gold);
  transform: scale(1.08);
}

.zoom-btn:active {
  transform: scale(0.95);
}

.zoom-level {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gold);
  min-width: 48px;
  text-align: center;
  letter-spacing: 0.5px;
}

/* Zoom bo'yicha maslahat */
.zoom-hint {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(14, 10, 12, 0.7);
  backdrop-filter: blur(10px);
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.5px;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  z-index: 10;
  opacity: 0.85;
  transition: opacity 0.3s;
}

.exhibition-image-zone:hover .zoom-hint {
  opacity: 0.35;
}

/* O'ng tomon: Ma'lumotlar paneli */
.exhibition-info-zone {
  width: min(480px, 92vw);
  height: 100%;
  background: linear-gradient(135deg, rgba(16, 11, 14, 0.95) 0%, rgba(24, 16, 20, 0.94) 100%);
  border-left: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow: -15px 0 50px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: flex-end; /* Chiqish tugmasi o'ng tomonda */
  padding: 20px 24px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-close {
  width: 40px;
  height: 40px;
  margin-left: auto; /* O'ng tomonga qat'iy tekislash */
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 1.15rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.sidebar-close:hover {
  background: rgba(212, 175, 55, 0.25);
  border-color: var(--gold);
  color: var(--gold);
  transform: rotate(90deg);
}

.sidebar-body {
  padding: 30px 32px 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 168, 76, 0.45) transparent;
}

.sidebar-body::-webkit-scrollbar {
  width: 5px;
}
.sidebar-body::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-body::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.4);
  border-radius: 99px;
}
.sidebar-body::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.7);
}

.artwork-number {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(201, 168, 76, 0.15);
  border: 1px solid rgba(201, 168, 76, 0.35);
  border-radius: 99px;
  font-size: 0.8rem;
  color: var(--gold);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.sidebar-body h2 {
  font-size: 1.85rem;
  color: var(--text-primary);
  line-height: 1.25;
  letter-spacing: 0.5px;
}

.artwork-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}

.artwork-meta p {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.artwork-description {
  margin-top: 6px;
  font-size: 0.96rem;
  line-height: 1.85;
  color: #dfd8cc;
  flex: 1;
}

.artwork-description p + p {
  margin-top: 14px;
}



/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 680px) {
  .modal-body {
    grid-template-columns: 1fr;
  }

  .modal-image-wrap {
    border-right: none;
    border-bottom: 1px solid var(--panel-border);
    padding: 20px;
  }

  #artwork-canvas {
    max-height: 220px;
  }

  .modal-info {
    padding: 24px 20px;
  }

  .controls-grid {
    grid-template-columns: 1fr;
  }

  .start-content h1 {
    font-size: 2rem;
  }
}

/* ── SCROLLBAR ───────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); border-radius: 99px; }
::-webkit-scrollbar-thumb { background: rgba(201,168,76,0.35); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(201,168,76,0.65); }

.modal-info::-webkit-scrollbar {
  width: 6px;
}
.modal-info::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 99px;
  margin: 10px 0;
}
.modal-info::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.45);
  border-radius: 99px;
}
.modal-info::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.75);
}

/* ── MOBILE CONTROLS & ORIENTATION OVERLAY ───────────── */
#orientation-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 10, 0.96);
  backdrop-filter: blur(15px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.orientation-box {
  max-width: 340px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 24px;
  background: rgba(25, 18, 22, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 20px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(212, 175, 55, 0.15);
}

.phone-rotate-icon {
  font-size: 3.4rem;
  line-height: 1;
  animation: phoneRotateAnim 2.2s ease-in-out infinite;
  display: inline-block;
}

@keyframes phoneRotateAnim {
  0% { transform: rotate(0deg) scale(1); }
  35% { transform: rotate(-90deg) scale(1.1); }
  65% { transform: rotate(-90deg) scale(1.1); }
  100% { transform: rotate(0deg) scale(1); }
}

.orientation-box h2 {
  font-size: 1.35rem;
  color: var(--gold);
  letter-spacing: 0.5px;
}

.orientation-box p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Faqat portret rejimdagi mobil ekranlarda avtomatik ko'rsatish */
@media (orientation: portrait) and (max-width: 950px) {
  #orientation-overlay:not(.force-hidden) {
    display: flex !important;
  }
}

@media (orientation: landscape) {
  #orientation-overlay {
    display: none !important;
  }
}

/* Mobil Boshqaruv (HUD) */
#mobile-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 110;
}

/* Virtual Djoystik */
#joystick-zone {
  position: absolute;
  bottom: 24px;
  left: 24px;
  width: 140px;
  height: 140px;
  pointer-events: auto;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

#joystick-base {
  width: 124px;
  height: 124px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.12) 0%, rgba(18, 14, 16, 0.65) 70%);
  border: 2px solid rgba(212, 175, 55, 0.4);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.6), inset 0 0 16px rgba(212, 175, 55, 0.2);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

#joystick-knob {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-light), #8a6520);
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 15px rgba(212, 175, 55, 0.5);
  position: absolute;
  transform: translate(0px, 0px);
  will-change: transform;
}

/* O'ng tomon: Kamera burish */
#touch-look-zone {
  position: absolute;
  top: 50px;
  right: 0;
  bottom: 0;
  width: 55%;
  pointer-events: auto;
  touch-action: none;
}

/* Rasm oldida chiquvchi mobil action tugmasi */
.mobile-action-btn {
  position: absolute;
  bottom: 30px;
  right: 30px;
  pointer-events: auto;
  touch-action: manipulation;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4af37 0%, #8a6520 70%, #d4af37 100%);
  border: 3px solid rgba(255, 255, 255, 0.85);
  color: #100b0e;
  font-family: 'Georgia', serif;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.7), 0 0 25px rgba(212, 175, 55, 0.7);
  animation: actionPulse 1.8s infinite;
  z-index: 130;
  transition: transform 0.15s ease;
}

.mobile-action-btn:active {
  transform: scale(0.92);
}

.mobile-action-btn .action-icon {
  font-size: 1.45rem;
  line-height: 1;
}

.mobile-action-btn .action-label {
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

@keyframes actionPulse {
  0% {
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.5);
  }
  50% {
    box-shadow: 0 0 32px rgba(212, 175, 55, 0.95), 0 0 14px rgba(255, 255, 255, 0.85);
  }
  100% {
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.5);
  }
}

/* ── MOBIL LANDSCAPE (Qisqa bo'yli ekranlar) OPTIMIZATSIYASI ── */
body.is-mobile #interaction-hint,
body.is-mobile #bottom-bar {
  display: none !important;
}

@media (max-height: 520px) {
  #start-screen {
    align-items: flex-start !important;
    padding: 8px 16px !important;
    overflow-y: auto !important;
  }

  .start-content {
    margin: auto !important;
    padding: 12px 20px !important;
    gap: 8px !important;
    max-width: 520px !important;
  }

  .museum-logo {
    display: none !important;
  }

  .start-content h1 {
    font-size: 1.45rem !important;
    letter-spacing: 2px !important;
    margin: 0 !important;
  }

  .subtitle {
    font-size: 0.8rem !important;
    margin: -4px 0 0 0 !important;
  }

  .controls-info {
    padding: 8px 14px !important;
  }

  .controls-info h3 {
    margin-bottom: 5px !important;
    font-size: 0.72rem !important;
  }

  .controls-grid {
    gap: 4px 10px !important;
  }

  .control-item {
    font-size: 0.75rem !important;
    gap: 6px !important;
  }

  kbd {
    padding: 2px 6px !important;
    font-size: 0.72rem !important;
  }

  .btn-enter {
    padding: 8px 36px !important;
    font-size: 0.95rem !important;
    margin-top: 2px !important;
  }

  #top-bar {
    padding: 6px 16px;
  }
  .museum-name {
    font-size: 0.85rem;
  }
  #pause-btn, #fullscreen-btn {
    padding: 4px 10px;
    font-size: 0.85rem;
  }
  #bottom-bar,
  #interaction-hint {
    display: none !important;
  }

  /* Ko'rgazma oynasi (Exhibition) */
  .exhibition-image-zone {
    padding: 12px 16px;
  }
  .image-frame-container {
    padding: 8px;
    max-height: 94vh;
  }
  #exhibition-img {
    max-height: calc(94vh - 16px);
  }
  .exhibition-info-zone {
    width: min(350px, 46vw);
  }
  .sidebar-header {
    padding: 10px 16px 6px;
  }
  .sidebar-close {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
  .sidebar-body {
    padding: 12px 16px 20px;
    gap: 8px;
  }
  .sidebar-body h2 {
    font-size: 1.15rem;
    line-height: 1.2;
  }
  .artwork-meta {
    padding: 6px 10px;
    gap: 2px;
  }
  .artwork-meta p {
    font-size: 0.78rem;
  }
  .artwork-description {
    font-size: 0.82rem;
    line-height: 1.6;
  }
  .image-zoom-toolbar {
    bottom: 12px;
    padding: 4px 10px;
    gap: 6px;
  }
  .zoom-btn {
    width: 26px;
    height: 26px;
    font-size: 0.85rem;
  }
  .zoom-level {
    font-size: 0.78rem;
    min-width: 40px;
  }
  .zoom-hint {
    display: none; /* Kichik ekranda rasmni to'sib qo'ymaslik uchun */
  }

  /* Djoystik va action button */
  #joystick-zone {
    bottom: 14px;
    left: 14px;
    width: 120px;
    height: 120px;
  }
  #joystick-base {
    width: 105px;
    height: 105px;
  }
  #joystick-knob {
    width: 44px;
    height: 44px;
  }
  .mobile-action-btn {
    bottom: 18px;
    right: 18px;
    width: 66px;
    height: 66px;
  }
  .mobile-action-btn .action-icon {
    font-size: 1.25rem;
  }
  .mobile-action-btn .action-label {
    font-size: 0.68rem;
  }

  /* Noma oynasi mobil landshaft uchun */
  .parchment-wrapper {
    max-height: 94vh;
  }
  .parchment-scroll {
    padding: 20px 24px;
  }
  .wax-seal {
    width: 44px;
    height: 44px;
    margin-bottom: 6px;
  }
  .wax-seal-inner {
    width: 32px;
    height: 32px;
  }
  .wax-symbol {
    font-size: 1.1rem;
  }
  .parchment-title {
    font-size: 1.35rem;
    margin-bottom: 6px;
  }
  .parchment-body {
    font-size: 0.85rem;
    line-height: 1.6;
  }
  .drop-cap {
    font-size: 2.4rem;
    padding: 0 6px 0 0;
  }
  .channel-scroll-box {
    margin: 12px 0 6px;
    padding: 12px 14px;
  }
  .channel-scroll-box h3 {
    font-size: 1.05rem;
  }
  .channel-scroll-box p {
    font-size: 0.82rem;
  }
  .parchment-footer {
    margin-top: 14px;
  }
  .btn-parchment-channel {
    padding: 10px 24px;
    font-size: 0.9rem;
  }
}

/* ── ANCIENT ROYAL PARCHMENT MODAL (ESKI DAVRLARDAGI NOMA) ── */
#parchment-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.35s ease;
}

.parchment-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 6, 8, 0.9);
  backdrop-filter: blur(12px);
}

.parchment-wrapper {
  position: relative;
  z-index: 2;
  width: min(680px, 94vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: parchmentUnroll 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes parchmentUnroll {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.parchment-scroll {
  background: radial-gradient(ellipse at 50% 35%, #fffbf2 0%, #fdf5e2 40%, #f5e4bd 75%, #dfc595 100%);
  border: 2px solid #996e36;
  border-radius: 12px;
  box-shadow: 
    0 30px 90px rgba(0, 0, 0, 0.9),
    inset 0 0 50px rgba(120, 75, 20, 0.3),
    0 0 40px rgba(212, 175, 55, 0.25);
  padding: 44px 44px 38px;
  overflow-y: auto;
  position: relative;
  color: #2c1a0e;
  font-family: 'Georgia', 'Times New Roman', serif;
  scrollbar-width: thin;
  scrollbar-color: rgba(153, 110, 54, 0.5) transparent;
}

.parchment-scroll::-webkit-scrollbar {
  width: 6px;
}
.parchment-scroll::-webkit-scrollbar-thumb {
  background: rgba(153, 110, 54, 0.5);
  border-radius: 99px;
}

.parchment-close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(120, 75, 20, 0.15);
  border: 1px solid rgba(120, 75, 20, 0.35);
  color: #4a280f;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.parchment-close:hover {
  background: #8b0000;
  border-color: #8b0000;
  color: #fff;
  transform: rotate(90deg);
}

.parchment-header {
  text-align: center;
  margin-bottom: 22px;
  position: relative;
}

.wax-seal {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #b22222, #8b0000 65%, #4a0000 100%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.35);
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #5a0000;
}

.wax-seal-inner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 220, 140, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wax-symbol {
  font-size: 1.55rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.parchment-flourish {
  font-size: 1.1rem;
  color: #8c622d;
  letter-spacing: 4px;
  margin-bottom: 4px;
}

.parchment-subtitle {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #7a5426;
  font-style: italic;
  margin-bottom: 4px;
}

.parchment-title {
  font-size: 2.1rem;
  color: #1f1006;
  font-weight: bold;
  letter-spacing: 1px;
  margin: 0 0 12px;
}

.parchment-divider {
  width: 60%;
  height: 2px;
  margin: 0 auto;
  background: linear-gradient(to right, transparent, #a67c3b, transparent);
  position: relative;
}

.parchment-divider::after {
  content: '❖';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fdf5e2;
  padding: 0 8px;
  color: #8c622d;
  font-size: 0.85rem;
}

.parchment-body {
  font-size: 1.02rem;
  line-height: 1.85;
  color: #331e10;
  text-align: justify;
}

.parchment-lead {
  font-size: 1.08rem;
  font-style: italic;
  color: #271609;
}

.drop-cap {
  float: left;
  font-size: 3.6rem;
  line-height: 0.8;
  padding: 4px 10px 0 0;
  color: #8b0000;
  font-weight: bold;
  font-family: 'Georgia', serif;
}

.parchment-body p {
  margin-bottom: 14px;
}

.channel-scroll-box {
  margin: 22px 0 10px;
  padding: 20px 22px;
  background: rgba(166, 124, 59, 0.12);
  border: 1px solid rgba(153, 110, 54, 0.45);
  border-radius: 10px;
  box-shadow: inset 0 0 20px rgba(120, 75, 20, 0.08);
}

.channel-seal-badge {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #8b0000;
  font-weight: bold;
  margin-bottom: 6px;
}

.channel-scroll-box h3 {
  font-size: 1.35rem;
  color: #1f1006;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.channel-scroll-box p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #3b2313;
  margin: 0;
}

.parchment-footer {
  margin-top: 26px;
  display: flex;
  justify-content: center;
}

.btn-parchment-channel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 38px;
  background: linear-gradient(135deg, #1b68a8 0%, #0088cc 60%, #0d5482 100%);
  color: #ffffff !important;
  text-decoration: none;
  border-radius: 99px;
  font-weight: bold;
  font-size: 1.08rem;
  letter-spacing: 0.5px;
  box-shadow: 0 8px 25px rgba(0, 136, 204, 0.45), 0 2px 4px rgba(0, 0, 0, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.35);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-parchment-channel:hover {
  background: linear-gradient(135deg, #257bc0 0%, #0099e6 60%, #116296 100%);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 32px rgba(0, 136, 204, 0.6);
  border-color: rgba(255, 255, 255, 0.6);
}

.channel-btn-icon {
  font-size: 1.35rem;
}

.channel-btn-arrow {
  font-size: 1.35rem;
  transition: transform 0.2s ease;
}

.btn-parchment-channel:hover .channel-btn-arrow {
  transform: translateX(5px);
}
