/* public/css/style.css */

:root {
    --bg-color: #9bbc0f;
    /* Lightest Green (Background) */
    --fill-color: #8bac0f;
    /* Light Green (Fill) */
    --accent-color: #306230;
    /* Dark Green (Accent) */
    --outline-color: #0f380f;
    /* Darkest Green (Outline/Text) */
    --device-shell: #f0f0f0;
    /* Gameboy-ish white/grey */
    --device-shadow: #b0b0b0;
}

@font-face {
    font-family: 'PixelEmul';
    src: local('Courier New'), monospace;
    /* Fallback for now */
}

* {
    box-sizing: border-box;
}

body {
    background-color: #222;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    font-family: 'PixelEmul', 'Courier New', monospace;
}

/* The Physical Device Container */
.digivice-container {
    width: 360px;
    height: 640px;
    background-color: var(--device-shell);
    border-radius: 20px 20px 40px 40px;
    padding: 30px 20px;
    box-shadow:
        inset -5px -5px 10px rgba(0, 0, 0, 0.1),
        inset 5px 5px 10px rgba(255, 255, 255, 0.8),
        0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* The Screen Area */
.screen-bezel {
    width: 100%;
    background-color: #555;
    border-radius: 10px 10px 30px 10px;
    padding: 15px;
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
}

.screen {
    width: 100%;
    height: 300px;
    /* Square-ish gameplay area */
    background-color: var(--bg-color);
    border: 2px solid var(--outline-color);
    box-shadow: inset 3px 3px 5px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    color: var(--outline-color);
    display: flex;
    flex-direction: column;
    padding: 5px;
}

/* Retro LCD Grid Effect */
.screen::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(15, 56, 15, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 56, 15, 0.1) 1px, transparent 1px);
    background-size: 2px 2px;
    opacity: 0.3;
}

/* UI Elements */
.header-stats {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    border-bottom: 2px solid var(--outline-color);
    margin-bottom: 5px;
    z-index: 2;
    background-color: var(--bg-color);
    padding-bottom: 5px;
}

.main-stage {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

.controls {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    width: 100%;
}

.btn {
    background: #ddd;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    box-shadow: 0 4px 0 #999;
    cursor: pointer;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #999;
}

/* Utility Classes */
.pixel-icon {
    display: inline-block;
    vertical-align: middle;
}

/* Responsive for actual mobile usage */
@media (max-width: 400px) {
    .digivice-container {
        width: 100%;
        height: 100vh;
        border-radius: 0;
        box-shadow: none;
    }
}

/* Bottom Nav */
.bottom-nav {
    position: absolute;
    bottom: 20px;
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding: 0 10px;
}

.nav-item {
    text-decoration: none;
    font-size: 24px;
    background: #ddd;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    border: 2px solid #555;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}


/* Wandering Monster Animation */
.wandering-container {
    animation: wander 10s infinite ease-in-out;
    display: inline-block;
}

@keyframes wander {
    0% {
        transform: translateX(0) scaleX(1);
    }

    10% {
        transform: translateX(20px) scaleX(1);
    }

    15% {
        transform: translateX(20px) scaleX(1);
    }

    /* Pause */
    20% {
        transform: translateX(20px) scaleX(-1);
    }

    /* Flip */
    35% {
        transform: translateX(-30px) scaleX(-1);
    }

    /* Move Left */
    40% {
        transform: translateX(-30px) scaleX(-1);
    }

    /* Pause */
    45% {
        transform: translateX(-30px) scaleX(1);
    }

    /* Flip Back */
    60% {
        transform: translateX(10px) scaleX(1);
    }

    75% {
        transform: translateX(0) scaleX(1);
    }

    100% {
        transform: translateX(0) scaleX(1);
    }
}

/* Decorations Layer */
.decorations-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Ensure monster is above decorations */
.wandering-container {
    z-index: 1;
    position: relative;
}