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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    text-align: center;
}

.header h1 {
    color: #4a5568;
    font-size: 2.5rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.header .subtitle {
    color: #718096;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.header .description {
    color: #4a5568;
    font-size: 1rem;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
}

.auth-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.auth-section h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.auth-section p {
    color: #718096;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.auth-options {
    display: grid;
    grid-template-columns: 1fr minmax(200px, auto) 1fr;
    gap: 30px;
    align-items: center;
}

.steam-auth, .manual-auth-section {
    text-align: center;
}

.steam-auth h3, .manual-auth-section h3 {
    color: #4a5568;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.steam-auth p, .manual-auth-section p {
    color: #718096;
    margin-bottom: 20px;
    font-size: 1rem;
}

.manual-login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.steam-input {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    width: 100%;
    max-width: 350px;
    transition: border-color 0.3s ease;
}

.steam-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-examples {
    margin-top: 15px;
    text-align: left;
    color: #a0aec0;
    font-size: 0.85rem;
    max-width: 350px;
}

/* Prevent phone number linking on mobile */
.no-phone-link {
    pointer-events: none;
    text-decoration: none;
}

@media (max-width: 768px) {
    .auth-options {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .divider {
        order: 2;
    }
    
    .steam-auth {
        order: 1;
    }
    
    .manual-auth-section {
        order: 3;
    }
    
    /* Ensure form elements don't extend beyond container */
    .steam-input {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
    
    .input-examples {
        max-width: 100%;
        word-break: break-all;
    }
    
    /* Improve mobile auth section padding */
    .auth-section {
        padding: 20px;
    }
    
    .manual-login-form {
        width: 100%;
    }
}

.manual-auth-notice {
    width: 100%;
}

.notice-card {
    background: #ebf8ff;
    border: 1px solid #bee3f8;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.notice-card h4 {
    color: #2c5282;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.notice-card p {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.read-only-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #f7fafc;
    color: #718096;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

.main-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.user-welcome h2 {
    color: #4a5568;
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.user-welcome p {
    color: #718096;
    font-size: 1rem;
}

.actions-section {
    margin-bottom: 30px;
}

.actions-section h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.friends-section h3 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.friends-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.friends-table th {
    background: #f7fafc;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    border-bottom: 2px solid #e2e8f0;
    font-size: 0.9rem;
}

.friends-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
    height: 60px;
}

.friends-table tr:hover {
    background: #f7fafc;
}

.profile-pic {
    border-radius: 50%;
    border: 2px solid #e2e8f0;
}

.friend-include-checkbox {
    transform: scale(1.2);
    margin: 0;
    cursor: pointer;
}

.friend-row.included {
    background-color: rgba(72, 187, 120, 0.1) !important;
    border-left: 4px solid #48bb78;
}

.friend-row.excluded {
    background-color: rgba(160, 174, 192, 0.15) !important;
    border-left: 4px solid #a0aec0;
    opacity: 0.7;
}

.friend-row.included:hover {
    background-color: rgba(72, 187, 120, 0.15) !important;
}

.friend-row.excluded:hover {
    background-color: rgba(160, 174, 192, 0.25) !important;
}

.compare-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e2e8f0;
}

.compare-section h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.compare-section p {
    color: #718096;
    margin-bottom: 20px;
}

.download-section {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
    transform: translateY(-1px);
}

.btn-secondary.btn-large {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
    color: #4a5568;
}

.btn-secondary.btn-large:hover {
    background: linear-gradient(135deg, #cbd5e0 0%, #a0aec0 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(160, 174, 192, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(237, 137, 54, 0.4);
}

/* Minimal score refresh progress UI to prevent table jumping */
.score-refresh-progress {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    background: #f7fafc;
    color: #4a5568;
    box-sizing: border-box;
    transition: all 0.3s ease;
    cursor: default;
    text-decoration: none;
}

.progress-bar-container {
    background: #e2e8f0;
    border-radius: 6px;
    height: 16px;
    width: 120px;
    overflow: hidden;
    border: 1px solid #cbd5e0;
}

.progress-bar {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    height: 100%;
    width: 0%;
    transition: width 0.8s ease;
}

.info-card {
    background: #ebf8ff;
    border: 1px solid #bee3f8;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.info-card h4 {
    color: #2c5282;
    margin-bottom: 8px;
}

.info-card p {
    color: #2d3748;
    margin: 0;
    font-size: 0.95rem;
}

/* New Layout Styles */
.primary-action-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    text-align: center;
}

.compare-highlight h3 {
    color: #4a5568;
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.compare-highlight p {
    color: #718096;
    margin-bottom: 20px;
    font-size: 1rem;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 700;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
    align-items: start;
}

.dashboard-main {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.dashboard-sidebar {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.playlist-section {
    margin-bottom: 25px;
}

.playlist-toggle {
    cursor: pointer;
    padding: 15px;
    background: #f7fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    list-style: none;
}

.playlist-toggle::-webkit-details-marker {
    display: none;
}

.playlist-toggle h3 {
    color: #4a5568;
    margin: 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.playlist-toggle::before {
    content: "▶";
    transition: transform 0.3s ease;
    color: #718096;
}

.playlist-section[open] .playlist-toggle::before {
    transform: rotate(90deg);
}

.playlist-content {
    padding: 20px 0;
}

.playlist-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.playlist-option {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.playlist-option h4 {
    color: #4a5568;
    margin-bottom: 8px;
    font-size: 1rem;
}

.playlist-option p {
    color: #718096;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

.info-card.compact {
    padding: 10px 15px;
    margin-bottom: 15px;
}

.info-card.compact p {
    margin: 0;
    font-size: 0.9rem;
}

/* Removed friends-table-container - no more scroll constraint */

.dashboard-sidebar h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.dashboard-sidebar .info-card.compact {
    margin-bottom: 12px;
}

/* Primary Downloads Section */
.primary-downloads {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.download-highlight h3 {
    color: #4a5568;
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.download-highlight p {
    color: #718096;
    margin-bottom: 25px;
    font-size: 1rem;
}

.info-section {
    margin-bottom: 25px;
}

.info-section h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.secondary-actions {
    margin-top: 20px;
}

.secondary-actions h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .header {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 20px;
    }
    
    /* Mobile layout adjustments */
    .dashboard-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .dashboard-main,
    .dashboard-sidebar {
        padding: 20px;
    }
    
    .primary-action-section {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .btn-large {
        padding: 14px 24px;
        font-size: 1rem;
    }
    
    .playlist-options {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .primary-downloads {
        gap: 12px;
    }
    
    .primary-downloads .btn-large {
        width: 100%;
        text-align: center;
    }
    
    .action-buttons,
    .download-section {
        flex-direction: column;
    }
    
    .user-info {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    /* Ensure tables don't overflow on mobile */
    .friends-table {
        width: 100%;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .friends-table thead,
    .friends-table tbody,
    .friends-table th,
    .friends-table td,
    .friends-table tr {
        display: block;
    }
    
    .friends-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .friends-table tr {
        border: 1px solid #e2e8f0;
        margin-bottom: 10px;
        padding: 10px;
        border-radius: 8px;
        background: white;
    }
    
    .friends-table tr.included {
        background: rgba(72, 187, 120, 0.1) !important;
        border-left: 4px solid #48bb78;
    }
    
    .friends-table tr.excluded {
        background: rgba(160, 174, 192, 0.15) !important;
        border-left: 4px solid #a0aec0;
        opacity: 0.7;
    }
    
    .friends-table td {
        border: none;
        position: relative;
        padding: 10px 10px 10px 50%;
        white-space: normal;
        text-align: left;
        height: auto;
    }
    
    .friends-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
        color: #4a5568;
    }
}