* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header h1 {
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: 700;
}

.header .subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.back-btn {
    display: block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 16px;
    transition: background 0.2s;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Games List */
.games-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.game-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-left: 5px solid #667eea;
}

.game-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.game-card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.game-card-info {
    font-size: 13px;
    color: #666;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.game-card-info span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.game-card-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 8px;
}

.status-checked-in {
    background: #d4edda;
    color: #155724;
}

.status-checked-out {
    background: #f8d7da;
    color: #721c24;
}

.status-not-started {
    background: #e7e7e7;
    color: #666;
}

/* Code Input */
.code-input-box {
    background: white;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.code-input-box p {
    font-size: 16px;
    margin-bottom: 20px;
    color: #666;
}

#code-input {
    font-size: 32px;
    padding: 16px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 8px;
    width: 100%;
    letter-spacing: 8px;
    font-weight: 600;
    transition: border-color 0.2s;
}

#code-input:focus {
    outline: none;
    border-color: #667eea;
}

#position-number-input {
    font-size: 24px;
    padding: 12px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 8px;
    width: 100%;
    letter-spacing: 6px;
    font-weight: 600;
    transition: border-color 0.2s;
}

#position-number-input:focus {
    outline: none;
    border-color: #667eea;
}

#status-message {
    margin-top: 16px;
    font-size: 14px;
    min-height: 20px;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.5;
}

#status-message.success {
    color: #28a745;
}

#status-message.error {
    color: #dc3545;
    padding: 12px 16px;
    background: #ffe6e6;
    border-left: 4px solid #dc3545;
    border-radius: 6px;
    margin-top: 16px;
}

/* Success Card */
.success-card,
.error-card {
    background: white;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.success-icon {
    font-size: 64px;
    color: #28a745;
    margin-bottom: 16px;
    font-weight: bold;
}

.error-icon {
    font-size: 64px;
    color: #dc3545;
    margin-bottom: 16px;
    font-weight: bold;
}

.success-card h1,
.error-card h1 {
    font-size: 24px;
    margin-bottom: 12px;
    color: #333;
}

.success-card p,
.error-card p {
    font-size: 14px;
    color: #666;
    margin-bottom: 24px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(102, 126, 234, 0.4);
}

/* Spinner */
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading {
    text-align: center;
    color: white;
    padding: 40px 20px;
}

#loading p {
    font-size: 16px;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        max-width: 100%;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .game-card-title {
        font-size: 16px;
    }
    
    #code-input {
        font-size: 28px;
        letter-spacing: 6px;
    }

    #position-number-input {
        font-size: 22px;
        letter-spacing: 4px;
    }
}
