/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    touch-action: manipulation;
}

body {
    font-family: 'Comic Sans MS', 'Marker Felt', cursive, sans-serif;
    background: #0a0a0a;
    color: #00ff00;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.game-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0a1a 100%);
}

/* Doodle Border Effect */
.game-container::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 3px solid #00ff00;
    border-radius: 20px;
    opacity: 0.3;
    filter: blur(1px);
    animation: doodleGlow 2s ease-in-out infinite alternate;
}

@keyframes doodleGlow {
    0% { opacity: 0.3; transform: scale(1); }
    100% { opacity: 0.6; transform: scale(1.02); }
}

/* Header Styles */
.game-header {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px 10px;
    background: rgba(0, 255, 0, 0.1);
    border-bottom: 2px solid #00ff00;
    position: relative;
    z-index: 10;
}

.timer, .score, .combo {
    font-size: clamp(14px, 4vw, 18px);
    font-weight: bold;
    text-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00;
    animation: textFlicker 3s infinite;
}

@keyframes textFlicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Game Grid */
.game-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 8px;
    padding: 15px;
    max-width: 500px;
    max-height: 500px;
    margin: 0 auto;
    width: 100%;
    height: 100%;
}

/* Doodle Holes */
.hole {
    background: radial-gradient(circle, rgba(0, 255, 0, 0.2) 0%, rgba(0, 255, 0, 0.05) 70%, transparent 100%);
    border: 2px dashed #00ff00;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    min-width: 50px;
}

.hole:hover {
    transform: scale(1.05);
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

/* Target Styles */
.target {
    position: absolute;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, #ff0066 0%, #ff0066 30%, transparent 70%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: targetPulse 0.5s ease-in-out infinite;
    cursor: pointer;
    z-index: 5;
}

.target::before {
    content: '';
    position: absolute;
    width: 80%;
    height: 80%;
    border: 3px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 20px #ff0066, inset 0 0 10px #ffffff;
}

.target::after {
    content: '';
    position: absolute;
    width: 40%;
    height: 40%;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 10px #ffffff;
}

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

.target.hit {
    animation: targetHit 0.3s ease-out forwards;
}

@keyframes targetHit {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

/* Start Overlay */
.start-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.start-content {
    text-align: center;
    padding: 30px;
    background: rgba(0, 255, 0, 0.1);
    border: 3px solid #00ff00;
    border-radius: 20px;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.5);
}

.start-content h1 {
    font-size: clamp(24px, 8vw, 36px);
    margin-bottom: 15px;
    text-shadow: 0 0 20px #00ff00;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% { text-shadow: 0 0 20px #00ff00; }
    100% { text-shadow: 0 0 30px #00ff00, 0 0 40px #00ffff; }
}

.start-content p {
    font-size: clamp(14px, 4vw, 18px);
    margin-bottom: 25px;
    opacity: 0.8;
}

.start-btn, .restart-btn {
    background: linear-gradient(45deg, #00ff00, #00ffff);
    color: #000;
    border: none;
    padding: 15px 30px;
    font-size: clamp(16px, 5vw, 20px);
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 255, 0, 0.4);
    font-family: inherit;
}

.start-btn:hover, .restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 255, 0, 0.6);
    background: linear-gradient(45deg, #00ffff, #00ff00);
}

.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(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.game-over-content {
    text-align: center;
    padding: 30px;
    background: rgba(255, 0, 102, 0.1);
    border: 3px solid #ff0066;
    border-radius: 20px;
    box-shadow: 0 0 30px rgba(255, 0, 102, 0.5);
}

.game-over-content h2 {
    font-size: clamp(28px, 8vw, 40px);
    margin-bottom: 20px;
    text-shadow: 0 0 20px #ff0066;
    color: #ff0066;
}

.final-score {
    font-size: clamp(20px, 6vw, 28px);
    margin-bottom: 15px;
    text-shadow: 0 0 15px #00ff00;
}

.rank {
    font-size: clamp(18px, 5vw, 24px);
    margin-bottom: 25px;
    padding: 10px 20px;
    background: rgba(0, 255, 0, 0.2);
    border-radius: 15px;
    border: 2px solid #00ff00;
    text-shadow: 0 0 10px currentColor;
}

/* Footer */
.footer {
    text-align: center;
    padding: 10px;
    background: rgba(0, 255, 0, 0.1);
    border-top: 2px solid #00ff00;
    font-size: clamp(12px, 3vw, 14px);
    opacity: 0.7;
    position: relative;
    z-index: 10;
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .game-grid {
        gap: 5px;
        padding: 10px;
        max-width: 350px;
        max-height: 350px;
    }
    
    .hole {
        min-height: 40px;
        min-width: 40px;
    }
    
    .target {
        width: 70%;
        height: 70%;
    }
}

@media (max-width: 480px) {
    .game-header {
        padding: 10px 5px;
    }
    
    .game-grid {
        gap: 3px;
        padding: 8px;
        max-width: 300px;
        max-height: 300px;
    }
    
    .hole {
        min-height: 35px;
        min-width: 35px;
        border-width: 1px;
    }
    
    .start-content, .game-over-content {
        padding: 20px;
        margin: 20px;
    }
}

/* Prevent text selection and zoom */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Hide scrollbar */
::-webkit-scrollbar {
    display: none;
}

html, body {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}
