/* The handful of utility classes this page uses, self-hosted; the page
       previously loaded all of Tailwind from a CDN its own CSP blocked. */
    .font-semibold { font-weight: 600; }
    .mb-1 { margin-bottom: .25rem; }
    .text-blue-400 { color: #60a5fa; }
    .tracking-wider { letter-spacing: .05em; }
    .uppercase { text-transform: uppercase; }

        body { margin: 0; overflow: hidden; background-color: #0a0b0d; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; color: #e2e8f0; }
        .skip-link { position: absolute; top: -100px; left: 0; background: #4f46e5; color: #fff; padding: 0.6rem 1rem; border-radius: 0 0 6px 0; z-index: 999; font-weight: 600; font-size: 0.85rem; text-decoration: none; transition: top 0.15s; }
        .skip-link:focus { top: 0; outline: 2px solid #fff; outline-offset: -4px; }
        .lang-switcher-floating { position: fixed; top: 12px; right: 12px; z-index: 260; display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px; border-radius: 10px; background: rgba(6, 11, 25, 0.88); border: 1px solid rgba(96, 165, 250, 0.35); backdrop-filter: blur(12px); pointer-events: auto; }
        .lang-switcher-floating > span { color: rgba(148, 163, 184, 0.45); font-size: 0.72rem; }
        .lang-btn { font-family: inherit; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; color: #cbd5e1; background: transparent; border: 1px solid rgba(148, 163, 184, 0.3); border-radius: 7px; padding: 0.25rem 0.5rem; min-width: 32px; min-height: 28px; cursor: pointer; }
        .lang-btn.active { color: #0a0b0d; background: #60a5fa; border-color: #60a5fa; }
        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
        }
        #canvas-container { position: absolute; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 1; }

        #ui-layer {
            position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; pointer-events: none;
            display: flex; flex-direction: column; justify-content: space-between;
            perspective: 1200px;
        }

        .spatial-panel {
            pointer-events: auto;
            background: linear-gradient(135deg, rgba(6, 11, 25, 0.8), rgba(15, 25, 50, 0.9));
            backdrop-filter: blur(12px);
            border: 1px solid rgba(96, 165, 250, 0.3);
            border-top: 1px solid rgba(147, 197, 253, 0.6);
            box-shadow: 0 15px 35px rgba(0,0,0,0.6), inset 0 0 20px rgba(59, 130, 246, 0.15);
            transform-style: preserve-3d;
            border-radius: 12px;
        }

        header { padding: 1.25rem; text-align: center; border-bottom: 1px solid rgba(100, 150, 255, 0.15); border-radius: 0; }
        h1 { margin: 0; font-size: 1.25rem; font-weight: 400; letter-spacing: 3px; color: #93c5fd; text-transform: uppercase; text-shadow: 0 0 10px rgba(147, 197, 253, 0.5); }
        h2 { margin: 0.25rem 0 0 0; font-size: 0.8rem; font-weight: 400; color: #94a3b8; }

        #controls { display: flex; justify-content: center; gap: 0.5rem; padding: 0.75rem; flex-wrap: wrap; background: rgba(6, 11, 25, 0.4); border-top: none; }
        .nav-btn {
            background: rgba(30, 41, 59, 0.6); border: 1px solid rgba(59, 130, 246, 0.4); color: #bfdbfe;
            padding: 0.5rem 1rem; border-radius: 9999px; cursor: pointer; transition: all 0.3s ease;
            font-size: 0.8rem; letter-spacing: 1px; font-weight: 600; text-transform: uppercase;
            box-shadow: 0 4px 6px rgba(0,0,0,0.3);
        }
        .nav-btn:hover { background: rgba(59, 130, 246, 0.3); box-shadow: 0 0 15px rgba(59, 130, 246, 0.5); transform: translateY(-2px); }
        .nav-btn.active { background: rgba(59, 130, 246, 0.8); color: #fff; box-shadow: 0 0 20px rgba(59, 130, 246, 0.6); border-color: #93c5fd; }

        .action-btn { border-color: #3b82f6; color: #bfdbfe; margin-left: 0.5rem;}
        .action-btn:hover { background: rgba(59, 130, 246, 0.2); box-shadow: 0 0 15px rgba(59, 130, 246, 0.4); }

        .history-btn { border-color: #f59e0b; color: #fde68a; }
        .history-btn.active { background: #f59e0b; color: #fff; box-shadow: 0 0 20px #f59e0b; border-color: #fde68a; }

        #info-panel-container {
            position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
            width: 90%; max-width: 950px;
            perspective: 1500px;
            transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
        }

        #info-panel-container.hidden {
            transform: translateX(-50%) translateY(150%);
            opacity: 0;
            pointer-events: none;
        }

        #info-panel {
            width: 100%; padding: 1.5rem 2rem;
            max-height: 50vh; overflow-y: auto;
            transition: transform 0.1s ease-out;
        }

        #info-panel::-webkit-scrollbar { width: 6px; }
        #info-panel::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); border-radius: 4px; }
        #info-panel::-webkit-scrollbar-thumb { background: rgba(59, 130, 246, 0.6); border-radius: 4px; }

        #text-content {
            transform: translateZ(30px);
            text-shadow: 0 2px 10px rgba(0,0,0,0.8);
            transition: opacity 0.3s ease-in-out;
        }

        .topic-title { font-size: 1.25rem; font-weight: 700; color: #60a5fa; margin-bottom: 0.5rem; display: flex; align-items: center; justify-content: space-between;}
        .topic-badge { background: rgba(96, 165, 250, 0.2); padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.7rem; color: #93c5fd; border: 1px solid rgba(147, 197, 253, 0.3); }
        .section-header { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; color: #94a3b8; border-bottom: 1px solid rgba(148, 163, 184, 0.3); padding-bottom: 0.2rem; margin-top: 1rem; margin-bottom: 0.5rem; }
        .topic-content { font-size: 0.95rem; line-height: 1.6; color: #cbd5e1; }
        .topic-content p { margin-bottom: 0.5rem; }
        .highlight { color: #facc15; font-weight: 600; text-shadow: 0 0 8px rgba(250, 204, 21, 0.4); }
        .highlight-green { color: #60a5fa; font-weight: 600; text-shadow: 0 0 8px rgba(96, 165, 250, 0.4); }
        .math { font-family: 'Courier New', Courier, monospace; background: rgba(0,0,0,0.5); padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.9em; border: 1px solid rgba(255,255,255,0.2); color: #fff;}

        .simple-box { background: rgba(59, 130, 246, 0.1); border-left: 4px solid #3b82f6; padding: 0.75rem; border-radius: 0 8px 8px 0; margin-top: 0.5rem; font-size: 0.9rem; }
        .simple-box strong { color: #60a5fa; }

        #loading {
            position: absolute; top: 0; left: 0; width: 100%; height: 100%;
            background: #030308; display: flex; justify-content: center; align-items: center;
            z-index: 100; color: #60a5fa; font-size: 1.5rem; letter-spacing: 3px; transition: opacity 1s;
        }

        .instruction {
            position: absolute; right: 1.5rem; bottom: 1.5rem; text-align: right;
            color: #94a3b8; font-size: 0.8rem; padding: 1rem;
            border-right: 3px solid #3b82f6;
            pointer-events: none;
            transform: translateZ(20px);
        }

        @media (max-width: 768px) {
            .instruction { display: none; }
            #info-panel { padding: 1rem; max-height: 55vh; }
            #controls { padding: 0.5rem; gap: 0.4rem; }
            .nav-btn { padding: 0.4rem 0.6rem; font-size: 0.65rem; }
            .action-btn { margin-left: 0; }
            #info-panel { transform: none !important; }
            #text-content { transform: translateZ(0); }
        }
