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

:root {
    --bg-dark: #0a0e1a;
    --bg-darker: #050810;
    --primary: #ff6b35;
    --primary-light: #ff8c5a;
    --secondary: #f7931e;
    --gold: #ffd700;
    --success: #4ade80;
    --danger: #ef4444;
    --text-light: #e2e8f0;
    --text-dim: #94a3b8;
    --card-bg: rgba(15, 23, 42, 0.8);
    --card-border: rgba(255, 255, 255, 0.1);
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0a0e1a 0%, #1a1f35 50%, #0a0e1a 100%);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 107, 53, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(247, 147, 30, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.game-container {
    width: 100%;
    max-width: 1200px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* Header Stats */
.header {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--card-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.stat-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1) 0%, rgba(247, 147, 30, 0.05) 100%);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.3);
}

.stat-icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
    text-shadow: 0 2px 8px rgba(255, 107, 53, 0.5);
}

/* Game Canvas */
#gameCanvas {
    flex: 1;
    background: linear-gradient(180deg, #1a2332 0%, #0f1419 100%);
    cursor: crosshair;
    border: 2px solid var(--card-border);
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
}

/* Start Screen */
.start-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.5s ease;
}

.start-content {
    text-align: center;
    padding: 3rem;
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    animation: slideUp 0.6s ease;
}

.game-title {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 4px 8px rgba(255, 107, 53, 0.5));
    animation: pulse 2s ease-in-out infinite;
}

.game-description {
    font-size: 1.125rem;
    color: var(--text-dim);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.controls-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 107, 53, 0.1);
    border: 1px solid var(--card-border);
    border-radius: 12px;
}

.control-icon {
    font-size: 1.5rem;
}

.control-text {
    font-size: 1rem;
    color: var(--text-light);
}

.start-btn,
.restart-btn {
    padding: 1rem 3rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.4);
    position: relative;
    overflow: hidden;
}

.start-btn::before,
.restart-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.start-btn:hover::before,
.restart-btn:hover::before {
    width: 300px;
    height: 300px;
}

.start-btn:hover,
.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(255, 107, 53, 0.6);
}

.start-btn:active,
.restart-btn:active {
    transform: translateY(0);
}

/* Game Over Screen */
.game-over {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.5s ease;
}

.game-over.active {
    display: flex;
}

.game-over-content {
    text-align: center;
    padding: 3rem;
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    animation: slideUp 0.6s ease;
}

.game-over-title {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    color: var(--danger);
    margin-bottom: 2rem;
    filter: drop-shadow(0 4px 8px rgba(239, 68, 68, 0.5));
}

.final-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.final-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 107, 53, 0.1);
    border: 1px solid var(--card-border);
    border-radius: 12px;
}

.final-stat-label {
    font-size: 1rem;
    color: var(--text-dim);
    font-weight: 600;
}

.final-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
    text-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 1rem;
    }

    .stat-card {
        flex: 1 1 calc(50% - 0.5rem);
        padding: 0.75rem;
    }

    .stat-icon {
        font-size: 1.5rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .game-title {
        font-size: 2rem;
    }

    .start-content,
    .game-over-content {
        padding: 2rem;
        margin: 1rem;
    }
}