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

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(to bottom right, #0f172a, #1e293b, #0f172a);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

#game-container {
    position: relative;
    max-width: 500px;
    width: 100%;
    padding: 16px;
}

#game-canvas {
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 4px solid #334155;
    display: block;
    width: 100%;
    height: auto;
}

.screen-overlay {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom right, #0f172a, #1e293b, #0f172a);
    border-radius: 16px;
    padding: 24px;
    overflow-y: auto;
}

    .screen-overlay.active {
        display: flex;
    }

.screen-content {
    text-align: center;
    width: 100%;
    max-width: 500px;
}

.logo-image {
    width: 150px;
    height: auto;
    margin: 0 auto 24px;
    display: block;
    animation: bounce 1s infinite;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

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

    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
}

h1 {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 12px;
    letter-spacing: -0.025em;
}

.subtitle {
    background: linear-gradient(to right, #f59e0b, #f97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.subtitle-secondary {
    color: #94a3b8;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 24px;
    font-style: italic;
}

.tagline {
    color: #cbd5e1;
    font-size: 1.125rem;
    font-weight: 300;
    margin-bottom: 16px;
}

.charity-info {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(16, 185, 129, 0.15));
    border: 2px solid rgba(34, 197, 94, 0.5);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.2);
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(34, 197, 94, 0.2);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 6px 30px rgba(34, 197, 94, 0.35);
        transform: scale(1.02);
    }
}

.charity-info p {
    color: #f0fdf4;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.6;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.input-container {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid #475569;
}

.input-label {
    display: block;
    font-size: 0.875rem;
    color: #94a3b8;
    margin-bottom: 8px;
    text-align: left;
}

.input-row {
    display: flex;
    gap: 12px;
}

.input-field {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid #475569;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s;
}

    .input-field.input-small {
        width: 100px;
        flex-shrink: 0;
    }

    .input-field:focus {
        outline: none;
        border-color: #f59e0b;
        box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
    }

    .input-field::placeholder {
        color: #64748b;
    }

.btn {
    width: 100%;
    padding: 16px 32px;
    font-size: 1.125rem;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(to right, #f59e0b, #f97316);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(245, 158, 11, 0.3);
}

    .btn-primary:hover {
        transform: scale(1.05);
        box-shadow: 0 20px 25px -5px rgba(245, 158, 11, 0.3);
    }

    .btn-primary:active {
        transform: scale(0.95);
    }

.btn-secondary {
    background: #475569;
    color: white;
}

    .btn-secondary:hover {
        background: #64748b;
    }

.powered-by {
    margin-top: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #64748b;
    font-size: 0.875rem;
}

    .powered-by span:last-child {
        color: #cbd5e1;
        font-weight: 600;
    }

#hud {
    position: absolute;
    top: 24px;
    left: 24px;
    right: 24px;
    display: none;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
    z-index: 10;
}

    #hud.active {
        display: flex;
    }

.hud-logo {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(12px);
    padding: 8px 16px;
    border-radius: 9999px;
    border: 1px solid rgba(71, 85, 105, 0.5);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    font-size: 0.875rem;
}

.hud-score {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(12px);
    padding: 12px 24px;
    border-radius: 9999px;
    border: 1px solid rgba(71, 85, 105, 0.5);
    text-align: center;
}

.hud-score-label {
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 2px;
}

.hud-score-value {
    font-size: 1.5rem;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
}

.game-over-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    background: linear-gradient(to bottom right, #ef4444, #f97316);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    position: relative;
}

    .game-over-icon::after {
        content: '';
        position: absolute;
        top: -4px;
        right: -4px;
        width: 24px;
        height: 24px;
        background: #ef4444;
        border-radius: 50%;
        animation: pulse 2s infinite;
    }

.hit-label {
    color: #f87171;
    font-size: 1.25rem;
    margin-bottom: 4px;
}

    .hit-label strong {
        font-weight: bold;
    }

.hit-message {
    color: #cbd5e1;
    font-style: italic;
    margin-bottom: 24px;
}

.score-display {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    border: 1px solid #475569;
}

.score-display-label {
    color: #94a3b8;
    font-size: 0.875rem;
    margin-bottom: 8px;
}

.score-display-value {
    font-size: 4rem;
    font-weight: bold;
    background: linear-gradient(to right, #f59e0b, #f97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

.tier-badge {
    display: inline-block;
    background: linear-gradient(to right, #9333ea, #ec4899);
    padding: 12px 24px;
    border-radius: 9999px;
    font-weight: 600;
    margin-bottom: 8px;
}

.tier-message {
    color: #cbd5e1;
    font-size: 0.875rem;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.share-link {
    display: inline-block;
    color: #22d3ee;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 32px;
    transition: color 0.3s;
}

    .share-link:hover {
        color: #67e8f9;
    }

.leaderboard {
    background: rgba(30, 41, 59, 0.3);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #475569;
}

.leaderboard-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 8px;
    padding: 12px 16px;
}

.leaderboard-rank {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    margin-right: 12px;
}

    .leaderboard-rank.gold {
        background: #f59e0b;
        color: white;
    }

    .leaderboard-rank.silver {
        background: #94a3b8;
        color: white;
    }

    .leaderboard-rank.bronze {
        background: #ea580c;
        color: white;
    }

    .leaderboard-rank.other {
        background: #334155;
        color: #94a3b8;
    }

.leaderboard-player {
    display: flex;
    align-items: center;
    flex: 1;
}

.leaderboard-name {
    font-weight: 500;
}

.leaderboard-score {
    color: #f59e0b;
    font-weight: bold;
    font-size: 1.125rem;
    font-variant-numeric: tabular-nums;
}

.icon {
    width: 20px;
    height: 20px;
    display: inline-block;
}

@media (max-width: 640px) {
    h1 {
        font-size: 2.5rem;
    }

    .score-display-value {
        font-size: 3rem;
    }
}
