/* ============================================
   Al-Qarawashiya Tarot - Hand Gesture Control
   Colors: BEIGE + DEEP BURGUNDY + DARK BROWN ONLY
   NO GOLD - NO GOLD - NO GOLD
   ============================================ */

:root {
    /* STRICT COLOR PALETTE - ONLY THESE THREE */
    --beige: #d4c5a9;
    --beige-light: #e8dcc8;
    --beige-dark: #b8a88a;
    --beige-dim: #9a8b6b;

    --burgundy: #4a0e1f;
    --burgundy-deep: #2a080f;
    --burgundy-light: #6b1a2e;
    --burgundy-glow: #5c1528;

    --brown: #3d2817;
    --brown-deep: #1f140a;
    --brown-light: #5c3d24;
    --brown-warm: #4a3020;

    /* Derived - NO GOLD, only beige/brown tones */
    --accent: var(--beige);
    --accent-dim: var(--beige-dim);
    --accent-glow: var(--beige-light);

    --bg-primary: var(--brown-deep);
    --bg-secondary: var(--brown);
    --bg-panel: var(--burgundy-deep);
    --bg-overlay: rgba(31, 20, 10, 0.95);

    --text-primary: var(--beige-light);
    --text-secondary: var(--beige);
    --text-muted: var(--beige-dim);
    --text-burgundy: var(--burgundy-light);

    --border-subtle: rgba(212, 197, 169, 0.15);
    --border-medium: rgba(212, 197, 169, 0.3);
    --border-strong: rgba(212, 197, 169, 0.5);

    --shadow-beige: 0 0 20px rgba(212, 197, 169, 0.15), 0 0 40px rgba(212, 197, 169, 0.05);
    --shadow-burgundy: 0 0 30px rgba(74, 14, 31, 0.4);
    --shadow-brown: 0 10px 40px rgba(31, 20, 10, 0.8);

    --font-display: 'Cinzel', serif;
    --font-body: 'Cormorant Garamond', serif;
    --font-arabic: 'Amiri', serif;

    --transition-fast: 0.2s ease;
    --transition-medium: 0.4s ease;
    --transition-slow: 0.8s ease;
    --transition-mystical: 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: none;
}

body[dir="rtl"] { direction: rtl; }
body[dir="ltr"] { direction: ltr; }

.hidden { display: none !important; }

/* ============================================
   LOADING SCREEN
   ============================================ */
#loading-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(31, 20, 10, 0.72);
    display: flex; align-items: center; justify-content: center;
    z-index: 10000; flex-direction: column;
}

#mansion-bg { position: fixed; inset: 0; z-index: 0; }
#mansion-credit {
    position: fixed; bottom: 6px; left: 10px; z-index: 20000;
    font-family: var(--font-body, sans-serif); font-size: 9px; color: rgba(212,197,169,0.35);
    direction: ltr; unicode-bidi: isolate; max-width: 70vw;
}

.loading-content { text-align: center; animation: fadeIn 2s ease-out; }

.mystical-symbol {
    font-size: 4rem; margin-bottom: 2rem;
    animation: moonPulse 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(212, 197, 169, 0.3));
}

@keyframes moonPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

.loading-title {
    font-family: var(--font-display); font-size: 2.8rem; font-weight: 700;
    color: var(--beige-light); letter-spacing: 0.15em;
    text-shadow: 0 0 30px rgba(212, 197, 169, 0.2);
    margin-bottom: 0.5rem;
}

.loading-subtitle {
    font-family: var(--font-body); font-size: 1.2rem; font-weight: 300;
    color: var(--beige-dim); font-style: italic;
    letter-spacing: 0.2em; margin-bottom: 3rem;
}

.loading-bar-container { width: 280px; margin: 0 auto; }
.loading-bar {
    width: 100%; height: 2px; background: var(--brown);
    border-radius: 1px; overflow: hidden; margin-bottom: 1.5rem;
}
.loading-bar-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--burgundy), var(--beige-dim), var(--burgundy));
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
    transition: width 0.5s ease;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.loading-text {
    font-family: var(--font-body); font-size: 0.9rem;
    color: var(--beige-dim); letter-spacing: 0.1em;
    animation: textPulse 2s ease-in-out infinite;
}

@keyframes textPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ============================================
   CAMERA PERMISSION
   ============================================ */
#camera-permission {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-overlay); backdrop-filter: blur(20px);
    display: flex; align-items: center; justify-content: center;
    z-index: 9000;
}

.permission-content {
    text-align: center; max-width: 450px; padding: 3rem;
    background: var(--bg-panel); border: 1px solid var(--border-medium);
    border-radius: 16px; box-shadow: var(--shadow-brown);
}

.permission-icon { font-size: 4rem; margin-bottom: 1.5rem; }

.permission-content h2 {
    font-family: var(--font-display); font-size: 1.8rem;
    color: var(--beige-light); margin-bottom: 1rem;
}

.permission-content p {
    font-size: 1.1rem; color: var(--beige-dim);
    line-height: 1.7; margin-bottom: 2rem;
}

.permission-btn {
    display: block; width: 100%; padding: 1rem 2rem;
    background: var(--burgundy); border: 1px solid var(--border-medium);
    border-radius: 8px; color: var(--beige-light);
    font-family: var(--font-display); font-size: 1rem;
    font-weight: 600; cursor: pointer; margin-bottom: 0.8rem;
    transition: all var(--transition-medium); letter-spacing: 0.1em;
}

.permission-btn:hover {
    background: var(--burgundy-light);
    box-shadow: var(--shadow-beige);
    transform: translateY(-2px);
}

.permission-btn.secondary {
    background: transparent; border: 1px solid var(--border-subtle);
    color: var(--beige-dim);
}
.permission-btn.secondary:hover {
    border-color: var(--border-medium); color: var(--beige);
}

/* ============================================
   MAIN MENU
   ============================================ */
#main-menu {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1000; display: flex; align-items: center; justify-content: center;
}

.menu-background {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(74, 14, 31, 0.35) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 80%, rgba(61, 40, 23, 0.45) 0%, transparent 60%),
        rgba(31, 20, 10, 0.55);
    overflow: hidden;
}

.ambient-glow {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(74, 14, 31, 0.2) 0%, transparent 70%);
    animation: ambientPulse 8s ease-in-out infinite;
}

@keyframes ambientPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
}

.mystical-particles {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
}

.menu-content {
    position: relative; z-index: 10; text-align: center;
    padding: 2rem; max-width: 500px; width: 100%;
}

/* Logo */
.game-logo { margin-bottom: 3rem; animation: fadeInUp 1.5s ease-out; }
.logo-moon {
    font-size: 3.5rem; margin-bottom: 1.5rem;
    animation: moonFloat 4s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(212, 197, 169, 0.3));
}

@keyframes moonFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(5deg); }
}

.logo-title {
    font-family: var(--font-display); font-size: 2.2rem; font-weight: 700;
    color: var(--beige-light); letter-spacing: 0.15em;
    text-shadow: 0 0 20px rgba(212, 197, 169, 0.15);
    margin-bottom: 0.5rem; line-height: 1.3;
}

.logo-subtitle {
    font-family: var(--font-body); font-size: 1rem; font-weight: 300;
    color: var(--beige-dim); font-style: italic;
    letter-spacing: 0.15em; margin-bottom: 1.5rem;
}

.logo-divider {
    width: 60px; height: 1px; background: var(--border-medium);
    margin: 0 auto;
}

/* Menu Buttons */
.menu-buttons { display: flex; flex-direction: column; gap: 0.7rem; margin-bottom: 2.5rem; }
.menu-btn {
    position: relative; display: flex; align-items: center; justify-content: center;
    gap: 0.8rem; padding: 1rem 2rem;
    background: transparent; border: 1px solid var(--border-subtle);
    border-radius: 8px; color: var(--beige);
    font-family: var(--font-display); font-size: 0.95rem;
    font-weight: 500; cursor: pointer; letter-spacing: 0.08em;
    transition: all var(--transition-medium); overflow: hidden;
}

.menu-btn::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 197, 169, 0.05), transparent);
    transform: translateX(-100%); transition: transform 0.6s ease;
}

.menu-btn:hover::before { transform: translateX(100%); }

.menu-btn:hover {
    border-color: var(--border-medium); color: var(--beige-light);
    transform: translateX(-3px); box-shadow: var(--shadow-beige);
    background: rgba(212, 197, 169, 0.03);
}

.menu-btn.primary {
    background: var(--burgundy); border-color: var(--burgundy-light);
    color: var(--beige-light); font-weight: 600;
}
.menu-btn.primary:hover {
    background: var(--burgundy-light); border-color: var(--beige-dim);
    box-shadow: var(--shadow-burgundy);
}

.btn-icon { font-size: 1.2rem; opacity: 0.8; }
.btn-text { position: relative; z-index: 2; }

/* Menu Footer */
.menu-footer {
    margin-top: 2rem; padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
}
.menu-footer p { font-size: 0.8rem; color: var(--beige-dim); margin-bottom: 0.3rem; letter-spacing: 0.1em; }
.menu-footer .version { font-size: 0.7rem; opacity: 0.6; }

/* ============================================
   GAME AREA
   ============================================ */
#game-area {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 100; overflow: hidden;
}

#input-video { position: absolute; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; }

#hand-canvas {
    position: absolute; top: 20px; right: 20px;
    width: 200px; height: 150px;
    border-radius: 12px; border: 1px solid var(--border-subtle);
    background: rgba(31, 20, 10, 0.8); z-index: 200;
    opacity: 0.7; transition: opacity var(--transition-fast);
}
#hand-canvas:hover { opacity: 1; }

#tarot-canvas {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1; display: block;
}

/* Gesture Feedback */
.gesture-feedback {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    display: flex; flex-direction: column; align-items: center; gap: 1rem;
    pointer-events: none; z-index: 150;
    transition: opacity var(--transition-medium);
}

.gesture-icon {
    font-size: 4rem; opacity: 0.6;
    animation: gestureFloat 2s ease-in-out infinite;
}

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

.gesture-text {
    font-family: var(--font-display); font-size: 1.2rem;
    color: var(--beige-dim); letter-spacing: 0.1em;
    text-align: center; max-width: 300px;
}

/* Hand Status */
.hand-status {
    position: absolute; top: 20px; left: 20px;
    display: flex; align-items: center; gap: 0.5rem;
    background: rgba(31, 20, 10, 0.8); padding: 0.5rem 1rem;
    border-radius: 20px; border: 1px solid var(--border-subtle);
    z-index: 200;
}

.status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--beige-dim); transition: all var(--transition-fast);
}
.status-dot.active { background: var(--beige-light); box-shadow: 0 0 8px rgba(212, 197, 169, 0.4); }
.status-dot.tracking { background: var(--burgundy-light); box-shadow: 0 0 8px rgba(74, 14, 31, 0.6); }

.status-text { font-size: 0.75rem; color: var(--beige-dim); letter-spacing: 0.1em; }

/* Reading Panel */
.reading-panel {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-overlay); backdrop-filter: blur(30px);
    z-index: 500; display: flex; align-items: center; justify-content: center;
}

.reading-content {
    max-width: 600px; width: 90%; max-height: 85vh;
    background: var(--bg-panel); border: 1px solid var(--border-medium);
    border-radius: 16px; padding: 2.5rem;
    overflow-y: auto; box-shadow: var(--shadow-brown);
    animation: readingAppear 0.6s ease-out;
}

@keyframes readingAppear {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.reading-card-display {
    text-align: center; margin-bottom: 2rem;
}

.reading-card-display .card-visual {
    width: 200px; height: 340px; margin: 0 auto;
    border-radius: 12px; border: 2px solid var(--border-medium);
    background: var(--brown); display: flex; flex-direction: column;
    align-items: center; justify-content: center; padding: 1.5rem;
    box-shadow: var(--shadow-beige);
}

.reading-text {
    font-family: var(--font-body); font-size: 1.1rem;
    line-height: 1.8; color: var(--beige);
    text-align: center; margin-bottom: 2rem;
}

.reading-text h3 {
    font-family: var(--font-display); font-size: 1.5rem;
    color: var(--beige-light); margin-bottom: 1rem;
}

.reading-close {
    display: block; margin: 0 auto; padding: 0.8rem 2.5rem;
    background: var(--burgundy); border: 1px solid var(--border-medium);
    border-radius: 8px; color: var(--beige-light);
    font-family: var(--font-display); font-size: 0.9rem;
    font-weight: 600; cursor: pointer; letter-spacing: 0.1em;
    transition: all var(--transition-medium);
}

.reading-close:hover {
    background: var(--burgundy-light); box-shadow: var(--shadow-beige);
}

/* ============================================
   HUD
   ============================================ */
.tarot-hud {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 50;
}

.tarot-hud > * { pointer-events: auto; }

.hud-top-left {
    position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
}

.spread-info {
    background: rgba(31, 20, 10, 0.8); padding: 0.6rem 1.5rem;
    border-radius: 20px; border: 1px solid var(--border-subtle);
    backdrop-filter: blur(10px);
}

.spread-name {
    font-family: var(--font-display); font-size: 0.85rem;
    color: var(--beige); letter-spacing: 0.15em;
}

.hud-top-right {
    position: absolute; top: 20px; right: 240px;
    display: flex; gap: 0.5rem;
}

.hud-btn {
    padding: 0.5rem 1rem; background: rgba(31, 20, 10, 0.8);
    border: 1px solid var(--border-subtle); border-radius: 6px;
    color: var(--beige-dim); font-family: var(--font-display);
    font-size: 0.75rem; cursor: pointer; letter-spacing: 0.1em;
    transition: all var(--transition-fast);
}

.hud-btn:hover {
    border-color: var(--border-medium); color: var(--beige-light);
    background: rgba(212, 197, 169, 0.05);
}

.hud-bottom {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
}

.gesture-legend {
    display: flex; gap: 2rem; background: rgba(31, 20, 10, 0.8);
    padding: 0.8rem 1.5rem; border-radius: 12px;
    border: 1px solid var(--border-subtle); backdrop-filter: blur(10px);
}

.gesture-item {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.75rem; color: var(--beige-dim);
}

.gesture-emoji { font-size: 1.2rem; }

/* ============================================
   SCREEN OVERLAYS
   ============================================ */
.screen-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 500; display: flex; align-items: center; justify-content: center;
    background: var(--bg-overlay); backdrop-filter: blur(20px);
    overflow-y: auto; padding: 2rem;
}

.screen-overlay > div {
    max-width: 700px; width: 100%; background: var(--bg-panel);
    border: 1px solid var(--border-subtle); border-radius: 16px;
    padding: 2.5rem; max-height: 85vh; overflow-y: auto;
    box-shadow: var(--shadow-brown);
}

.back-btn {
    display: block; margin: 2rem auto 0; padding: 0.8rem 2.5rem;
    background: transparent; border: 1px solid var(--border-medium);
    border-radius: 8px; color: var(--beige);
    font-family: var(--font-display); font-size: 0.9rem;
    font-weight: 500; cursor: pointer; letter-spacing: 0.1em;
    transition: all var(--transition-medium);
}

.back-btn:hover {
    border-color: var(--beige-dim); color: var(--beige-light);
    background: rgba(212, 197, 169, 0.05);
}

/* Settings */
.settings-title {
    font-family: var(--font-display); font-size: 1.8rem;
    color: var(--beige-light); text-align: center;
    margin-bottom: 2rem; letter-spacing: 0.1em;
}

.settings-section { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border-subtle); }
.settings-section:last-of-type { border-bottom: none; }
.settings-section h3 {
    font-family: var(--font-display); font-size: 1rem;
    color: var(--burgundy-light); margin-bottom: 1rem; letter-spacing: 0.1em;
}

.setting-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.8rem 0; gap: 1rem;
}

.setting-item label { font-size: 0.95rem; color: var(--beige); }

.setting-item input[type="range"] {
    width: 150px; accent-color: var(--burgundy-light);
    background: var(--brown); height: 4px; border-radius: 2px;
}

.setting-item input[type="checkbox"] {
    width: 18px; height: 18px; accent-color: var(--burgundy-light);
    cursor: pointer;
}

.setting-value { font-size: 0.8rem; color: var(--beige-dim); min-width: 40px; text-align: left; }

/* Language Toggle */
.language-toggle { display: flex; gap: 0.5rem; }
.lang-btn {
    padding: 0.5rem 1rem; background: transparent;
    border: 1px solid var(--border-subtle); border-radius: 6px;
    color: var(--beige-dim); font-family: var(--font-display);
    font-size: 0.8rem; cursor: pointer; transition: all var(--transition-fast);
}
.lang-btn.active { background: var(--burgundy); border-color: var(--burgundy-light); color: var(--beige-light); }
.lang-btn:hover:not(.active) { border-color: var(--border-medium); color: var(--beige); }

/* Learn Screen */
.learn-title {
    font-family: var(--font-display); font-size: 1.8rem;
    color: var(--beige-light); text-align: center;
    margin-bottom: 2rem; letter-spacing: 0.1em;
}

.cards-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem; margin-bottom: 2rem;
}

.card-thumbnail {
    aspect-ratio: 2/3; background: var(--brown);
    border: 1px solid var(--border-subtle); border-radius: 8px;
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 1rem; cursor: pointer;
    transition: all var(--transition-medium);
}

.card-thumbnail:hover {
    border-color: var(--border-medium); transform: translateY(-5px);
    box-shadow: var(--shadow-beige);
}

.card-thumbnail .card-num { font-family: var(--font-display); font-size: 0.7rem; color: var(--beige-dim); margin-bottom: 0.5rem; }
.card-thumbnail .card-name { font-family: var(--font-display); font-size: 0.75rem; color: var(--beige); text-align: center; }
.card-thumbnail .card-emoji { font-size: 2rem; margin-bottom: 0.5rem; }

/* Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-overlay); backdrop-filter: blur(30px);
    z-index: 600; display: flex; align-items: center; justify-content: center;
}

.modal-content {
    position: relative; max-width: 500px; width: 90%;
    background: var(--bg-panel); border: 1px solid var(--border-medium);
    border-radius: 16px; padding: 2rem; box-shadow: var(--shadow-brown);
}

.modal-close {
    position: absolute; top: 1rem; right: 1rem;
    width: 32px; height: 32px; border-radius: 50%;
    background: transparent; border: 1px solid var(--border-subtle);
    color: var(--beige-dim); font-size: 1.5rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition-fast);
}
.modal-close:hover { border-color: var(--border-medium); color: var(--beige-light); }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .loading-title { font-size: 2rem; }
    .logo-title { font-size: 1.6rem; }
    .menu-content { padding: 1rem; }
    .gesture-legend { gap: 1rem; padding: 0.6rem 1rem; }
    .gesture-legend span { display: none; }
    .hud-top-right { right: 20px; top: 80px; flex-direction: column; }
    #hand-canvas { width: 120px; height: 90px; top: 10px; right: 10px; }
    .reading-content { padding: 1.5rem; }
    .cards-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}

@media (max-width: 480px) {
    .loading-title { font-size: 1.5rem; }
    .logo-title { font-size: 1.3rem; }
    .menu-btn { padding: 0.8rem 1.5rem; font-size: 0.85rem; }
    .permission-content { padding: 2rem; margin: 1rem; }
    .screen-overlay > div { padding: 1.5rem; }
}

/* ============================================
   SCROLLBAR & SELECTION
   ============================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); border-radius: 3px; }
::-webkit-scrollbar-thumb { background: var(--burgundy); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--burgundy-light); }
::selection { background: rgba(74, 14, 31, 0.4); color: var(--beige-light); }

/* ============================================
   LIBRARY HOTSPOTS — كروت / ستارة / بلاك هول
   يتوهج بس اللي بدوره حتى ما يتوه اللاعب
   ============================================ */
#libraryHotspots { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 9500; display: flex; gap: 14px; }
.hotspot { display: flex; align-items: center; gap: 8px; background: rgba(10,8,13,0.75); border: 1px solid rgba(212,197,169,0.25); color: #8b7a5f; padding: 10px 16px; border-radius: 12px; cursor: not-allowed; opacity: 0.45; transition: all 0.3s; font-family: inherit; font-size: 13px; }
.hotspot .num { width: 20px; height: 20px; border-radius: 50%; background: rgba(212,197,169,0.15); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.hotspot.active { cursor: pointer; opacity: 1; color: #e8d5b5; border-color: #00d4aa; box-shadow: 0 0 16px rgba(0,212,170,0.35); animation: hotspotPulse 1.8s ease-in-out infinite; }
.hotspot.active .num { background: #00d4aa; color: #08110d; }
.hotspot.done { opacity: 0.7; border-color: rgba(0,212,170,0.3); cursor: default; }
.hotspot.done .num { background: rgba(0,212,170,0.3); }
@keyframes hotspotPulse {
    0%, 100% { box-shadow: 0 0 12px rgba(0,212,170,0.3); }
    50% { box-shadow: 0 0 24px rgba(0,212,170,0.6); }
}

/* ============================================
   المكتبة الثلاثية الأبعاد — تصويبة، تلميح تفاعل، وأزرار مشي/تفاعل للمس
   ============================================ */
#lib-crosshair {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 8px; height: 8px; border-radius: 50%;
    border: 1.5px solid rgba(232, 213, 181, 0.75);
    z-index: 400; pointer-events: none;
}
#lib-prompt {
    position: fixed; bottom: 34%; left: 50%; transform: translateX(-50%);
    background: rgba(10,8,13,0.8); border: 1px solid rgba(0,212,170,0.5); color: #e8d5b5;
    padding: 8px 18px; border-radius: 10px; font-size: 13px; z-index: 400;
    box-shadow: 0 0 16px rgba(0,212,170,0.3);
}
#lib-controls {
    position: fixed; bottom: 20px; left: 0; right: 0; z-index: 400;
    display: flex; justify-content: space-between; align-items: flex-end; padding: 0 20px;
    pointer-events: none;
}
.lib-btn {
    pointer-events: auto; width: 52px; height: 52px; border-radius: 50%;
    background: rgba(10,8,13,0.7); border: 1px solid rgba(212,197,169,0.35); color: #e8d5b5;
    font-size: 18px; display: flex; align-items: center; justify-content: center;
    user-select: none; touch-action: none;
}
.lib-btn:active { background: rgba(212,197,169,0.2); }
#lib-dpad { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lib-dpad-row { display: flex; gap: 4px; }
.lib-interact {
    width: 78px; height: 78px; font-size: 30px;
    border-color: rgba(0,212,170,0.6); box-shadow: 0 0 18px rgba(0,212,170,0.35);
}
@media (min-width: 900px) and (hover: hover) {
    #lib-controls { display: none; }
}

#lib-menu-btn {
    position: fixed; top: 16px; right: 16px; z-index: 410;
    width: 42px; height: 42px; border-radius: 10px;
    background: rgba(10,8,13,0.7); border: 1px solid rgba(212,197,169,0.3); color: #e8d5b5;
    font-size: 18px; cursor: pointer;
}
#btn-menu-to-library {
    position: absolute; top: 16px; right: 16px; z-index: 20;
    background: rgba(10,8,13,0.7); border: 1px solid rgba(212,197,169,0.35); color: #e8d5b5;
    padding: 8px 14px; border-radius: 10px; font-size: 12px; cursor: pointer;
}
