* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Auth Section */
.auth-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.auth-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.auth-card h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #333;
}

.auth-card p {
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

.github-login-btn {
    background: #24292e;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: center;
    transition: all 0.3s ease;
}

.github-login-btn:hover {
    background: #2f363d;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.github-icon {
    width: 20px;
    height: 20px;
}

/* Main Content */
.main-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

/* User Info */
.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid #667eea;
}

.user-details h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.user-details p {
    color: #666;
    font-size: 0.9rem;
}

.logout-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #ff5252;
    transform: translateY(-1px);
}

/* Categories */
.gacha-section h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
    color: #333;
}

.categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.category-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    position: relative;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

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

.category-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.category-card h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.category-card p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.category-card.selected p {
    color: rgba(255,255,255,0.8);
}

.problem-count {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.category-card.selected .problem-count {
    background: rgba(255,255,255,0.2);
}

/* Gacha Controls */
.gacha-controls {
    text-align: center;
    margin-bottom: 40px;
}

.selected-category {
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: #666;
}

.selected-category span {
    font-weight: 600;
    color: #667eea;
}

.gacha-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 20px 40px;
    border-radius: 50px;
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(102,126,234,0.3);
}

.gacha-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(102,126,234,0.4);
}

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

/* Result Section */
.result-section {
    margin-bottom: 40px;
}

.result-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-tier {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 15px;
    padding: 10px 20px;
    border-radius: 25px;
    background: rgba(255,255,255,0.2);
    display: inline-block;
}

.result-card h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.result-info {
    margin-bottom: 30px;
}

.result-info p {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-link, .send-btn {
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-link {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
}

.btn-link:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.send-btn {
    background: #4CAF50;
    color: white;
}

.send-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
}

/* History */
.history-section h3 {
    margin-bottom: 20px;
    color: #333;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-info h4 {
    margin-bottom: 5px;
    color: #333;
}

.history-info p {
    color: #666;
    font-size: 0.9rem;
}

.history-tier {
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
}

.no-history {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 40px;
}

/* Loading */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .categories {
        grid-template-columns: 1fr;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .user-info {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}