/* ── Save Game page styles ──────────────────────────────────────────── */

/* Side panel width for this page */
:root { --panel-width: 420px; }

/* Hero */
.replay-hero {
    padding: 32px 36px 28px;
    margin-bottom: 0;
}

.replay-hero h1 {
    margin: 8px 0 0;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.replay-hero-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.replay-help-btn {
    flex-shrink: 0;
    font-size: .83rem;
    padding: 6px 14px;
    border-color: rgba(255,255,255,.18) !important;
}

/* Info bar (description + ads, sits below hero) */
.replay-info-bar {
    padding: 18px 36px;
    margin-bottom: 20px;
    margin-top: 12px;
    display: flex;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
}

.replay-info-bar p {
    flex: 1;
    color: var(--muted);
    margin: 0;
    line-height: 1.6;
    min-width: 200px;
}

.replay-ads-slot {
    flex-shrink: 0;
    min-width: 160px;
    min-height: 60px;
    border-radius: 8px;
    background: rgba(255,255,255,.03);
    border: 1px dashed rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: .7rem;
}

/* No data */
.replay-no-data {
    padding: 36px;
    text-align: center;
    margin-bottom: 20px;
}

.replay-no-data p {
    color: var(--muted);
    line-height: 1.7;
    margin: 0;
}

/* ── Workspace ──────────────────────────────────────────────────────── */
.replay-workspace {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    margin-bottom: 24px;
}

@media (max-width: 860px) {
    .replay-workspace {
        grid-template-columns: 1fr;
    }
}

/* ── Settings panel ─────────────────────────────────────────────────── */
.replay-settings {
    padding: 24px;
    position: sticky;
    top: 20px;
}

.replay-settings h2 {
    margin: 0 0 20px;
    font-size: 1.1rem;
}

.replay-field {
    margin-bottom: 18px;
}

.replay-field > label:first-child {
    display: block;
    font-size: .8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: 8px;
    font-weight: 600;
}

.replay-input {
    width: 100%;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
    padding: 9px 12px;
    color: inherit;
    font-family: inherit;
    font-size: .92rem;
    transition: border-color .2s;
}

.replay-input:focus {
    outline: none;
    border-color: rgba(63, 198, 202, .45);
    background: rgba(255, 255, 255, .09);
}

/* Segmented control */
.replay-seg {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.replay-seg-btn {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
    background: rgba(255, 255, 255, .04);
    color: var(--muted);
    cursor: pointer;
    font-size: .83rem;
    font-family: inherit;
    transition: border-color .15s, background .15s, color .15s;
    white-space: nowrap;
}

.replay-seg-btn:hover {
    border-color: rgba(63, 198, 202, .35);
    color: var(--text);
}

.replay-seg-btn.is-active {
    border-color: rgba(63, 198, 202, .55);
    background: rgba(63, 198, 202, .14);
    color: var(--accent-2);
}

.replay-hint {
    margin: 6px 0 0;
    font-size: .76rem;
    color: var(--muted);
    line-height: 1.5;
}

/* Move range */
.replay-range-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.replay-range-row > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.replay-range-label {
    font-size: .72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.replay-range-input {
    width: 100%;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
    padding: 8px 10px;
    color: inherit;
    font-family: inherit;
    font-size: .9rem;
    text-align: center;
}

.replay-range-input:focus {
    outline: none;
    border-color: rgba(63, 198, 202, .45);
}

.replay-range-sep {
    color: var(--muted);
    font-size: 1.1rem;
    flex-shrink: 0;
    padding-top: 18px;
}

/* Watermark toggle */
.replay-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.replay-toggle-row > label:first-child {
    margin-bottom: 0;
    flex: 1;
}

.replay-toggle {
    flex-shrink: 0;
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    cursor: pointer;
}

.replay-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.replay-toggle-track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .16);
    transition: background .2s;
}

.replay-toggle-track::after {
    content: '';
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--muted);
    transition: left .2s, background .2s;
}

.replay-toggle input:checked + .replay-toggle-track {
    background: rgba(63, 198, 202, .35);
    border-color: rgba(63, 198, 202, .5);
}

.replay-toggle input:checked + .replay-toggle-track::after {
    left: calc(100% - 18px);
    background: var(--accent-2);
}

/* Actions */
.replay-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.replay-actions .primary-button,
.replay-actions .ghost-button {
    flex: 1;
    min-width: 110px;
    text-align: center;
    font-size: .85rem;
}

.replay-save-btn {
    border-color: rgba(129, 107, 255, .4) !important;
    color: var(--accent) !important;
}

.replay-save-btn:hover {
    background: rgba(129, 107, 255, .12) !important;
}

/* Status */
.replay-status {
    margin: 10px 0 0;
    font-size: .82rem;
    color: var(--muted);
    line-height: 1.5;
    min-height: 1.2em;
}

.replay-status.is-ok     { color: var(--accent-2); }
.replay-status.is-error  { color: #f87171; }
.replay-status.is-warn   { color: #fbbf24; }

/* Progress */
.replay-progress-wrap {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.replay-progress-wrap[hidden] { display: none; }

.replay-progress-bar {
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent-2), var(--accent));
    width: 0%;
    transition: width .25s;
}

.replay-progress-label {
    font-size: .76rem;
    color: var(--muted);
}

/* ── Preview panel ──────────────────────────────────────────────────── */
.replay-preview-wrap {
    padding: 20px 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
}

.replay-preview-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.replay-move-counter {
    font-size: .8rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.replay-canvas {
    display: block;
    border-radius: 8px;
    max-width: 100%;
    height: auto;
    background: #1b2a40;
}

/* Playback controls */
.replay-preview-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.replay-ctrl-btn {
    padding: 6px 12px;
    font-size: 1rem;
    line-height: 1;
}

.replay-ctrl-play {
    min-width: 52px;
}

/* Slider */
.replay-slider {
    width: 100%;
    accent-color: var(--accent-2);
    cursor: pointer;
    height: 4px;
}

/* ── Info sections ──────────────────────────────────────────────────── */
.replay-info-section {
    padding: 28px 32px;
    margin-bottom: 20px;
}

.replay-info-section h2 {
    margin: 0 0 16px;
    font-size: 1.15rem;
}

.replay-info-section p {
    color: var(--muted);
    line-height: 1.75;
    margin: 0 0 10px;
}

.replay-info-section p:last-child {
    margin-bottom: 0;
}

.replay-how-list {
    padding-left: 20px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--muted);
    line-height: 1.7;
}

.replay-how-list li strong {
    color: var(--text);
}

/* FAQ accordion */
.replay-faq-item {
    border-top: 1px solid var(--line);
    padding: 12px 0;
}

.replay-faq-item:first-of-type {
    margin-top: 8px;
}

.replay-faq-item summary {
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    padding-right: 8px;
    color: var(--text);
}

.replay-faq-item summary::-webkit-details-marker { display: none; }

.replay-faq-item summary::after {
    content: ' ›';
    color: var(--muted);
    transition: transform .2s;
    display: inline-block;
}

.replay-faq-item[open] summary::after {
    transform: rotate(90deg);
}

.replay-faq-item p {
    margin: 10px 0 0;
    padding-left: 4px;
}

.replay-faq-item a {
    color: var(--accent-2);
    text-decoration: underline;
}

/* ── Saved projects list (loaded on this page for quick access) ──────── */
.replay-saved-section {
    margin-bottom: 24px;
}

.replay-saved-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.replay-saved-card {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .03);
}

.replay-saved-card-info strong { display: block; margin-bottom: 4px; font-size: .95rem; }
.replay-saved-card-info span   { color: var(--muted); font-size: .8rem; }

.replay-saved-card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.replay-saved-card-actions button {
    font-size: .78rem;
    padding: 5px 12px;
}

.replay-saved-empty {
    color: var(--muted);
    font-size: .88rem;
    padding: 12px 0;
}

/* ── Help panel sections ──────────────────────────────────────────────── */
.help-section {
    margin-bottom: 28px;
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section h3 {
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.help-section p {
    color: var(--muted);
    line-height: 1.7;
    margin: 0 0 10px;
    font-size: .9rem;
}

.help-section p:last-child { margin-bottom: 0; }

.help-section .replay-how-list {
    font-size: .9rem;
}
