@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;
}

/* Login Page Styles */
.login-container {
    background-color: #2a2a2a;
    padding: 3rem;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    margin: 100px auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.logo {
    text-align: center;
    margin-bottom: 2rem;
    color: #ff6b1a;
    font-size: 32px;
    font-weight: bold;
    letter-spacing: 2px;
}

.login-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.tab-button {
    flex: 1;
    padding: 12px;
    background-color: #3a3a3a;
    color: #aaa;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: normal;
    transition: all 0.3s ease;
}

.tab-button.active {
    background-color: #ff6b1a;
    color: white;
}

.tab-button:hover:not(.active) {
    background-color: #444;
}

.login-form {
    display: none;
}

.login-form.active {
    display: block;
}

.help-section {
    display: none;
}

.help-section.active {
    display: block;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 14px;
    margin: 10px 0;
    border: none;
    border-radius: 6px;
    background-color: #3a3a3a;
    color: #ffffff;
    font-size: 16px;
    font-family: 'Oswald', sans-serif;
}

textarea {
    width: 100%;
    padding: 14px;
    margin: 10px 0;
    border: none;
    border-radius: 6px;
    background-color: #3a3a3a;
    color: #ffffff;
    font-size: 14px;
    font-family: 'Oswald', sans-serif;
    min-height: 150px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: #888;
}

button {
    width: 100%;
    padding: 14px;
    background-color: #ff6b1a;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    margin-top: 1rem;
    font-family: 'Oswald', sans-serif;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #e55d0d;
}

button:disabled {
    background-color: #666;
    cursor: not-allowed;
}

.error-message {
    color: #ff4444;
    margin: 10px 0;
    font-size: 14px;
    min-height: 20px;
    white-space: pre-line; /* Allow line breaks */
    line-height: 1.5;
}

.help-text {
    color: #aaa;
    font-size: 14px;
    line-height: 1.6;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #3a3a3a;
}

.help-text a {
    color: #ff6b1a;
    text-decoration: none;
}

.help-text a:hover {
    text-decoration: underline;
}

.bookmarklet-button {
    display: inline-block;
    padding: 12px 24px;
    background: #ff6b1a;
    color: white !important;
    text-decoration: none !important;
    border-radius: 6px;
    font-weight: bold;
    cursor: move;
    transition: all 0.3s ease;
    border: 2px dashed transparent;
}

.bookmarklet-button:hover {
    background: #ff8534;
    border-color: #fff;
    transform: scale(1.05);
    text-decoration: none !important;
}

.help-text ol {
    margin-left: 20px;
    margin-top: 10px;
}

.help-text li {
    margin: 8px 0;
}

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

.dashboard-header .logo {
    margin: 0;
    font-size: 24px;
}

.party-mode-link {
    background: linear-gradient(135deg, #ff6b1a, #ff9a44);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(255, 107, 26, 0.3);
}

.party-mode-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 26, 0.5);
}

.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 height of other controls */
}

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

.settings-button {
    background-color: #3a3a3a;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 42px;
    width: 42px; /* Make it square */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Prevent shrinking */
}

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

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

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

.settings-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

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

.settings-item label {
    font-size: 14px;
    color: #aaa;
    font-weight: normal;
}

.user-info-dropdown {
    padding: 10px;
    background-color: #3a3a3a;
    border-radius: 6px;
    text-align: center;
}

.user-info-dropdown #userName {
    font-weight: 500;
    color: #ff6b1a;
}

.logout-button-dropdown {
    width: 100%;
    padding: 10px 24px;
    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.3s ease;
}

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

.voice-selector-global {
    width: 100%;
    padding: 10px;
    background-color: #3a3a3a;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Oswald', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.voice-selector-global:hover {
    background-color: #4a4a4a;
    border-color: rgba(255, 255, 255, 0.4);
}

.voice-selector-global:focus {
    border-color: #ff6b1a;
}

/* User info now in settings dropdown */

.share-button {
    width: auto;
    padding: 10px 24px;
    margin: 0;
    background-color: #ff6b1a;
    white-space: nowrap;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    color: white;
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-button:hover {
    background-color: #ff8534;
}

.share-button:disabled {
    background-color: #666;
    cursor: not-allowed;
}

.share-button-dropdown {
    width: 100%;
    padding: 10px;
    background-color: #ff6b1a;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.share-button-dropdown:hover {
    background-color: #ff8534;
}

.share-button-dropdown:disabled {
    background-color: #666;
    cursor: not-allowed;
}

.export-button-dropdown {
    width: 100%;
    padding: 10px;
    background-color: #6366f1;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.export-button-dropdown:hover {
    background-color: #818cf8;
}

.export-button-dropdown:disabled {
    background-color: #666;
    cursor: not-allowed;
}

.fullscreen-button-dropdown {
    width: 100%;
    padding: 10px;
    background-color: #4a4a4a;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.fullscreen-button-dropdown:hover {
    background-color: #5a5a5a;
}

/* Logout button now in settings dropdown */

/* Fullscreen mode */
body.fullscreen-mode .dashboard-header {
    display: none;
}

body.fullscreen-mode .dashboard-layout {
    margin-top: 0;
    height: 100vh;
}

/* Hole details modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #2a2a2a;
    padding: 15px;
    border-radius: 12px;
    max-width: 1000px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #fff;
}

#modalHoleTitle {
    margin-bottom: 20px;
    color: #ff6b1a;
    font-size: 28px;
}

.hole-player-stats {
    margin-bottom: 5px;
    padding: 10px;
    background-color: #1a1a1a;
    border-radius: 8px;
    border-left: 4px solid #ff6b1a;
}

.hole-player-stats h3 {
    margin-bottom: 10px;
    color: #fff;
    font-size: 20px;
}

.hole-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #3a3a3a;
}

.hole-stat-row:last-child {
    border-bottom: none;
}

.hole-stat-label {
    color: #aaa;
    font-size: 14px;
}

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

.hole-score-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: bold;
    margin-left: 10px;
}

.hole-score-badge.eagle {
    background-color: #FFD700;
    color: #000;
}

.hole-score-badge.birdie {
    background-color: #FF4444;
    color: #fff;
}

.hole-score-badge.par {
    background-color: #555;
    color: #fff;
}

.hole-score-badge.bogey {
    background-color: #4A90E2;
    color: #fff;
}

.hole-score-badge.double-bogey {
    background-color: #1a1a1a;
    color: #fff;
}

.dashboard-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem;
    max-width: 1800px;
    margin: 0 auto;
}

.players-section {
    width: 100%;
}

.leaderboard-section {
    width: 100%;
    background-color: #2a2a2a;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    overflow-x: auto;
}

/* Score Legend */
.score-legend {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border-left: 4px solid #555;
    flex-wrap: wrap;
}

.score-legend .legend-title {
    font-weight: bold;
    color: #aaa;
    font-size: 14px;
}

.score-legend .legend-item {
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
}

.eagle-legend {
    color: #FFD700;
    font-weight: bold;
}

.birdie-legend {
    color: #D9534F;
    font-weight: bold;
}

.par-legend {
    color: #ffffff;
}

.bogey-legend {
    color: #5BC0DE;
}

.double-legend {
    color: #0275D8;
}

/* Scorecard Table */
.scorecard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
}

.scorecard-table thead {
    background-color: #ff6b1a;
    color: white;
}

.scorecard-table th {
    padding: 8px 6px;
    text-align: center;
    font-weight: bold;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.scorecard-table .player-name-header {
    text-align: left;
    padding-left: 16px;
    min-width: 200px;
}

.scorecard-table .hole-header {
    min-width: 40px;
}

.scorecard-table th.split-border,
.scorecard-table td.split-border {
    border-left: 2px solid rgba(255, 255, 255, 0.25);
}

.scorecard-table .split-total-header,
.scorecard-table .split-total-cell,
.scorecard-table .front-nine-total {
    background-color: rgba(255, 255, 255, 0.06);
    font-weight: 600;
    color: #ddd;
    border-left: 2px solid rgba(255, 255, 255, 0.25);
}

.scorecard-table .split-total-header {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
}

.scorecard-table .stat-header {
    background-color: #ff6b1a;
    min-width: 60px;
    font-size: 12px;
}

.scorecard-table .total-header {
    background-color: #e65100;
    min-width: 60px;
}

.scorecard-table .hcp-cell,
.scorecard-table .total-shots {
    text-align: center;
    color: #ccc;
    font-size: 13px;
}

/* Par row styling */
.scorecard-table .par-row {
    background-color: #333;
    font-size: 12px;
    color: #999;
    border-top: 2px solid #555;
}

.scorecard-table .par-label {
    text-align: left;
    padding-left: 16px;
    font-style: italic;
    font-weight: normal;
}

.scorecard-table .par-cell {
    font-weight: normal;
    color: #888;
}

.scorecard-table .par-total {
    background-color: rgba(255, 255, 255, 0.08);
    font-weight: bold;
    color: #aaa;
}

.scorecard-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s;
}

.scorecard-table tbody tr:hover {
    background-color: rgba(255, 107, 26, 0.1);
}

.scorecard-table tbody tr.first-place {
    background-color: rgba(255, 215, 0, 0.1);
}

.scorecard-table tbody tr.second-place {
    background-color: rgba(192, 192, 192, 0.1);
}

.scorecard-table tbody tr.third-place {
    background-color: rgba(205, 127, 50, 0.1);
}

.scorecard-table td {
    padding: 6px 6px;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.scorecard-table .player-name-cell {
    text-align: left;
    padding-left: 12px;
    font-weight: bold;
}

.scorecard-table .player-name-cell strong {
    display: block;
    margin-bottom: 2px;
}

.scorecard-table .hcp-badge {
    font-size: 11px;
    color: #aaa;
    font-weight: normal;
}

.scorecard-table .hole-score {
    font-weight: bold;
}

/* Score colors - Traditional TV Golf colors */
.scorecard-table .eagle {
    background-color: rgba(255, 215, 0, 0.4);
    color: #FFD700;
    font-weight: bold;
}

.scorecard-table .birdie {
    background-color: rgba(217, 83, 79, 0.4);
    color: #D9534F;
    font-weight: bold;
}

.scorecard-table .par {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.scorecard-table .bogey {
    background-color: rgba(91, 192, 222, 0.3);
    color: #5BC0DE;
}

.scorecard-table .double-bogey {
    background-color: rgba(2, 117, 216, 0.3);
    color: #0275D8;
}

.scorecard-table .total-score {
    font-weight: bold;
    font-size: 16px;
    background-color: #333;
}

.scorecard-table .under-par {
    color: #4caf50;
}

.scorecard-table .over-par {
    color: #f44336;
}

.scorecard-table .even-par {
    color: #ffffff;
}

h2 {
    color: #ff6b1a;
    margin-bottom: 1.5rem;
    font-size: 24px;
    letter-spacing: 1px;
}

/* Player Grid */
.player-grid {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    justify-content: center;
}

.player-grid .player-card {
    flex: 0 0 300px;
    min-width: 300px;
    position: relative;
}

.player-card {
    background-color: #2a2a2a;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

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

.player-card.flash {
    animation: flash 1s ease-in-out;
}

@keyframes flash {
    0%, 100% { 
        background-color: #2a2a2a; 
    }
    50% { 
        background-color: rgba(255, 107, 26, 0.3);
    }
}

.player-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #3a3a3a;
}

.player-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ff6b1a;
}

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

.player-info h3 {
    font-size: 18px;
    margin-bottom: 3px;
}

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

.shot-info {
    margin: 0.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    background-color: rgba(255, 107, 26, 0.1);
    padding: 0.8rem;
    border-radius: 8px;
    width: 100%;
    flex-grow: 1;
}

.shot-header {
    font-size: 18px;
    font-weight: bold;
    color: #ff6b1a;
    text-align: left;
    margin-bottom: 0.2rem;
}

.club-badge {
    display: inline-block;
    background-color: #ff6b1a;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
}

.shot-distance-large {
    font-size: 36px;
    font-weight: bold;
    color: #4caf50;
    text-align: center;
}

.player-stats-section {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: auto;
    padding: 0.6rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 13px;
    color: #ddd;
}

.stat-item .stat-text {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
}

.stat-item .stat-text strong {
    color: #ff6b1a;
    text-align: right;
    min-width: 100px;
    flex-shrink: 0;
}

.stat-icon {
    font-size: 18px;
}

/* Action buttons */
.action-buttons {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
    align-items: center;
    z-index: 10;
}

.roast-button,
.replay-button,
.download-button {
    background: linear-gradient(135deg, #ff6b1a, #ff8c42);
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 107, 26, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.replay-button {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
    display: none; /* Hidden by default */
}

.download-button {
    background: linear-gradient(135deg, #2196f3, #42a5f5);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
    display: none; /* Hidden by default */
}

.replay-button.visible,
.download-button.visible {
    display: inline-flex;
}

.roast-button:hover,
.replay-button:hover,
.download-button:hover {
    transform: translateY(-2px);
}

.roast-button:hover {
    box-shadow: 0 4px 12px rgba(255, 107, 26, 0.5);
}

.replay-button:hover {
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.5);
}

.download-button:hover {
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.5);
}

.roast-button:active,
.replay-button:active,
.download-button:active {
    transform: translateY(0);
}

.roast-button.loading,
.replay-button.loading,
.roast-button.playing,
.replay-button.playing {
    cursor: wait;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    width: 14px !important;
    height: 14px !important;
}

/* Rotating white circle loader */
.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top: 2px solid white;
    border-radius: 50%;
    display: inline-block;
    animation: spinnerRotate 0.8s linear infinite;
}

@keyframes spinnerRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.shot-meta {
    color: #aaa;
    font-size: 13px;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #3a3a3a;
}

.shot-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

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

.stat-value {
    color: #ffffff;
    font-weight: bold;
    font-size: 15px;
}

.stat-value.main-stat {
    color: #ff6b1a;
    font-size: 18px;
}

.no-shot {
    color: #666;
    font-size: 14px;
    text-align: center;
    padding: 1rem;
}

.score-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #3a3a3a;
}

.score-display {
    font-size: 24px;
    font-weight: bold;
    color: #ff6b1a;
}

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

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

.score-details {
    color: #aaa;
    font-size: 14px;
    margin-top: 4px;
}

/* Leaderboard */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.leaderboard-item {
    display: grid;
    grid-template-columns: 35px 1fr auto auto;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background-color: #3a3a3a;
    border-radius: 8px;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

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

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

.leaderboard-item.second {
    background-color: #4a4a4a;
    border-left-color: #C0C0C0;
}

.leaderboard-item.third {
    background-color: #454545;
    border-left-color: #CD7F32;
}

.leaderboard-item.first * {
    color: #000 !important;
}

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

.leaderboard-player-col {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

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

.leaderboard-course {
    font-size: 12px;
    color: #999;
}

.leaderboard-score {
    font-size: 20px;
    font-weight: bold;
    min-width: 45px;
    text-align: center;
}

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

.leaderboard-score.score-over {
    color: #ff4444;
}

.leaderboard-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    min-width: 120px;
    justify-content: flex-end;
}

.stat-badge {
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: normal;
    white-space: nowrap;
}

.stat-badge.eagle {
    background-color: rgba(255, 215, 0, 0.2);
    color: #FFD700;
}

.stat-badge.birdie {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.stat-badge.accuracy {
    background-color: rgba(33, 150, 243, 0.2);
    color: #2196F3;
}

.stat-badge.putts {
    background-color: rgba(156, 39, 176, 0.2);
    color: #9C27B0;
}

/* Status Bar */
.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;
}

#lastUpdateTime {
    font-size: 11px;
    color: #999;
}

/* No Data Messages */
.no-data {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 18px;
}

.no-data.small {
    padding: 2rem 1rem;
    font-size: 14px;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 107, 26, 0.3);
    border-radius: 50%;
    border-top-color: #ff6b1a;
    animation: spin 1s linear infinite;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .dashboard-layout {
        flex-direction: column;
    }
    
    .leaderboard-section {
        position: static;
        max-height: none;
    }
    
    .player-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .logo {
        font-size: 24px;
    }
    
    .header-controls {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    .match-selector,
    .logout-button,
    .share-button {
        width: 100%;
    }
    
    .settings-button {
        width: 42px;
        height: 42px;
    }
    
    .player-grid {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        width: 100%;
    }
    
    .player-card {
        width: 100%;
        max-width: 500px;
    }
    
    .dashboard-layout {
        padding: 1rem;
        gap: 1rem;
    }
    
    /* Leaderboard/Scorecard mobile optimization - swipeable tabs */
    .scorecard-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Mobile tabs for front/back 9 */
    .mobile-scorecard-tabs {
        display: flex;
        gap: 0.5rem;
        margin-bottom: 1rem;
        border-bottom: 2px solid #3a3a3a;
    }
    
    .mobile-tab {
        flex: 1;
        padding: 12px;
        background: transparent;
        border: none;
        color: #aaa;
        font-family: 'Oswald', sans-serif;
        font-size: 16px;
        font-weight: bold;
        cursor: pointer;
        border-bottom: 3px solid transparent;
        transition: all 0.3s ease;
    }
    
    .mobile-tab.active {
        color: #ff6b1a;
        border-bottom-color: #ff6b1a;
    }
    
    .mobile-scorecard-content {
        position: relative;
        overflow: hidden;
        touch-action: pan-y;
    }
    
    .mobile-scorecard-panel {
        display: none;
    }
    
    .mobile-scorecard-panel.active {
        display: block;
    }
    
    /* Mobile table - transposed layout (holes vertical, players horizontal) */
    .scorecard-table {
        font-size: 12px;
        width: 100%;
        border-collapse: collapse;
    }
    
    .scorecard-table th,
    .scorecard-table td {
        padding: 6px 4px;
        text-align: center;
        border: 1px solid #3a3a3a;
        min-width: 45px;
    }
    
    .scorecard-table th {
        background-color: #2a2a2a;
        font-weight: bold;
        font-size: 11px;
    }
    
    /* First three columns (Hole, Par, HCP) should be sticky */
    .scorecard-table th:first-child,
    .scorecard-table td:first-child {
        position: sticky;
        left: 0;
        z-index: 10;
        background-color: #2a2a2a;
        text-align: center;
        font-weight: bold;
        min-width: 40px;
    }
    
    .scorecard-table th:nth-child(2),
    .scorecard-table td:nth-child(2) {
        position: sticky;
        left: 40px;
        z-index: 10;
        background-color: #2a2a2a;
        font-weight: bold;
        min-width: 40px;
    }
    
    .scorecard-table th:nth-child(3),
    .scorecard-table td:nth-child(3) {
        position: sticky;
        left: 80px;
        z-index: 10;
        background-color: #2a2a2a;
        font-size: 10px;
        min-width: 40px;
    }
    
    /* Player columns - make them narrower */
    .scorecard-table th:nth-child(n+4),
    .scorecard-table td:nth-child(n+4) {
        min-width: 50px;
        max-width: 50px;
        padding: 4px 2px;
    }
    
    /* Player photos in header */
    .player-name-header {
        background-color: #2a2a2a;
        font-weight: bold;
        color: #ff6b1a;
        padding: 2px;
    }
    
    .player-name-header img {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        object-fit: cover;
        display: block;
        margin: 0 auto;
    }
    
    .scorecard-legend {
        flex-wrap: wrap;
        gap: 0.5rem;
        font-size: 11px;
        margin-bottom: 1rem;
    }
    
    /* Player cards mobile optimization */
    .player-card {
        height: auto !important;
        min-height: auto;
    }
    
    .player-header {
        gap: 0.6rem;
        margin-bottom: 0.6rem;
        padding-bottom: 0.6rem;
    }
    
    .player-photo,
    .player-photo-placeholder {
        width: 45px;
        height: 45px;
    }
    
    .player-photo-placeholder {
        font-size: 18px;
    }
    
    .player-info h3 {
        font-size: 16px;
    }
    
    .player-hcp {
        font-size: 12px;
    }
    
    .shot-info {
        padding: 0.6rem;
        margin: 0.4rem 0;
    }
    
    .shot-header {
        font-size: 16px;
    }
    
    .player-stats-section {
        padding: 0.5rem;
        gap: 0.25rem;
    }
    
    .stat-item {
        font-size: 13px;
    }
    
    /* Roast button mobile */
    .action-buttons {
        top: 0.5rem;
        right: 0.5rem;
        gap: 0.3rem;
    }
    
    .roast-button,
    .replay-button,
    .download-button {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    /* Modal mobile optimization */
    .modal-content {
        width: 95%;
        max-width: 95%;
        padding: 10px;
        margin: 5% auto;
    }
    
    .modal-close {
        top: 5px;
        right: 10px;
        font-size: 32px;
    }
    
    #modalHoleTitle {
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    #modalHoleMap {
        height: 50vh !important;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 20px;
    }
    
    .dashboard-layout {
        padding: 0.5rem;
    }
    
    .player-card {
        padding: 0.8rem;
        min-height: 450px;
    }
    
    .scorecard-table {
        font-size: 10px;
    }
    
    .scorecard-table th,
    .scorecard-table td {
        padding: 4px 2px;
        min-width: 25px;
    }
    
    .player-name-cell {
        min-width: 80px;
        max-width: 80px;
        font-size: 11px;
    }
    
    .shot-info {
        padding: 0.5rem;
    }
    
    .player-stats-section {
        font-size: 12px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.2rem;
    }
    
    .roast-button,
    .replay-button,
    .download-button {
        padding: 5px 10px;
        font-size: 11px;
        min-width: 60px;
    }
}

/* Custom tooltip styles */
.shot-metric-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.95);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.4;
    max-width: 280px;
    z-index: 10000;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.shot-metric-tooltip.show {
    opacity: 1;
}

.shot-metric-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(0, 0, 0, 0.95);
}

