* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
    padding: 0;
    background: #f5f5f7;
    min-height: 100vh;
}

.card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.player-name {
    font-size: 24px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 10px;
}

.status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
}

.status.online {
    background: #e3f9e5;
    color: #198754;
}

.status.offline {
    background: #ffeeee;
    color: #dc3545;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.stat-box {
    background: #f5f5f7;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #1d1d1f;
}

.stat-label {
    font-size: 14px;
    color: #86868b;
    margin-top: 5px;
}

.completion-rate {
    text-align: center;
    padding: 15px;
    background: #f5f5f7;
    border-radius: 12px;
}

.completion-value {
    font-size: 28px;
    font-weight: 600;
    color: #1d1d1f;
}

.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 0 30px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    justify-items: center;
}

.card {
    margin: 0 auto;
    width: 100%;
    max-width: 400px;
}

.screenshot-container {
    position: relative;
    margin: 15px 0;
    border-radius: 12px;
    overflow: hidden;
}

.user-screenshot {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
}

.live-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
}


.modal-content {
    position: relative;
    background: white;
    margin: 20px auto;
    padding: 20px;
    width: 95%;
    max-width: 800px;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 20px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f5f5f7;
    font-weight: 600;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: #0071e3;
    color: white;
    cursor: pointer;
}

.pagination button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    overflow: hidden;
    touch-action: none;
}

.image-modal.zooming {
    cursor: move;
}

.image-modal.zooming .full-screen-image {
    cursor: move;
}

.full-screen-image {
    max-width: 100%;
    max-height: 90vh;
    margin: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    transform-origin: center;
    transition: transform 0.1s ease;
}

.close-button,
.close-image-button {
    position: absolute;
    right: 15px;
    top: 15px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.expand-icon {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 5px;
    border-radius: 4px;
    cursor: pointer;
}

.user-screenshot {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    transition: opacity 0.3s ease;
}

.user-screenshot.loading {
    opacity: 0.5;
}

.screenshot-container.offline {
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.offline-message {
    color: #666;
    font-style: italic;
}

.login-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #f5f5f7;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.login-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

@media (max-width: 480px) {
    .login-content {
        margin: 10px;
        padding: 20px;
    }

    .input-group input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

.login-content h2 {
    color: #1d1d1f;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 30px;
    text-align: center;
}

.input-group {
    margin-bottom: 20px;
}

.input-group input {
    width: 100%;
    padding: 15px;
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: #f5f5f7;
}

.input-group input:focus {
    outline: none;
    border-color: #0071e3;
    background: white;
}

.login-button {
    width: 100%;
    padding: 15px;
    background: #0071e3;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.login-button:hover {
    background: #0077ed;
}

.header {
    /* position: sticky; */
    top: 20px;
    z-index: 100;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto 20px auto;
    padding: 20px 30px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.logout-button {
    padding: 10px 20px;
    background: white;
    color: #1d1d1f;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.logout-button:hover {
    background: #f5f5f7;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.page-container {
    width: 100%;
    min-height: 100vh;
    padding: 20px 0;
}

.action-button {
    padding: 10px 20px;
    background: #0071e3;
    color: white;
    border: none;
    border-radius: 8px;
    margin-right: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-button:hover {
    background: #0077ed;
    transform: translateY(-1px);
}

/* Make tables more readable on mobile */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px 15px;
    }

    .container {
        padding: 0 15px;
        grid-template-columns: 1fr; /* Force single column on mobile */
    }

    .action-button,
    .logout-button {
        width: 100%;
        margin: 0;
    }

    table {
        font-size: 14px;
    }

    th, td {
        padding: 8px;
    }

    .modal-content {
        margin: 10px;
        padding: 15px;
    }

    .pagination {
        flex-direction: column;
        gap: 10px;
    }

    .pagination button {
        width: 100%;
    }

    .card {
        width: 95%; /* Slightly smaller width on mobile */
    }

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

@media (max-width: 400px) {
    .card {
        width: 100%;
    }
}

button {
    min-height: 44px;
}