/* ═══ 3D dashboard (index.html) ════════════════════════════════════════════
   Page-specific on top of css/style.css: the viewport, the hover tooltip, the
   loading curtain and the replay widgets. The sidebar itself and everything in
   it comes from the shared sheet.
   ═════════════════════════════════════════════════════════════════════════ */

body {
    /* The viewport is fixed and fills the page; nothing here scrolls but the
       sidebar body, which owns its own scrollbar. */
    overflow: hidden;
}

/* ─── Viewport ─────────────────────────────────────────────────────────── */
#canvas-container {
    position: fixed;
    left: var(--sidebar-w);
    top: 0;
    right: 0;
    bottom: 0;
}

/* ─── Tooltip ──────────────────────────────────────────────────────────── */
#tooltip {
    position: fixed;
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 3px solid var(--brand-500);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 12px;
    pointer-events: none;
    display: none;
    z-index: 200;
    box-shadow: var(--shadow-card);
    min-width: 220px;
}
.tt-code {
    font-size: 16px;
    font-weight: 800;
    color: var(--accent-text);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}
.tt-row {
    display: flex;
    justify-content: space-between;
    color: var(--text-soft);
    margin-bottom: 4px;
    font-size: 11px;
}
.tt-row span:last-child {
    color: var(--text);
    font-weight: 700;
}

/* ─── Loading curtain ──────────────────────────────────────────────────── */
/* On the brand gradient rather than flat navy: this is the first thing shown, so
   it is where the product identity lands hardest. */
#loading {
    position: fixed;
    inset: 0;
    background: linear-gradient(120deg, var(--brand-700), var(--brand-600) 60%, var(--brand-500));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s;
}
#loading .loading-logo {
    height: 30px;
    width: auto;
    margin-bottom: 22px;
}
#loading h1 {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
}
#loading p {
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    margin-top: 8px;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.22);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    margin-bottom: 20px;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ─── Replay widgets ───────────────────────────────────────────────────── */
.sim-stat {
    text-align: center;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 6px;
}
.sim-stat .num {
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
}
.sim-stat .lbl {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-soft);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.sim-bar-track {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 4px;
    height: 6px;
    overflow: hidden;
    margin: 8px 0 4px;
}
.sim-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--brand-500);
    width: 0%;
    transition: width 0.12s linear;
}
.speed-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
    margin-bottom: 8px;
}
.speed-grid .mode-btn {
    padding: 6px 2px;
    font-size: 11px;
}

/* ─── Hint ─────────────────────────────────────────────────────────────── */
#hint {
    position: fixed;
    bottom: 12px;
    right: 12px;
    font-size: 10px;
    color: var(--text-faint);
    opacity: 0.7;
    pointer-events: none;
    text-align: right;
}
