/* 🐱 CAT CAFÉ DASH - MAIN STYLESHEET 🐱 */

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Marker Felt', 'Arial', sans-serif;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    overflow: hidden;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    position: fixed;
    width: 100%;
    height: 100%;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 0px rgba(255,255,255,0.4);
    cursor: url('/static/images/PointerCursorr/BobaJellyFish.png') 16 16, auto; /* Default Cursor centered */
}

/* Force custom cursor on all clickable elements */
button, a, .control-btn, .upgrade-btn, .start-btn, .close-btn, .ui-toggle-btn, .recipe-item, .ingredient-tag {
    cursor: url('/static/images/PointerCursorr/BobaJellyFish.png') 16 16, pointer;
}

/* Cozy Vignette Overlay - Dreamy Purple/Pink */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 50%, rgba(75, 0, 130, 0.1) 90%, rgba(75, 0, 130, 0.2) 100%);
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: multiply;
}

/* Dreamy Tint Overlay */
.dreamy-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, rgba(255, 182, 193, 0.15), rgba(230, 230, 250, 0.15));
    pointer-events: none;
    z-index: 9997;
    mix-blend-mode: screen;
    animation: pulseOverlay 10s infinite alternate;
}

@keyframes pulseOverlay {
    0% { opacity: 0.7; }
    100% { opacity: 1.0; }
}

/* Scanline/Texture Effect (Subtle) */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        rgba(255, 255, 255, 0.03) 3px
    );
    pointer-events: none;
    z-index: 9998;
}

/* Canvas Dreamy Filter */
#game-canvas {
    filter: contrast(1.05) brightness(1.05) saturate(1.1) sepia(0.1);
}

/* === LOADING SCREEN === */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/static/images/loadbar.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    color: white;
    animation: fadeIn 0.5s ease;
    background: rgba(0, 0, 0, 0.4);
    padding: 60px 80px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.cafe-logo {
    margin-bottom: 40px;
}

.loading-logo {
    max-width: 300px;
    width: 80%;
    height: auto;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.coffee-cup {
    font-size: 120px;
    animation: float 3s ease-in-out infinite;
    margin-bottom: 20px;
}

.cafe-logo h1 {
    font-size: 48px;
    color: #fff;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    margin: 20px 0;
    font-weight: bold;
}

.cat-icon {
    font-size: 60px;
    animation: bounce 2s ease-in-out infinite;
}

.loading-bar-container {
    width: 400px;
    max-width: 80vw;
    height: 34px;
    background: rgba(62, 39, 35, 0.85);
    border-radius: 20px;
    overflow: hidden;
    margin: 30px auto;
    box-shadow: 
        0 0 0 3px #a1887f,
        0 0 0 6px #5d4037,
        0 10px 20px rgba(0, 0, 0, 0.3),
        inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

.loading-bar {
    height: 100%;
    background: linear-gradient(90deg, #ffecb3, #ffe082, #ffecb3);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite, loadProgress 2s ease-out forwards;
    border-radius: 20px;
    width: 0%;
    box-shadow: 0 0 10px rgba(255, 213, 79, 0.4);
}

.loading-text {
    font-size: 20px;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes loadProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* === GAME CONTAINER === */
#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 182, 193, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 228, 196, 0.3) 0%, transparent 50%);
}

#game-canvas {
    background: linear-gradient(180deg, #fff8e7 0%, #ffe4c4 100%);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.3),
        0 0 0 10px rgba(255, 255, 255, 0.5),
        0 0 0 11px rgba(139, 69, 19, 0.2);
    border-radius: 15px;
    cursor: default;
    
    /* Responsive sizing to fit screen */
    height: 95vh;           /* Try to fill vertical space */
    width: auto;            /* Let width adjust */
    max-width: 95vw;        /* But don't overflow horizontal space */
    aspect-ratio: 3/2;      /* Maintain strict aspect ratio */
    
    image-rendering: crisp-edges;
    display: block;
}

@media (max-width: 1024px) {
    #game-canvas {
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
        border-radius: 0;
    }
}

/* === UI OVERLAY === */
#ui-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    z-index: 10;
    gap: 10px;
    transition: transform 0.3s ease;
}

#ui-overlay.ui-overlay-hidden .ui-panels {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

.ui-panels {
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.ui-toggle-btn {
    width: 40px;
    height: 50px;
    font-size: 20px;
    border: none;
    border-radius: 0 15px 15px 0;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.95) 0%, rgba(101, 67, 33, 0.95) 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid #654321;
    border-left: none;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 11;
}

.ui-toggle-btn:hover {
    background: linear-gradient(135deg, rgba(160, 82, 45, 0.95) 0%, rgba(139, 69, 19, 0.95) 100%);
    transform: translateX(2px);
}

.ui-toggle-btn:active {
    transform: translateX(0) scale(0.95);
}

#ui-overlay.ui-overlay-hidden .ui-toggle-btn {
    border-radius: 0 15px 15px 0;
}

@media (max-width: 768px) {
    #ui-overlay {
        top: 5px;
        left: 0;
        gap: 5px;
        /* Scale down UI on small screens */
        transform: scale(0.8);
        transform-origin: top left;
    }
    
    .ui-toggle-btn {
        width: 35px;
        height: 45px;
        font-size: 18px;
    }
}

.ui-panel {
    background: #fffbf0;
    padding: 12px 20px;
    border-radius: 25px;
    box-shadow: 
        0 8px 20px rgba(139, 69, 19, 0.15),
        inset 0 2px 5px rgba(255, 255, 255, 1),
        0 0 0 3px #fffbf0,
        0 0 0 5px rgba(139, 69, 19, 0.3);
    font-size: 16px;
    font-weight: bold;
    color: #8b4513;
    border: none;
    animation: float 3s ease-in-out infinite;
    min-width: 100px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(5px);
}

    /* Mobile compatibility note */
    .mobile-compat-note {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 10001; /* Above everything */
        
        width: 80%;
        max-width: 400px;
        padding: 20px;
        
        border-radius: 20px;
        background: rgba(255, 248, 225, 0.95); /* Creamy background */
        color: #5d4037;
        font-family: 'Comic Sans MS', 'Chalkboard SE', sans-serif;
        font-size: 18px;
        text-align: center;
        
        box-shadow: 
            0 10px 30px rgba(0, 0, 0, 0.3),
            0 0 0 5px rgba(255, 255, 255, 0.5),
            0 0 0 8px #8b4513;
            
        border: none;
        display: none;
        animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

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

    @media (max-width: 900px) {
        .mobile-compat-note {
            display: block;
        }
    }
.ui-panel:hover {
    transform: translateY(-2px) scale(1.02);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 245, 230, 0.85) 100%);
    box-shadow: 
        0 5px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 3px rgba(255, 255, 255, 0.8),
        0 0 25px rgba(255, 215, 0, 0.2);
}

@media (max-width: 768px) {
    .ui-panel {
        padding: 6px 12px;
        border-radius: 10px;
        font-size: 13px;
        border: 2px solid rgba(139, 69, 19, 0.15);
        min-width: 110px;
        backdrop-filter: blur(3px);
    }
    
    .ui-panels {
        gap: 5px;
    }
}

.hearts { 
    color: #ff69b4; 
    text-shadow: 0 2px 4px rgba(255, 105, 180, 0.3);
}

.coins { 
    color: #ffd700; 
    text-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
}

.day { 
    color: #4169e1; 
    text-shadow: 0 2px 4px rgba(65, 105, 225, 0.3);
}

.day-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.day-row {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 20px;
    font-weight: bold;
    color: #8b4513;
}

.timer-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.timer-bar {
    height: 100%;
    width: 100%;
    background: #4caf50;
    transition: width 0.3s ease, background-color 0.5s ease;
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

/* === CONTROL BUTTONS === */
#control-buttons {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
    pointer-events: all;
}

@media (max-width: 768px) {
    #control-buttons {
        top: 5px;
        right: 5px;
        gap: 5px;
        flex-direction: column;
        /* Scale down buttons on small screens */
        transform: scale(0.8);
        transform-origin: top right;
    }
}

.control-btn {
    width: 54px;
    height: 54px;
    font-size: 24px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff8e7 0%, #ffe4c4 100%);
    box-shadow: 
        0 6px 0 #d2b48c,
        0 10px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 3px solid #8b4513;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-width: 54px;
    min-height: 54px;
    margin-bottom: 6px; /* Space for the 3D shadow */
}

.control-btn:hover {
    transform: translateY(-2px) rotate(-5deg);
    box-shadow: 
        0 8px 0 #d2b48c,
        0 15px 20px rgba(0,0,0,0.15);
}

.control-btn:active {
    transform: translateY(4px);
    box-shadow: 
        0 2px 0 #d2b48c,
        0 4px 4px rgba(0,0,0,0.1);
}

.control-btn.active {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6b 100%);
    border-color: #c92a2a;
}

/* === UPGRADE SHOP === */
#shop-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 245, 230, 0.98) 100%);
    padding: 25px;
    border-radius: 25px;
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.25),
        inset 0 2px 4px rgba(255, 255, 255, 0.9);
    border: 4px solid rgba(139, 69, 19, 0.3);
    pointer-events: all;
    z-index: 15;
    min-width: 280px;
    backdrop-filter: blur(10px);
}

#shop-panel h3 {
    color: #8b4513;
    margin-bottom: 15px;
    text-align: center;
    font-size: 20px;
    text-shadow: 0 2px 4px rgba(139, 69, 19, 0.2);
}

.upgrade-btn {
    display: block;
    width: 100%;
    padding: 12px 15px;
    margin: 8px 0;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border: 3px solid #daa520;
    border-radius: 12px;
    color: #8b4513;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    font-family: 'Comic Sans MS', sans-serif;
    position: relative;
    overflow: hidden;
}

.upgrade-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(45deg);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.upgrade-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 215, 0, 0.5);
    background: linear-gradient(135deg, #ffed4e 0%, #ffd700 100%);
    border-color: #ff8c00;
}

.upgrade-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.upgrade-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* === ANIMATIONS === */
@keyframes float {
    0%, 100% { 
        transform: translateY(0px); 
    }
    50% { 
        transform: translateY(-10px); 
    }
}

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

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
    .ui-panel {
        font-size: 14px;
        padding: 10px 15px;
    }
    
    #shop-panel {
        top: auto;
        bottom: 100px;
        right: 10px;
        padding: 15px;
        min-width: 160px;
    }
    
    #shop-panel h3 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .upgrade-btn {
        font-size: 12px;
        padding: 10px 12px;
    }
    
    #ui-overlay {
        flex-wrap: wrap;
        top: 10px;
        left: 10px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .ui-panel {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    #shop-panel {
        bottom: 80px;
        padding: 10px;
    }
    
    .upgrade-btn {
        font-size: 11px;
        padding: 8px 10px;
        margin: 6px 0;
    }
}

/* === LOADING SCREEN === */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
    animation: fadeIn 0.5s ease;
}

.loading-screen h1 {
    font-size: 48px;
    color: #8b4513;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(139, 69, 19, 0.2);
    border-top-color: #8b4513;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* === RECIPE BOOK MODAL === */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

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

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 
            0 4px 12px rgba(0, 0, 0, 0.15),
            inset 0 2px 4px rgba(255, 255, 255, 0.8),
            0 0 20px rgba(255, 215, 0, 0.1);
    }
    50% {
        box-shadow: 
            0 4px 12px rgba(0, 0, 0, 0.15),
            inset 0 2px 4px rgba(255, 255, 255, 0.8),
            0 0 25px rgba(255, 215, 0, 0.2);
    }
}

.modal-content {
    background: #fffbf0;
    background-image: 
        linear-gradient(to right, rgba(139, 69, 19, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(139, 69, 19, 0.05) 1px, transparent 1px);
    background-size: 25px 25px;
    padding: 45px;
    border-radius: 35px;
    max-width: 1000px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.35),
        0 0 0 12px #fffbf0,
        0 0 0 16px #8b4513,
        0 0 0 22px rgba(139, 69, 19, 0.2);
    animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    width: 90%;
    margin: auto;
    position: relative;
}

@media (max-width: 768px) {
    .modal-content {
        padding: 25px;
        border-radius: 25px;
        max-height: 90vh;
        box-shadow: 
            0 15px 40px rgba(0, 0, 0, 0.3),
            0 0 0 6px #fffbf0,
            0 0 0 9px #8b4513;
        width: 95%;
        margin: 10px;
    }
    
    .recipe-header h2 {
        font-size: 24px;
    }
    
    .recipe-item h3 {
        font-size: 18px;
    }
    
    .ingredient-tag {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    .start-btn {
        padding: 12px 30px;
        font-size: 18px;
    }
}

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

.recipe-header {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px dashed rgba(139, 69, 19, 0.3);
}

.recipe-header .close-btn {
    position: absolute;
    right: 0;
    top: -10px;
}

.recipe-header h2 {
    color: #8b4513;
    font-size: 36px;
    margin: 0;
    text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.5);
    font-family: 'Comic Sans MS', cursive;
    letter-spacing: 1px;
}

.close-btn {
    background: #8b4513;
    color: #fff8e7;
    border: 2px solid #5d2e0c;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 0 #5d2e0c, 0 5px 10px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: #a0522d;
    transform: translateY(-3px);
    box-shadow: 0 6px 0 #5d2e0c, 0 8px 15px rgba(0,0,0,0.25);
}

.close-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #5d2e0c, 0 2px 4px rgba(0,0,0,0.2);
}

.recipe-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    .recipe-list {
        grid-template-columns: 1fr;
    }
}

.recipe-item {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    padding: 30px;
    border-radius: 20px;
    border: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.recipe-item::before {
    display: none;
}

.recipe-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(139, 69, 19, 0.25), 0 5px 15px rgba(0, 0, 0, 0.1);
}

.recipe-item h3 {
    color: #8b4513;
    margin: 0 0 15px 0;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(139, 69, 19, 0.1);
    width: 100%;
}

.recipe-ingredients {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 0;
}

.ingredient-tag {
    background: linear-gradient(135deg, #8b4513 0%, #a0522d 100%);
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 4px 10px rgba(139, 69, 19, 0.25);
    border: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ingredient-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(139, 69, 19, 0.35);
}

.recipe-arrow {
    display: none;
}

.recipe-result {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    padding: 15px 20px;
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
    border-radius: 15px;
    margin-top: 15px;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.recipe-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 3px solid #d2691e;
}

.start-btn {
    background: #8b4513;
    color: #fff8e7;
    border: none;
    padding: 18px 45px;
    font-size: 22px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 
        0 8px 0 #5d2e0c,
        0 15px 20px rgba(0,0,0,0.2);
    text-transform: uppercase;
    text-align: center;
    display: inline-block;
    letter-spacing: 1px;
    border: 2px solid #a0522d;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 10px 0 #5d2e0c,
        0 20px 25px rgba(0,0,0,0.25);
    background: #a0522d;
}

.start-btn:active {
    transform: translateY(6px);
    box-shadow: 
        0 2px 0 #5d2e0c,
        0 5px 10px rgba(0,0,0,0.2);
}

/* === CUSTOM SCROLLBAR === */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 228, 196, 0.5);
}

::-webkit-scrollbar-thumb {
    background: #d2691e;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #8b4513;
}

/* === MOBILE TOUCH IMPROVEMENTS === */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .control-btn:hover {
        transform: none;
    }
    
    .upgrade-btn:hover {
        transform: none;
    }
    
    .recipe-item:hover {
        transform: none;
    }
    
    /* Bigger touch targets */
    .control-btn {
        width: 55px;
        height: 55px;
        font-size: 26px;
    }
    
    button, .control-btn, .upgrade-btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* === BUTTON PRESS FEEDBACK === */
.control-btn:active,
.upgrade-btn:active,
.start-btn:active,
.close-btn:active {
    transform: scale(0.92) !important;
    transition: transform 0.1s ease;
}

/* === IMPROVED ANIMATIONS === */
@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.ui-panel {
    animation: bounceIn 0.6s ease both;
}

.ui-panel:nth-child(1) { animation-delay: 0.1s; }
.ui-panel:nth-child(2) { animation-delay: 0.2s; }
.ui-panel:nth-child(3) { animation-delay: 0.3s; }
.ui-panel:nth-child(4) { animation-delay: 0.4s; }

/* === SMOOTH TRANSITIONS === */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button {
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

/* === LOADING STATE === */
.loading {
    pointer-events: none;
    opacity: 0.6;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* === MOBILE OPTIMIZATIONS === */
@media (max-width: 768px) {
    /* Larger touch targets for mobile */
    .ui-toggle-btn,
    .control-btn,
    button {
        min-width: 44px !important;
        min-height: 44px !important;
        padding: 12px;
    }
    
    /* Prevent text selection on mobile */
    * {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* Better modal sizing for mobile */
    .modal-content {
        max-width: 100vw;
        max-height: 95vh;
        border-radius: 0;
        margin: 0;
    }
    
    /* Improve button visibility */
    .upgrade-btn,
    .btn {
        font-size: 16px;
        padding: 14px 20px;
        min-height: 50px;
    }
}

/* Portrait mode optimizations */
@media (max-width: 768px) and (orientation: portrait) {
    #game-canvas {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
    
    #game-container {
        padding: 0;
    }
    
    .ui-panel {
        font-size: 14px;
        padding: 8px 12px;
    }
    
    #control-buttons {
        right: 2px;
        top: 2px;
    }
}

/* Landscape mode optimizations */
@media (max-width: 1024px) and (orientation: landscape) {
    #game-canvas {
        max-width: 100vw;
        max-height: 100vh;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    #game-canvas {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Prevent zoom on input focus (iOS Safari) */
input, textarea, select {
    font-size: 16px !important;
}

/* === STICKER BOOK === */
.sticker-book {
    max-width: 1100px;
}

.sticker-header {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 4px solid #d2691e;
}

.sticker-header .close-btn {
    position: absolute;
    right: 0;
}

.sticker-header h2 {
    color: #8b4513;
    font-size: 36px;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.sticker-content {
    max-height: 65vh;
    overflow-y: auto;
    padding-right: 10px;
}

.sticker-stats {
    background: linear-gradient(135deg, #8b4513 0%, #d2691e 100%);
    color: white;
    padding: 25px;
    border-radius: 18px;
    margin-bottom: 30px;
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.3);
}

.stat-item {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
    font-size: 18px;
    gap: 15px;
}

.stat-label {
    font-weight: 600;
}

.stat-value {
    font-weight: 700;
    font-size: 20px;
}

.progress-bar-container {
    width: 100%;
    height: 25px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700 0%, #ffed4e 100%);
    border-radius: 15px;
    transition: width 1s ease;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.sticker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.sticker-card {
    background: white;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    animation: fadeInUp 0.4s ease;
}

.sticker-card.unlocked {
    border: 3px solid #4caf50;
}

.sticker-card.locked {
    border: 3px solid #ccc;
    opacity: 0.6;
}

.sticker-card.new-unlock {
    animation: newUnlock 1s ease;
    border-color: #ffd700;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
}

.sticker-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.new-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.4);
    animation: pulse 2s infinite;
}

.sticker-img {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.sticker-name {
    font-weight: 700;
    color: #8b4513;
    font-size: 14px;
    margin-bottom: 5px;
}

.sticker-price {
    color: #ffd700;
    font-weight: 700;
    font-size: 16px;
}

.sticker-locked {
    padding: 20px 0;
}

.lock-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.unlock-hint {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
}

.photo-gallery {
    margin-top: 40px;
}

.photo-gallery h3 {
    color: #8b4513;
    font-size: 28px;
    margin-bottom: 20px;
    text-align: center;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.photo-card {
    background: white;
    border-radius: 15px;
    padding: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    animation: fadeInUp 0.4s ease;
}

.photo-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.photo-img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 10px;
}

.photo-info {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 12px;
    color: #666;
    font-weight: 600;
    margin-bottom: 8px;
}

.download-sticker-btn,
.download-photo-btn {
    width: 100%;
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.download-sticker-btn:hover,
.download-photo-btn:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.download-sticker-btn:active,
.download-photo-btn:active {
    transform: translateY(0);
}

.no-photos {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 18px;
    background: rgba(139, 69, 19, 0.05);
    border-radius: 15px;
}

.sticker-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 3px solid #d2691e;
}

.continue-btn {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 15px 50px;
    font-size: 20px;
    font-weight: 700;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
    text-align: center;
    display: inline-block;
}

.continue-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6);
}

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

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

@media (max-width: 768px) {
    .sticker-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 15px;
    }
    
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .sticker-img {
        width: 60px;
        height: 60px;
    }
}

/* === ICON IMAGES === */
.icon-img, .control-btn img, .ui-panel img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    vertical-align: middle;
    display: inline-block;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2));
}

/* Specific sizing for control buttons */
.control-btn img {
    width: 32px;
    height: 32px;
    pointer-events: none;
}

/* Specific sizing for UI panels */
.ui-panel img {
    width: 28px;
    height: 28px;
    margin-right: 8px;
}

/* Ensure UI panels align content nicely */
.ui-panel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
