/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Fredoka+One:wght@400&family=Open+Sans:wght@400;600;700&display=swap');

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow: hidden;
}

/* Red flash effect */
.red-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 0, 0, 0.3);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s ease;
}

.red-flash.active {
    opacity: 1;
}

/* Game container */
.game-container {
    width: 100%;
    height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Header */
.game-header {
    padding: 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.game-title {
    font-family: 'Fredoka One', cursive;
    font-size: 3rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin: 0;
}

.title-scan {
    color: #ff6b6b;
}

.title-ette {
    color: #4ecdc4;
}

.title-sh {
    color: #ffe66d;
}

/* Game UI */
.game-ui {
    display: flex;
    justify-content: space-between;
    padding: 20px 40px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.ui-element {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px 25px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.score-label, .timer-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 5px;
}

.score-value, .timer-value {
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Game area */
.game-area {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* Start screen */
.start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
}

.start-content {
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 400px;
}

.start-content h2 {
    font-family: 'Fredoka One', cursive;
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 20px;
}

.start-content p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.5;
}

.start-button, .restart-button {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-family: 'Fredoka One', cursive;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

.start-button:hover, .restart-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(255, 107, 107, 0.4);
}

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

/* Game over screen */
.game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.game-over-content {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 400px;
}

.game-over-content h2 {
    font-family: 'Fredoka One', cursive;
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 20px;
}

.game-over-content p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
}

.final-score {
    font-family: 'Fredoka One', cursive;
    font-size: 3rem;
    color: #ff6b6b;
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* Barcode styles */
.barcode {
    position: absolute;
    width: 100px;
    height: 60px;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 2px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.barcode:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.barcode::before {
    content: '';
    position: absolute;
    width: 80%;
    height: 70%;
    background-image: repeating-linear-gradient(
        90deg,
        #000 0px,
        #000 2px,
        transparent 2px,
        transparent 4px,
        #000 4px,
        #000 5px,
        transparent 5px,
        transparent 8px,
        #000 8px,
        #000 9px,
        transparent 9px,
        transparent 11px,
        #000 11px,
        #000 13px,
        transparent 13px,
        transparent 15px
    );
}

/* Animations */
@keyframes barcodeAppear {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes barcodeDisappear {
    0% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
}

.barcode.appear {
    animation: barcodeAppear 0.3s ease-out forwards;
}

.barcode.disappear {
    animation: barcodeDisappear 0.2s ease-in forwards;
}

/* Pulse animation for score */
@keyframes scorePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.score-value.pulse {
    animation: scorePulse 0.3s ease;
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .game-title {
        font-size: 2rem;
    }
    
    .game-ui {
        padding: 15px 20px;
    }
    
    .ui-element {
        padding: 10px 20px;
    }
    
    .score-value, .timer-value {
        font-size: 1.5rem;
    }
    
    .start-content, .game-over-content {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .start-content h2, .game-over-content h2 {
        font-size: 2rem;
    }
    
    .barcode {
        width: 80px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .game-header {
        padding: 15px;
    }
    
    .game-title {
        font-size: 1.5rem;
    }
    
    .ui-element {
        padding: 8px 15px;
    }
    
    .score-value, .timer-value {
        font-size: 1.2rem;
    }
    
    .barcode {
        width: 70px;
        height: 45px;
    }
}