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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    width: 100%;
    max-width: 900px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.game-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-header h1 {
    font-size: 1.8rem;
}

.back-btn {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border: 2px solid white;
    border-radius: 8px;
    transition: all 0.3s;
}

.back-btn:hover {
    background: white;
    color: #f5576c;
}

.game-wrapper {
    padding: 20px;
}

.stats-bar {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    background: #f7fafc;
    border-radius: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat .label {
    font-size: 0.85rem;
    color: #718096;
    font-weight: 600;
}

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

.stat .value.combo {
    color: #f5576c;
}

.game-area {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
}

.query-display {
    background: #2d3748;
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.query-label {
    font-size: 0.9rem;
    color: #a0aec0;
    margin-bottom: 15px;
    font-weight: 600;
}

.query-text {
    font-family: 'Courier New', monospace;
    font-size: 1.3rem;
    line-height: 1.8;
    color: #48bb78;
    word-wrap: break-word;
}

.query-timer-bar {
    width: 100%;
    height: 6px;
    background: #1a202c;
    border-radius: 3px;
    margin-top: 15px;
    overflow: hidden;
}

.query-timer-fill {
    height: 100%;
    background: linear-gradient(90deg, #f5576c, #48bb78);
    width: 100%;
    transition: width 0.1s linear;
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.action-btn {
    padding: 20px;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn.safe {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.action-btn.safe:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(72, 187, 120, 0.4);
}

.action-btn.danger {
    background: linear-gradient(135deg, #f56565, #c53030);
    color: white;
}

.action-btn.danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(245, 101, 101, 0.4);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.feedback {
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: 600;
    text-align: center;
    animation: slideIn 0.3s ease;
}

.feedback.correct {
    background: #c6f6d5;
    color: #22543d;
    border: 2px solid #48bb78;
}

.feedback.wrong {
    background: #fed7d7;
    color: #742a2a;
    border: 2px solid #f56565;
}

.feedback.hidden {
    display: none;
}

.stats-panel {
    background: #f7fafc;
    padding: 20px;
    border-radius: 12px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.stat-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-row span:first-child {
    font-size: 0.85rem;
    color: #718096;
    font-weight: 600;
}

.stat-row span:last-child {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2d3748;
}

/* Overlays */
.game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.game-overlay.hidden {
    display: none;
}

.overlay-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    text-align: center;
}

.overlay-content h2 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 2rem;
}

.overlay-content p {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.instructions {
    text-align: left;
    margin: 20px 0;
}

.instructions h3,
.instructions h4 {
    color: #2d3748;
    margin: 15px 0 10px;
}

.instructions ul {
    margin-left: 20px;
    color: #4a5568;
}

.instructions li {
    margin: 8px 0;
    line-height: 1.6;
}

.game-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    font-weight: 600;
    margin: 10px;
}

.game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 87, 108, 0.4);
}

.final-stats {
    background: #f7fafc;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
}

.final-stats p {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
    font-size: 1rem;
}

.final-stats span {
    font-weight: bold;
    color: #f5576c;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .game-header h1 {
        font-size: 1.3rem;
    }

    .query-text {
        font-size: 1.1rem;
    }

    .action-buttons {
        grid-template-columns: 1fr;
    }

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

    .overlay-content {
        padding: 25px;
        margin: 20px;
    }
}

@media (max-width: 480px) {
    .game-wrapper {
        padding: 15px;
    }

    .query-display {
        padding: 20px;
        min-height: 150px;
    }

    .query-text {
        font-size: 1rem;
    }
}
