/* ====================================================
   Master of MASHIMASHI - style.css (Game UI Edition)
   ==================================================== */

:root {
    --color-neon-pink: #ff0080;
    --color-neon-blue: #00d1ff;
    --color-neon-yellow: #f59e0b;
    --color-hachiro-yellow: #facc15; /* yellow-400 */
    --color-background-dark: #090d16;
}

body {
    font-family: 'DotGothic16', 'Noto Sans JP', sans-serif;
    touch-action: none; /* Prevent scroll on touch swipe */
    -webkit-user-select: none;
    user-select: none;
    background-color: #0f172a; /* Fallback for outer body */
    margin: 0;
    padding: 0;
    overflow: hidden;
    min-height: 100vh;
    background-image: radial-gradient(circle at top left, rgba(250, 204, 21, 0.05), transparent),
                      radial-gradient(circle at bottom right, rgba(239, 68, 68, 0.05), transparent);
}

/* Enforce sharp pixels for pixel art images */
img, canvas, .pixelated {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: pixelated;
}

/* Pixel art style border */
.pixel-border {
    border: 4px solid #000;
    box-shadow: inset -4px -4px 0px 0px rgba(0,0,0,0.3);
}

.pixel-border-yellow {
    background-color: #facc15;
    border: 4px solid #000;
    box-shadow: inset -4px -4px 0px 0px rgba(0,0,0,0.2);
}

.pixel-border-red {
    background-color: #ef4444;
    border: 4px solid #000;
    color: white;
    box-shadow: inset -4px -4px 0px 0px rgba(0,0,0,0.3);
}

/* --- Ramen Noren & Bowl Border --- */
.noren-stripe {
    background: repeating-linear-gradient(
        -45deg,
        #dc2626, /* red-600 */
        #dc2626 20px,
        #facc15 20px, /* yellow-400 */
        #facc15 25px
    );
    border-bottom: 2px solid #991b1b;
}

/* --- animations --- */

/* 1. screen shake (guilty effect) */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px) rotate(-0.8deg); }
    20%, 40%, 60%, 80% { transform: translateX(8px) rotate(0.8deg); }
}

.shake-effect {
    animation: shake 0.35s cubic-bezier(.36,.07,.19,.97) both;
}

/* 2. flashing background (regular customer alert) */
@keyframes flash-red {
    0%, 100% { background-color: var(--color-background-dark); }
    50% { background-color: rgba(239, 68, 68, 0.35); }
}

.flash-bg {
    animation: flash-red 1s infinite;
}

/* 3. topping drop animation */
@keyframes fall-drop {
    0% {
        transform: translateY(-120px) scaleY(1.4) scaleX(0.8);
        opacity: 0;
    }
    60% {
        transform: translateY(8px) scaleY(0.9) scaleX(1.1);
    }
    80% {
        transform: translateY(-4px) scale(1.02);
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.fall-drop-anim {
    animation: fall-drop 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* 4. Steam rise animation */
@keyframes steam-rise {
    0% {
        transform: translateY(0) scaleX(1) rotate(0deg);
        opacity: 0;
    }
    30% {
        opacity: 0.35;
    }
    50% {
        transform: translateY(-40px) scaleX(1.3) rotate(10deg);
    }
    80% {
        opacity: 0.1;
    }
    100% {
        transform: translateY(-80px) scaleX(1.6) rotate(-10deg);
        opacity: 0;
    }
}

.steam-particle {
    position: absolute;
    background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: steam-rise 3s infinite linear;
}

/* --- custom visual elements --- */

.glass-panel {
    background: rgba(255, 255, 255, 0.75);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.arcade-border-yellow {
    border: 4px solid #facc15;
    box-shadow: 0 0 15px rgba(250, 204, 21, 0.3), inset 0 0 10px rgba(250, 204, 21, 0.1);
    background-color: #fffbeb;
}

.arcade-border-red {
    border: 4px solid #ef4444;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4), inset 0 0 10px rgba(239, 68, 68, 0.15);
    background-color: #fef2f2;
}

/* --- Kitchen & Counter UI (Pop 3D Perspective) --- */

/* 台座のパース (奥に向かって狭くなる) */
.kitchen-counter-3d {
    background: linear-gradient(180deg, #b45309 0%, #78350f 100%);
    transform: perspective(800px) rotateX(15deg);
    transform-origin: bottom center;
    border: 4px solid #000;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    box-shadow: inset 0 10px 20px rgba(255,255,255,0.1), 0 -5px 15px rgba(0,0,0,0.5);
}

/* 具材バット（トレイ）の共通スタイル */
.food-tray-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.1s;
}

.food-tray-container:active {
    transform: translateY(4px);
}

.food-tray {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #94a3b8;
    border: 4px solid #000;
    box-shadow: inset -4px -4px 0px 0px rgba(0,0,0,0.3), inset 4px 4px 0px 0px rgba(255,255,255,0.4);
    transition: all 0.1s;
}

/* 注文パネル (テキスト吹き出し) */
.order-panel {
    background: rgba(255, 255, 255, 0.95);
    border: 4px solid #000;
    padding: 6px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.3);
    position: relative;
    transform-origin: bottom center;
    border-radius: 8px;
}

/* 注文パネルの吹き出し尻尾 */
.order-panel::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #000;
}

/* 客が座る枠 */
.customer-seat {
    position: relative;
    width: 80px;
    height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    transition: all 0.3s ease-out;
}

/* --- Bowl Graphics --- */
.bowl-base {
    position: relative;
    width: 260px;
    height: 130px;
    border-bottom-left-radius: 130px;
    border-bottom-right-radius: 130px;
    background: linear-gradient(135deg, #e11d48, #9f1239); /* Red bowl */
    border: 8px solid #ffffff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6);
    overflow: visible;
}

/* Blue dragon pattern on the bowl */
.bowl-base::after {
    content: "🍜";
    font-size: 20px;
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.15;
}

.bowl-rim {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 260px;
    height: 16px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 2px solid #9f1239;
    z-index: 15;
}

/* Yellow line pattern on bowl rim */
.bowl-rim::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 10px;
    width: 224px;
    height: 4px;
    border-radius: 50%;
    border-bottom: 2px dashed #9f1239;
}

.soup-surface {
    position: absolute;
    top: -2px;
    left: 8px;
    width: 228px;
    height: 28px;
    border-radius: 50%;
    background-color: #713f12; /* brown rich tonkotsu shoyu soup */
    z-index: 11;
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.6);
}

.noodle-pile {
    position: absolute;
    top: -12px;
    left: 24px;
    width: 196px;
    height: 46px;
    background-color: #fef08a; /* yellow-200 */
    border-radius: 40% 40% 35% 35%;
    z-index: 12;
    border: 2px solid #ca8a04;
    box-shadow: inset 0 -3px 6px rgba(202, 138, 4, 0.3), 0 3px 5px rgba(0, 0, 0, 0.3);
}

/* 🐷 Chashu Pork (ブタ) - Essential visual for Hachiro style */
.chashu-pork {
    position: absolute;
    width: 52px;
    height: 42px;
    background: linear-gradient(135deg, #b45309, #78350f); /* Meaty brown */
    border: 3px solid #f59e0b; /* fat rim */
    border-radius: 20% 45% 30% 40%;
    z-index: 16;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.chashu-1 {
    top: -20px;
    left: 12px;
    transform: rotate(-25deg);
}

.chashu-2 {
    top: -16px;
    left: 45px;
    transform: rotate(5deg);
}

/* --- Dynamic Toppings --- */

/* Yasai Stack (cabbage & bean sprouts) */
.topping-yasai {
    position: absolute;
    left: 36px;
    width: 172px;
    background: linear-gradient(180deg, #a7f3d0 0%, #4ade80 70%, #16a34a 100%); /* Cabbage and sprout gradient */
    border-radius: 80% 80% 0 0;
    z-index: 20;
    border-left: 2px solid #15803d;
    border-right: 2px solid #15803d;
    border-top: 1px solid #ffffff;
    box-shadow: inset 0 6px 10px rgba(255, 255, 255, 0.5), 0 4px 6px rgba(0,0,0,0.25);
    transition: all 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

/* Garlic Pile dots */
.topping-ninniku {
    position: absolute;
    background-color: #f8fafc;
    border-radius: 40% 50% 40% 60%;
    z-index: 30;
    border: 1px solid #cbd5e1;
    box-shadow: 0 2px 3px rgba(0,0,0,0.2);
    transition: all 0.2s ease-out;
}

/* Lard chunks */
.topping-abura {
    position: absolute;
    background-color: #fef08a; /* fatty yellow */
    border-radius: 30% 60% 40% 50%;
    z-index: 32;
    border: 1px solid #eab308;
    box-shadow: 0 3px 4px rgba(0,0,0,0.2);
    transition: all 0.2s ease-out;
}

/* Soy sauce drizzle */
.topping-karame {
    position: absolute;
    background-color: rgba(146, 64, 14, 0.88); /* dark amber sauce */
    border-radius: 10px;
    z-index: 35;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.22s ease-out;
}

/* Active Topping Highlight class */
.topping-btn-selected {
    transform: scale(1.05);
    background-color: rgba(250, 204, 21, 0.15) !important;
    border-color: #facc15 !important;
    box-shadow: 0 0 20px rgba(250, 204, 21, 0.4);
}

/* --- Level Up / Result Screens decorations --- */
.coin-gold {
    animation: spin 1.5s linear infinite;
}

@keyframes spin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}