/* Chess Move Presenter - board and save/load page inside the framework layout.
   Colours come from the framework (colors.css); this file holds layout and
   the few chess-specific controls only. */

.studio-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
}

.board-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.status-line {
    font-size: 1.1rem;
    font-weight: 600;
}

.board-svg {
    width: min(70vh, 640px);
    height: min(70vh, 640px);
    border: 2px solid #333;
    touch-action: none;
    user-select: none;
}

.board-coord {
    font-size: 11px;
    font-weight: 600;
    fill: #333;
    pointer-events: none;
    user-select: none;
}

.selected-square {
    fill: rgba(255, 215, 0, 0.55);
}

.move-marker {
    fill: rgba(0, 0, 0, 0.35);
}

.capture-marker {
    fill: none;
    stroke: rgba(0, 0, 0, 0.35);
    stroke-width: 6;
}

.piece-cell {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    line-height: 1;
}

.piece-white {
    color: #ffffff;
    text-shadow: -1px 0 #222, 0 1px #222, 1px 0 #222, 0 -1px #222;
}

.piece-black {
    color: #111111;
    text-shadow: -1px 0 #eee, 0 1px #eee, 1px 0 #eee, 0 -1px #eee;
}

.annotation-caption {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
}

/* Toolbox: framework panel look */

.tool-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 260px;
    padding: 1rem;
    background: var(--color-bg-panel);
    border: 1px solid var(--color-border-panel);
    color: var(--color-text-normal);
}

/* Section titles use the framework class; only the spacing is tighter here. */
.tool-section .settings-section-title {
    margin: 0 0 0.6rem 0;
}

.toggle-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.6rem;
}

.toggle-caption {
    font-size: var(--fs-s);
    color: var(--color-text-section);
}

.button-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.button-column {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* Active tool on a framework standard button */
.btn-std.tool-active,
.btn-std.tool-active:hover:not(:disabled) {
    background: var(--color-btn-std-pressed-bg);
    border-color: var(--color-btn-std-hover-border);
    color: var(--color-text-bright);
}

.piece-palette {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.6rem;
}

.piece-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.35rem;
}

.piece-button {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
    background: var(--color-bg-window);
    border: 1px solid var(--color-border-panel);
    cursor: pointer;
    transition: border-color 0.15s;
}

.piece-button:hover {
    border-color: var(--color-btn-std-hover-border);
}

.piece-button-white {
    color: #ffffff;
    text-shadow: -1px 0 #222, 0 1px #222, 1px 0 #222, 0 -1px #222;
}

/* Light outline keeps black glyphs visible on the dark background. */
.piece-button-black {
    color: #111111;
    text-shadow: -1px 0 #eee, 0 1px #eee, 1px 0 #eee, 0 -1px #eee;
}

.piece-button.active {
    border-color: var(--color-text-accent);
    box-shadow: 0 0 0 1px var(--color-text-accent);
}

.color-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
}

.color-swatch.active {
    border-color: var(--color-text-bright);
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--fs-m);
    cursor: pointer;
}

.radio-option input {
    accent-color: var(--color-text-accent);
}

/* Text field in the toolbox: framework inline input, full width */
.tool-panel .inline-input {
    width: 100%;
    box-sizing: border-box;
    margin-top: 0.4rem;
}

/* Save/Load page: framework settings layout; only rows and list are local. */

.storage-save,
.storage-search,
.storage-confirm {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

/* Framework search field, stretched inside a row */
.storage-save .admin-search,
.storage-search .admin-search {
    flex: 1;
    max-width: none;
    margin-bottom: 0;
}

.storage-message {
    margin: 0 0 0.75rem 0;
    color: var(--color-text-accent);
}

/* Ten rows visible, the rest scrolls. */
.storage-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: calc(10 * 2.5rem);
    overflow-y: auto;
    background: var(--color-bg-window);
    border: 1px solid var(--color-border-panel);
}

.storage-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(78, 78, 80, 0.5);
    font-size: 0.82rem;
}

.storage-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
