/* Party Mode Styles - New Grid Layout */

@font-face {
    font-family: 'Oswald';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('https://fonts.gstatic.com/s/oswald/v53/TK3_WkUHHAIjg75cFRf3bXL8LICs1_FvsUZiZSSUhiCXAA.woff2') format('woff2');
}

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

body {
    font-family: 'Oswald', sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Header */
.party-header {
    background-color: #2a2a2a;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.party-header .logo {
    margin: 0;
    font-size: 24px;
    color: #ff6b1a;
    font-weight: bold;
    letter-spacing: 2px;
}

.header-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: nowrap;
}

.match-selector {
    padding: 10px 16px;
    background-color: #3a3a3a;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-family: 'Oswald', sans-serif;
    cursor: pointer;
    min-width: 300px;
    height: 42px;
}

.match-selector option {
    background: #2a2a2a;
    color: #fff;
}

.status-bar {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    font-size: 13px;
    color: #aaa;
}

#statusText {
    color: #ff6b1a;
    font-weight: bold;
}

/* Main Layout - 2 rows 50/50 */
.party-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    height: calc(100vh - 60px);
}

/* Top Row: Comments + Stats - 50% height */
.top-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

/* Bottom Row: Leaderboard + Players - 50% height */
.bottom-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

.section-title {
    color: #ff6b1a;
    margin-bottom: 0.5rem;
    font-size: 16px;
    letter-spacing: 1px;
    font-weight: bold;
}

/* Commentator Section */
.commentator-section {
    background-color: #2a2a2a;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.commentator-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
}

.commentator-icon {
    font-size: 3rem;
}

.commentator-text {
    font-size: 1.6rem;
    line-height: 1.4;
    color: #fff;
    font-style: italic;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

/* Fun Stats Section */
.fun-stats-section {
    background-color: #2a2a2a;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.fun-stats-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    height: calc(100% - 30px);
}

.stats-row {
    display: flex;
    gap: 0.5rem;
    flex: 1;
}

.stats-row.drives-row {
    /* 3 items */
}

.stats-row.scoring-row {
    /* 5 items */
}

.fun-stat-card {
    background-color: #3a3a3a;
    border-radius: 10px;
    padding: 0.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    flex: 1;
    min-width: 0;
}

.fun-stat-card:hover {
    transform: translateY(-2px);
    border-color: #ff6b1a;
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 14px;
    letter-spacing: 0.5px;
    color: #aaa;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 38px;
    font-weight: bold;
    color: #ff6b1a;
    line-height: 1;
}

.stat-player {
    font-size: 16px;
    color: #ccc;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Mini Leaderboard */
.mini-leaderboard-section {
    background-color: #2a2a2a;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
}

.mini-leaderboard {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.leaderboard-row {
    display: grid;
    grid-template-columns: 35px 1fr 60px 50px 70px;
    align-items: center;
    padding: 10px 12px;
    background-color: #3a3a3a;
    border-radius: 8px;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.leaderboard-row:hover {
    background-color: #444;
    transform: translateX(4px);
}

.leaderboard-row.leader {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    border-left-color: #FFD700;
}

.leaderboard-row.leader * {
    color: #000 !important;
}

.lb-position {
    font-size: 20px;
    font-weight: bold;
    color: #ff6b1a;
    text-align: center;
}

.lb-name {
    font-size: 15px;
    font-weight: bold;
}

.lb-score {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}

.lb-score.under-par {
    color: #4CAF50;
}

.lb-score.over-par {
    color: #ff4444;
}

.lb-score.even-par {
    color: #ffffff;
}

.lb-thru {
    font-size: 13px;
    color: #aaa;
    text-align: right;
}

.lb-points {
    font-size: 14px;
    font-weight: bold;
    color: #ff6b1a;
    text-align: center;
}

/* Player Cards Section */
.player-cards-section {
    background-color: #2a2a2a;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.player-cards-grid {
    display: flex;
    gap: 1rem;
    flex: 1;
    min-height: 0;
    overflow-x: auto;
}

.player-card {
    background-color: #3a3a3a;
    border-radius: 12px;
    padding: 0.6rem;
    flex: 1;
    min-width: 180px;
    max-width: 280px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
}

.player-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

.player-card.leader {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 107, 26, 0.1));
    border-color: #FFD700;
}

.player-card .player-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.player-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ff6b1a;
    flex-shrink: 0;
}

.player-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b1a, #e55d0d);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}

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

.player-name {
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-hcp {
    font-size: 11px;
    color: #aaa;
}

.player-stats {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
}

.player-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.1rem 0;
}

.player-stat-row.main-score {
    flex-direction: column;
    align-items: center;
    padding: 0.25rem 0;
    margin-bottom: 0.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.player-stat-row.main-score .player-stat-label {
    font-size: 10px;
    margin-top: 0.1rem;
}

.player-stat-row.last-holes {
    margin-top: 0.15rem;
    padding-top: 0.15rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.player-stat-row.streak {
    justify-content: center;
    background: rgba(255, 107, 26, 0.15);
    border-radius: 4px;
    padding: 0.2rem;
    margin-top: 0.15rem;
}

.player-stat-label {
    font-size: 12px;
    color: #aaa;
}

.player-stat-value {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
}

.player-stat-value.emojis {
    font-size: 16px;
    letter-spacing: 2px;
}

.player-stat-value.streak-value {
    font-size: 12px;
    color: #ff6b1a;
}

.player-stat-value.score {
    color: #ff6b1a;
    font-size: 28px;
}

.player-stat-row.highlight-stat {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    margin: 0.1rem 0;
}

.player-stat-value.under-par {
    color: #4CAF50;
}

.player-stat-value.over-par {
    color: #ff4444;
}

.no-data {
    text-align: center;
    color: #666;
    padding: 2rem;
    font-size: 16px;
}

/* Settings Dropdown */
.settings-container {
    position: relative;
}

.settings-btn {
    background-color: #3a3a3a;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-btn:hover {
    background-color: #4a4a4a;
}

.settings-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 1rem;
    min-width: 250px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    z-index: 100;
    border: 1px solid #3a3a3a;
}

.settings-dropdown.show {
    display: block;
}

.settings-item {
    margin-bottom: 1rem;
}

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

.settings-item label {
    display: block;
    font-size: 13px;
    color: #aaa;
    margin-bottom: 0.5rem;
}

.voice-selector {
    width: 100%;
    padding: 8px 12px;
    background-color: #3a3a3a;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    cursor: pointer;
}

.voice-selector option {
    background: #2a2a2a;
    color: #fff;
}

.switch-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.switch-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #ff6b1a;
}

.switch-text {
    font-size: 14px;
    color: #fff;
}

.logout-btn-dropdown {
    width: 100%;
    padding: 10px 16px;
    background-color: #444;
    color: white;
    border: none;
    border-radius: 6px;
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-btn-dropdown:hover {
    background-color: #555;
}

/* Scrollbar styling */
.player-cards-grid::-webkit-scrollbar,
.mini-leaderboard-section::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.player-cards-grid::-webkit-scrollbar-track,
.mini-leaderboard-section::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.player-cards-grid::-webkit-scrollbar-thumb,
.mini-leaderboard-section::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 26, 0.5);
    border-radius: 4px;
}

.player-cards-grid::-webkit-scrollbar-thumb:hover,
.mini-leaderboard-section::-webkit-scrollbar-thumb:hover {
    background: #ff6b1a;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile */
@media (max-width: 1200px) {
    .top-row {
        grid-template-columns: 1fr;
    }

    .bottom-row {
        grid-template-columns: 1fr;
    }

    .party-layout {
        height: auto;
    }

    .top-row, .bottom-row {
        flex: none;
    }
}

@media (max-width: 768px) {
    .party-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .header-controls {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }

    .match-selector {
        width: 100%;
        min-width: auto;
    }

    .party-layout {
        padding: 0.5rem;
        height: auto;
    }

    .top-row,
    .bottom-row {
        grid-template-columns: 1fr;
    }

    .stats-row {
        flex-wrap: wrap;
    }

    .stats-row .fun-stat-card {
        flex: 1 1 30%;
        min-width: 80px;
    }

    .player-cards-grid {
        flex-direction: column;
    }

    .player-card {
        max-width: none;
        min-width: auto;
    }

    .leaderboard-row {
        grid-template-columns: 30px 1fr 50px 45px 60px;
        padding: 8px 10px;
    }

    .lb-position {
        font-size: 16px;
    }

    .lb-name {
        font-size: 13px;
    }

    .lb-score {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .party-header .logo {
        font-size: 20px;
    }

    .stats-row .fun-stat-card {
        flex: 1 1 45%;
    }

    .fun-stat-card {
        padding: 0.4rem;
    }

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

    .stat-value {
        font-size: 16px;
    }

    .commentator-text {
        font-size: 1rem;
    }
}
