/* Root Variables for Harmonious Pastel and Playful Theme */
:root {
    --sky-blue: #88D3F8;
    --grass-green: #85F28B;
    --white: #FFFFFF;
    --black: #1C1D21;
    --grey-light: #F4F5F7;
    --bunny-grey: #9FA2B2;
    --bunny-pink: #F9A1B2;
    --carrot-orange: #F28B30;
    --shadow: rgba(28, 29, 33, 0.15);
    --font-primary: 'Outfit', sans-serif;
    --border-width: 4px;
}

/* Reset and Core Layout */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-primary);
    background-color: #E2E8F0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

/* App Container (Emulates a phone/tablet viewport) */
.app-container {
    width: 100%;
    max-width: 480px;
    height: 100vh;
    max-height: 850px;
    background-color: var(--sky-blue);
    border: var(--border-width) solid var(--black);
    border-radius: 36px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Header Styling */
.app-header {
    background-color: var(--white);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: var(--border-width) solid var(--black);
    z-index: 10;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0E4E75;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.icon-btn:hover {
    transform: scale(1.1);
}

.icon-btn .material-icons {
    font-size: 1.8rem;
}

/* Game Area (Sky and Grass) */
.game-area {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sky-area {
    height: 50%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 24px;
    z-index: 1;
}

.game-headline {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--white);
    text-align: center;
    text-shadow: 
        3px 3px 0 var(--black),
        -3px -3px 0 var(--black),
        3px -3px 0 var(--black),
        -3px 3px 0 var(--black),
        3px 0px 0 var(--black),
        -3px 0px 0 var(--black),
        0px 3px 0 var(--black),
        0px -3px 0 var(--black);
    letter-spacing: 1px;
}

.grass-area {
    height: 50%;
    background-color: var(--grass-green);
    border-top: var(--border-width) solid var(--black);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 0;
}

/* Sandbox for character positioning and animations */
.character-sandbox {
    position: absolute;
    top: 0;
    bottom: 100px; /* Above the control panel */
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

/* Bunny Container and responsive SVG */
.bunny-container {
    width: 220px;
    height: 260px;
    position: relative;
    cursor: pointer;
}

.bunny-container svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* SVG Elements transitions */
#bunny-character {
    transition: transform 0.15s ease-out;
}

#bunny-belly {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: 100px 172px; /* Center of belly circle */
}

/* Stuffed state: scales the belly up */
.full #bunny-belly {
    transform: scale(1.35);
}

/* Wiggle animation (applied to character group) */
@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    15% { transform: rotate(-6deg) translateY(-2px); }
    35% { transform: rotate(5deg) translateY(-1px); }
    55% { transform: rotate(-4deg) translateY(-2px); }
    75% { transform: rotate(3deg) translateY(0); }
    90% { transform: rotate(-1deg); }
}

.wiggle #bunny-character {
    animation: wiggle 0.4s ease-in-out;
    transform-origin: 100px 220px; /* Base pivot point near feet */
}

/* Poop Emoji Styling and Drop Animation */
.poop-emoji {
    position: absolute;
    font-size: 2.2rem;
    pointer-events: none;
    z-index: 1; /* Drop behind head but next to/behind tail/feet */
    transform-origin: center;
    animation: poop-drop 2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes poop-drop {
    0% {
        transform: translate(0, 30px) scale(0);
        opacity: 0;
    }
    15% {
        transform: translate(35px, 60px) scale(1.3) rotate(15deg);
        opacity: 1;
    }
    30% {
        transform: translate(50px, 95px) scale(1) rotate(5deg);
        opacity: 1;
    }
    80% {
        transform: translate(50px, 95px) scale(1) rotate(5deg);
        opacity: 1;
    }
    100% {
        transform: translate(50px, 110px) scale(0.7) rotate(0deg);
        opacity: 0;
    }
}

/* Control Panel (Feed Button) */
.control-panel {
    position: absolute;
    bottom: 24px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding: 0 24px;
    z-index: 3;
}

.feed-btn {
    font-family: var(--font-primary);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--white);
    background-color: var(--carrot-orange);
    border: var(--border-width) solid var(--black);
    border-radius: 20px;
    padding: 14px 32px;
    cursor: pointer;
    box-shadow: 0 6px 0 var(--black);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.1s ease;
}

.feed-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 var(--black);
}

.feed-btn:disabled {
    background-color: #B2B5C0;
    color: #E2E8F0;
    box-shadow: 0 6px 0 #7A7C8A;
    cursor: not-allowed;
    transform: none;
}

.btn-emoji {
    font-size: 1.4rem;
}

/* Bottom Tab Navbar */
.app-navbar {
    background-color: var(--white);
    border-top: var(--border-width) solid var(--black);
    padding: 12px 24px 20px 24px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-bottom-left-radius: 32px;
    border-bottom-right-radius: 32px;
    z-index: 10;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #7A7C8A;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    gap: 4px;
    transition: color 0.2s ease;
}

.nav-item .material-icons {
    font-size: 1.8rem;
}

.nav-item.active {
    color: #0E4E75;
}

/* Active tab style matches visual reference: Green pill background, black border */
.nav-item.active {
    background-color: #92E898;
    border: 3px solid var(--black);
    border-radius: 20px;
    padding: 6px 20px;
    color: var(--black);
    margin-top: -6px;
    margin-bottom: -6px;
    box-shadow: 0 4px 0 var(--black);
}

.nav-item.active .material-icons {
    color: var(--black);
}
