/* ================================================================== */
/*  LearnPress Marble Worlds — Viewer Styles                          */
/* ================================================================== */

/* Container — takes over the lesson content area */
.lpmw-world-wrapper {
    position: relative;
    width: 100%;
    height: 75vh;
    min-height: 480px;
    max-height: 900px;
    background: #0a0a12;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.4);
}

.lpmw-world-wrapper:fullscreen,
.lpmw-world-wrapper:-webkit-full-screen {
    height: 100vh;
    max-height: none;
    border-radius: 0;
}

/* Canvas */
.lpmw-canvas-container {
    position: absolute;
    inset: 0;
    z-index: 1;
}
.lpmw-canvas-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* ------------------------------------------------------------------ */
/*  Loading screen                                                    */
/* ------------------------------------------------------------------ */
.lpmw-loading {
    position: absolute;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a12;
}

.lpmw-loading-inner {
    text-align: center;
    color: #c0c8d8;
    max-width: 320px;
}

.lpmw-loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 3px solid rgba(120, 140, 200, 0.15);
    border-top-color: #7a8adf;
    border-radius: 50%;
    animation: lpmw-spin 0.9s linear infinite;
}

@keyframes lpmw-spin {
    to { transform: rotate(360deg); }
}

.lpmw-loading-title {
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
    font-size: 18px;
    font-weight: 600;
    color: #e0e4f0;
    margin: 0 0 8px;
    letter-spacing: 0.02em;
}

.lpmw-loading-status {
    font-size: 13px;
    color: #7a8aaa;
    margin: 0 0 16px;
}

.lpmw-loading-bar {
    width: 100%;
    height: 4px;
    background: rgba(120, 140, 200, 0.12);
    border-radius: 2px;
    overflow: hidden;
}

.lpmw-loading-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #5a6abf, #7a8adf);
    border-radius: 2px;
    transition: width 0.4s ease-out;
}

.lpmw-loading.loaded {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

/* ------------------------------------------------------------------ */
/*  HUD overlay                                                       */
/* ------------------------------------------------------------------ */
.lpmw-hud {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
}

.lpmw-hud-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(180deg, rgba(10, 10, 18, 0.7) 0%, transparent 100%);
    pointer-events: auto;
}

.lpmw-hud-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #c0c8d8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.lpmw-hud-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #5DCAA5;
    box-shadow: 0 0 8px rgba(93, 202, 165, 0.5);
    animation: lpmw-pulse 2s ease-in-out infinite;
}

@keyframes lpmw-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.lpmw-hud-controls {
    display: flex;
    gap: 6px;
}

.lpmw-hud-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(120, 140, 200, 0.2);
    border-radius: 6px;
    background: rgba(10, 10, 18, 0.5);
    color: #c0c8d8;
    font-size: 14px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: background 0.2s, border-color 0.2s;
}

.lpmw-hud-btn:hover {
    background: rgba(90, 106, 191, 0.3);
    border-color: rgba(120, 140, 200, 0.4);
}

.lpmw-view-mode-badge {
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    color: #7a8aaa;
    background: rgba(120, 140, 200, 0.1);
    border: 1px solid rgba(120, 140, 200, 0.15);
    border-radius: 4px;
    padding: 4px 8px;
    letter-spacing: 0.08em;
    line-height: 1;
    align-self: center;
}

/* Bottom bar */
.lpmw-hud-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(0deg, rgba(10, 10, 18, 0.7) 0%, transparent 100%);
    pointer-events: auto;
}

.lpmw-hud-progress {
    flex: 1;
    max-width: 300px;
}

.lpmw-hud-progress-label {
    font-size: 11px;
    color: #7a8aaa;
    margin-bottom: 4px;
    display: block;
}

.lpmw-hud-progress-bar {
    height: 4px;
    background: rgba(120, 140, 200, 0.12);
    border-radius: 2px;
    overflow: hidden;
}

.lpmw-hud-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #5DCAA5, #7adfcf);
    border-radius: 2px;
    transition: width 0.6s ease-out;
}

.lpmw-hud-hotspot-count {
    font-size: 12px;
    color: #7a8aaa;
}

/* Crosshair */
.lpmw-crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    color: rgba(200, 210, 230, 0.4);
    pointer-events: none;
    display: none;
}
.lpmw-crosshair.active { display: block; }

/* ------------------------------------------------------------------ */
/*  Hotspot panel                                                     */
/* ------------------------------------------------------------------ */
.lpmw-hotspot-panel {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    pointer-events: auto;
}

.lpmw-hotspot-panel-inner {
    background: rgba(10, 10, 18, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(120, 140, 200, 0.2);
    border-radius: 10px;
    padding: 16px 20px;
    min-width: 280px;
    max-width: 400px;
    text-align: center;
}

.lpmw-hotspot-panel-inner h4 {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 14px;
    font-weight: 600;
    color: #e0e4f0;
    margin: 0 0 6px;
}

.lpmw-hotspot-panel-inner p {
    font-size: 12px;
    color: #7a8aaa;
    margin: 0 0 12px;
    line-height: 1.5;
}

.lpmw-hotspot-btn {
    background: linear-gradient(135deg, #5a6abf, #7a8adf);
    border: none;
    border-radius: 6px;
    padding: 8px 20px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: opacity 0.2s;
}

.lpmw-hotspot-btn:hover {
    opacity: 0.85;
}

/* ------------------------------------------------------------------ */
/*  Help overlay                                                      */
/* ------------------------------------------------------------------ */
.lpmw-help-overlay {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 18, 0.8);
    backdrop-filter: blur(8px);
}

.lpmw-help-inner {
    background: rgba(20, 20, 35, 0.95);
    border: 1px solid rgba(120, 140, 200, 0.2);
    border-radius: 12px;
    padding: 24px 28px;
    max-width: 400px;
    text-align: center;
}

.lpmw-help-inner h3 {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 16px;
    color: #e0e4f0;
    margin: 0 0 16px;
}

.lpmw-help-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 16px;
    text-align: left;
    margin-bottom: 20px;
}

.lpmw-help-grid div {
    font-size: 12px;
    color: #a0a8c0;
    line-height: 1.6;
}

.lpmw-help-key {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 11px;
    font-weight: 600;
    color: #c0c8d8;
    background: rgba(120, 140, 200, 0.1);
    border: 1px solid rgba(120, 140, 200, 0.2);
    border-radius: 4px;
    padding: 2px 8px;
    white-space: nowrap;
}
