/* Class Studio drawer + File picker. Revert this file with the JS to hide the feature. */

body.class-screen #btn-studio,
body.class-screen #btn-file,
body.class-screen #studio-drawer {
    display: none !important;
}

#studio-drawer[hidden] { display: none !important; }

#studio-drawer .drawer {
    width: min(420px, 92vw);
}

.studio-split {
    display: grid;
    gap: 14px;
}

.studio-tree-list {
    list-style: none;
    margin: 0;
    padding: 0 0 0 8px;
}

.studio-tree-item { margin: 2px 0; }

.studio-node-row {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px;
    border-radius: 8px;
    border: 1px solid transparent;
}
.studio-node-row.is-selected { background: var(--bg-tertiary); border-color: var(--border-subtle); }
.studio-node-row.is-drop { outline: 2px dashed var(--accent-gold); }

.studio-twist,
.studio-icon {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text-main);
    min-width: 28px;
    min-height: 32px;
    cursor: pointer;
    font: inherit;
}
.studio-twist-spacer { width: 28px; flex: 0 0 28px; }
.studio-node-title {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    text-align: left;
    flex: 1;
    min-height: 36px;
    cursor: pointer;
}
.studio-count {
    color: var(--text-muted, #94a3b8);
    font-weight: 500;
    font-size: 0.82rem;
}
.studio-del {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 4px 10px;
    font-size: 0.82rem;
    color: #fca5a5;
    background: transparent;
    border-color: transparent;
}
.studio-del:hover {
    background: #7f1d1d;
    color: #fff;
    border-color: transparent;
}

.studio-moments { display: flex; flex-direction: column; gap: 6px; }
.studio-moment-row {
    display: flex;
    gap: 6px;
    align-items: stretch;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    background: var(--bg-secondary);
}
.studio-moment-row.is-selected { border-color: var(--accent-gold); }
.studio-moment-row.is-drop { outline: 2px dashed var(--accent-gold); }
.studio-moment-open {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    flex: 1;
    padding: 8px 10px;
    cursor: pointer;
}
.studio-moment-note { color: var(--text-muted, #94a3b8); font-size: 0.86rem; margin-top: 4px; }
.studio-ply { color: var(--text-muted, #94a3b8); font-weight: 500; }

/* Picker (live + class) */
.studio-picker[hidden] { display: none !important; }
.studio-picker {
    position: fixed;
    inset: 0;
    z-index: 12000;
}
.studio-picker-back {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}
.studio-picker-card {
    position: relative;
    z-index: 1;
    width: min(480px, calc(100vw - 24px));
    max-height: min(88vh, 640px);
    overflow: auto;
    margin: 8vh auto 0;
    background: #131b2e;
    color: #e5e7eb;
    border: 1px solid #2d3748;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.studio-picker-head {
    display: flex;
    align-items: center;
    gap: 8px;
}
.studio-picker-head h2 { flex: 1; margin: 0; font-size: 1.1rem; }
.studio-picker-x {
    min-width: 40px;
    min-height: 40px;
}
.studio-picker-help { color: #94a3b8; font-size: 0.9rem; }
.studio-picker-label { display: block; margin: 10px 0 4px; font-weight: 600; font-size: 0.86rem; }
.studio-picker input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    border-radius: 10px;
    border: 1px solid #2d3748;
    background: #0b0f19;
    color: #e5e7eb;
    padding: 8px 12px;
    font: inherit;
}
.studio-picker-list {
    margin: 8px 0;
    max-height: 240px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.studio-picker-row {
    appearance: none;
    text-align: left;
    border: 1px solid #2d3748;
    background: #1e293b;
    color: inherit;
    border-radius: 8px;
    padding: 10px 12px;
    min-height: 44px;
    cursor: pointer;
    display: flex;
    gap: 8px;
    align-items: center;
    font: inherit;
}
.studio-picker-row.is-selected {
    border-color: #f59e0b;
    background: #1e293b;
}
.studio-picker-path { flex: 1; }
.studio-picker-recent {
    font-size: 0.75rem;
    color: #f59e0b;
    font-weight: 700;
}
.studio-picker-empty { color: #94a3b8; margin: 8px 0; }
.studio-picker-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.studio-picker-actions .cb-btn {
    appearance: none;
    border: 1px solid #2d3748;
    background: #1e293b;
    color: #e5e7eb;
    border-radius: 10px;
    min-height: 44px;
    padding: 8px 14px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.studio-picker-actions .cb-btn.primary {
    background: #3b82f6;
    border-color: transparent;
    color: #fff;
}

body.is-admin .game-file-btn { display: inline-flex; }
.game-file-btn { display: none; }
.analysis-file-btn { display: none; }
body.is-admin .analysis-file-btn { display: inline-flex; }
