/* Tee Times Page Styles */

.tee-times-section {
    background: white;
    margin: 2rem auto;
    padding: 2rem 0;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    min-height: 70vh;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0 20px;
    margin-bottom: 1.5rem;
}

.header-left h1 {
    color: #2c3e50;
    font-size: 2rem;
    margin: 0 0 0.5rem 0;
}

.page-subtitle {
    color: #666;
    font-size: 1rem;
    margin: 0;
}

.create-lobby-btn {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.create-lobby-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

/* Tabs */
.lobby-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0 20px;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #2B5A9E;
}

.tab-btn.active {
    color: #2B5A9E;
    border-bottom-color: #2B5A9E;
}

/* Tab Count Badge */
.tab-count {
    display: inline-block;
    background: #28a745;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 10px;
    margin-left: 0.3rem;
    vertical-align: middle;
    line-height: 1.2;
}

.tab-btn.active .tab-count {
    background: #2B5A9E;
}

/* Filters */
.filters-container {
    background: #f8f9fa;
    padding: 1.25rem;
    border-radius: 8px;
    margin: 0 20px 1.5rem 20px;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.85rem;
}

.filter-input,
.filter-select {
    padding: 0.6rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
}

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

.clear-filters-btn {
    background: transparent;
    color: #666;
    border: 2px solid #ddd;
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    height: fit-content;
}

.clear-filters-btn:hover {
    border-color: #999;
    color: #333;
}

/* Lobbies Grid */
.lobbies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
    gap: 1.25rem;
    padding: 0 20px;
}

/* Lobby Card */
.lobby-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.lobby-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
    border-color: #2B5A9E;
}

.lobby-card.expired {
    opacity: 0.6;
    border-color: #ccc;
}

.lobby-card.in-progress {
    border-color: #28a745;
    border-width: 2px;
}

.lobby-card.in-progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #28a745, #20c997);
}

/* Lobby Header */
.lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.lobby-course-info h3 {
    color: #2B5A9E;
    font-size: 1.2rem;
    margin: 0 0 0.25rem 0;
}

.lobby-layout {
    color: #666;
    font-size: 0.85rem;
    font-weight: 500;
}

.lobby-status {
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.lobby-status.open {
    background: #e8f5e9;
    color: #2e7d32;
}

.lobby-status.full {
    background: #fff3e0;
    color: #ef6c00;
}

.lobby-status.in-progress {
    background: #e3f2fd;
    color: #1565c0;
}

.lobby-status.completed {
    background: #e8f5e9;
    color: #2e7d32;
}

.lobby-status.expired {
    background: #fce4ec;
    color: #c62828;
}

/* Lobby Details */
.lobby-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.lobby-detail {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #555;
    font-size: 0.9rem;
}

.lobby-detail-icon {
    font-size: 1rem;
}

/* Rating Badge */
.rating-badge {
    background: #f0f4ff;
    color: #2B5A9E;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Player Slots */
.lobby-players {
    margin-bottom: 1rem;
}

.players-label {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.player-slots {
    display: flex;
    gap: 0.5rem;
}

.player-slot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    position: relative;
}

.player-slot.filled {
    background: linear-gradient(135deg, #2B5A9E 0%, #4A90E2 100%);
    color: white;
    border: 2px solid #2B5A9E;
}

.player-slot.host {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    border-color: #FF6B35;
}

.player-slot.host::after {
    content: '★';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 0.7rem;
    color: #FFD700;
}

.player-slot.empty {
    background: #f5f5f5;
    border: 2px dashed #ccc;
    color: #999;
}

.player-slot .player-initial {
    text-transform: uppercase;
}

/* Player Tooltip */
.player-slot[title] {
    cursor: pointer;
}

/* Lobby Description */
.lobby-description {
    color: #666;
    font-size: 0.85rem;
    font-style: italic;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #f9f9f9;
    border-radius: 6px;
}

/* Lobby Actions */
.lobby-actions {
    display: flex;
    gap: 0.75rem;
}

.lobby-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
}

.lobby-btn.view-btn {
    background: white;
    color: #2B5A9E;
    border: 2px solid #2B5A9E;
}

.lobby-btn.view-btn:hover {
    background: #f0f4ff;
}

.lobby-btn.join-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
}

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

.lobby-btn.join-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.lobby-btn.leave-btn {
    background: #dc3545;
    color: white;
    border: none;
}

.lobby-btn.start-btn {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    color: white;
    border: none;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.no-results-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results-text {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.no-results-subtext {
    font-size: 0.95rem;
    color: #999;
}

/* ==================== CREATE LOBBY MODAL ==================== */

.lobby-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.lobby-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.lobby-form .form-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.lobby-form input,
.lobby-form select,
.lobby-form textarea {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.lobby-form input:focus,
.lobby-form select:focus,
.lobby-form textarea:focus {
    outline: none;
    border-color: #2B5A9E;
    box-shadow: 0 0 0 3px rgba(43, 90, 158, 0.1);
}

/* Player Slots Selector */
.player-slots-selector {
    display: flex;
    gap: 0.5rem;
}

.slot-btn {
    width: 50px;
    height: 50px;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    background: white;
    font-size: 1.1rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slot-btn:hover {
    border-color: #2B5A9E;
    color: #2B5A9E;
}

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

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.cancel-btn {
    padding: 0.75rem 1.5rem;
    background: white;
    color: #666;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    border-color: #999;
    color: #333;
}

/* ==================== RESPONSIVE ==================== */

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

    .create-lobby-btn {
        width: 100%;
    }

    .lobby-tabs {
        overflow-x: auto;
    }

    .tab-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .filters-container {
        flex-direction: column;
    }

    .filter-group {
        min-width: 100%;
    }

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

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

    .player-slots-selector {
        justify-content: center;
    }

    .lobby-actions {
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column;
    }

    .cancel-btn,
    .submit-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .lobbies-grid {
        grid-template-columns: 1fr;
        padding: 0 12px;
    }

    .lobby-card {
        padding: 1rem;
    }

    .lobby-btn {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        min-height: 44px;
    }

    .tab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .filters-container {
        padding: 1rem;
        margin: 0 12px 1rem 12px;
    }

    .page-header {
        padding: 0 12px;
    }

    .lobby-detail-section {
        margin: 0.5rem;
        padding: 1rem;
    }

    /* Mobile form improvements */
    .lobby-form {
        gap: 0.875rem;
        padding-bottom: 180px; /* Extra space for sticky buttons - ensures Description is accessible */
    }

    .lobby-form .form-group label {
        font-size: 0.85rem;
    }

    .lobby-form input,
    .lobby-form select,
    .lobby-form textarea {
        padding: 0.875rem 0.75rem;
        font-size: 16px; /* Prevents iOS zoom */
        border-radius: 10px;
    }

    .player-slots-selector {
        gap: 0.4rem;
    }

    .slot-btn {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }

    /* Sticky form actions on mobile - fixes hidden Create button */
    .lobby-form .form-actions {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 1rem;
        margin: 0;
        border-top: 1px solid #e0e0e0;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
        z-index: 100;
        gap: 0.75rem;
    }

    .cancel-btn,
    .submit-btn {
        padding: 0.875rem 1rem;
        font-size: 1rem;
        min-height: 48px;
    }

    /* Make Submit button more prominent on mobile */
    .lobby-form .submit-btn {
        order: -1; /* Show Create button first (on top) */
    }
}

/* ==================== LOBBY DETAIL PAGE ==================== */

.lobby-detail-section {
    background: white;
    margin: 2rem auto;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    max-width: 900px;
}

.lobby-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #eee;
}

.lobby-detail-info h1 {
    color: #2B5A9E;
    font-size: 1.8rem;
    margin: 0 0 0.5rem 0;
}

.lobby-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #555;
}

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

/* Players List */
.players-section {
    margin-bottom: 2rem;
}

.players-section h2 {
    color: #2c3e50;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.players-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.player-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
}

.player-card.host {
    border-color: #FF6B35;
    background: #fff8f5;
}

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

.player-card.host .player-avatar-large {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
}

.player-info h4 {
    margin: 0 0 0.25rem 0;
    color: #2c3e50;
}

.player-rating {
    font-size: 0.85rem;
    color: #666;
}

.empty-slot-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: #f5f5f5;
    border: 2px dashed #ccc;
    border-radius: 10px;
    color: #999;
    font-weight: 500;
}

/* Chat Section */
.chat-section {
    margin-bottom: 2rem;
}

.chat-section h2 {
    color: #2c3e50;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.chat-container {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.chat-messages {
    height: 300px;
    overflow-y: auto;
    padding: 1rem;
    background: #fafafa;
}

.chat-message {
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chat-message.own {
    background: #e3f2fd;
    margin-left: 20%;
}

.chat-message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.chat-sender {
    font-weight: 600;
    color: #2B5A9E;
    font-size: 0.85rem;
}

.chat-time {
    font-size: 0.75rem;
    color: #999;
}

.chat-text {
    color: #333;
    font-size: 0.9rem;
}

.chat-input-container {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.chat-input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
}

.chat-input:focus {
    outline: none;
    border-color: #2B5A9E;
}

.chat-send-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #2B5A9E 0%, #4A90E2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* Scoring Section */
.scoring-section {
    margin-bottom: 2rem;
}

.scoring-section h2 {
    color: #2c3e50;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.start-round-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.start-round-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* Host Actions */
.host-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #eee;
}

.host-actions .lobby-btn {
    flex: 1;
}

/* ==================== LOBBY DETAIL PAGE - EXTENDED ==================== */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #2B5A9E;
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: #FF6B35;
}

.lobby-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.lobby-info-column,
.lobby-chat-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Status Banner */
.lobby-status-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
}

.lobby-status-banner.open {
    background: #e8f5e9;
    color: #2e7d32;
}

.lobby-status-banner.full {
    background: #fff3e0;
    color: #ef6c00;
}

.lobby-status-banner.in-progress {
    background: #e3f2fd;
    color: #1565c0;
}

.lobby-status-banner.completed {
    background: #f3e5f5;
    color: #7b1fa2;
}

.lobby-status-banner.expired {
    background: #fafafa;
    color: #757575;
}

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

/* Info Cards */
.info-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.card-header h2,
.card-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1rem;
}

.card-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.edit-course-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.edit-course-btn:hover {
    background: #e3f2fd;
    opacity: 1;
}

.layout-badge {
    background: #e3f2fd;
    color: #1565c0;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.player-count {
    background: #2B5A9E;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Course Details */
.course-details {
    padding: 1rem 1.25rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 1rem;
}

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

.detail-label {
    color: #666;
    font-weight: 500;
    font-size: 0.85rem;
    flex-shrink: 0;
    min-width: 5.5rem;
}

.detail-row span:not(.detail-label) {
    text-align: right;
    font-size: 0.9rem;
}

.detail-value {
    color: #2c3e50;
    font-weight: 600;
}

.lobby-description-section {
    padding: 0 1.25rem 1rem;
    border-top: 1px solid #f0f0f0;
    margin-top: 0.5rem;
}

.lobby-description-section p {
    margin: 0.75rem 0 0;
    color: #666;
    font-style: italic;
    padding: 0.75rem;
    background: #f9f9f9;
    border-radius: 6px;
}

/* Players List in Detail */
.info-card .players-list {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.player-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.player-item.host {
    background: #fff8f5;
    border: 1px solid #FF6B35;
}

.player-item.current-user {
    background: #e8f5e9;
    border: 1px solid #4caf50;
}

.player-item.empty {
    background: #fafafa;
    border: 2px dashed #ddd;
}

.player-item .player-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: 600;
    font-size: 0.9rem;
}

.player-item.host .player-avatar {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
}

.player-item.empty .player-avatar {
    background: #e0e0e0;
    color: #999;
    border: 2px dashed #ccc;
}

.player-item .player-info {
    flex: 1;
}

.player-item .player-name {
    font-weight: 600;
    color: #2c3e50;
}

.player-item .player-name.empty-slot {
    color: #999;
    font-weight: 500;
}

.player-item .player-rating {
    font-size: 0.8rem;
    color: #666;
    display: block;
    margin-top: 0.15rem;
}

/* Action Buttons */
.host-actions,
.player-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.action-btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.action-btn.start-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.action-btn.start-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.action-btn.start-btn:disabled,
.action-btn.start-btn.disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.action-btn.cancel-btn {
    background: white;
    color: #dc3545;
    border: 2px solid #dc3545;
}

.action-btn.cancel-btn:hover {
    background: #dc3545;
    color: white;
}

.action-btn.join-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.action-btn.join-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.action-btn.join-btn:disabled,
.action-btn.join-btn.disabled {
    background: #ccc;
    cursor: not-allowed;
}

.action-btn.leave-btn {
    background: white;
    color: #dc3545;
    border: 2px solid #dc3545;
}

.action-btn.leave-btn:hover {
    background: #dc3545;
    color: white;
}

/* Chat Card */
.chat-card {
    display: flex;
    flex-direction: column;
    height: 400px;
}

.chat-card .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-message {
    max-width: 85%;
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    font-size: 0.9rem;
}

.chat-message.system {
    align-self: center;
    background: #f0f0f0;
    color: #666;
    font-style: italic;
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
    max-width: 100%;
    text-align: center;
}

.chat-message.own {
    align-self: flex-end;
    background: #2B5A9E;
    color: white;
}

.chat-message.other {
    align-self: flex-start;
    background: white;
    border: 1px solid #e0e0e0;
}

.message-sender {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #2B5A9E;
    margin-bottom: 0.2rem;
}

.message-time {
    display: block;
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 0.25rem;
    text-align: right;
}

.chat-message.own .message-time {
    color: rgba(255, 255, 255, 0.8);
}

.send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2B5A9E 0%, #4A90E2 100%);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(43, 90, 158, 0.4);
}

/* Not Joined Card */
.not-joined-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    background: #f8f9fa;
}

.not-joined-content {
    text-align: center;
    padding: 2rem;
}

.not-joined-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.not-joined-content h3 {
    color: #666;
    margin: 0 0 0.5rem;
}

.not-joined-content p {
    color: #999;
    margin: 0;
    font-size: 0.9rem;
}

/* Scoring Card */
.scoring-card {
    display: flex;
    flex-direction: column;
}

.scoring-content {
    padding: 1rem;
}

.scoring-leaderboard {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.leaderboard-header {
    display: grid;
    grid-template-columns: 40px 1fr 60px 60px;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #2B5A9E;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

.leaderboard-row {
    display: grid;
    grid-template-columns: 40px 1fr 60px 60px;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
}

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

.leaderboard-row.current-user {
    background: #e8f5e9;
}

.rank-col {
    font-weight: 600;
    color: #666;
}

.player-col {
    font-weight: 500;
}

.holes-col {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

.score-col {
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
}

.score-col.under-par {
    color: #28a745;
}

.score-col.over-par {
    color: #dc3545;
}

.scoring-actions {
    padding: 1rem;
    border-top: 1px solid #e0e0e0;
}

/* Mini Scorecard */
.mini-scorecard {
    margin-top: 1rem;
    border-top: 1px solid #e0e0e0;
    padding-top: 1rem;
}

.mini-scorecard-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    max-width: 100%;
}

.mini-scorecard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    min-width: 400px;
}

.mini-scorecard-table th,
.mini-scorecard-table td {
    padding: 4px 3px;
    text-align: center;
    border: 1px solid #e0e0e0;
    white-space: nowrap;
}

.mini-scorecard-table th {
    background: #2B5A9E;
    color: white;
    font-weight: 600;
}

.mini-scorecard-table .par-row td {
    background: #f0f0f0;
    font-weight: 600;
    color: #555;
}

.mini-scorecard-table .player-header {
    text-align: left;
    padding-left: 6px;
    min-width: 60px;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-scorecard-table .total-header {
    font-weight: 700;
    background: #f8f9fa;
}

.mini-scorecard-table th.total-header,
.mini-scorecard-table th.par-header {
    background: #1e4580;
}

.mini-scorecard-table .par-header {
    font-weight: 700;
}

.mini-scorecard-table .hole-ace {
    background: linear-gradient(135deg, #7b2d8e, #d4af37);
    color: #fff;
    font-weight: 700;
    border-radius: 3px;
    animation: ace-glow-mini 2s ease-in-out infinite alternate;
}

@keyframes ace-glow-mini {
    from { box-shadow: inset 0 0 4px rgba(212, 175, 55, 0.3); }
    to { box-shadow: inset 0 0 8px rgba(212, 175, 55, 0.7); }
}

.mini-scorecard-table .hole-albatross {
    background: #1a3a6b;
    color: #fff;
    font-weight: 700;
    border-radius: 3px;
}

.mini-scorecard-table .hole-eagle {
    background: #28a745;
    color: #fff;
    font-weight: 700;
    border-radius: 3px;
}

.mini-scorecard-table .hole-birdie {
    color: #28a745;
    font-weight: 700;
}

.mini-scorecard-table .hole-under {
    color: #28a745;
    font-weight: 700;
}

.mini-scorecard-table .hole-par {
    color: #666;
}

.mini-scorecard-table .hole-bogey {
    color: #e8913a;
    font-weight: 700;
}

.mini-scorecard-table .hole-over {
    color: #dc3545;
    font-weight: 700;
}

.mini-scorecard-table .hole-double-bogey {
    background: #e74c3c;
    color: #fff;
    font-weight: 700;
    border-radius: 3px;
}

.mini-scorecard-table .hole-triple-bogey {
    background: #8b0000;
    color: #fff;
    font-weight: 700;
    border-radius: 3px;
}

.mini-scorecard-table .hole-worse-than-triple {
    background: #4a0000;
    color: #fff;
    font-weight: 700;
    border-radius: 3px;
}

.mini-scorecard-table .hole-empty {
    color: #ccc;
}

.mini-scorecard-table .current-user-row {
    background: #e8f5e9;
}

.mini-scorecard-table .current-user-row td.total-header {
    background: #d4edda;
}

.score-btn {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.score-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

/* Score Entry Modal */
.score-entry-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.hole-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hole-selector label {
    font-weight: 600;
    color: #2c3e50;
}

.hole-selector select {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
}

.hole-info {
    display: flex;
    gap: 1.5rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    font-weight: 500;
    color: #666;
}

.player-scores {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.player-score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.player-score-row label {
    font-weight: 600;
    color: #2c3e50;
}

.score-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.score-input-group .score-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-input-group .score-btn.minus {
    background: #f0f0f0;
    color: #666;
}

.score-input-group .score-btn.plus {
    background: #e8f5e9;
    color: #28a745;
}

.score-input-group .score-btn:hover {
    transform: scale(1.1);
    box-shadow: none;
}

.score-input {
    width: 60px;
    padding: 0.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
}

.score-input:focus {
    outline: none;
    border-color: #2B5A9E;
}

.score-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

/* Lobby Footer on Cards */
.lobby-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px solid #eee;
}

.lobby-host {
    font-size: 0.85rem;
    color: #666;
}

.spots-text {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.4rem;
    display: block;
}

.lobby-status-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.lobby-time-until {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

.lobby-action {
    margin-top: 1rem;
}

.lobby-action-btn {
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.lobby-action-btn.join {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

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

.lobby-action-btn.joined,
.lobby-action-btn.host {
    background: #2B5A9E;
    color: white;
}

.lobby-action-btn.joined:hover,
.lobby-action-btn.host:hover {
    background: #1e4a8a;
}

.lobby-action-btn.disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

/* ========== In-Progress State - Focused Scorecard Layout ========== */

/* Single column layout for in-progress rounds */
.lobby-detail-grid.in-progress-layout {
    grid-template-columns: 1fr !important;
}

/* Minimized players card - compact horizontal layout */
.info-card.minimized {
    padding: 0;
}

.info-card.minimized .card-header {
    padding: 0.75rem 1rem;
    cursor: pointer;
}

.info-card.minimized .players-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
}

.info-card.minimized .player-item {
    padding: 0.35rem 0.6rem;
    gap: 0.4rem;
    flex: none;
    background: #f0f4ff;
    border: 1px solid #d0d8e8;
}

.info-card.minimized .player-item.host {
    background: #fff5f0;
    border-color: #ffcbb3;
}

.info-card.minimized .player-item.current-user {
    background: #e8f5e9;
    border-color: #a5d6a7;
}

.info-card.minimized .player-item .player-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
}

.info-card.minimized .player-item .player-rating {
    display: none;
}

.info-card.minimized .player-item.empty {
    display: none;
}

/* Minimized chat - collapsed with limited height */
.chat-card.minimized {
    height: auto;
    max-height: 180px;
}

.chat-card.minimized .chat-messages {
    max-height: 120px;
    flex: none;
}

.chat-card.minimized .card-header h3::after {
    content: ' (Read Only)';
    font-size: 0.75rem;
    font-weight: normal;
    color: #999;
}

/* Scoring card takes priority in layout */
.lobby-detail-grid.in-progress-layout .scoring-card {
    order: -2;
}

.lobby-detail-grid.in-progress-layout .lobby-status-banner {
    order: -3;
}

/* Ensure scoring card stands out */
.lobby-detail-grid.in-progress-layout .scoring-card {
    border: 2px solid #2B5A9E;
    box-shadow: 0 4px 12px rgba(43, 90, 158, 0.15);
}

/* Info column becomes compact row when in progress */
.lobby-detail-grid.in-progress-layout .lobby-info-column {
    display: contents;
}

.lobby-detail-grid.in-progress-layout .lobby-info-column > * {
    order: 10;
}

.lobby-detail-grid.in-progress-layout .lobby-chat-column {
    display: contents;
}

.lobby-detail-grid.in-progress-layout .lobby-chat-column > * {
    order: 5;
}

/* Responsive for Lobby Detail */
@media (max-width: 900px) {
    .lobby-detail-grid {
        grid-template-columns: 1fr;
    }

    .lobby-detail-section {
        margin: 1rem;
        padding: 1.5rem;
    }

    .chat-card {
        height: 350px;
    }
}

/* ========== Mobile Lobby Detail - Compact Layout ========== */
@media (max-width: 600px) {
    .lobby-detail-section {
        margin: 0;
        padding: 0.75rem;
        border-radius: 0;
        box-shadow: none;
        min-height: calc(100vh - 200px);
    }

    .lobby-detail-section .container {
        padding: 0;
    }

    .back-link {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
        color: #2B5A9E;
        font-weight: 600;
    }

    /* Enhanced status banner - more prominent on mobile */
    .lobby-status-banner {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        margin-bottom: 1rem;
        border-radius: 10px;
        font-weight: 600;
    }

    .lobby-status-banner .status-icon {
        font-size: 1.1rem;
    }

    /* Open status - friendly and inviting */
    .lobby-status-banner.open {
        background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
        border: 2px solid #28a745;
    }

    /* Full status - attention needed */
    .lobby-status-banner.full {
        background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
        border: 2px solid #ffc107;
    }

    /* Compact info cards with subtle shadows */
    .lobby-detail-grid .info-card {
        margin-bottom: 0.75rem;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .lobby-detail-grid .card-header {
        padding: 0.6rem 0.875rem;
    }

    .lobby-detail-grid .card-header h2,
    .lobby-detail-grid .card-header h3 {
        font-size: 0.9rem;
    }

    /* Compact course details */
    .lobby-detail-grid .course-details {
        padding: 0.5rem 0.875rem;
    }

    .lobby-detail-grid .detail-row {
        padding: 0.4rem 0;
        font-size: 0.85rem;
    }

    .lobby-detail-grid .detail-label {
        min-width: 4.5rem;
        font-size: 0.8rem;
    }

    /* Compact players list */
    .lobby-detail-grid .players-list {
        padding: 0.5rem;
        gap: 0.4rem;
    }

    .lobby-detail-grid .player-item {
        padding: 0.5rem 0.6rem;
        gap: 0.5rem;
    }

    .lobby-detail-grid .player-item .player-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    .lobby-detail-grid .player-item .player-name {
        font-size: 0.85rem;
    }

    .lobby-detail-grid .player-item .player-rating {
        font-size: 0.75rem;
    }

    /* Hide empty slots on mobile to save space */
    .lobby-detail-grid .player-item.empty {
        padding: 0.4rem 0.6rem;
    }

    /* Compact action buttons */
    .host-actions,
    .player-actions {
        gap: 0.5rem;
        margin-top: 0.75rem;
    }

    .action-btn {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }

    /* Compact chat */
    .chat-card {
        height: auto;
        max-height: 280px;
    }

    .chat-card .chat-messages {
        max-height: 180px;
        padding: 0.75rem;
    }

    .chat-message {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }

    .chat-input-container {
        padding: 0.6rem;
        gap: 0.4rem;
    }

    .chat-input {
        padding: 0.6rem;
        font-size: 0.9rem;
    }

    .send-btn {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    /* Compact scoring section */
    .scoring-card .scoring-content {
        padding: 0.75rem;
    }

    .scoring-leaderboard {
        font-size: 0.85rem;
    }

    .leaderboard-header,
    .leaderboard-row {
        padding: 0.5rem 0.6rem;
    }

    /* Mini scorecard table more compact */
    .mini-scorecard-table {
        font-size: 0.65rem;
        min-width: 280px;
    }

    .mini-scorecard-table th,
    .mini-scorecard-table td {
        padding: 2px 1px;
    }

    .mini-scorecard-table .player-header {
        min-width: 45px;
        max-width: 55px;
        font-size: 0.6rem;
    }

    /* Ensure wrapper doesn't overflow */
    .mini-scorecard-table-wrapper {
        margin: 0 -0.5rem;
        padding: 0 0.5rem;
    }

    /* Completed state - show scores prominently */
    .lobby-detail-section.status-completed .scoring-card {
        order: -1;
    }

    .lobby-detail-section.status-completed .info-card:not(.scoring-card):not(.chat-card) {
        /* Collapse course info and players on completed view */
    }

    .lobby-detail-section.status-completed .course-details {
        display: none;
    }

    .lobby-detail-section.status-completed .lobby-description-section {
        display: none !important;
    }

    /* Prevent page overflow on all lobby states */
    .lobby-detail-section {
        overflow-x: hidden;
        max-width: 100vw;
    }

    .lobby-detail-grid {
        overflow-x: hidden;
    }

    /* Completed state - ensure scoring section fits */
    .lobby-detail-section.status-completed .scoring-content {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .lobby-detail-section.status-completed .leaderboard-header,
    .lobby-detail-section.status-completed .leaderboard-row {
        min-width: 0;
    }

    /* Hide empty slots on completed rounds to save space */
    .lobby-detail-section.status-completed .player-item.empty {
        display: none;
    }
}

@media (max-width: 480px) {
    .leaderboard-header,
    .leaderboard-row {
        grid-template-columns: 30px 1fr 50px 50px;
        font-size: 0.85rem;
        padding: 0.6rem 0.75rem;
    }

    .player-score-row {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }

    .score-input-group {
        justify-content: center;
    }
}

/* ========== Completed Lobby Card Leaderboard ========== */

.lobby-card-leaderboard {
    padding: 0.5rem 0.75rem;
    border-top: 1px solid #e8e8e8;
}

.card-leaderboard-row {
    display: flex;
    align-items: center;
    padding: 0.3rem 0;
    font-size: 0.85rem;
    border-bottom: 1px solid #f5f5f5;
}

.card-leaderboard-row:last-child {
    border-bottom: none;
}

.card-lb-rank {
    width: 1.5rem;
    color: #999;
    font-weight: 600;
    font-size: 0.8rem;
}

.card-lb-name {
    flex: 1;
    color: #333;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-lb-score {
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 2.5rem;
    text-align: right;
    color: #666;
}

.card-lb-score.under-par {
    color: #2e7d32;
}

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

/* ========== Currently Playing Section Headers ========== */

.playing-section-header {
    grid-column: 1 / -1;
    padding: 0.75rem 0;
    margin-bottom: 0.5rem;
}

.playing-section-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.playing-section-header.completed-header {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e0e0e0;
}

.playing-section-header.completed-header h3 {
    color: #666;
}

/* ========== My Lobbies History List ========== */

.lobby-history-list {
    grid-column: 1 / -1;
    background: white;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
}

.lobby-history-header {
    display: flex;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, #2B5A9E 0%, #4A90E2 100%);
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.lobby-history-row {
    display: flex;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.15s;
    align-items: center;
    font-size: 0.85rem;
}

.lobby-history-row:last-child {
    border-bottom: none;
}

.lobby-history-row:hover {
    background: #f5f8fd;
}

.lobby-history-row:nth-child(even) {
    background: #fafafa;
}

.lobby-history-row:nth-child(even):hover {
    background: #f0f4fa;
}

.lh-date {
    width: 7rem;
    flex-shrink: 0;
    color: #666;
}

.lh-course {
    flex: 1;
    color: #333;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lh-course small {
    color: #999;
    font-weight: 400;
    margin-left: 0.4rem;
}

.lh-score {
    width: 5rem;
    text-align: right;
    flex-shrink: 0;
}

.lh-score-val {
    font-weight: 700;
    color: #666;
}

.lh-score-val.under-par {
    color: #2e7d32;
}

.lh-score-val.over-par {
    color: #d32f2f;
}

.lh-status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    background: #e8e8e8;
    color: #666;
}

.lh-status-badge.in-progress {
    background: #e3f2fd;
    color: #1565c0;
}

.lh-status-badge.completed {
    background: #e8f5e9;
    color: #2e7d32;
}

@media (max-width: 600px) {
    .lh-date {
        width: 5rem;
        font-size: 0.8rem;
    }

    .lh-course small {
        display: none;
    }

    .lobby-history-header,
    .lobby-history-row {
        padding: 0.5rem 0.75rem;
    }
}

/* ========== Friends Selector for Create Lobby ========== */

.friends-selector-group {
    margin-top: 0.5rem;
}

.friends-selector-group > label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.friends-count-badge {
    background: #2B5A9E;
    color: white;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
}

.friends-selector {
    max-height: 160px;
    overflow-y: auto;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fafafa;
    -webkit-overflow-scrolling: touch;
}

.friends-loading {
    text-align: center;
    color: #666;
    padding: 1rem;
    font-size: 0.9rem;
}

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

.friend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: white;
    cursor: pointer;
    transition: background 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(43, 90, 158, 0.2);
    border-bottom: 1px solid #f0f0f0;
}

.friend-item:last-child {
    border-bottom: none;
}

.friend-item:hover:not(.disabled) {
    background: #f5f8ff;
}

.friend-item:active:not(.disabled) {
    background: #e8f0ff;
}

.friend-item.selected {
    background: linear-gradient(135deg, rgba(43, 90, 158, 0.08) 0%, rgba(74, 144, 226, 0.08) 100%);
}

.friend-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

.friend-item-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid #ccc;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
    background: white;
}

.friend-item.selected .friend-item-checkbox {
    background: linear-gradient(135deg, #2B5A9E 0%, #4A90E2 100%);
    border-color: #2B5A9E;
    color: white;
}

.friend-item-checkbox::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.15s ease;
}

.friend-item.selected .friend-item-checkbox::after {
    transform: rotate(45deg) scale(1);
}

.friend-item-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.friend-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.friend-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.friend-item-rating {
    font-size: 0.8rem;
    color: #666;
    flex-shrink: 0;
}

.friends-hint {
    margin: 0.5rem 0 0 0;
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
}

.friends-empty {
    text-align: center;
    padding: 1.5rem 1rem;
    color: #888;
    font-size: 0.9rem;
}

.friends-empty-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* Friends Selector Mobile */
@media (max-width: 480px) {
    .friends-selector {
        max-height: 140px;
    }

    .friend-item {
        padding: 0.5rem 0.6rem;
        gap: 0.6rem;
    }

    .friend-item-checkbox {
        width: 20px;
        height: 20px;
    }

    .friend-item-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }

    .friend-item-name {
        font-size: 0.85rem;
    }

    .friend-item-rating {
        font-size: 0.75rem;
    }
}
