/**
 * Schach-Arena: Stylesheet
 * Version: 1.2 (17.10.2026)
 * Änderung: Stile für Abspieler, Partienlisten und Aufzeichnen (sr-*).
 * Vorversion 1.1 (17.10.2026): Stil für die Katalogliste im Admin-Bereich (sa-cat, sa-linkbtn).
 * Vorversion 1.0 (17.10.2026): Erstfassung; Zeilenhöhe des Bretts korrigiert.
 */

.sa-root { --sa-light: #f0d9b5; --sa-dark: #b58863; --sa-ink: #1c1c1c; --sa-line: #c9c2b4; --sa-panel: #faf8f3; --sa-accent: #2f5d8a; max-width: 100%; color: #1c1c1c; }
.sa-root * { box-sizing: border-box; }
.sa-wrap { display: grid; grid-template-columns: minmax(0, 560px) minmax(260px, 1fr); gap: 24px; align-items: start; }
.sa-main { min-width: 0; }
.sa-side { min-width: 0; display: flex; flex-direction: column; gap: 14px; }

/* Brett */
.sa-boardbox { position: relative; width: 100%; max-width: 560px; }
.sa-board { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); grid-template-rows: repeat(8, minmax(0, 1fr)); width: 100%; aspect-ratio: 1 / 1; border: 2px solid #5a4630; user-select: none; -webkit-user-select: none; }
.sa-sq { position: relative; display: flex; align-items: center; justify-content: center; margin: 0; padding: 0; border: 0; border-radius: 0; cursor: pointer; font: inherit; line-height: 1; }
.sa-sq.light { background: var(--sa-light); }
.sa-sq.dark { background: var(--sa-dark); }
.sa-sq.last::before { content: ""; position: absolute; inset: 0; background: rgba(255, 221, 51, 0.38); }
.sa-sq.sel::before { content: ""; position: absolute; inset: 0; background: rgba(60, 140, 255, 0.45); }
.sa-sq.chk::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, rgba(220, 30, 30, 0.75) 0%, rgba(220, 30, 30, 0) 75%); }
.sa-sq.tgt::after { content: ""; position: absolute; width: 28%; height: 28%; border-radius: 50%; background: rgba(20, 20, 20, 0.28); }
.sa-sq.cap::after { content: ""; position: absolute; inset: 4%; border-radius: 50%; border: 5px solid rgba(20, 20, 20, 0.28); }
.sa-sq:focus-visible { outline: 3px solid var(--sa-accent); outline-offset: -3px; z-index: 2; }

.sa-pc { position: relative; z-index: 1; font-size: clamp(26px, 6.6vw, 50px); line-height: 1; font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "DejaVu Sans", "Apple Symbols", sans-serif; pointer-events: none; }
.sa-pc.w { color: #ffffff; text-shadow: 0 0 2px #000, 0 0 1px #000, 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000; }
.sa-pc.b { color: #151515; text-shadow: 0 0 1px rgba(255, 255, 255, 0.35); }

.sa-coord { position: absolute; z-index: 1; font-family: sans-serif; font-size: 10px; font-weight: 700; line-height: 1; opacity: 0.75; pointer-events: none; }
.sa-sq.light .sa-coord { color: var(--sa-dark); }
.sa-sq.dark .sa-coord { color: var(--sa-light); }
.sa-rank { top: 3px; left: 3px; }
.sa-file { bottom: 3px; right: 3px; }

/* Spielerleisten und Status */
.sa-bar { min-height: 30px; padding: 5px 0; font-family: sans-serif; font-size: 14px; }
.sa-bar-in { display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px; border-radius: 14px; border: 1px solid transparent; }
.sa-bar-in.active { border-color: var(--sa-accent); background: rgba(47, 93, 138, 0.08); }
.sa-dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid #333; display: inline-block; }
.sa-dot.w { background: #fff; }
.sa-dot.b { background: #151515; }
.sa-status { margin: 6px 0 0; padding: 8px 12px; border-left: 4px solid var(--sa-accent); background: var(--sa-panel); font-family: sans-serif; font-size: 15px; min-height: 40px; }

/* Umwandlung */
.sa-promo { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; padding: 12px 14px; background: #fff; border: 2px solid var(--sa-accent); border-radius: 8px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); font-family: sans-serif; font-size: 14px; }
.sa-promo[hidden] { display: none; }
.sa-pbtn { padding: 4px 10px; background: var(--sa-light); }
.sa-pbtn .sa-pc { font-size: 34px; }

/* Panels */
.sa-panel { padding: 12px 14px; border: 1px solid var(--sa-line); border-radius: 8px; background: var(--sa-panel); font-family: sans-serif; font-size: 14px; }
.sa-panel[hidden] { display: none; }
.sa-panel h2 { margin: 0 0 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: #555; }
.sa-field { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.sa-field span { font-size: 12px; color: #555; }
.sa-field select { width: 100%; padding: 7px 8px; font: inherit; border: 1px solid #aaa; border-radius: 5px; background: #fff; color: #1c1c1c; }
.sa-check { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 10px; font-size: 13px; line-height: 1.35; }
.sa-check input { margin-top: 3px; }
.sa-hint { margin: 0 0 12px; font-size: 12px; color: #666; line-height: 1.4; }

.sa-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.sa-btn { padding: 8px 12px; font: inherit; font-size: 13px; border: 1px solid #8d8d8d; border-radius: 5px; background: #fff; color: #1c1c1c; cursor: pointer; }
.sa-btn:hover:not(:disabled) { background: #eef3f8; border-color: var(--sa-accent); }
.sa-btn:disabled { opacity: 0.45; cursor: default; }
.sa-btn:focus-visible { outline: 3px solid var(--sa-accent); outline-offset: 1px; }
.sa-primary { background: var(--sa-accent); border-color: var(--sa-accent); color: #fff; font-weight: 700; }
.sa-primary:hover:not(:disabled) { background: #244a6f; color: #fff; }

/* Admin: Eden-Katalog */
.sa-cat { max-height: 240px; margin-top: 8px; }
.sa-linkbtn { padding: 0; border: 0; background: none; color: var(--sa-accent); font: inherit; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; text-align: left; cursor: pointer; text-decoration: underline; }

/* Tabelle, Zugliste, Protokoll */
.sa-tablewrap { overflow-x: auto; }
.sa-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sa-table th, .sa-table td { padding: 5px 6px; border-bottom: 1px solid #e2ddd1; text-align: left; vertical-align: top; }
.sa-table th { font-weight: 700; color: #555; white-space: nowrap; }
.sa-moves { margin: 0; padding: 0; list-style: none; max-height: 220px; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }
.sa-moves li { display: flex; gap: 6px; white-space: nowrap; }
.sa-moves li .n { color: #888; min-width: 28px; }
.sa-moves li.sa-empty { grid-column: 1 / -1; color: #888; font-family: sans-serif; }
.sa-log { margin: 0; padding: 0; list-style: none; max-height: 180px; overflow-y: auto; font-size: 12px; line-height: 1.45; }
.sa-log li { padding: 3px 0; border-bottom: 1px dotted #ddd6c8; }
.sa-log li.sa-empty { color: #888; border: 0; }

.sa-note { margin: 18px 0 0; font-family: sans-serif; font-size: 12px; line-height: 1.5; color: #666; }

@media (max-width: 900px) {
    .sa-wrap { grid-template-columns: minmax(0, 1fr); }
    .sa-boardbox { max-width: none; }
}

@media (prefers-color-scheme: dark) {
    .sa-root { --sa-panel: #23262b; --sa-line: #3a3f46; color: #e8e8e8; }
    .sa-panel h2, .sa-field span, .sa-table th { color: #b7bcc4; }
    .sa-hint, .sa-note { color: #a3a9b1; }
    .sa-field select, .sa-btn { background: #2d3138; color: #e8e8e8; border-color: #565c66; }
    .sa-btn:hover:not(:disabled) { background: #36404d; }
    .sa-primary { background: #3d78b0; border-color: #3d78b0; color: #fff; }
    .sa-primary:hover:not(:disabled) { background: #4a8bc6; }
    .sa-status { background: #23262b; }
    .sa-table th, .sa-table td { border-color: #3a3f46; }
    .sa-log li { border-color: #3a3f46; }
    .sa-promo { background: #23262b; color: #e8e8e8; }
}

/* Partien: Abspieler, Listen, Aufzeichnen (schach-replay.js) */
#sr-root { margin-top: 32px; }
.sr-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.sr-list { margin: 0; padding: 0; list-style: none; }
.sr-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #e2ddd1; }
.sr-sub { font-size: 12px; color: #666; }
.sr-locked { padding: 8px 10px; border-left: 4px solid #b58863; background: rgba(181, 136, 99, 0.12); }
.sr-ctrl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.sr-speed { margin-left: auto; font-family: sans-serif; font-size: 12px; color: #555; }
.sr-speed select { padding: 5px; font: inherit; }
.sr-slider { width: 100%; margin: 10px 0 0; }
.sr-intro, .sr-note { margin: 8px 0 0; font-size: 14px; line-height: 1.5; }
.sr-note { min-height: 3em; }
.sr-moves { margin: 0; padding: 0; list-style: none; max-height: 260px; overflow-y: auto; position: relative; display: grid; grid-template-columns: 34px 1fr 1fr; gap: 2px 6px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }
.sr-moves li.n { color: #888; align-self: center; }
.sr-moves button { width: 100%; padding: 3px 6px; border: 1px solid transparent; border-radius: 4px; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.sr-moves button:hover { background: rgba(47, 93, 138, 0.1); }
.sr-moves button.cur { background: var(--sa-accent); color: #fff; }
.sr-moves button:focus-visible { outline: 2px solid var(--sa-accent); }
.sr-warn { color: #c0392b; }
.sr-star { color: #d4a017; }
.sr-rec { margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--sa-accent); border-radius: 8px; background: rgba(47, 93, 138, 0.06); }
.sr-vis { margin: 0 0 10px; padding: 8px 10px; border: 1px solid var(--sa-line); border-radius: 6px; font-size: 13px; line-height: 1.8; }
.sr-linkbox { width: 100%; margin-top: 4px; padding: 6px; font: inherit; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
@media (prefers-color-scheme: dark) {
    .sr-list li { border-color: #3a3f46; }
    .sr-sub, .sr-speed { color: #a3a9b1; }
    .sr-moves button.cur { background: #3d78b0; }
    .sr-linkbox, .sr-speed select { background: #2d3138; color: #e8e8e8; border: 1px solid #565c66; }
}
