/* Profile Page Styles */

.profile-section {
    background: white;
    margin: 1.5rem auto;
    padding: 1.5rem 0;
    border-radius: 10px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
    min-height: 70vh;
}

/* Profile Header */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0 18px;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 1.5rem;
}

.profile-picture-container {
    position: relative;
}

.profile-picture {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #2B5A9E;
}

.change-picture-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    background: linear-gradient(135deg, #2B5A9E 0%, #4A90E2 100%);
    color: white;
    border: none;
    padding: 0.4rem 0.85rem;
    border-radius: 18px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.change-picture-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(43, 90, 158, 0.3);
}

.profile-title {
    flex: 1;
}

.profile-title h1 {
    color: #2c3e50;
    font-size: 1.6rem;
    margin: 0 0 0.85rem 0;
}

.edit-toggle {
    display: flex;
    gap: 0.85rem;
}

.edit-profile-btn,
.save-profile-btn,
.cancel-edit-btn {
    background: linear-gradient(135deg, #2B5A9E 0%, #4A90E2 100%);
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 7px;
    transition: all 0.3s ease;
}

.cancel-edit-btn {
    background: #6c757d;
}

.edit-profile-btn:hover,
.save-profile-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(43, 90, 158, 0.4);
}

.cancel-edit-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Profile Information Card */
.profile-info-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 0 18px 1.5rem 18px;
}

.profile-info-card h2 {
    color: #2c3e50;
    font-size: 1.2rem;
    margin: 0 0 1.15rem 0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.15rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.info-item label {
    color: #666;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-display {
    color: #2c3e50;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.35rem 0;
}

.info-edit {
    padding: 0.6rem;
    border: 2px solid #e0e0e0;
    border-radius: 7px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.info-edit:focus {
    outline: none;
    border-color: #2B5A9E;
    box-shadow: 0 0 0 3px rgba(43, 90, 158, 0.1);
}

/* Back Button */
.back-button-container {
    padding: 0 18px;
    margin-bottom: 1.15rem;
}

.back-btn {
    background: transparent;
    border: 2px solid #2B5A9E;
    color: #2B5A9E;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 7px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #2B5A9E;
    color: white;
    transform: translateX(-5px);
}

/* Ratings Section */
.ratings-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    padding: 0 18px;
    margin-bottom: 1.5rem;
}

.rating-card {
    background: linear-gradient(135deg, #2B5A9E 0%, #4A90E2 100%);
    border-radius: 10px;
    padding: 1.5rem;
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.rating-card.compact {
    padding: 1.15rem;
}

.rating-card.compact .rating-value {
    font-size: 2.4rem;
}

.rating-card.compact h3 {
    font-size: 0.875rem;
}

.rating-card h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    opacity: 0.9;
}

.rating-display {
    text-align: center;
}

.rating-value {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 0.35rem;
}

.rating-label {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-bottom: 0.75rem;
}

.fetch-pdga-btn {
    background: white;
    color: #2B5A9E;
    border: none;
    padding: 0.6rem 1.15rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 7px;
    margin-top: 0.75rem;
    transition: all 0.3s ease;
}

.fetch-pdga-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Membership Card */
.membership-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 0 18px 1.5rem 18px;
}

.membership-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.membership-header h3 {
    color: #2c3e50;
    font-size: 1.2rem;
    margin: 0;
}

.membership-status {
    padding: 0.4rem 0.85rem;
    border-radius: 18px;
    font-size: 0.75rem;
    font-weight: 600;
}

.membership-status.active {
    background: #d4edda;
    color: #155724;
}

.membership-status.inactive {
    background: #f8d7da;
    color: #721c24;
}

.membership-card p {
    color: #555;
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
}

.expiration {
    color: #2B5A9E;
    font-weight: 600;
    margin-top: 0.75rem;
}

.join-ifs-btn {
    background: linear-gradient(135deg, #2B5A9E 0%, #4A90E2 100%);
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 7px;
    margin-top: 1.15rem;
    transition: all 0.3s ease;
}

.join-ifs-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(43, 90, 158, 0.4);
}

/* Tournaments Cards */
.tournaments-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 0 18px 1.5rem 18px;
}

.tournaments-card h2 {
    color: #2c3e50;
    font-size: 1.2rem;
    margin: 0 0 1.15rem 0;
}

.tournaments-table-container {
    overflow-x: auto;
}

.profile-tournaments-table {
    width: 100%;
    border-collapse: collapse;
}

.profile-tournaments-table thead {
    background: linear-gradient(135deg, #2B5A9E 0%, #4A90E2 100%);
    color: white;
}

.profile-tournaments-table th {
    padding: 0.75rem 0.85rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
}

.profile-tournaments-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s ease;
}

.profile-tournaments-table tbody tr:hover {
    background: #f8f9fa;
}

.profile-tournaments-table td {
    padding: 0.75rem 0.85rem;
    color: #333;
    font-size: 0.85rem;
}

/* PDGA Tier Badges */
.pdga-tier {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 16px;
    font-size: 0.65rem;
    font-weight: 700;
    white-space: nowrap;
}

.pdga-tier.non-pdga {
    background: #e0e0e0;
    color: #777;
}

.pdga-tier.tier-c {
    background: linear-gradient(135deg, #CD7F32 0%, #B87333 100%);
    color: white;
}

.pdga-tier.tier-b {
    background: linear-gradient(135deg, #C0C0C0 0%, #A8A8A8 100%);
    color: #333;
}

.pdga-tier.tier-a {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #333;
}

.pdga-tier.tier-silver {
    background: linear-gradient(135deg, #4A90D9 0%, #357ABD 100%);
    color: white;
}

.pdga-tier.tier-elite {
    background: linear-gradient(135deg, #7B2D8E 0%, #5B1A6E 100%);
    color: white;
}

.pdga-tier.tier-major {
    background: linear-gradient(135deg, #C41E3A 0%, #8B0000 100%);
    color: #FFD700;
}

/* Place Badge */
.place-badge {
    font-weight: 600;
    color: #2B5A9E;
    font-size: 0.85rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-title h1 {
        font-size: 1.35rem;
    }

    .edit-toggle {
        flex-direction: column;
        width: 100%;
    }

    .edit-profile-btn,
    .save-profile-btn,
    .cancel-edit-btn {
        width: 100%;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .ratings-section {
        grid-template-columns: 1fr;
    }

    .rating-value {
        font-size: 2.4rem;
    }

    .profile-tournaments-table {
        font-size: 0.75rem;
    }

    .profile-tournaments-table th,
    .profile-tournaments-table td {
        padding: 0.6rem 0.4rem;
    }
}

/* Fetch Rating Button */
.fetch-rating-btn:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.fetch-rating-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.fetch-rating-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ========== Preferences Section ========== */
.preferences-card {
    background: white;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin: 0 18px 1.5rem 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border-left: 4px solid #2B5A9E;
}

.preferences-card h2 {
    color: #2B5A9E;
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 1rem;
}

.pref-hint {
    color: #888;
    font-size: 0.75rem;
    margin: 0.2rem 0 0.5rem;
}

.pref-select {
    padding: 0.5rem 0.75rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    width: 100%;
    max-width: 300px;
    transition: border-color 0.3s;
}

.pref-select:focus {
    outline: none;
    border-color: #2B5A9E;
}

/* ========== Player Statistics Section ========== */
.statistics-card {
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    border: none;
    border-radius: 10px;
    padding: 0;
    margin: 0 18px 1.25rem 18px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.07);
    overflow: hidden;
}

.statistics-card h2 {
    color: white;
    font-size: 1rem;
    margin: 0;
    padding: 0.85rem 1.1rem;
    background: linear-gradient(135deg, #2B5A9E 0%, #4A90E2 100%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.statistics-card h2::before {
    content: "📊";
    font-size: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    background: white;
}

.stat-item {
    background: white;
    padding: 1rem 0.6rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.stat-item:last-child {
    border-right: none;
}

.stat-item:hover {
    background: #f8f9fa;
}

.stat-item.highlight {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    color: white;
    border-right: none;
}

.stat-item.highlight .stat-label {
    color: rgba(255, 255, 255, 0.9);
}

.stat-item.highlight .stat-value {
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.4rem;
    display: block;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #2B5A9E;
    line-height: 1.1;
    margin-bottom: 0.3rem;
}

.stat-label {
    font-size: 0.6rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    font-weight: 600;
}

/* Top Courses Section */
.top-courses-section {
    padding: 1rem 1.1rem;
    background: white;
}

.top-courses-section h3 {
    color: #2c3e50;
    font-size: 0.85rem;
    margin: 0 0 0.6rem 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.top-courses-section h3::before {
    content: "⛳";
    font-size: 0.9rem;
}

.top-courses-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.top-courses-list .no-data {
    color: #999;
    font-style: italic;
    padding: 0.9rem;
    text-align: center;
    background: #fafafa;
    border-radius: 6px;
    font-size: 0.75rem;
}

.top-course-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.7rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 7px;
    border: 1px solid #e8e8e8;
    transition: all 0.2s ease;
}

.top-course-item:hover {
    border-color: #2B5A9E;
    box-shadow: 0 2px 6px rgba(43, 90, 158, 0.1);
    transform: translateX(3px);
}

.top-course-item:first-child {
    background: linear-gradient(135deg, #fff8f0 0%, #ffffff 100%);
    border-color: #FFD700;
}

.top-course-item:first-child .course-name {
    color: #b8860b;
}

.course-rank {
    font-size: 1.2rem;
    min-width: 28px;
    text-align: center;
}

.course-name {
    flex: 1;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.75rem;
}

.course-count {
    font-size: 0.65rem;
    color: #666;
    background: linear-gradient(135deg, #e8f4fd 0%, #f0f7ff 100%);
    padding: 0.25rem 0.55rem;
    border-radius: 14px;
    font-weight: 600;
    border: 1px solid #d0e8f8;
}

/* Best Rated Round Section */
.best-rated-section {
    padding: 1rem 1.1rem;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
}

.best-rated-section h3 {
    color: #2c3e50;
    font-size: 0.85rem;
    margin: 0 0 0.6rem 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.best-rated-section h3::before {
    content: "⭐";
    font-size: 0.9rem;
}

.best-rated-card {
    background: linear-gradient(135deg, #FFD700 0%, #FFB347 50%, #FFA500 100%);
    border-radius: 8px;
    padding: 1rem;
    color: #333;
    box-shadow: 0 3px 10px rgba(255, 165, 0, 0.25);
    position: relative;
    overflow: hidden;
}

.best-rated-card::before {
    content: "🏆";
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 3.5rem;
    opacity: 0.15;
    transform: rotate(15deg);
}

.best-rated-info {
    text-align: center;
    position: relative;
    z-index: 1;
}

.rated-tournament {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

.rated-details {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
}

.rated-course,
.rated-layout {
    background: rgba(255, 255, 255, 0.6);
    padding: 0.25rem 0.55rem;
    border-radius: 14px;
    font-size: 0.65rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.rated-score {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.rated-date {
    font-size: 0.65rem;
    opacity: 0.85;
    font-weight: 500;
}

/* Score Breakdown Pie Chart */
.score-breakdown-section {
    margin-top: 1.5rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.score-breakdown-section h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.score-breakdown-section h3::before {
    content: '🥧';
    font-size: 1.1rem;
}

.pie-chart-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.pie-chart-container canvas {
    max-width: 280px;
    max-height: 280px;
}

.pie-chart-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 160px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-label {
    font-weight: 600;
    color: #333;
    min-width: 50px;
}

.legend-value {
    color: #666;
    font-size: 0.75rem;
}

/* Responsive Design for Statistics */
@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-item:nth-child(2) {
        border-right: none;
    }
}

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

    .stat-item {
        padding: 0.85rem 0.5rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-icon {
        font-size: 1.25rem;
    }

    .rated-details {
        flex-direction: column;
        gap: 0.35rem;
    }

    .statistics-card {
        margin: 0 10px 1rem 10px;
    }
}

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

    .stat-item {
        padding: 0.7rem 0.35rem;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .stat-label {
        font-size: 0.55rem;
    }

    .stat-icon {
        font-size: 1.1rem;
    }

    .top-course-item {
        flex-wrap: wrap;
    }

    .course-count {
        width: 100%;
        text-align: center;
        margin-top: 0.35rem;
    }

    .best-rated-card::before {
        font-size: 2.25rem;
    }
}

/* ========== Stats Filter Bar ========== */
.stats-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.1rem;
    background: white;
    border-bottom: 1px solid #f0f0f0;
}

.stats-filter-bar label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
}

.stats-filter-bar select {
    padding: 0.35rem 0.7rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #333;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.stats-filter-bar select:focus {
    outline: none;
    border-color: #2B5A9E;
}

/* ========== Per-Hole Statistics ========== */
.per-hole-stats-section {
    padding: 1rem 1.1rem;
    background: white;
    border-top: 1px solid #f0f0f0;
}

.per-hole-stats-section h3 {
    color: #2c3e50;
    font-size: 0.85rem;
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.per-hole-stats-section h3::before {
    content: "📈";
    font-size: 0.9rem;
}

.per-hole-course-section {
    margin-bottom: 0.5rem;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
}

.per-hole-course-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    cursor: pointer;
    transition: background 0.2s ease;
}

.per-hole-course-header:hover {
    background: linear-gradient(135deg, #e8f4fd 0%, #f0f7ff 100%);
}

.course-header-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.course-header-name {
    font-weight: 700;
    color: #2c3e50;
    font-size: 0.85rem;
}

.course-header-layout {
    font-size: 0.7rem;
    color: #666;
    background: #e8f4fd;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-weight: 500;
}

.course-header-rounds {
    font-size: 0.7rem;
    color: #888;
    font-weight: 500;
}

.course-expand-arrow {
    font-size: 0.75rem;
    color: #999;
    transition: transform 0.2s ease;
}

.per-hole-table-container {
    padding: 0.5rem;
}

.per-hole-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.per-hole-table thead {
    background: linear-gradient(135deg, #2B5A9E 0%, #4A90E2 100%);
    color: white;
}

.per-hole-table th {
    padding: 0.5rem 0.6rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.per-hole-table td {
    padding: 0.45rem 0.6rem;
    text-align: center;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}

.per-hole-table tbody tr:hover {
    background: #f8f9fa;
}

.per-hole-table tbody tr:last-child td {
    border-bottom: none;
}

/* Color-coded vs Par cells */
.under-par {
    color: #28a745;
    font-weight: 700;
}

.over-par {
    color: #dc3545;
    font-weight: 700;
}

.even-par {
    color: #888;
    font-weight: 500;
}

/* Responsive for per-hole stats */
@media (max-width: 768px) {
    .per-hole-table {
        font-size: 0.7rem;
    }

    .per-hole-table th,
    .per-hole-table td {
        padding: 0.35rem 0.4rem;
    }

    .course-header-info {
        gap: 0.4rem;
    }

    .course-header-name {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .stats-filter-bar {
        padding: 0.5rem 0.8rem;
    }

    .per-hole-stats-section {
        padding: 0.75rem 0.8rem;
    }

    .per-hole-table th,
    .per-hole-table td {
        padding: 0.3rem 0.25rem;
        font-size: 0.65rem;
    }
}

/* ========== Friends Section ========== */

.friends-card {
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    border: none;
    border-radius: 10px;
    margin: 0 18px 1.25rem 18px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.07);
    overflow: hidden;
}

.friends-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.1rem;
    background: linear-gradient(135deg, #2B5A9E 0%, #4A90E2 100%);
}

.friends-header h2 {
    color: white;
    font-size: 1rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.friends-header h2::before {
    content: "👥";
    font-size: 1rem;
}

.friends-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Pending Friend Requests */
.pending-requests {
    background: #fff8e1;
    border-bottom: 2px solid #ffc107;
    padding: 1rem;
}

.pending-requests h3 {
    color: #856404;
    font-size: 0.9rem;
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pending-requests h3::before {
    content: "🔔";
}

.requests-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.friend-request-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    padding: 0.75rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.request-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2B5A9E 0%, #4A90E2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

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

.request-name {
    display: block;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.request-rating {
    display: block;
    font-size: 0.75rem;
    color: #666;
}

.request-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.accept-btn,
.decline-btn {
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    touch-action: manipulation;
}

.accept-btn {
    background: linear-gradient(135deg, #28a745 0%, #34ce57 100%);
    color: white;
}

.accept-btn:hover {
    transform: scale(1.05);
}

.decline-btn {
    background: #f0f0f0;
    color: #666;
}

.decline-btn:hover {
    background: #e0e0e0;
}

/* Friends List */
.friends-list-container {
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.friends-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.no-friends-message {
    text-align: center;
    padding: 2rem 1rem;
    color: #666;
}

.no-friends-message p {
    margin: 0 0 0.5rem 0;
}

.no-friends-message .hint {
    font-size: 0.85rem;
    color: #888;
}

.no-friends-message a {
    color: #2B5A9E;
    text-decoration: underline;
}

.friend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    cursor: pointer;
    transition: all 0.2s;
}

.friend-item:hover {
    border-color: #2B5A9E;
    box-shadow: 0 2px 8px rgba(43, 90, 158, 0.15);
    transform: translateX(3px);
}

.friend-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2B5A9E 0%, #4A90E2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

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

.friend-name {
    display: block;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-rating {
    display: block;
    font-size: 0.8rem;
    color: #666;
}

.friend-remove-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f5f5f5;
    color: #999;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.5;
}

.friend-item:hover .friend-remove-btn {
    opacity: 1;
}

.friend-remove-btn:hover {
    background: #ffebee;
    color: #e53935;
}

/* Mobile responsiveness for friends */
@media (max-width: 768px) {
    .friends-card {
        margin: 0 12px 1rem 12px;
    }

    .friend-request-item {
        flex-wrap: wrap;
    }

    .request-actions {
        width: 100%;
        margin-top: 0.5rem;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .friends-list-container {
        padding: 0.75rem;
    }

    .friend-item {
        padding: 0.6rem;
    }

    .friend-avatar {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .friend-name {
        font-size: 0.9rem;
    }

    .accept-btn,
    .decline-btn {
        padding: 0.5rem 0.6rem;
        font-size: 0.75rem;
    }
}

/* ========== Profile Friend Button (view-profile page) ========== */

.profile-friend-action {
    margin-top: 0.75rem;
}

.profile-friend-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(43, 90, 158, 0.2);
    user-select: none;
}

.profile-friend-btn .friend-icon {
    font-size: 1rem;
}

.profile-friend-btn.add {
    background: linear-gradient(135deg, #2B5A9E 0%, #4A90E2 100%);
    color: white;
}

.profile-friend-btn.add:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(43, 90, 158, 0.4);
}

.profile-friend-btn.pending {
    background: #f0f0f0;
    color: #888;
    border: 2px solid #ddd;
}

.profile-friend-btn.pending:hover {
    background: #ffe8e8;
    color: #c44;
    border-color: #fcc;
}

.profile-friend-btn.accept {
    background: linear-gradient(135deg, #28a745 0%, #34ce57 100%);
    color: white;
    animation: pulse-accept 2s infinite;
}

.profile-friend-btn.accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.profile-friend-btn.friends {
    background: #e8f5e9;
    color: #2e7d32;
    border: 2px solid #c8e6c9;
}

.profile-friend-btn.friends:hover {
    background: #ffebee;
    color: #c62828;
    border-color: #ffcdd2;
}

@media (max-width: 480px) {
    .profile-friend-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

/* ========== More Score Details Toggle ========== */

.more-details-toggle {
    padding: 0.75rem 1.1rem;
    background: white;
    border-top: 1px solid #f0f0f0;
}

.more-details-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #2B5A9E;
    cursor: pointer;
    transition: all 0.2s ease;
}

.more-details-btn:hover {
    border-color: #2B5A9E;
    background: linear-gradient(135deg, #e8f4fd 0%, #f0f7ff 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(43, 90, 158, 0.15);
}

.more-details-icon {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.more-details-icon.expanded {
    transform: rotate(90deg);
}

/* ========== Collapsible Sections Container ========== */

.more-details-container {
    padding: 0 1.1rem 1rem 1.1rem;
    background: white;
}

.collapsible-section {
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

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

.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, #1a3a6b 0%, #2B5A9E 100%);
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.collapsible-header:hover {
    opacity: 0.95;
}

.collapsible-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
}

.collapsible-icon {
    font-size: 1rem;
}

.collapsible-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.collapsible-arrow {
    color: white;
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    opacity: 0.8;
}

.collapsible-arrow.expanded {
    transform: rotate(90deg);
}

.collapsible-content {
    background: white;
}

/* ========== Head-to-Head Stats Section ========== */

/* Search Container */
.h2h-search-container {
    padding: 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e8e8e8;
}

.h2h-search-container label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 0.5rem;
}

.h2h-search-wrapper {
    position: relative;
}

#h2h-player-search {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

#h2h-player-search:focus {
    outline: none;
    border-color: #2B5A9E;
}

/* Dropdown */
.h2h-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.h2h-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.h2h-dropdown-item:hover {
    background: #f0f7ff;
}

.h2h-dropdown-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2B5A9E, #4A90E2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

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

.h2h-dropdown-name {
    display: block;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.h2h-dropdown-games {
    display: block;
    font-size: 0.8rem;
    color: #888;
}

.h2h-dropdown-empty {
    padding: 1rem;
    text-align: center;
    color: #888;
    font-style: italic;
}

/* Empty State */
.h2h-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: #888;
}

.h2h-empty p {
    margin: 0;
}

/* Result Section */
.h2h-result {
    padding: 1rem;
}

.h2h-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
}

.h2h-clear-btn {
    background: #f0f0f0;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}

.h2h-clear-btn:hover {
    background: #e0e0e0;
    color: #333;
}

/* Record Display */
.h2h-record-display {
    text-align: center;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    background: #f8f9fa;
}

.h2h-record-big {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: #2c3e50;
}

.h2h-record-display.winning .h2h-record-big {
    color: #28a745;
}

.h2h-record-display.losing .h2h-record-big {
    color: #dc3545;
}

.h2h-record-display.even .h2h-record-big {
    color: #6c757d;
}

.h2h-record-label {
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.25rem;
}

/* Stats Row */
.h2h-stats-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.h2h-stat-box {
    flex: 1;
    text-align: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.h2h-stat-box .stat-num {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: #2c3e50;
}

.h2h-stat-box.wins .stat-num {
    color: #28a745;
}

.h2h-stat-box.losses .stat-num {
    color: #dc3545;
}

.h2h-stat-box .stat-lbl {
    display: block;
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
}

/* Game History */
.h2h-game-history h4 {
    font-size: 0.9rem;
    color: #555;
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e8e8e8;
}

.h2h-games-list {
    max-height: 250px;
    overflow-y: auto;
}

.h2h-game-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.h2h-game-row:last-child {
    border-bottom: none;
}

.h2h-game-result-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.h2h-game-result-badge.win {
    background: #d4edda;
    color: #155724;
}

.h2h-game-result-badge.loss {
    background: #f8d7da;
    color: #721c24;
}

.h2h-game-result-badge.tie {
    background: #e2e3e5;
    color: #383d41;
}

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

.h2h-game-info .h2h-game-course {
    display: block;
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.h2h-game-info .h2h-game-date {
    display: block;
    font-size: 0.75rem;
    color: #888;
}

.h2h-game-scores {
    text-align: right;
    font-size: 0.85rem;
}

.h2h-game-scores span:first-child {
    font-weight: 600;
    color: #333;
}

.h2h-score-diff {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
}

.h2h-score-diff.win {
    color: #28a745;
}

.h2h-score-diff.loss {
    color: #dc3545;
}

.h2h-score-diff.tie {
    color: #6c757d;
}

/* Legacy styles kept for compatibility */
.h2h-year-select {
    padding: 0.3rem 0.6rem;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
}

.h2h-year-select option {
    background: #2B5A9E;
    color: white;
}

/* H2H Summary Stats */
.h2h-summary {
    display: flex;
    justify-content: space-around;
    padding: 0.85rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e8e8e8;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.h2h-stat-item {
    text-align: center;
    padding: 0.5rem 1rem;
    min-width: 60px;
}

.h2h-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #2B5A9E;
    line-height: 1.2;
}

.h2h-stat-label {
    display: block;
    font-size: 0.65rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.h2h-stat-item.wins .h2h-stat-value {
    color: #28a745;
}

.h2h-stat-item.losses .h2h-stat-value {
    color: #dc3545;
}

.h2h-no-data {
    text-align: center;
    padding: 2rem 1rem;
    color: #888;
    font-style: italic;
}

.h2h-loading {
    text-align: center;
    padding: 2rem 1rem;
    color: #666;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.h2h-error {
    text-align: center;
    padding: 1.5rem 1rem;
    color: #dc3545;
    background: #fff5f5;
}

/* H2H Opponent List */
.h2h-list {
    padding: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.h2h-opponent-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem;
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.h2h-opponent-item:hover {
    border-color: #2B5A9E;
    box-shadow: 0 3px 10px rgba(43, 90, 158, 0.15);
    transform: translateX(3px);
}

.h2h-opponent-item:last-child {
    margin-bottom: 0;
}

.h2h-opponent-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a3a6b 0%, #2B5A9E 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

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

.h2h-opponent-name {
    display: block;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.h2h-opponent-games {
    display: block;
    font-size: 0.75rem;
    color: #888;
}

.h2h-opponent-record {
    text-align: right;
    flex-shrink: 0;
}

.h2h-record-main {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
}

.h2h-opponent-record.winning .h2h-record-main {
    color: #28a745;
}

.h2h-opponent-record.losing .h2h-record-main {
    color: #dc3545;
}

.h2h-opponent-record.even .h2h-record-main {
    color: #888;
}

.h2h-record-pct {
    display: block;
    font-size: 0.7rem;
    color: #888;
}

.h2h-arrow {
    color: #ccc;
    font-size: 1.25rem;
    font-weight: 300;
    flex-shrink: 0;
}

/* H2H Detail Modal */
.h2h-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.h2h-modal {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.h2h-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #1a3a6b 0%, #2B5A9E 100%);
    color: white;
}

.h2h-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.h2h-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.h2h-modal-close:hover {
    opacity: 1;
}

.h2h-modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    max-height: calc(80vh - 60px);
    -webkit-overflow-scrolling: touch;
}

.h2h-modal-loading {
    text-align: center;
    padding: 2rem;
    color: #666;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

/* H2H Detail Summary */
.h2h-detail-summary {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 100%);
    border-radius: 10px;
    margin-bottom: 1.25rem;
}

.h2h-detail-record {
    font-size: 2.5rem;
    font-weight: 800;
    color: #333;
    margin-bottom: 0.25rem;
}

.h2h-detail-record .wins {
    color: #28a745;
}

.h2h-detail-record .losses {
    color: #dc3545;
}

.h2h-detail-record .ties {
    color: #888;
}

.h2h-detail-label {
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* H2H Game List */
.h2h-game-list h4 {
    font-size: 0.9rem;
    color: #333;
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.h2h-game-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem;
    background: #fafafa;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.h2h-game-item:last-child {
    margin-bottom: 0;
}

.h2h-game-date {
    font-size: 0.75rem;
    color: #888;
    min-width: 80px;
}

.h2h-game-course {
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.h2h-game-scores {
    display: flex;
    flex-direction: column;
    font-size: 0.75rem;
    color: #666;
    text-align: right;
}

.h2h-game-result {
    text-align: center;
    min-width: 50px;
}

.h2h-game-result .result-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.h2h-game-result .result-diff {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
}

.h2h-game-result.win .result-label {
    color: #28a745;
}

.h2h-game-result.win .result-diff {
    color: #28a745;
}

.h2h-game-result.loss .result-label {
    color: #dc3545;
}

.h2h-game-result.loss .result-diff {
    color: #dc3545;
}

.h2h-game-result.tie .result-label,
.h2h-game-result.tie .result-diff {
    color: #888;
}

/* Responsive More Details & Collapsible styles */
@media (max-width: 768px) {
    .more-details-container {
        padding: 0 0.75rem 0.75rem 0.75rem;
    }

    .collapsible-header {
        padding: 0.75rem 0.85rem;
    }

    .collapsible-title {
        font-size: 0.9rem;
    }

    .h2h-summary {
        padding: 0.65rem;
    }

    .h2h-stat-item {
        padding: 0.4rem 0.6rem;
    }

    .h2h-stat-value {
        font-size: 1.25rem;
    }

    .h2h-game-item {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .h2h-game-date {
        order: 1;
    }

    .h2h-game-result {
        order: 2;
        text-align: right;
    }

    .h2h-game-course {
        order: 3;
        grid-column: 1 / -1;
    }

    .h2h-game-scores {
        order: 4;
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .more-details-toggle {
        padding: 0.6rem 0.75rem;
    }

    .more-details-btn {
        padding: 0.75rem 0.85rem;
        font-size: 0.9rem;
    }

    .more-details-container {
        padding: 0 0.5rem 0.6rem 0.5rem;
    }

    .collapsible-header {
        padding: 0.7rem 0.75rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .collapsible-title {
        font-size: 0.85rem;
    }

    .collapsible-right {
        width: 100%;
        justify-content: space-between;
    }

    .h2h-year-select {
        flex: 1;
    }

    .h2h-summary {
        justify-content: space-between;
        padding: 0.6rem;
    }

    .h2h-stat-item {
        padding: 0.3rem 0.4rem;
        min-width: 50px;
    }

    .h2h-stat-value {
        font-size: 1.1rem;
    }

    .h2h-stat-label {
        font-size: 0.55rem;
    }

    .h2h-opponent-item {
        padding: 0.7rem;
    }

    .h2h-opponent-avatar {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .h2h-detail-record {
        font-size: 2rem;
    }

    .h2h-modal {
        max-height: 90vh;
    }

    .h2h-modal-body {
        max-height: calc(90vh - 60px);
    }
}
