html, body {
    width: 100%;
    height: 100%;
    height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #FAF6F0; /* AppColors.Background: Warm Milk Ivory */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
    outline: none;
}

* {
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    outline: none;
    box-sizing: border-box;
}

canvas {
    outline: none;
    -webkit-tap-highlight-color: transparent;
    display: block;
    width: 100% !important;
    height: 100% !important;
}

#composeApp {
    width: 100%;
    height: 100%;
    height: 100dvh;
    position: absolute;
    top: 0;
    left: 0;
}

/* 🧱 Smart Loading Splash Screen (Fixed Overlay, Warm Ivory Palette) */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background-color: #FAF6F0; /* Matching AppColors.Background */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    z-index: 99999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease-out, visibility 0.5s ease;
}

#splash-screen.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Center Content Area */
.splash-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 20px;
}

.splash-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0;
    max-width: 340px;
    width: 100%;
    background: transparent;
    border: none;
    box-shadow: none;
    animation: cardFloat 3s ease-in-out infinite alternate;
}

@keyframes cardFloat {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-5px); }
}

/* 🌿🧀🥩 Top-View Food Blocks (Authentic food_block_top drawables) */
.food-assembly-track {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 76px;
    margin-bottom: 18px;
    position: relative;
    filter: drop-shadow(0 6px 14px rgba(44, 36, 30, 0.12));
}

.food-brick-img {
    height: 64px;
    width: auto;
    object-fit: contain;
    animation: blockSnapIn 1.8s cubic-bezier(0.16, 1, 0.3, 1) infinite;
    will-change: transform, opacity;
}

.food-brick-img.brick-green {
    animation-delay: 0.0s;
    z-index: 3;
}

.food-brick-img.brick-yellow {
    animation-delay: 0.12s;
    z-index: 2;
}

.food-brick-img.brick-red {
    animation-delay: 0.24s;
    z-index: 1;
}

/* 슉 → 착! 오른쪽에서 왼쪽으로 빠르게 날아와 1~2px 오버슛 후 조립 고정 */
@keyframes blockSnapIn {
    0% {
        opacity: 0;
        transform: translateX(80px);
    }
    11% {
        opacity: 1;
        transform: translateX(-2px); /* 1~2px 미세 overshoot */
    }
    15% {
        opacity: 1;
        transform: translateX(0px);  /* 제자리에 착! 락킹 */
    }
    72% {
        opacity: 1;
        transform: translateX(0px);  /* 완벽한 트리콜로 푸드 블록 유지 */
    }
    82% {
        opacity: 0;
        transform: translateX(0px);  /* 부드러운 페이드 리셋 */
    }
    100% {
        opacity: 0;
        transform: translateX(80px);
    }
}

/* App Title & Loading Text */
.splash-title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: #2C241E; /* AppColors.TextPrimary */
}

.splash-loading-text {
    margin: 8px 0 0 0;
    font-size: 13.5px;
    font-weight: 600;
    color: #6B5E54; /* AppColors.TextSecondary */
    letter-spacing: -0.2px;
}

.splash-loading-text .dots {
    display: inline-block;
    animation: dotsWave 1.4s infinite;
}

@keyframes dotsWave {
    0%, 20% { opacity: 0.2; }
    50% { opacity: 0.6; }
    80%, 100% { opacity: 1; }
}

/* 📱 Bottom Navigation Bar during Splash */
.splash-bottom-nav {
    width: 100%;
    background: #FFFFFF; /* AppColors.Surface */
    border-top: 1px solid #E5DDD3; /* AppColors.Border */
    border-radius: 20px 20px 0 0;
    padding: 8px 16px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-sizing: border-box;
}

.splash-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px 14px;
    color: #A89F91; /* AppColors.TextMuted */
}

.splash-nav-item.active {
    color: #3D7A68; /* AppColors.Primary */
}

.splash-nav-item svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.splash-nav-item span {
    margin-top: 2px;
    font-size: 11px;
    font-weight: 500;
}

.splash-nav-item.active span {
    font-weight: 700;
}