:root {
    --primary: #FFCC00; /* ZERO74 Yellow */
    --primary-glow: rgba(255, 204, 0, 0.4);
    --secondary: #F5F5F5;
    --accent: #B28F00;
    --text: #1A1A1A;
    --glass: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.08);
    --bg: #FFFFFF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    overflow: hidden; /* No scroll, all content within view */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
}

.app-container {
    height: 100%;
    width: 100%;
    max-width: 450px;
    position: relative;
    display: flex;
    flex-direction: column;
    padding-bottom: constant(safe-area-inset-bottom);
    padding-bottom: env(safe-area-inset-bottom);
}

/* Header Styling */
header {
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 24px 10px;
    z-index: 10;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: 'Outfit', sans-serif;
    font-size: 48px; /* High impact for totems */
    font-weight: 950;
    letter-spacing: 5px;
    margin-bottom: 5px;
}

.logo-subtitle {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.logo-icon {
    width: 80px; /* Big goat icon */
    height: 80px;
    background-image: url('logo_bode.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.logo-accent {
    color: var(--primary);
}

/* Pizza Stage */
.pizza-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Move up slightly to fit large pizza */
    align-items: center;
    position: relative;
    padding-top: 20px;
    padding-bottom: 40px;
}

.wooden-board {
    position: absolute;
    width: 620px; /* Slightly larger to frame the pizza better */
    height: 620px;
    background-image: url('madeira.png');
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 0;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.pizza-base-wrapper {
    z-index: 1;
    width: 480px; /* Maximize size */
    height: 480px;
    position: relative;
    border-radius: 50%;
    box-shadow: 0 0 80px rgba(255, 204, 0, 0.2); /* Enhanced glow */
    perspective: 1500px;
}

.pizza-crust {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-image: url('pizza_crust.png'); /* To be set dynamically after generation */
    background-size: cover;
    background-position: center;
    position: relative;
    /* Rotation logic */
    animation: rotatePizza 40s linear infinite;
    transform-style: preserve-3d;
    box-shadow: 
        inset 0 0 40px rgba(0, 0, 0, 0.4),
        0 15px 40px rgba(0, 0, 0, 0.6);
}

@keyframes rotatePizza {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Ingredient Layers (Base Layers for presets) */
.ingredient-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-size: cover;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.sauce {
    background: radial-gradient(circle, #D32F2F 10%, #B71C1C 70%, transparent 90%);
    opacity: 0.9;
    mix-blend-mode: multiply;
}

.cheese {
    background-size: cover;
    background-position: center;
    opacity: 1;
    mix-blend-mode: normal;
}

.hidden {
    opacity: 0 !important;
}

/* Ingredient "Stickers" added dynamically */
.ingredient-sticker {
    position: absolute;
    width: 45px;
    height: 45px;
    background-size: 200% 300%;
    background-repeat: no-repeat;
    pointer-events: all; /* Needed for dragging */
    z-index: 10;
    mix-blend-mode: multiply;
    cursor: grab;
    transform: translate(-50%, -50%); /* Center on coordinates */
    transition: transform 0.1s;
    user-select: none;
}

.ingredient-sticker:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.2);
}

.ingredient-sticker.dragging {
    opacity: 0.8;
    z-index: 100;
}

/* Animation for dropping ingredient */
.ingredient-drop {
    animation: dropIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes dropIn {
    0% { transform: scale(3) rotate(45deg); opacity: 0; }
    100% { transform: scale(1) rotate(var(--angle)); opacity: 1; }
}

.status-indicator {
    margin-top: 30px;
    text-align: center;
}

#flavor-name {
    display: block;
    font-size: 24px;
    font-family: 'Playfair Display', serif;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 4px;
}

#ingredient-count {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Control Area */
.controls-area {
    width: 100%;
    padding: 20px;
}

.controls-glass {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(25px);
    border-radius: 30px;
    padding: 24px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

.category-header {
    margin-bottom: 20px;
}

.category-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.category-header p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

.category-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
}

.category-tab {
    padding: 10px 20px;
    background: #F0F0F0;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    color: #666;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.category-tab.active {
    background: var(--primary);
    color: #000;
    box-shadow: 0 4px 10px var(--primary-glow);
}

.category-content {
    display: none;
}

.category-content.active {
    display: flex;
}

.ingredient-selector {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    padding-bottom: 15px;
    scrollbar-width: none; /* Firefox */
}

.ingredient-selector::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.ingredient-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    cursor: pointer;
}

.ing-icon {
    width: 60px;
    height: 60px;
    background: var(--secondary);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s, border-color 0.3s;
    background-size: 70%;
    background-position: center;
    background-repeat: no-repeat;
}

.ingredient-item:active .ing-icon {
    transform: scale(0.9);
    border-color: var(--primary);
}

.ingredient-item span {
    font-size: 11px;
    color: #000; /* Forcing black text */
    font-weight: 700;
}

/* Ingredient Icons (Placeholder styles/Gradients until real assets) */
.pepperoni { background-image: url('ingredients.png'); background-position: 0% 0%; background-size: 200% 300%; }
.basil { background-image: url('ingredients.png'); background-position: 100% 0%; background-size: 200% 300%; }
.olive { background-image: url('ingredients.png'); background-position: 0% 50%; background-size: 200% 300%; }
.mushroom { background-image: url('ingredients.png'); background-position: 100% 50%; background-size: 200% 300%; }
.onion { background-image: url('ingredients.png'); background-position: 0% 100%; background-size: 200% 300%; }
.corn { background-image: url('ingredients.png'); background-position: 100% 100%; background-size: 200% 300%; }

.tomato, .egg {
    font-size: 24px;
    background: #FFF;
}

/* Beer Items Styles */
.beer-item {
    background-image: url('beers.png');
    background-size: 300% 100%;
}

.beer-1 { background-position: 0% 0%; }
.beer-2 { background-position: 50% 0%; }
.beer-3 { background-position: 100% 0%; }

.petiscos-item {
    background-color: #EEE;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
}

/* Cheese Types Grid */
.cheese-item {
    background-image: url('cheeses.png');
    background-size: 200% 200%;
}

.cheese-mozz { background-position: 0% 0%; }
.cheese-gorg { background-position: 100% 0%; }
.cheese-parm { background-position: 0% 100%; }
.cheese-prov { background-position: 100% 100%; }

.cheese-sticker {
    width: 70px;
    height: 70px;
    mix-blend-mode: normal; /* Cheeses look better without multiply sometimes */
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.primary-btn {
    flex: 1;
    background: var(--primary);
    color: #000; /* Forcing black text */
    border: none;
    padding: 18px;
    border-radius: 18px;
    font-size: 16px;
    font-weight: 800;
    box-shadow: 0 10px 20px var(--primary-glow);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.primary-btn:active {
    transform: scale(0.98);
    box-shadow: 0 5px 10px var(--primary-glow);
}

.secondary-btn {
    padding: 18px 24px;
    background: white;
    border: 1px solid var(--glass-border);
    color: var(--text);
    border-radius: 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 30px;
    padding: 30px;
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.payment-animation {
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 50px;
}

.payment-info h3 {
    font-size: 24px;
    margin-bottom: 12px;
}

.payment-info p {
    color: #666;
    margin-bottom: 30px;
}

.close-modal {
    width: 100%;
    background: var(--primary);
    color: var(--text);
    border: none;
    padding: 16px;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 370px) {
    .pizza-base-wrapper {
        width: 280px;
        height: 280px;
    }
    
    .ing-icon {
        width: 50px;
        height: 50px;
    }
}
