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

body {
    font-family: 'Bebas Neue', sans-serif;
    min-height: 100vh;
    background: linear-gradient(180deg, #1a0a00 0%, #2d1810 30%, #4a2c1a 60%, #1a0a00 100%);
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    overflow-x: hidden;
}

.smoke-effect {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(255,100,50,0.1) 0%, transparent 40%),
        radial-gradient(ellipse at 80% 70%, rgba(255,150,50,0.08) 0%, transparent 40%);
    pointer-events: none;
    animation: smokeMove 8s ease-in-out infinite;
}

@keyframes smokeMove {
    0%, 100% { opacity: 0.6; transform: translateY(0); }
    50% { opacity: 0.9; transform: translateY(-10px); }
}

.game-container {
    max-width: 420px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.game-header {
    text-align: center;
    width: 100%;
}

.game-title {
    font-family: 'Passion One', cursive;
    font-size: 3.5rem;
    font-weight: 900;
    color: #FF6B35;
    text-shadow: 
        0 0 10px rgba(255,100,50,0.8),
        0 0 20px rgba(255,50,0,0.6),
        0 4px 0 #8B0000,
        0 6px 10px rgba(0,0,0,0.5);
    margin-bottom: 0;
    letter-spacing: 4px;
    animation: flameGlow 2s ease-in-out infinite alternate;
}

@keyframes flameGlow {
    0% { text-shadow: 0 0 10px rgba(255,100,50,0.8), 0 0 20px rgba(255,50,0,0.6), 0 4px 0 #8B0000; }
    100% { text-shadow: 0 0 20px rgba(255,150,50,1), 0 0 40px rgba(255,100,0,0.8), 0 4px 0 #8B0000; }
}

.game-subtitle {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1rem;
    color: #DAA520;
    letter-spacing: 8px;
    margin-bottom: 1rem;
}

.stats-row {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat-box {
    background: linear-gradient(180deg, #3a2010 0%, #2a1508 100%);
    border: 2px solid #8B4513;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 
        inset 0 2px 10px rgba(0,0,0,0.5),
        0 4px 15px rgba(0,0,0,0.3);
    min-width: 80px;
}

.stat-label {
    font-size: 0.7rem;
    color: #DAA520;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.stat-value {
    font-family: 'Passion One', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #FFF8DC;
}

.stat-value.best {
    color: #FFD700;
}

.stat-value.low {
    color: #FF4500;
    animation: pulse 0.5s ease-in-out infinite;
}

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

.combo-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Passion One', cursive;
    font-size: 2.5rem;
    color: #FFD700;
    text-shadow: 0 0 20px rgba(255,100,0,0.9), 0 0 40px rgba(255,50,0,0.7);
    z-index: 100;
    animation: comboAnim 0.8s ease-out forwards;
    pointer-events: none;
}

@keyframes comboAnim {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.3); }
    100% { opacity: 0; transform: translate(-50%, -80%) scale(1); }
}

.grill-frame {
    background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
    border: 6px solid #333;
    border-radius: 16px;
    padding: 8px;
    box-shadow: 
        inset 0 0 30px rgba(255,100,50,0.2),
        0 10px 40px rgba(0,0,0,0.5);
    position: relative;
}

.grill-frame::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 18px;
    background: linear-gradient(45deg, #8B4513, #DAA520, #8B4513);
    z-index: -1;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 3px;
    background: repeating-linear-gradient(
        90deg,
        #222 0px,
        #222 4px,
        #333 4px,
        #333 calc(12.5% - 2px)
    );
    padding: 4px;
    border-radius: 10px;
    width: 100%;
    aspect-ratio: 1;
}

.meat-tile {
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: clamp(1.2rem, 4vw, 2rem);
    background: radial-gradient(circle at 30% 30%, rgba(255,200,150,0.3), rgba(50,30,20,0.9));
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 
        0 3px 8px rgba(0,0,0,0.4),
        inset 0 1px 2px rgba(255,150,100,0.2);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.meat-tile::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,100,50,0.5), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.meat-tile:hover::after {
    opacity: 1;
}

.meat-tile:hover {
    transform: scale(1.08);
    box-shadow: 
        0 5px 15px rgba(0,0,0,0.5),
        0 0 15px rgba(255,100,50,0.4);
}

.meat-tile:active {
    transform: scale(0.95);
}

.meat-tile.selected {
    animation: selectedPulse 0.6s ease-in-out infinite;
    box-shadow: 
        0 0 0 3px #FFD700, 
        0 0 20px rgba(255,150,0,0.6);
}

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

.meat-tile.matched {
    animation: matchSizzle 0.4s ease-out forwards;
}

@keyframes matchSizzle {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); filter: brightness(2); }
    100% { transform: scale(0); opacity: 0; }
}

.reset-btn {
    font-family: 'Passion One', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 0.75rem 2rem;
    background: linear-gradient(180deg, #8B0000 0%, #5a0000 100%);
    color: #FFD700;
    border: 3px solid #DAA520;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 
        0 4px 15px rgba(139,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.1);
    transition: all 0.3s ease;
    letter-spacing: 2px;
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(139,0,0,0.6),
        0 0 20px rgba(255,100,50,0.4);
}

.reset-btn:active {
    transform: translateY(0);
}

.game-over-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.game-over-modal {
    background: linear-gradient(180deg, #2d1810 0%, #1a0a00 100%);
    border: 4px solid #DAA520;
    padding: 2.5rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 
        0 0 50px rgba(255,100,50,0.3),
        0 20px 60px rgba(0,0,0,0.5);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.game-over-modal h2 {
    font-family: 'Passion One', cursive;
    font-size: 2.5rem;
    color: #FF6B35;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(255,100,50,0.6);
}

.final-score {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    color: #FFF8DC;
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}

.new-record {
    color: #FFD700;
    font-weight: 700;
    animation: newRecord 0.5s ease infinite;
}

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

.play-again-btn {
    font-family: 'Passion One', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    padding: 1rem 2.5rem;
    margin-top: 1.5rem;
    background: linear-gradient(180deg, #FF6B35 0%, #8B0000 100%);
    color: #FFF8DC;
    border: 3px solid #DAA520;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 2px;
}

.play-again-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255,100,50,0.5);
}

.footer {
    margin-top: 1rem;
    text-align: center;
}

.footer a {
    color: rgba(218,165,32,0.7);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s ease;
    letter-spacing: 1px;
}

.footer a:hover {
    color: #FFD700;
}

@media (max-width: 400px) {
    .game-board {
        gap: 2px;
        padding: 4px;
    }
    
    .meat-tile {
        border-radius: 6px;
    }
    
    .game-title {
        font-size: 2.5rem;
    }
    
    .stat-box {
        padding: 0.4rem 1rem;
        min-width: 70px;
    }
}