/* The animator's page styles (anim.html, served at /solve).
   Colors come from the shared tokens in burr-theme.css. */

body { margin: 0; overflow: hidden; background: var(--bg); font-family: var(--font-ui); color: var(--text); }
canvas { display: block; }

/* ── Sidebar Panel ── */
#sidebar {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--panel);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    width: 300px;
    border: 1px solid var(--panel-border);
    pointer-events: auto;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

h1 { font-size: 16px; margin: 0 0 15px 0; color: var(--text); text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid var(--line-soft); padding-bottom: 10px; }
.title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid var(--line-soft);
    padding-bottom: 10px;
    margin-bottom: 15px;
}
.title-row h1 { border-bottom: none; padding-bottom: 0; margin: 0; }

.control-group { margin-bottom: 12px; }
label { display: block; margin-bottom: 4px; font-size: 12px; color: var(--muted); }

/* ── Input ── */
.input-row {
    display: flex;
    gap: 6px;
}
.input-row input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--line);
    background: var(--field);
    padding: 8px 10px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 14px;
    border-radius: 6px;
    box-sizing: border-box;
}
.input-row input:focus { outline: none; border-color: var(--accent); }

/* ── Buttons ── */
.btn {
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--field);
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--field-strong); }
.btn:active { background: var(--field-strong); border-color: var(--faint); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn:disabled { opacity: 0.4; cursor: default; }

/* ── Dropdown ── */
select {
    width: 100%;
    padding: 8px 10px;
    background: var(--field);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
    cursor: pointer;
}
select:focus { outline: none; border-color: var(--accent); }

/* ── Playback Controls ── */
.playback-row {
    display: flex;
    gap: 6px;
    align-items: center;
}
.playback-row .btn {
    font-size: 16px;
    padding: 0;
    width: 38px;
    /* fixed height too: the arrow/triangle/pause glyphs have
       different natural line boxes, which would otherwise make
       button heights differ and the row jump on play/pause */
    height: 38px;
    box-sizing: border-box;
    text-align: center;
}
/* Rewind + play swap with the single pause button inside a
   fixed-track grid: pause spans both tracks, so either state
   fills exactly the same footprint and nothing shifts. */
.transport {
    display: grid;
    grid-template-columns: repeat(2, 38px);
    gap: 6px;   /* matches .playback-row's gap */
}
.transport .btn-pause { grid-column: 1 / -1; width: auto; }
.move-label {
    font-size: 12px;
    color: var(--muted);
    margin-left: auto;
    white-space: nowrap;
}

/* ── Info Section ── */
.info-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line-soft);
}
.info { font-size: 12px; color: var(--muted); line-height: 1.6; }
.info strong { color: var(--text); }
.info .note-warn { color: var(--orange); }

/* ── Status ── */
#status {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    margin-top: 8px;
    display: none;
}
#status.error { display: block; background: var(--red-soft); border: 1px solid var(--red); color: var(--red); }
#status.solving { display: block; background: var(--accent-soft); border: 1px solid var(--accent); color: var(--accent-text); }

.hint { font-size: 11px; color: var(--faint); margin-top: 3px; }

.hidden { display: none !important; }

/* ── Move Tree Panel ── */
#move-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--panel);
    backdrop-filter: blur(10px);
    padding: 16px 16px 12px 16px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    width: 240px;
    border: 1px solid var(--panel-border);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}
.move-legend { font-size: 11px; color: var(--faint); margin-bottom: 8px; line-height: 1.4; }
.move-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 6px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text);
}
.move-item:hover { background: var(--field); }
.move-item.current { background: var(--accent-soft); outline: 1px solid var(--accent); }
.move-item.routing .move-text { color: var(--faint); font-style: italic; }

.move-num { color: var(--faint); font-size: 10px; min-width: 16px; text-align: right; flex-shrink: 0; }
.move-chip { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.move-text { white-space: nowrap; }
/* completion cursor: > above the puzzle's position, < below */
.move-done { color: var(--accent); font-size: 10px; width: 8px; text-align: center; flex-shrink: 0; }
.move-done.todo { color: var(--faint); }

/* ── Mode toast (matches exploded.html) ── */
#mode-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--panel-strong);
    color: var(--text);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow-soft);
    padding: 5px 14px;
    border-radius: 16px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
#mode-toast.show { opacity: 1; }

/* ── Isometric (SVG) view container ── */
#iso-container {
    position: fixed;
    inset: 0;
    display: none;
    touch-action: none;
    cursor: grab;
}
#iso-container svg { width: 100%; height: 100%; display: block; }

/* ── View toggle (segmented 3D / 2D pair) ── */
.view-toggle { display: flex; gap: 6px; }
.view-toggle .btn { flex: 1; text-align: center; }
.btn.active { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn.active:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
