/* Lobby Styles - Modern Compact Table Style */

.lobby-container {
    width: 100%;
    min-height: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 16px;
    overflow: visible;
    position: relative;
}

.lobby-content {
    background: rgba(8, 8, 12, 0.98);
    border-radius: 12px;
    padding: 20px;
    max-width: 1250px;
    width: 100%;
    backdrop-filter: blur(10px);
    margin-top: 60px;
}

.lobby-status-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 16px;
    position: relative;
}

.lobby-fees-text {
    color: #666;
    font-size: 0.85em;
    font-weight: 400;
    position: absolute;
    right: 0;
    padding-left: 16px;
}

.lobby-title {
    font-size: 1.5em;
    color: #fff;
    margin-bottom: 12px;
    font-weight: 600;
    text-align: center;
    letter-spacing: -0.5px;
}

.lobby-status-text {
    font-size: 0.85em;
    color: #888;
    margin: 0;
    text-align: center;
    font-weight: 400;
    transition: all 0.3s ease;
}

.lobby-status-text.countdown-active {
    font-size: 1.2em;
    font-weight: 600;
    color: #8b9cff;
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* Lobby Table Container */
.lobby-table-container {
    width: 100%;
    max-height: 70vh;
    margin-bottom: 16px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(20, 20, 28, 0.6);
    display: flex;
    flex-direction: column;
}

/* Lobby Table */
.lobby-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: rgba(20, 20, 28, 0.6);
    font-size: 0.875em;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.lobby-table thead {
    background: rgba(26, 26, 36, 0.9);
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    display: table;
    width: calc(100% - 8px); /* Account for scrollbar width */
    table-layout: fixed;
    position: sticky;
    top: 0;
    z-index: 10;
}

.lobby-table thead tr {
    display: table-row;
    width: 100%;
}

.lobby-table tbody {
    display: block;
    max-height: calc(70vh - 42px); /* Subtract header height */
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
}

.lobby-table-container::-webkit-scrollbar,
.lobby-table tbody::-webkit-scrollbar {
    width: 8px;
}

.lobby-table-container::-webkit-scrollbar-track,
.lobby-table tbody::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.lobby-table-container::-webkit-scrollbar-thumb,
.lobby-table tbody::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 4px;
}

.lobby-table-container::-webkit-scrollbar-thumb:hover,
.lobby-table tbody::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

.lobby-table th {
    padding: 8px 10px;
    text-align: left;
    font-size: 0.8em;
    font-weight: 600;
    color: #b0b0b0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Column widths - must be set on both th and td for proper alignment */
.lobby-table th:first-child,
.lobby-table td:first-child {
    width: 18%;
    min-width: 18%;
    max-width: 18%;
}

.lobby-table th:nth-child(2),
.lobby-table td:nth-child(2) {
    width: 18%;
    min-width: 18%;
    max-width: 18%;
}

.lobby-table th:nth-child(3),
.lobby-table td:nth-child(3) {
    width: 12%;
    min-width: 12%;
    max-width: 12%;
}

.lobby-table th:nth-child(4),
.lobby-table td:nth-child(4) {
    width: 15%;
    min-width: 15%;
    max-width: 15%;
}

.lobby-table th:nth-child(5),
.lobby-table td:nth-child(5) {
    width: 18%;
    min-width: 18%;
    max-width: 18%;
}

.lobby-table th:last-child,
.lobby-table td:last-child {
    width: 19%;
    min-width: 19%;
    max-width: 19%;
    border-right: none;
}

.lobby-table tbody tr {
    display: table;
    width: 100%;
    table-layout: fixed;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background-color 0.15s ease;
    background: rgba(20, 20, 28, 0.4);
}

.lobby-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.08);
}

.lobby-table tbody tr.full {
    opacity: 0.5;
    background: rgba(255, 193, 7, 0.03);
}

.lobby-table tbody tr.in-game {
    opacity: 0.4;
    background: rgba(76, 175, 80, 0.03);
}

.lobby-table tbody tr:last-child {
    border-bottom: none;
}

.lobby-table td {
    padding: 8px 10px;
    color: #d0d0d0;
    font-size: 0.95em;
    border-right: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lobby-table td:last-child {
    border-right: none;
}

/* Table Cell Styles */
.lobby-name-cell {
    font-weight: 500;
}

.lobby-name {
    color: #fff;
    font-size: 1em;
    font-weight: 500;
}

.lobby-stake-cell {
    text-align: center;
}

.lobby-stake {
    font-size: 1.1em;
    font-weight: bold;
    color: #8300ce;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sol-symbol {
    font-size: 0.9rem;
    color: #8300ce;
    font-weight: bold;
}

.lobby-players-cell {
    text-align: center;
}

.lobby-players-count {
    font-size: 1em;
    font-weight: 500;
    color: #fff;
}

.lobby-mode-cell {
    text-align: center;
}

.lobby-mode {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
    color: #8b9cff;
    font-size: 0.8em;
}

.lobby-mode-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

.lobby-mode-text {
    font-size: 1.1em;
    font-weight: 600;
}

.lobby-status-cell {
    text-align: center;
}

.lobby-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.lobby-status-badge.waiting {
    background: rgba(102, 126, 234, 0.15);
    color: #8b9cff;
    border: 1px solid rgba(102, 126, 234, 0.25);
}

.lobby-status-badge.full {
    background: rgba(255, 193, 7, 0.15);
    color: #ffd54f;
    border: 1px solid rgba(255, 193, 7, 0.25);
}

.lobby-status-badge.in-game {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.4);
    font-weight: 600;
}

.lobby-action-cell {
    text-align: center;
}

.lobby-join-btn {
    padding: 6px 16px;
    background: #8300ce;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 70px;
}

.lobby-join-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.lobby-join-btn:active:not(:disabled) {
    transform: translateY(0);
}

.lobby-join-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.05);
    color: #666;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lobby-join-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Current Lobby View */
.current-lobby-view {
    background: rgba(20, 20, 28, 0.6);
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.current-lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.current-lobby-header h2 {
    color: #fff;
    font-size: 1.2em;
    margin: 0;
    font-weight: 600;
}

.current-lobby-info {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
    padding: 10px;
    background: rgba(102, 126, 234, 0.08);
    border-radius: 6px;
}

.lobby-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-label {
    font-size: 0.75em;
    color: #888;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 0.95em;
    font-weight: 600;
    color: #fff;
}

#currentLobbyStake {
    color: #ffd700;
}

.lobby-players {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
    padding: 0 4px;
}

.player-slot {
    width: 100%;
}

.player-card {
    background: rgba(20, 20, 28, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.player-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.player-card.occupied {
    border-color: rgba(102, 126, 234, 0.4);
    background: rgba(26, 26, 36, 0.7);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.player-card.occupied::before {
    opacity: 1;
}

.player-card.occupied:hover {
    transform: translateY(-2px);
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.25);
}

.player-card.empty {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
    opacity: 0.6;
}

.player-card-avatar-container {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(102, 126, 234, 0.3);
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.player-card.occupied .player-card-avatar-container {
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.player-card.empty .player-card-avatar-container {
    border-color: rgba(255, 255, 255, 0.1);
    opacity: 0.5;
}

.player-card-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.player-card-avatar-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.avatar-question-mark {
    font-size: 2em;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1;
    user-select: none;
}

.player-card-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
    text-align: center;
}

.player-card-name {
    font-size: 0.9em;
    font-weight: 600;
    color: #fff;
    word-break: break-word;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-card.empty .player-card-name {
    color: #666;
    font-weight: 400;
}

.player-card-status {
    font-size: 0.75em;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.player-card-status.ready {
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.player-card-status.empty {
    background: rgba(255, 255, 255, 0.05);
    color: #888;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Buttons */
.btn {
    padding: 8px 16px;
    font-size: 0.85em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s ease;
}

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

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

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.8em;
    padding: 6px 12px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

/* Messages */
.lobby-message {
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8em;
    min-height: 16px;
    text-align: center;
}

.lobby-message.info {
    background: rgba(33, 150, 243, 0.15);
    color: #64b5f6;
    border: 1px solid rgba(33, 150, 243, 0.2);
}

.lobby-message.success {
    background: rgba(76, 175, 80, 0.15);
    color: #81c784;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.lobby-message.error {
    background: rgba(244, 67, 54, 0.15);
    color: #e57373;
    border: 1px solid rgba(244, 67, 54, 0.2);
}

/* Recent Wins Section */
.recent-wins-container {
    width: 100%;
    margin-top: 0;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0 16px 16px;
}

.recent-wins-content {
    background: rgba(8, 8, 12, 0.98);
    border-radius: 12px;
    padding: 20px;
    max-width: 1250px;
    width: 100%;
    backdrop-filter: blur(10px);
}

.recent-wins-title {
    font-size: 1.3em;
    color: #fff;
    margin-bottom: 12px;
    font-weight: 600;
    text-align: center;
    letter-spacing: -0.5px;
}

.recent-wins-table-container {
    width: 100%;
    max-height: 50vh;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(20, 20, 28, 0.6);
    display: flex;
    flex-direction: column;
}

.recent-wins-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: rgba(20, 20, 28, 0.6);
    font-size: 0.875em;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.recent-wins-table thead {
    background: rgba(26, 26, 36, 0.9);
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    display: table;
    width: 100%;
    table-layout: fixed;
    position: sticky;
    top: 0;
    z-index: 10;
}

.recent-wins-table thead tr {
    display: table-row;
    width: 100%;
}

.recent-wins-table tbody {
    display: block;
    max-height: calc(50vh - 42px);
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
}

.recent-wins-table tbody::-webkit-scrollbar {
    width: 8px;
}

.recent-wins-table tbody::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.recent-wins-table tbody::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 4px;
}

.recent-wins-table tbody::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

.recent-wins-table th {
    padding: 8px 10px;
    text-align: left;
    font-size: 0.8em;
    font-weight: 600;
    color: #b0b0b0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Column widths */
.recent-wins-table th:first-child,
.recent-wins-table td:first-child {
    width: 20%;
    min-width: 20%;
    max-width: 20%;
}

.recent-wins-table th:nth-child(2),
.recent-wins-table td:nth-child(2) {
    width: 18%;
    min-width: 18%;
    max-width: 18%;
}

.recent-wins-table th:nth-child(3),
.recent-wins-table td:nth-child(3) {
    width: 12%;
    min-width: 12%;
    max-width: 12%;
}

.recent-wins-table th:nth-child(4),
.recent-wins-table td:nth-child(4) {
    width: 15%;
    min-width: 15%;
    max-width: 15%;
}

.recent-wins-table th:nth-child(5),
.recent-wins-table td:nth-child(5) {
    width: 15%;
    min-width: 15%;
    max-width: 15%;
}

.recent-wins-table th:last-child,
.recent-wins-table td:last-child {
    width: 20%;
    min-width: 20%;
    max-width: 20%;
    border-right: none;
}

.recent-wins-table tbody tr {
    display: table;
    width: 100%;
    table-layout: fixed;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background-color 0.15s ease;
    background: rgba(20, 20, 28, 0.4);
}

.recent-wins-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.08);
}

.recent-wins-table tbody tr:last-child {
    border-bottom: none;
}

.recent-wins-table td {
    padding: 8px 10px;
    color: #d0d0d0;
    font-size: 0.95em;
    border-right: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-wins-table td:last-child {
    border-right: none;
}

.winner-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.winner-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(102, 126, 234, 0.3);
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.winner-username {
    font-weight: 500;
    color: #fff;
}

.win-time {
    color: #888;
    font-size: 0.9em;
}

.win-mode-cell {
    text-align: center;
}

.win-mode {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
    color: #8b9cff;
    font-size: 0.8em;
}

.win-mode-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

.win-mode-text {
    font-size: 1.1em;
    font-weight: 600;
}

.win-stake {
    text-align: center;
    color: #8300ce;
    font-weight: 600;
}

.win-amount {
    text-align: center;
    color: #4caf50;
    font-weight: 600;
}

.tx-link-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tx-link {
    color: #8b9cff;
    text-decoration: none;
    font-size: 0.85em;
    transition: color 0.2s ease;
    word-break: break-all;
    flex: 1;
}

.tx-link:hover {
    color: #fff;
    text-decoration: underline;
}

.tx-link:visited {
    color: #8b9cff;
}

.tx-copy-btn {
    background: transparent;
    border: none;
    color: #8b9cff;
    cursor: pointer;
    padding: 4px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.75em;
    opacity: 0.7;
    flex-shrink: 0;
}

.tx-copy-btn:hover {
    color: #fff;
    opacity: 1;
    transform: scale(1.1);
}

.tx-copy-btn:active {
    transform: scale(0.95);
}

/* Responsive */
@media (max-width: 768px) {
    .lobby-container {
        padding: 12px;
    }
    
    .lobby-content {
        padding: 16px;
    }
    
    .lobby-table-container {
        overflow-x: scroll;
    }
    
    .lobby-table {
        min-width: 600px;
    }
    
    .lobby-title {
        font-size: 1.3em;
    }
    
    .lobby-table th,
    .lobby-table td {
        padding: 10px 8px;
        font-size: 0.8em;
    }
}
