/* ============================================================
   player.css — Unified stylesheet for profile_player.php,
   profile_steam.php, and profile_ra.php
   ============================================================ */

:root {
    --primary:        #6366f1;
    --primary-hover:  #4f46e5;
    --primary-dark:   #4f46e5;
    --success:        #10b981;
    --warning:        #f59e0b;
    --danger:         #ef4444;
    --dark-bg:        #0f172a;
    --card-bg:        #1e293b;
    --card-hover:     #2d3b52;
    --border-color:   #334155;
    --text-primary:   #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted:     #7487a3;
    --text-muted2:    #ebe48b;
    --hover-1:        rgb(234,102,102);  --hover-1rgba: rgba(241,99,99,0.3);
    --hover-2:        rgb(240,147,251);  --hover-2rgba: rgba(241,99,229,0.3);
    --hover-3:        rgb(79,140,254);   --hover-3rgba: rgba(99,156,241,0.3);
    --hover-4:        rgb(201,254,79);   --hover-4rgba: rgba(175,241,99,0.3);
}

/* ============================================================
   KEYFRAMES
   ============================================================ */
@keyframes bar-pulse {
    0%,100% { box-shadow: 0 0 4px 1px rgba(52,211,153,0.4); }
    50%      { box-shadow: 0 0 10px 3px rgba(52,211,153,0.75); }
}

@keyframes bar-scan {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

@keyframes hc-shimmer {
    0%,100% {
        box-shadow:   0 0 3px 1px rgba(245,158,11,0.5),
                      inset 0 0 0px 0px rgba(255,215,0,0);
        border-color: #f59e0b;
    }
    50% {
        box-shadow:   0 0 8px 3px rgba(251,191,36,0.85),
                      inset 0 0 6px 1px rgba(255,215,0,0.15);
        border-color: #fde68a;
    }
}

@keyframes tab-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ============================================================
   PROFILE HEADER  (steam + ra full pages)
   ============================================================ */
.profile-header {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.profile-header::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 160px; height: 160px;
    background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%);
    pointer-events: none;
}

/* RA tab gets the purple/pink tint */
.profile-header.ra::after {
    background: radial-gradient(circle, rgba(240,147,251,0.07) 0%, transparent 70%);
}

.profile-header:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 24px -8px rgba(99,102,241,0.25);
}

.profile-header.ra:hover {
    border-color: var(--hover-2);
    box-shadow: 0 8px 24px -8px var(--hover-2rgba);
}

.profile-header-avatar {
    width: 80px; height: 80px;
    border-radius: 16px;
    object-fit: cover;
    border: 3px solid var(--border-color);
    flex-shrink: 0;
    transition: border-color 0.3s ease;
}

.profile-header:hover .profile-header-avatar   { border-color: var(--primary); }
.profile-header.ra:hover .profile-header-avatar { border-color: var(--hover-2); }

.profile-header-identity { flex: 1; min-width: 0; }

.profile-header-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.75rem;
    line-height: 1.2;
}

.profile-header-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
}

.stat-divider {
    width: 1px; height: 2rem;
    background: var(--border-color);
    flex-shrink: 0;
}

.profile-header-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    line-height: 1.2;
    gap: 0.2rem;
}

.profile-header-stat strong {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: normal;
    text-transform: none;
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.profile-header.ra .profile-header-stat strong { color: var(--hover-2); }

.true-ratio {
    font-size: 0.78em;
    color: var(--text-muted);
    font-weight: 600;
}

.profile-stats-strip {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0 1.5rem;
    margin-top: 0.45rem;
}
.pss-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
}
.pss-stat + .pss-stat::before {
    content: '';
    position: absolute;
    left: -0.75rem;
    top: 10%;
    height: 80%;
    width: 1px;
    background: var(--border-color);
    opacity: 0.5;
}
.pss-value {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.15;
}
.pss-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.pss-v1 { color: var(--hover-1); }
.pss-v2 { color: var(--hover-2); }
.pss-v3 { color: var(--hover-3); }
.pss-v4 { color: var(--hover-4); }

.profile-page-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 2rem;
    align-items: start;
}

.controls-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.controls-card label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    white-space: nowrap;
}

.controls-card input[type="text"],
.controls-card select {
    background: var(--card-hover);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    padding: 0.45rem 0.75rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.controls-card input[type="text"] { flex: 1; min-width: 140px; }

.controls-card input[type="text"]:focus,
.controls-card select:focus { border-color: var(--primary); }

.controls-card select { cursor: pointer; }

.sort-direction-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    background: var(--card-hover);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sort-direction-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ============================================================
   GAME LIST  (steam + ra full pages)
   ============================================================ */
.game-list-main {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.game-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem;
    background: var(--card-bg);
    border: 1px solid transparent;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.game-row:hover { background: var(--card-hover); border-color: var(--border-color); }

.game-row.game-complete { border-color: rgba(16,185,129,0.2); }
.game-row.game-complete:hover {
    border-color: rgba(16,185,129,0.5);
    box-shadow: 0 4px 12px -4px rgba(16,185,129,0.2);
}

/* Steam: wide landscape thumbnail */
.game-row-img {
    width: 100px; height: 50px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--card-hover);
}

/* RA: square icon wrapper */
.game-icon { flex-shrink: 0; }
.game-icon img {
    width: 50px; height: 50px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
    background: var(--card-hover);
}
.game-icon-placeholder {
    width: 50px; height: 50px;
    border-radius: 8px;
    background: var(--card-hover);
}

.game-info {
    flex: 1; min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.game-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.game-name a {
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-name a:hover { color: var(--primary); }
.game-row.ra .game-name a:hover { color: var(--hover-2); }

.game-meta {
    font-size: 0.8125rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.game-row-hours {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ============================================================
   COMPLETE BADGE  (shared across all pages)
   ============================================================ */
.complete-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    background: rgba(16,185,129,0.15);
    color: #34d399;
    flex-shrink: 0;
}

/* ============================================================
   HC BADGE  (shared)
   ============================================================ */
.hc-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.5625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    background: rgba(245,158,11,0.15);
    color: #fbbf24;
    margin-left: 0.3rem;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ============================================================
   CONSOLE BADGES  (shared: ra full page + player overview)
   ============================================================ */
.console-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 18px;
    padding: 0 5px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.93);
    white-space: nowrap;
    flex-shrink: 0;
    vertical-align: middle;
    font-family: ui-monospace, 'Cascadia Code', monospace;
}

.console-unknown {
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: normal;
    color: var(--text-muted);
    text-transform: none;
    background: none;
}

.console-nintendo { background: rgba(192,0,10,0.6); }
.console-sega     { background: rgba(16,88,160,0.6); }
.console-sony     { background: rgba(92,53,168,0.6); }
.console-xbox     { background: rgba(16,124,16,0.6); }
.console-atari    { background: rgba(184,83,0,0.6); }
.console-arcade   { background: rgba(106,26,144,0.6); }
.console-other    { background: rgba(55,78,92,0.6); }

/* ============================================================
   PROGRESS BARS  (shared across all pages)
   ============================================================ */
.recent-game-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recent-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
    max-width: 200px;
    position: relative;
}

.recent-progress-bar.progress-bar--complete {
    animation: bar-pulse 2.4s ease-in-out infinite;
    overflow: visible;
}

.progress-bar--complete .recent-progress-fill {
    position: relative;
    overflow: hidden;
}

.progress-bar--complete .recent-progress-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 30%; height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.45) 50%, transparent 100%);
    animation: bar-scan 2.4s ease-in-out infinite;
}

.recent-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.recent-progress-fill.progress-100 { background: linear-gradient(90deg, #10b981, #34d399); }
.recent-progress-fill.progress-60  { background: linear-gradient(90deg, #6366f1, #818cf8); }
.recent-progress-fill.progress-30  { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.recent-progress-fill.progress-0   { background: linear-gradient(90deg, #64748b, #94a3b8); }

.recent-progress-text {
    font-size: 0.8rem;
    color: var(--text-muted2);
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* RA extras in progress text */
.progress-pts-sep { opacity: 0.35; font-size: 0.75rem; }
.progress-pts     { color: var(--text-muted); font-size: 0.75rem; }

/* ============================================================
   ACHIEVEMENT ICONS  (shared across all pages)
   ============================================================ */
.ach-icons {
    display: flex;
    gap: 0.35rem;
    flex-wrap: nowrap;
    margin-top: 0.1rem;
}

.ach-icon {
    width: 28px; height: 28px;
    border-radius: 5px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}

.ach-icon:hover {
    transform: scale(1.25);
    border-color: var(--primary);
    z-index: 5;
}

/* Hardcore shimmer */
.ach-icon.ach-icon--hc,
.rarest-icon.ach-icon--hc {
    border-color: #f59e0b;
    box-shadow: 0 0 4px rgba(245,158,11,0.5);
    animation: hc-shimmer 2s ease-in-out infinite;
}

.ach-icon.ach-icon--hc:hover,
.rarest-icon.ach-icon--hc:hover {
    animation: none;
    border-color: #fde68a;
    box-shadow: 0 0 10px 3px rgba(251,191,36,0.85);
}

/* ============================================================
   LOAD MORE BUTTON  (steam + ra)
   ============================================================ */
.load-more-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 1.25rem;
}

.load-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 2rem;
    background: var(--card-hover);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.load-more-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.load-more-btn:disabled { opacity: 0.4; cursor: default; }

/* ============================================================
   SIDEBAR  (steam + ra)
   ============================================================ */
.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sidebar-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 100px; height: 100px;
    background: radial-gradient(circle, rgba(99,102,241,0.07) 0%, transparent 70%);
    pointer-events: none;
}

.sidebar-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 16px -8px rgba(99,102,241,0.2);
}

/* RA sidebar gets purple tint */
.profile-sidebar.ra .sidebar-card::after {
    background: radial-gradient(circle, rgba(240,147,251,0.06) 0%, transparent 70%);
}
.profile-sidebar.ra .sidebar-card:hover {
    border-color: var(--hover-2);
    box-shadow: 0 8px 16px -8px var(--hover-2rgba);
}

.sidebar-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1.25rem;
}

/* Top Games */
.top-game-row { margin-bottom: 0.9rem; }
.top-game-row:last-child { margin-bottom: 0; }

.top-game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.top-game-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.top-game-row.top-game-row-complete .top-game-name { color: #34d399; }

.top-game-percent {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-muted2);
    flex-shrink: 0;
}

.top-game-bar-bg {
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.25rem;
    position: relative;
}

.top-game-bar-bg.top-game-bar-bg--complete {
    animation: bar-pulse 2.4s ease-in-out infinite;
    overflow: visible;
}

.top-game-bar-bg--complete .top-game-bar-fill {
    position: relative;
    overflow: hidden;
}

.top-game-bar-bg--complete .top-game-bar-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 30%; height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.45) 50%, transparent 100%);
    animation: bar-scan 2.4s ease-in-out infinite;
}

.top-game-bar-fill { height: 100%; border-radius: 2px; }
.top-game-bar-fill.progress-100 { background: linear-gradient(90deg, #10b981, #34d399); }
.top-game-bar-fill.progress-60  { background: linear-gradient(90deg, #6366f1, #818cf8); }
.top-game-bar-fill.progress-30  { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.top-game-bar-fill.progress-0   { background: linear-gradient(90deg, #64748b, #94a3b8); }

.top-game-counts { font-size: 0.75rem; color: var(--text-muted); }

/* Sidebar achievement rows (rarest, recent) */
.rarest-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.5rem;
    border-radius: 10px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.rarest-row:hover {
    background: var(--card-hover);
    border-color: var(--border-color);
}

.rarest-icon {
    width: 36px; height: 36px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
}

.rarest-info { flex: 1; min-width: 0; }

.rarest-ach-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rarest-game-name {
    font-size: 0.75rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rarest-meta {
    font-size: 0.6875rem;
    color: var(--text-muted);
    opacity: 0.8;
    margin-top: 0.15rem;
    line-height: 1.5;
}

.rarity-pct { color: var(--text-muted2); font-weight: 600; }

/* ============================================================
   ACHIEVEMENT HOVER MODAL  (shared)
   ============================================================ */
.achievement-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    max-width: 260px;
    box-shadow: 0 16px 32px rgba(0,0,0,0.5);
    pointer-events: none;
}

.achievement-modal-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.achievement-modal-icon {
    width: 40px; height: 40px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.achievement-modal-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.achievement-modal-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ============================================================
   PLAYER OVERVIEW PAGE SPECIFICS  (profile_player.php only)
   ============================================================ */

/* Platform tabs (combined overview nav) */
.platform-tabs {
    display: flex;
    gap: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem;
    margin-bottom: 2rem;
}

.platform-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    font-family: inherit;
}

.platform-tab:hover:not(.disabled):not(.active) {
    background: rgba(99,102,241,0.1);
    color: var(--text-primary);
}

.platform-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px -4px rgba(99,102,241,0.5);
}

.platform-tab.disabled { opacity: 0.3; cursor: not-allowed; }

.platform-tab-icon { width: 24px; height: 24px; object-fit: contain; }

.platform-tab-badge {
    position: absolute;
    top: 8px; right: 8px;
    background: rgba(239,68,68,0.9);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
    line-height: 1;
}

.platform-tab.active .platform-tab-badge { background: rgba(255,255,255,0.25); }

/* Content loading overlay */
.profile-content { min-height: 400px; position: relative; }
.profile-content-loading { pointer-events: none; }
.profile-content-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(15,23,42,0.5);
    border-radius: 12px;
    z-index: 10;
    backdrop-filter: blur(2px);
}
.profile-content-loading::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    width: 36px; height: 36px;
    border: 3px solid rgba(99,102,241,0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: tab-spin 0.7s linear infinite;
    z-index: 11;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.stat-card:hover              { border-color: var(--hover-1); box-shadow: 0 12px 24px -10px var(--hover-1rgba); }
.stat-card:nth-child(2):hover { border-color: var(--hover-2); box-shadow: 0 12px 24px -10px var(--hover-2rgba); }
.stat-card:nth-child(3):hover { border-color: var(--hover-3); box-shadow: 0 12px 24px -10px var(--hover-3rgba); }
.stat-card:nth-child(4):hover { border-color: var(--hover-4); box-shadow: 0 12px 24px -10px var(--hover-4rgba); }

.stat-value { font-size: 2.5rem; font-weight: 700; color: var(--text-primary); line-height: 1; margin-bottom: 0.5rem; }
.stat-label { font-size: 0.875rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }

/* Player overview layout */
.profile-layout  { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 2rem; align-items: start; }
.main-content    { display: flex; flex-direction: column; gap: 1.5rem; }
.sidebar-content { display: flex; flex-direction: column; gap: 1.5rem; }

/* Platform cards (linked Steam / RA summaries in player overview) */
.platform-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: block;
    color: inherit;
}

.platform-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 100px; height: 100px;
    background: radial-gradient(circle, rgba(99,102,241,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.platform-card:hover { border-color: var(--primary); box-shadow: 0 8px 16px -8px rgba(99,102,241,0.2); }
.platform-card.ra:hover { border-color: var(--hover-2); box-shadow: 0 8px 16px -8px var(--hover-2rgba); }

.platform-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; }
.platform-icon { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; }
.platform-icon img { width: 100%; height: 100%; object-fit: contain; }
.platform-title { font-size: 1.125rem; font-weight: 700; color: var(--text-primary); margin: 0; }

.platform-content { display: flex; gap: 1.25rem; align-items: center; }
.platform-avatar {
    width: 64px; height: 64px;
    border-radius: 12px; object-fit: cover;
    border: 2px solid var(--border-color);
    flex-shrink: 0; transition: border-color 0.3s;
}
.platform-card:hover .platform-avatar { border-color: var(--primary); }
.platform-card.ra:hover .platform-avatar { border-color: var(--hover-2); }

.platform-info { flex: 1; min-width: 0; }
.platform-username { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.5rem; }
.platform-stats { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 0.4rem; }
.platform-stat {
    display: flex; flex-direction: column; align-items: center;
    font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.03em; font-weight: 600; gap: 0.1rem;
}
.platform-stat strong { color: var(--primary); font-weight: 700; font-size: 0.95rem; letter-spacing: normal; text-transform: none; }
.platform-card.ra .platform-stat strong { color: var(--hover-2); }
.platform-meta { font-size: 0.8125rem; color: var(--text-muted); }
.platform-empty { text-align: center; padding: 1.5rem; color: var(--text-muted); font-size: 0.875rem; }

/* Player overview: Recent Games card */
.recent-games-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
}

.recent-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.recent-title  { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); margin: 0; }
.recent-games-list { display: flex; flex-direction: column; gap: 0.5rem; }

.recent-game-row {
    display: flex; align-items: center; gap: 1rem;
    padding: 0.75rem; border-radius: 12px;
    text-decoration: none; color: inherit;
    transition: all 0.2s ease; border: 1px solid transparent;
}
.recent-game-row:hover { background: var(--card-hover); border-color: var(--border-color); }
.recent-game-row.game-complete { border-color: rgba(16,185,129,0.2); }
.recent-game-row.game-complete:hover { border-color: rgba(16,185,129,0.5); box-shadow: 0 4px 12px -4px rgba(16,185,129,0.2); }

.recent-game-img     { width: 100px; height: 50px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: var(--card-hover); }
.recent-game-img.ra-icon { width: 50px; height: 50px; }

.recent-game-info   { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.3rem; }

.recent-game-name {
    font-size: 0.9375rem; font-weight: 600; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    display: flex; align-items: center; gap: 0.5rem;
}
.rg-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.recent-game-meta { font-size: 0.8125rem; color: var(--text-muted); display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.recent-game-hours { font-size: 0.875rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }

.recent-platform-badge { display: inline-flex; align-items: center; font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.125rem 0.5rem; border-radius: 4px; flex-shrink: 0; }
.steam-badge { background: rgba(99,102,241,0.15); color: #818cf8; }
.ra-badge    { background: rgba(240,147,251,0.15); color: #f093fb; }

/* Pagination (player overview) */
.pagination-controls { display: flex; align-items: center; justify-content: center; gap: 0.75rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border-color); }
.pagination-btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.5rem 1rem; background: var(--card-hover); border: 1px solid var(--border-color); border-radius: 8px; color: var(--text-secondary); font-size: 0.875rem; font-weight: 600; cursor: pointer; transition: all 0.2s ease; user-select: none; }
.pagination-btn:hover:not(.disabled) { background: var(--primary); color: white; border-color: var(--primary); }
.pagination-btn.disabled { opacity: 0.35; cursor: default; }
.pagination-info { font-size: 0.8125rem; color: var(--text-muted); font-weight: 600; min-width: 5rem; text-align: center; }

/* Favorites / Recent Achievements sidebar cards (player overview) */
.favorites-card, .recent-achievements-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
}
.favorites-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.favorites-title  { font-size: 1.125rem; font-weight: 700; color: var(--text-primary); margin: 0; }
.game-count       { font-size: 0.8125rem; color: var(--text-muted); background: rgba(99,102,241,0.1); padding: 0.2rem 0.6rem; border-radius: 12px; }

.games-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; }

/* Square game thumbnails (favorites grid) */
.game-item {
    position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
    transition: all 0.3s ease; cursor: pointer;
    background: var(--card-hover); border: 2px solid transparent; text-decoration: none;
}
.game-item:hover { border-color: var(--hover-1); z-index: 10; }
.game-img  { width: 100%; height: 100%; object-fit: cover; }
.game-hours {
    position: absolute; bottom: 5px; right: 5px;
    padding: 0.2rem 0.45rem; background: rgba(0,0,0,0.85);
    border-radius: 5px; font-size: 0.625rem; font-weight: 700; color: white;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Recent achievements sidebar (player overview) */
.recent-ach-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.recent-ach-title  { font-size: 1.125rem; font-weight: 700; color: var(--text-primary); margin: 0; }
.recent-ach-list   { display: flex; flex-direction: column; gap: 0.125rem; }

.recent-ach-row {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.5rem; border-radius: 10px;
    text-decoration: none; color: inherit;
    transition: all 0.2s ease; border: 1px solid transparent;
}
.recent-ach-row:hover { background: var(--card-hover); border-color: var(--border-color); }

.recent-ach-icon {
    width: 34px; height: 34px; border-radius: 6px; object-fit: cover;
    flex-shrink: 0; border: 1px solid rgba(255,255,255,0.06); background: var(--card-hover);
}

.recent-ach-icon.ach-icon--hc {
    border-color: #f59e0b;
    box-shadow: 0 0 4px rgba(245,158,11,0.5);
    animation: hc-shimmer 2s ease-in-out infinite;
}

.recent-ach-icon.ach-icon--hc:hover {
    animation: none; border-color: #fde68a; box-shadow: 0 0 10px 3px rgba(251,191,36,0.85);
}

.recent-ach-info { flex: 1; min-width: 0; }
.recent-ach-name { font-size: 0.8125rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-ach-game { font-size: 0.725rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-ach-right { text-align: right; flex-shrink: 0; }
.recent-ach-date   { font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; }
.recent-ach-rarity { font-size: 0.6875rem; color: var(--text-muted); opacity: 0.7; white-space: nowrap; }

/* Player overview: header section */
.player-profile-container { max-width: 1400px; margin: 0 auto; padding: 2rem; }

.profile-header-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.profile-avatar {
    width: 96px; height: 96px;
    border-radius: 20px;
    border: 3px solid var(--border-color);
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.profile-user-info { flex: 1; }

.profile-username {
    font-size: 2rem; font-weight: 700;
    color: var(--text-primary); margin: 0 0 0.5rem; line-height: 1;
}

.profile-stats-inline {
    display: flex; flex-wrap: wrap; gap: 1.5rem;
    font-size: 0.875rem; color: var(--text-secondary);
}

.profile-stat-item { display: flex; align-items: center; gap: 0.5rem; }
.profile-stat-value { font-weight: 700; color: var(--primary); font-size: 1rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
    /* Player overview */
    .profile-layout { grid-template-columns: minmax(0, 1fr); }
    .sidebar-content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; }
    .favorites-card, .recent-achievements-card { grid-column: 1 / -1; }
    .games-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 1100px) {
    /* Steam + RA full pages */
    .profile-page-layout { grid-template-columns: minmax(0, 1fr); }
    .profile-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; }
}

@media (max-width: 1024px) {
    .profile-header-section { flex-direction: column; text-align: center; }
    .platform-tabs { flex-direction: column; }
    .platform-tab { flex: none; }
}

@media (max-width: 768px) {
    /* Player overview */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .stat-value { font-size: 2rem; }
    .sidebar-content { grid-template-columns: minmax(0, 1fr); }
    .platform-content { flex-direction: column; align-items: flex-start; }
    .games-grid { grid-template-columns: repeat(4, 1fr); }
    .recent-game-img { width: 64px; height: 32px; }
    .recent-game-row { padding: 0.5rem; }
    .player-profile-container { padding: 1rem; }
    .profile-username { font-size: 1.5rem; }
    .profile-stats-inline { flex-direction: column; gap: 0.75rem; }

    /* Steam + RA full pages */
    .profile-header { flex-direction: column; align-items: flex-start; padding: 1.25rem; }
    .stat-divider { width: 100%; height: 1px; }
    .profile-sidebar { grid-template-columns: minmax(0, 1fr); }
    .game-row-img { width: 64px; height: 32px; }
    .controls-card { flex-direction: column; align-items: stretch; gap: 0.75rem; }
    .controls-card input[type="text"] { width: 100%; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .games-grid { grid-template-columns: repeat(3, 1fr); }
}