@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

body {
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #d2691e 0%, #cd853f 25%, #daa520 50%, #f4a460 75%, #ffd4a3 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #8b4513 0%, #d2691e 50%, #cd853f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

.cactus {
    font-size: 3rem;
    position: absolute;
    top: -10px;
    left: -20px;
    transform: rotate(-15deg);
}

.bingo-card {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.bingo-square {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #faf0e6 0%, #f5deb3 100%);
    border: 2px solid #deb887;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 12px;
    position: relative;
    overflow: hidden;
    min-height: 0;
    box-sizing: border-box;
    box-shadow: 0 4px 12px rgba(210, 105, 30, 0.08);
}

.bingo-square span {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
    z-index: 2;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    display: block;
    width: 100%;
    letter-spacing: -0.01em;
}

.bingo-square.free-space {
    background: linear-gradient(135deg, #d2691e 0%, #8b4513 100%);
    border-color: #8b4513;
    color: white;
}

.bingo-square.free-space span {
    font-size: 2rem;
}

.bingo-square:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 32px rgba(210, 105, 30, 0.25), 0 4px 16px rgba(0, 0, 0, 0.1);
    border-color: #d2691e;
}

.bingo-square.marked {
    background: linear-gradient(135deg, #228b22 0%, #006400 100%);
    border-color: #006400;
    transform: scale(0.98);
    color: white;
}

.bingo-square.marked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: white;
    font-weight: bold;
    z-index: 3;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.bingo-square.marked span {
    opacity: 0.9;
    color: white;
}

.bingo-square.winning-square {
    animation: pulse 1s infinite;
    box-shadow: 0 0 32px rgba(210, 105, 30, 0.8), 0 0 16px rgba(139, 69, 19, 0.6);
}

@keyframes pulse {
    0% { transform: scale(0.95); }
    50% { transform: scale(1.05); }
    100% { transform: scale(0.95); }
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.reset-btn, .new-card-btn {
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: -0.01em;
}

.reset-btn {
    background: linear-gradient(135deg, #d2691e 0%, #8b4513 100%);
    box-shadow: 0 8px 24px rgba(210, 105, 30, 0.25);
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(210, 105, 30, 0.35);
}

.new-card-btn {
    background: linear-gradient(135deg, #cd853f 0%, #d2691e 100%);
    box-shadow: 0 8px 24px rgba(205, 133, 63, 0.25);
}

.new-card-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(205, 133, 63, 0.35);
}

.progress {
    background: rgba(210, 105, 30, 0.1);
    padding: 12px 24px;
    border-radius: 16px;
    border: 2px solid rgba(210, 105, 30, 0.2);
    backdrop-filter: blur(10px);
}

#progressText {
    font-weight: 600;
    color: #8b4513;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.win-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.win-modal.hidden {
    display: none;
}

.win-content {
    background: rgba(255, 255, 255, 0.98);
    padding: 32px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25), 0 8px 32px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: celebration 0.6s ease-out;
    max-width: 600px;
    width: 90vw;
}

.celebration-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 24px;
}

.dancing-gif {
    flex-shrink: 0;
    animation: bounce 2s ease-in-out infinite;
}

.dancing-gif img {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
}

.celebration-message {
    text-align: center;
    width: 100%;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes celebration {
    0% { transform: scale(0.5) rotate(-5deg); opacity: 0; }
    50% { transform: scale(1.1) rotate(2deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.win-content h2 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #d2691e 0%, #8b4513 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.win-content p {
    font-size: 1.2rem;
    color: #475569;
    margin-bottom: 32px;
    font-weight: 500;
}

#continueBtn {
    background: linear-gradient(135deg, #228b22 0%, #006400 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: -0.01em;
}

#continueBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(34, 139, 34, 0.35);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 12px;
        margin: 0;
        border-radius: 15px;
    }
    
    h1 {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }
    
    header {
        margin-bottom: 15px;
    }
    
    .bingo-card {
        gap: 4px;
        margin-bottom: 20px;
    }
    
    .bingo-square {
        padding: 4px;
        border-width: 2px;
        border-radius: 8px;
    }
    
    .bingo-square span {
        line-height: 1.1;
        font-weight: 600;
    }
    
    .cactus {
        font-size: 1.8rem;
        top: -5px;
        left: -10px;
    }
    
    .controls {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .reset-btn, .new-card-btn {
        width: 100%;
        max-width: 200px;
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .celebration-container {
        flex-direction: column;
        gap: 16px;
    }
    
    .dancing-gif img {
        max-width: 100%;
        max-height: 200px;
        width: auto;
        height: auto;
    }
}

@media (max-width: 480px) {
    body {
        padding: 8px;
    }
    
    .container {
        padding: 8px;
        margin: 0;
        border-radius: 12px;
    }
    
    .bingo-card {
        gap: 3px;
        max-width: 100%;
        margin-bottom: 15px;
    }
    
    .bingo-square {
        padding: 3px;
        border-width: 2px;
        border-radius: 6px;
    }
    
    .bingo-square span {
        line-height: 1.0;
        font-weight: 600;
    }
    
    h1 {
        font-size: 1.6rem;
        margin-bottom: 10px;
    }
    
    header {
        margin-bottom: 12px;
    }
    
    .win-content {
        padding: 20px;
        width: 95vw;
    }
    
    .dancing-gif img {
        max-width: 100%;
        max-height: 150px;
        width: auto;
        height: auto;
    }
}

@media (max-width: 360px) {
    body {
        padding: 6px;
    }
    
    .container {
        padding: 6px;
        border-radius: 10px;
    }
    
    .bingo-card {
        gap: 2px;
    }
    
    .bingo-square {
        padding: 2px;
        border-width: 1px;
        border-radius: 5px;
    }
    
    .bingo-square span {
        line-height: 0.95;
        font-weight: 600;
    }
    
    h1 {
        font-size: 1.4rem;
    }
}
