@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Oswald:wght@500;600;700&display=swap');

:root {
    /* Steam Signature Palette */
    --bg-dark: #0e141b;              /* Deep background */
    --bg-dark-subtle: #141d27;
    --bg-panel: #1b2838;             /* Steam main panels, sidebar & cards */
    --bg-panel-hover: #213346;       /* Hover state for panels */
    --bg-input: #121e2b;             /* Inputs and dropdowns */
    --bg-input-focus: #172738;
    
    --steam-blue: #66c0f4;           /* Steam iconic bright cyan */
    --steam-blue-dark: #1999e3;
    --steam-blue-hover: #85d1f8;
    
    --accent-red: #66c0f4;           /* Remapped to Steam cyan for unified theme */
    --accent-red-hover: #85d1f8;
    
    --accent-green: #75b022;         /* Steam store purchase green */
    --accent-green-hover: #8bc53f;
    
    --accent-tag-red: #d94126;       /* Adult / Alert badge red */
    
    --text-main: #c7d5e0;            /* Steam primary readable text */
    --text-bright: #ffffff;
    --text-muted: #8f98a0;           /* Steam secondary / muted text */
    
    --border-color: #2a475e;         /* Steam signature blue-gray border */
    --border-light: rgba(102, 192, 244, 0.25);
    
    --steam-online: #57cbde;
    --steam-ingame: #90ba3c;
    
    --radius-xs: 3px;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --transition: 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    
    --steam-gradient-header: linear-gradient(180deg, #171a21 0%, #171d25 100%);
    --steam-gradient-card: linear-gradient(180deg, #1b2838 0%, #16202d 100%);
    --steam-gradient-btn: linear-gradient(90deg, #47bfff 0%, #1a9fff 100%);
    --steam-gradient-green: linear-gradient(90deg, #75b022 0%, #588a1b 100%);
    --steam-glow: 0 0 16px rgba(102, 192, 244, 0.25);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    overflow-x: clip;
}

body {
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-dark);
    background: radial-gradient(circle at 50% 0%, #1b2838 0%, #0e141b 75%);
    background-attachment: fixed;
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
a:hover { color: var(--steam-blue); }

.container { max-width: 1520px; margin: 0 auto; padding: 0 20px; }
.flex { display: flex; }
.text-center { text-align: center; }
.highlight { color: var(--steam-blue); }

/* Steam Styled Buttons */
.btn {
    padding: 8px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    -webkit-appearance: none;
    appearance: none;
}

.btn-red { 
    background: var(--steam-gradient-btn); 
    color: #fff;
    box-shadow: 0 2px 8px rgba(26, 159, 255, 0.35);
}
.btn-red:hover { 
    background: linear-gradient(90deg, #66c0f4 0%, #29a8ff 100%);
    box-shadow: 0 4px 16px rgba(102, 192, 244, 0.5);
    transform: translateY(-1px);
    color: #fff;
}

.btn-green { 
    background: var(--steam-gradient-green); 
    color: #d2efa9; 
    border: 1px solid rgba(164, 208, 7, 0.3);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.btn-green:hover { 
    background: linear-gradient(90deg, #8bc53f 0%, #689f21 100%);
    color: #fff;
    box-shadow: 0 3px 12px rgba(117, 176, 34, 0.4);
    transform: translateY(-1px);
}

.btn-white { 
    background: #e1e7ee; 
    color: #171a21; 
}
.btn-white:hover { 
    background: #ffffff; 
    box-shadow: 0 2px 10px rgba(255,255,255,0.2);
}

.btn-dark { 
    background: #213346; 
    color: var(--text-main); 
    border: 1px solid var(--border-color); 
}
.btn-dark:hover { 
    background: #2a435c; 
    color: #fff;
    border-color: var(--steam-blue);
}

.btn-party {
    background: rgba(102, 192, 244, 0.12);
    color: var(--steam-blue);
    border: 1px solid rgba(102, 192, 244, 0.35);
    border-radius: var(--radius-sm);
    padding: 7px 14px;
    font-size: 0.85rem;
    font-weight: 600;
}
.btn-party:hover {
    background: rgba(102, 192, 244, 0.22);
    color: #fff;
    border-color: var(--steam-blue);
    box-shadow: 0 0 12px rgba(102, 192, 244, 0.3);
}

/* Steam Top Navigation Header */
.header {
    background: var(--steam-gradient-header);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}
.header-inner {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    height: 66px;
}
.logo {
    font-family: 'Oswald', sans-serif; 
    font-size: 1.45rem; 
    font-weight: 700;
    letter-spacing: 0.8px;
    display: flex; 
    align-items: center; 
    gap: 12px; 
    color: #fff;
}
.logo img { 
    height: 36px; 
    width: 36px; 
    border-radius: 6px; 
    box-shadow: 0 0 10px rgba(102, 192, 244, 0.4);
    border: 1px solid rgba(102, 192, 244, 0.3);
}
.logo span.online-badge {
    color: var(--steam-blue);
    font-size: 0.85rem;
    background: rgba(102, 192, 244, 0.15);
    border: 1px solid rgba(102, 192, 244, 0.3);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    margin-left: 4px;
    letter-spacing: 0.5px;
}

.main-nav { 
    display: flex; 
    gap: 24px; 
    align-items: center; 
    font-family: 'Inter', sans-serif; 
    font-size: 0.92rem;
    font-weight: 600;
}
.main-nav a, .main-nav span { 
    position: relative; 
    padding: 22px 0; 
    color: var(--text-muted); 
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--transition);
}
.main-nav a:hover { 
    color: #fff; 
}
.main-nav a.active { 
    color: var(--steam-blue); 
}
.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--steam-blue);
    box-shadow: 0 0 10px var(--steam-blue);
}

.badge {
    background: #214b6b; 
    color: var(--steam-blue);
    border: 1px solid #387baf;
    font-size: 0.72rem; 
    font-weight: 700;
    padding: 2px 7px; 
    border-radius: 4px; 
    font-family: 'Inter', sans-serif;
}

.header-right { 
    display: flex; 
    align-items: center; 
    gap: 18px; 
}

/* Steam-styled Header Search Input */
.header-search {
    position: relative;
    display: flex;
    align-items: center;
}
.header-search input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    padding: 7px 32px 7px 12px;
    font-size: 0.85rem;
    font-family: inherit;
    width: 190px;
    transition: all 0.25s ease;
}
.header-search input:focus {
    width: 250px;
    outline: none;
    background: var(--bg-input-focus);
    border-color: var(--steam-blue);
    box-shadow: 0 0 10px rgba(102, 192, 244, 0.3);
    color: #fff;
}
.header-search i {
    position: absolute;
    right: 10px;
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

/* User & Community Pill */
.user-steam-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(33, 51, 70, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 4px 10px 4px 6px;
    cursor: pointer;
    transition: var(--transition);
}
.user-steam-pill:hover {
    background: #213346;
    border-color: var(--steam-blue);
}
.steam-avatar {
    width: 28px;
    height: 28px;
    border-radius: 3px;
    border: 2px solid var(--steam-online);
    background: #111;
    position: relative;
}
.steam-status-dot {
    width: 8px;
    height: 8px;
    background: var(--steam-ingame);
    border-radius: 50%;
    position: absolute;
    bottom: -2px;
    right: -2px;
    border: 1px solid #171a21;
}

@media (max-width: 900px) {
    .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 10px; justify-content: space-between; }
    .main-nav { display: none; }
    .header-right { width: 100%; justify-content: space-between; gap: 10px; }
    .header-search input { width: 130px; }
    .header-search input:focus { width: 170px; }
    
    #auth-section > div { gap: 8px !important; }
    #auth-section span { 
        font-size: 0.85rem !important; 
        max-width: 90px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: inline-block;
    }
    #auth-section button { padding: 5px 10px !important; font-size: 0.78rem !important; }
}

/* Modals */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 14, 20, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: all 0.25s ease-out;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal {
    background: linear-gradient(135deg, #1b2838 0%, #141c24 100%);
    padding: 32px; 
    border-radius: var(--radius-md);
    width: 90%; 
    max-width: 440px; 
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 20px rgba(102, 192, 244, 0.15);
    transform: translateY(15px) scale(0.97);
    transition: all 0.25s ease-out;
    position: relative;
}
.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

/* Modal Typography & Tabs */
.auth-tabs {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}
.auth-tab {
    font-family: 'Oswald', sans-serif;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.auth-tab.active {
    color: #fff;
}
.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--steam-blue);
    border-radius: 2px;
}

/* Steam Styled Form Inputs */
.input-group { margin-bottom: 18px; }
.input-group label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.input-group input {
    width: 100%; 
    padding: 12px 14px; 
    border-radius: var(--radius-sm);
    background: var(--bg-input); 
    border: 1px solid var(--border-color);
    color: #fff; 
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}
.input-group input:focus { 
    border-color: var(--steam-blue); 
    background: var(--bg-input-focus);
    outline: none; 
    box-shadow: 0 0 10px rgba(102, 192, 244, 0.3);
}
.input-group input::placeholder {
    color: rgba(143, 152, 160, 0.4);
}
.input-group.hidden { display: none; }

/* Dividers */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    margin: 20px 0;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}
.auth-divider::before { margin-right: 12px; }
.auth-divider::after { margin-left: 12px; }

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px;
    background: #ffffff;
    color: #171a21;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.google-btn:hover {
    background: #e1e7ee;
    transform: translateY(-1px);
}
.google-btn img {
    width: 18px;
    height: 18px;
}

.modal-close-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.2s ease;
    background: none;
    border: none;
    padding: 4px;
}
.modal-close-icon:hover { color: #fff; }

/* Steam Styled Tags and Badges */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: #213346;
    color: var(--steam-blue);
    border: 1px solid rgba(102, 192, 244, 0.2);
    border-radius: var(--radius-xs);
    font-size: 0.76rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: var(--transition);
    margin-right: 6px;
    margin-bottom: 6px;
}
.tag:hover {
    background: rgba(102, 192, 244, 0.2);
    color: #fff;
    border-color: var(--steam-blue);
}
.tag-secondary {
    background: #172433;
    color: var(--text-muted);
    border-color: var(--border-color);
}
.tag-secondary:hover {
    background: #213346;
    color: #fff;
}

/* Watch Party Room Modal Styles */
.party-lobby {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.party-link-box {
    display: flex;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
}
.party-link-box input {
    background: transparent;
    border: none;
    color: var(--steam-blue);
    font-family: monospace;
    font-size: 0.85rem;
    width: 100%;
    outline: none;
}
.party-friends-list {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    max-height: 180px;
    overflow-y: auto;
}
.party-friend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.party-friend-item:last-child { border-bottom: none; }
.party-friend-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.party-status {
    font-size: 0.75rem;
    color: var(--steam-online);
}