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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-touch-callout: none;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 2s ease-out;
}

.title {
    font-size: 3.5rem;
    font-weight: bold;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    margin-bottom: 10px;
    letter-spacing: 3px;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.3rem;
    color: #e0e0e0;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}


/* Login/Registration Styles */
.auth-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 2s ease-out 0.5s both;
}

.auth-tabs {
    display: flex;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 5px;
}

.auth-tab {
    flex: 1;
    padding: 15px;
    text-align: center;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.auth-tab.active {
    background: #ffd700;
    color: #333;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #ffd700;
}

.form-input {
    width: 100%;
    padding: 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.auth-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #333;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

/* Game Interface Styles */
.game-interface {
    display: none;
}

.user-info {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logout-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

.game-area {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px;
    margin-top: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.game-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.control-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.pause-btn {
    background: #ff9800;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.pause-btn:hover {
    background: #f57c00;
    transform: scale(1.05);
}

.pause-btn.paused {
    background: #4CAF50;
}

.leaderboard-btn {
    background: #9c27b0;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

.player-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: #ffd700;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.question-header {
    text-align: center;
    margin-bottom: 30px;
}

.question-number {
    font-size: 1.2rem;
    color: #ffd700;
    margin-bottom: 10px;
}

.category-badge {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: inline-block;
}

.question-content {
    margin-bottom: 30px;
}

.question-text {
    font-size: 1.3rem;
    line-height: 1.6;
    margin-bottom: 30px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 25px;
    border-radius: 15px;
}


.options-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.option-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 20px;
    font-size: 1.1rem;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.option-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: #ffd700;
    transform: translateY(-2px);
}

.option-btn.selected {
    background: rgba(255, 215, 0, 0.3);
    border-color: #ffd700;
}

.option-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.controls {
    text-align: center;
    margin-top: 20px;
}

.submit-btn {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 15px;
}

.submit-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.hint-btn {
    background: linear-gradient(45deg, #ff9800, #f57c00);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.feedback {
    margin-top: 20px;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.success {
    background: rgba(76, 175, 80, 0.3);
    border: 2px solid #4CAF50;
    color: #4CAF50;
}

.error {
    background: rgba(244, 67, 54, 0.3);
    border: 2px solid #f44336;
    color: #f44336;
}

/* Leaderboard Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 5% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    color: white;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: white;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.leaderboard-table th {
    background: rgba(255,255,255,0.1);
    font-weight: bold;
}

.rank-1 { color: #ffd700; font-weight: bold; }
.rank-2 { color: #c0c0c0; font-weight: bold; }
.rank-3 { color: #cd7f32; font-weight: bold; }

/* Loading Indicator */
.loading {
    text-align: center;
    padding: 20px;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid #ffd700;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes fastPulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.7; 
        transform: scale(1.1);
    }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .title { 
        font-size: 2.5rem; 
    }
    
    .container {
        padding: 15px;
    }
    
    /* Mobile-optimized option buttons */
    .options-container { 
        grid-template-columns: 1fr; 
        gap: 20px;
        margin-bottom: 40px;
    }
    
    .option-btn {
        padding: 25px 20px;
        font-size: 1.2rem;
        min-height: 60px;
        border-radius: 12px;
        transition: all 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }
    
    .option-btn:active {
        transform: scale(0.98);
        background: rgba(255, 215, 0, 0.4);
    }
    
    /* Mobile-friendly stats */
    .player-stats { 
        flex-direction: column; 
        gap: 15px;
        padding: 20px;
        margin-bottom: 25px;
    }
    
    .stat-item {
        min-width: auto;
        padding: 10px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 10px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    /* Mobile game controls */
    .game-controls { 
        justify-content: center;
        flex-direction: column;
        gap: 15px;
        margin-bottom: 25px;
    }
    
    .control-group {
        display: flex;
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }
    
    /* Larger mobile buttons */
    .ready-btn, .pause-btn, .submit-btn, .hint-btn {
        padding: 18px 25px !important;
        font-size: 1.1rem !important;
        min-height: 55px;
        border-radius: 12px !important;
        -webkit-tap-highlight-color: transparent;
        transition: all 0.2s ease !important;
    }
    
    .ready-btn:active, .pause-btn:active, .submit-btn:active, .hint-btn:active {
        transform: scale(0.95);
    }
    
    .submit-btn {
        margin-right: 0 !important;
        margin-bottom: 15px;
        width: 100%;
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
        display: block;
    }
    
    .hint-btn {
        width: 100%;
        max-width: 250px;
        margin-left: auto;
        margin-right: auto;
        display: block;
    }
    
    /* Mobile-friendly question text */
    .question-text {
        font-size: 1.2rem;
        line-height: 1.7;
        padding: 20px;
    }
    
    .question-header {
        margin-bottom: 25px;
    }
    
    .question-number {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    .category-badge {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    /* Mobile auth forms */
    .auth-section {
        padding: 25px;
        margin-bottom: 20px;
    }
    
    .form-input {
        padding: 18px;
        font-size: 1.1rem;
        border-radius: 12px;
    }
    
    .auth-btn {
        padding: 18px;
        font-size: 1.2rem;
        border-radius: 12px;
        -webkit-tap-highlight-color: transparent;
    }
    
    .auth-btn:active {
        transform: translateY(0);
        background: linear-gradient(45deg, #e6c200, #e6d429);
    }
    
    .auth-tab {
        padding: 18px;
        font-size: 1rem;
    }
    
    /* Mobile feedback */
    .feedback {
        margin-top: 25px;
        padding: 20px;
        font-size: 1.1rem;
        border-radius: 12px;
    }
    
    /* Mobile leaderboard */
    .leaderboard-btn, .logout-btn {
        padding: 12px 18px !important;
        font-size: 1rem !important;
        margin: 5px;
        -webkit-tap-highlight-color: transparent;
    }
    
    .modal-content {
        width: 95%;
        margin: 2% auto;
        padding: 20px;
        max-height: 90vh;
    }
    
    .leaderboard-table {
        font-size: 0.9rem;
    }
    
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 8px 6px;
    }
    
}

/* Tablet-specific optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    .options-container {
        grid-template-columns: 1fr 1fr;
        gap: 18px;
    }
    
    .option-btn {
        padding: 22px 18px;
        font-size: 1.15rem;
        min-height: 55px;
    }
    
    .game-controls {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .ready-btn, .pause-btn {
        padding: 15px 20px !important;
        font-size: 1rem !important;
    }
}

/* Touch device optimizations */
@media (pointer: coarse) {
    .option-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.3);
        transform: none;
    }
    
    .submit-btn:hover, .hint-btn:hover, .auth-btn:hover {
        transform: none;
        box-shadow: none;
    }
    
    .ready-btn:hover, .pause-btn:hover {
        transform: none;
    }
}

/* Footer Styles */
footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    padding: 30px 20px;
    margin-top: 50px;
    text-align: center;
}

.footer-links a {
    color: #ffd700; 
    text-decoration: none; 
    margin: 0 15px; 
    padding: 10px 20px; 
    border: 2px solid #ffd700; 
    border-radius: 25px; 
    font-size: 0.9rem; 
    transition: all 0.3s ease;
    display: inline-block;
    margin-bottom: 10px;
}

.footer-links a:hover {
    background: #ffd700;
    color: #333;
    transform: translateY(-2px);
}