/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Press Start 2P', monospace;
    background-color: #202020;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    color: #333;
    overflow: hidden;
}

/* Game Boy Advance Container Style */
#game-container {
    width: 720px;
    height: 480px;
    background-color: #f8f8f8;
    position: relative;
    border: 15px solid #d0d0d0;
    border-radius: 10px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    image-rendering: pixelated;
}

.screen {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* Start Screen */
#start-screen {
    background-image: url('sprites/nazareth_background.png');
    background-size: cover;
    background-position: center;
    /* Fallback gradient if image not loaded */
    background-color: #70c4c4;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}

.title-container h1 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #000;
    text-shadow: 2px 2px 0px #fff;
    background: rgba(255, 255, 255, 0.5);
    padding: 10px;
    border-radius: 5px;
    border: 2px solid #333;
}

.title-container p {
    font-size: 12px;
    color: #000;
    font-weight: bold;
    text-shadow: 1px 1px 0px #fff;
}

.start-content {
    margin: 40px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.start-sprite {
    width: 120px;
    height: 120px;
    animation: bob 1s ease-in-out infinite alternate;
}

@keyframes bob {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-10px);
    }
}

.bob-anim {
    animation: bob 1s ease-in-out infinite alternate;
}

.retro-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 14px;
    padding: 15px 20px;
    background: #ff5e5e;
    color: white;
    border: 4px solid #cc0000;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 4px 0 #990000;
    transition: transform 0.1s, box-shadow 0.1s;
}

.retro-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #990000;
}

.credits {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: auto;
}

/* Battle Screen */
#battle-screen {
    background-image: url('sprites/nazareth_background.png');
    background-size: cover;
    background-position: center;
}

.battle-scene {
    flex: 1;
    position: relative;
    padding: 20px;
}

/* Sprites */
.sprite-container {
    position: absolute;
}

.enemy-pos {
    top: 40px;
    right: 50px;
}

.player-pos {
    bottom: 0px;
    left: 40px;
}

.sprite {
    width: 180px;
    height: 180px;
    /* Basic drop shadow for sprites */
    filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, 0.3));
}

/* Animations */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

.float-anim {
    animation: float 3s ease-in-out infinite;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-300px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-left {
    animation: slideInLeft 1s ease-out forwards;
}

@keyframes slideOutRight {
    to {
        transform: translateX(300px);
        opacity: 0;
    }
}

.slide-out-right {
    animation: slideOutRight 1s ease-in forwards;
}

@keyframes happyJump {

    0%,
    100% {
        transform: translateY(0);
    }

    25% {
        transform: translateY(-15px);
    }

    50% {
        transform: translateY(0);
    }

    75% {
        transform: translateY(-8px);
    }
}

.happy-jump {
    animation: happyJump 0.8s ease-in-out;
}

@keyframes shake {
    0% {
        transform: translate(0, 0);
        filter: hue-rotate(0deg);
    }

    10%,
    90% {
        transform: translate(-3px, -1px);
    }

    20%,
    80% {
        transform: translate(4px, 2px);
    }

    30%,
    50%,
    70% {
        transform: translate(-6px, -4px);
        filter: sepia(100%) saturate(300%) hue-rotate(-50deg);
        /* Red tint */
    }

    40%,
    60% {
        transform: translate(6px, 4px);
    }

    100% {
        transform: translate(0, 0);
        filter: hue-rotate(0deg);
    }
}

.damage-anim {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes heal {
    0% {
        filter: brightness(100%);
    }

    50% {
        filter: brightness(150%) sepia(100%) saturate(300%) hue-rotate(50deg);
        /* Green/Gold tint */
    }

    100% {
        filter: brightness(100%);
    }
}

.heal-anim {
    animation: heal 1s ease-in-out;
}

@keyframes pulseStar {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
        filter: drop-shadow(0 0 10px #ffd700);
    }

    100% {
        transform: scale(1);
        opacity: 0.6;
    }
}

.glowing-star {
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, #ffd700 20%, rgba(255, 215, 0, 0) 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Centered relative to container */
    z-index: -1;
    /* Behind sprite */
    border-radius: 50%;
    animation: pulseStar 2s infinite ease-in-out;
}

/* Status Bars */
.status-bar {
    position: absolute;
    background: #f8f9fa;
    border: 3px solid #666;
    border-radius: 5px;
    padding: 10px;
    width: 250px;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.enemy-status {
    /* Below Gabriel (Top Right) */
    top: 250px;
    right: 20px;
    border-radius: 15px 0 15px 0;
}

.player-status {
    /* Above Mary (Bottom Left) */
    bottom: 200px;
    left: 20px;
    border-radius: 0 15px 0 15px;
}

.name {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
}

.level {
    font-size: 10px;
    float: right;
    margin-top: -18px;
}

.hp-bar-container {
    width: 100%;
    height: 12px;
    background: #555;
    border-radius: 6px;
    border: 2px solid #333;
    margin-top: 5px;
    overflow: hidden;
}

.hp-bar {
    width: 100%;
    height: 100%;
    background: #4caf50;
    /* Green */
}

.hp-text {
    font-size: 10px;
    margin-top: 5px;
    text-align: right;
}

/* UI Box (Text & Menu) */
#ui-box {
    height: 140px;
    background: #2e3b4e;
    /* Dark frame */
    border-top: 4px solid #d4af37;
    /* Gold accent */
    padding: 5px;
}

#dialogue-box,
#action-menu {
    height: 100%;
    background: #ffffff;
    border: 4px solid #5a5a5a;
    border-radius: 5px;
    padding: 15px;
    position: relative;
    font-size: 16px;
    line-height: 1.6;
    color: #000;
}

#continue-indicator {
    position: absolute;
    bottom: 15px;
    right: 20px;
    color: #d00;
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Menu Grid */
.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    height: 100%;
}

.menu-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    background: #fff;
    border: 2px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    text-transform: uppercase;
    transition: background 0.2s;
}

.menu-btn:hover {
    background: #f0f0f0;
    border-color: #d00;
    color: #d00;
}