/* ═══════════════════════════════════════════════════════════════
   FINISHED GAMES PAGE — addons on top of home.css shared classes
   ═══════════════════════════════════════════════════════════════ */

/* ── Layout: same grid as home ──────────────────────────────── */
.fg-layout {
    display: grid;
    grid-template-columns: minmax(300px, 30%) 1fr;
    gap: var(--space-2xl);
    align-items: start;
    margin-bottom: var(--space-2xl);
}

.fg-sidebar {
    position: sticky;
    top: calc(var(--topbar-height, 64px) + var(--space-xl));
}

.fg-sidebar-inner {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* ── Page icon in identity-header ───────────────────────────── */
.fg-page-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-full);
    background: linear-gradient(160deg, var(--color-primary-light) 0%, var(--color-primary) 55%, var(--color-primary-dark) 100%);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 4px 0 var(--bevel-primary-edge), 0 4px 10px rgba(0, 0, 0, .2);
}

/* ── Filter card ────────────────────────────────────────────── */
.fg-filter-card {
    overflow: visible;
}

.fg-filter-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--color-gray-100);
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.fg-filter-body {
    padding: var(--space-lg) var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.fg-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.fg-filter-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.fg-select {
    width: 100%;
    padding: 8px var(--space-md);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-lg);
    background: linear-gradient(155deg, var(--bg-primary) 0%, var(--bg-tertiary) 130%);
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-family: inherit;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 2px 0 rgba(0, 0, 0, .04), 0 3px 8px -2px rgba(0, 0, 0, .12);
}

.fg-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, .12);
}

.fg-reset-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 7px var(--space-md);
    border: none;
    border-radius: var(--radius-xl);
    background: linear-gradient(160deg, #cbd5e1 0%, #94a3b8 55%, #64748b 100%);
    color: #fff;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
    align-self: flex-start;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 4px 0 var(--bevel-gray-edge), 0 4px 10px rgba(0, 0, 0, .18);
}

.fg-reset-btn:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 6px 0 var(--bevel-gray-edge), 0 5px 12px rgba(0, 0, 0, .2);
}

/* ── Result-coloured left border on match cards ─────────────── */
.fg-match-card {
    border-left: 4px solid var(--color-gray-200);
    cursor: pointer;
}

.fg-result-win {
    border-left-color: var(--color-success, #22c55e);
}

.fg-result-loss {
    border-left-color: var(--color-error, #ef4444);
}

.fg-result-draw {
    border-left-color: var(--color-warning, #f59e0b);
}

/* ── Result status badges ───────────────────────────────────── */
.fg-status-win {
    background: linear-gradient(160deg, #4ade80 0%, #16a34a 100%);
    color: #fff;
    border: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 0 var(--bevel-green-edge), 0 2px 6px var(--bevel-green-glow);
}

.fg-status-loss {
    background: linear-gradient(160deg, #fca5a5 0%, #ef4444 100%);
    color: #fff;
    border: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 0 var(--bevel-red-edge), 0 2px 6px var(--bevel-red-glow);
}

.fg-status-draw {
    background: linear-gradient(160deg, #fcd34d 0%, #d97706 100%);
    color: #fff;
    border: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 0 var(--bevel-amber-edge), 0 2px 6px var(--bevel-amber-glow);
}

/* ── Date field ─────────────────────────────────────────────── */
.fg-date {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    white-space: nowrap;
    margin-left: auto;
}

/* ── Empty state icon (3D tile, scoped to this page) ────────── */
.fg-layout .no-matches-hero .no-matches-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: linear-gradient(160deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
    color: #fff;
    opacity: 1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 4px 0 var(--bevel-primary-edge), 0 4px 10px rgba(0, 0, 0, .2);
}

/* ── Pagination ─────────────────────────────────────────────── */
.fg-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: var(--space-xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--color-gray-100);
}

.fg-page-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: none;
    border-radius: var(--radius-lg);
    background: linear-gradient(160deg, #e2e8f0 0%, #cbd5e1 55%, #94a3b8 100%);
    color: #1e293b;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 3px 0 var(--bevel-gray-edge), 0 3px 8px rgba(0, 0, 0, .14);
}

.fg-page-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    color: #1e293b;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 5px 0 var(--bevel-gray-edge), 0 5px 12px rgba(0, 0, 0, .18);
}

.fg-page-btn:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 1px 0 var(--bevel-gray-edge), 0 2px 6px rgba(0, 0, 0, .12);
}

.fg-page-btn--active,
.fg-page-btn:disabled {
    background: linear-gradient(160deg, var(--color-primary-light) 0%, var(--color-primary) 55%, var(--color-primary-dark) 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 3px 0 var(--bevel-primary-edge), 0 3px 8px rgba(0, 0, 0, .2);
    cursor: default;
    transform: none;
}

.fg-page-ellipsis {
    color: var(--text-secondary);
    padding: 0 4px;
    font-size: var(--text-sm);
}

.fg-page-label {
    width: 100%;
    text-align: center;
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-top: var(--space-xs);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .fg-layout {
        grid-template-columns: minmax(260px, 32%) 1fr;
        gap: var(--space-xl);
    }
}

@media (max-width: 900px) {
    .fg-layout {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .fg-sidebar {
        position: static;
    }

    .fg-sidebar-inner {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-md);
        align-items: start;
    }
}

@media (max-width: 640px) {
    .fg-sidebar-inner {
        grid-template-columns: 1fr;
    }

    .matches-section {
        padding: var(--space-lg);
    }

    .match-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .match-info {
        flex-wrap: wrap;
    }

    .fg-date {
        margin-left: 0;
    }
}

@media (min-width: 1600px) {
    .fg-layout {
        grid-template-columns: minmax(360px, 28%) 1fr;
        gap: var(--space-3xl, 3rem);
    }
}