@font-face {
    font-family: 'PixelatedElegance';
    src: url('assets/fonts/PixelatedElegance.woff2') format('woff2'),
         url('assets/fonts/PixelatedElegance.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'PixelatedElegance', 'Arial', sans-serif;
    overflow: hidden !important;
    background: #000;
    color: white;
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    max-width: 100vw;
    max-height: 100vh;
}

#game-container {
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    overflow: hidden !important;
    touch-action: manipulation;
    max-width: 100vw;
    max-height: 100vh;
}

.screen {
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    max-width: 100vw;
    max-height: 100vh;
}

.screen.active {
    display: flex;
}

#story-screen.active,
#game-screen.active {
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#welcome-screen {
    background: #000;
    position: relative;
}

#welcome-screen.active {
    display: flex;
    flex-direction: row;
    align-items: center;
}

#background-image {
    position: absolute;
    top: 50%;
    right: 5%;
    transform: translateY(-50%);
    width: 35vw;
    height: 70vh;
    background-image: url('assets/sprites/sugar_daddy_tobi.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent;
    animation: slideInFromRight 2s ease-out forwards;
    z-index: 1;
}

.orientation-prompt {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    opacity: 1;
    transition: opacity 0.3s ease;
    z-index: 1000;
    color: #FFB400;
}

.rotate-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

.orientation-prompt p {
    font-size: 4vw;
    font-weight: 500;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    max-width: 80%;
    line-height: 1.4;
}

.title-container {
    position: absolute;
    left: 5%;
    top: 35%;
    transform: translateY(-50%);
    text-align: left;
    z-index: 2;
    width: 55%;
}

.title-line1,
.title-line2 {
    font-size: 3.5rem;
    font-weight: bold;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.7);
    margin: 0.2rem 0;
    opacity: 0;
    transform: translateY(50px);
}

.title-line1 {
    animation: fadeInUp 1s ease-out 0.5s forwards;
}

.title-line2 {
    animation: fadeInUp 1s ease-out 1s forwards;
    color: #ffd700;
}

.start-button {
    position: absolute;
    bottom: 20%;
    left: 5%;
    background: #FFB400;
    color: #000;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.3rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3), 0 0 20px rgba(255, 180, 0, 0.4);
    transition: all 0.3s ease;
    z-index: 3;
    opacity: 0;
    animation: fadeIn 1s ease-out 2s forwards;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.start-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.4), 0 0 30px rgba(255, 180, 0, 0.6);
}

.start-button:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3), 0 0 15px rgba(255, 180, 0, 0.5);
}

@keyframes slideInFromRight {
    0% {
        transform: translateY(-50%) translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateY(-50%) translateX(0);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Landscape mode adjustments */
@media screen and (orientation: landscape) {
    .orientation-prompt {
        opacity: 0;
        pointer-events: none;
    }
    
    .title-container {
        left: 5%;
        top: 35%;
        transform: translateY(-50%);
        width: 55%;
    }
    
    .title-line1,
    .title-line2 {
        font-size: 4rem;
    }
    
    #background-image {
        width: 35vw;
        height: 70vh;
        right: 5%;
    }
}

/* Tablet adjustments */
@media screen and (min-width: 768px) {
    .title-line1,
    .title-line2 {
        font-size: 4.5rem;
    }
    
    .start-button {
        font-size: 1.5rem;
        padding: 1.2rem 3.5rem;
    }
    
    .orientation-prompt p {
        font-size: 1.3rem;
    }
    
    .rotate-icon {
        font-size: 4rem;
    }
}

/* Desktop adjustments */
@media screen and (min-width: 1024px) {
    .title-line1,
    .title-line2 {
        font-size: 5rem;
    }
    
    #background-image {
        width: 40vw;
        height: 60vh;
    }
}

/* Fade Overlay */
.fade-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    opacity: 0;
    z-index: 1000;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

.fade-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Story Screen */
#story-screen {
    background: #111;
    justify-content: flex-start;
}

.story-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
}

.story-sprite {
    width: 50%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    position: relative;
}

#character-sprite {
    width: 80%;
    max-width: 300px;
    height: 90%;
    background: url('assets/sprites/tobi_sprite.png') center/contain no-repeat;
    border-radius: 10px;
    opacity: 0;
    transform: translateX(-100px) translateY(100vh);
    animation: spriteFloat 3s ease-in-out infinite;
}

#character-sprite.animate-in {
    animation: spriteEnter 1.5s ease-out forwards, spriteFloat 3s ease-in-out 1.5s infinite;
}

.story-dialogue {
    width: 50%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
}

#dialogue-text {
    font-size: 4vw;
    line-height: 1.8;
    color: white;
    text-align: left;
    margin-bottom: 2rem;
    min-height: 200px;
    max-height: calc(100% - 120px);
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.story-button {
    position: absolute;
    bottom: calc(env(safe-area-inset-bottom, 0px) + max(3rem, 8vh));
    right: calc(env(safe-area-inset-right, 0px) + max(2rem, 5vw));
    max-width: 40vw;
}

@keyframes spriteEnter {
    0% {
        opacity: 0;
        transform: translateX(-100px) translateY(100vh);
    }
    100% {
        opacity: 1;
        transform: translateX(0) translateY(0);
    }
}

@keyframes spriteFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Mobile story screen adjustments (all orientations) */
@media screen and (max-width: 767px) {
    #dialogue-text {
        font-size: 4vw;
        max-height: calc(100% - 80px);
        margin-bottom: 3rem;
        overflow-y: auto;
    }
    
    .story-button {
        bottom: max(0.5rem, 2vh);
        right: max(0.5rem, 2vw);
        font-size: 1rem;
        padding: 0.8rem 2rem;
    }
}

/* Small screen adjustments */
@media screen and (max-width: 480px) {
    .story-dialogue {
        padding: 1rem;
    }
    
    #dialogue-text {
        font-size: 3.5vw;
        max-height: calc(100% - 70px);
        margin-bottom: 2.5rem;
    }
    
    .story-button {
        font-size: 0.9rem;
        padding: 0.7rem 1.8rem;
    }
}

/* iPhone 16 and iOS 18 safe area bug workaround */
@supports (-webkit-appearance: none) {
    @media screen and (max-width: 430px) and (min-height: 800px) {
        .story-button {
            bottom: calc(env(safe-area-inset-bottom, 34px) + max(4rem, 10vh));
        }
    }
}

/* Game Screen */
#game-screen {
    background: #000 url('assets/sprites/backgrounds/Level 1 BG/ToteGrund6.png') center/cover no-repeat;
    overflow: hidden;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden !important;
    max-width: 100vw;
    max-height: 100vh;
}

/* Background Layers */
.background-layer {
    position: absolute;
    width: 100vw;
    height: 100%;
    top: 0;
    background-repeat: no-repeat;
    background-size: 100vw 100%;
    will-change: transform;
}

.far-bg {
    background-image: url('assets/sprites/backgrounds/Level 1 BG/ToteGrund5.png');
    z-index: 1;
}

.near-bg {
    background-image: url('assets/sprites/backgrounds/Level 1 BG/ToteGrund3.png');
    z-index: 2;
}

.mid-bg {
    background-image: url('assets/sprites/backgrounds/Level 1 BG/ToteGrund2.png');
    z-index: 3;
}

.front-bg {
    background-image: url('assets/sprites/backgrounds/Level 1 BG/ToteGrund1.png');
    z-index: 5;
}

/* Player Sprite */
.game-player {
    position: absolute;
    width: 5vw;
    height: 35vh;
    background-image: url('assets/sprites/tobi_sprite.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    left: -10vw;
    top: 32.5vh;
    z-index: 4;
    border-radius: 5px;
    will-change: transform;
}

.game-player.enter {
    animation: playerEnter 2s ease-out forwards;
}

/* Touch Instructions */
.touch-instructions {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: #FFB400;
    padding: min(2rem, 4vw);
    border-radius: 20px;
    text-align: center;
    z-index: 10000;
    font-size: min(4vw, 1.2rem);
    max-width: 80%;
    opacity: 1;
    transition: opacity 0.3s ease;
    animation: pulse 2s ease-in-out infinite;
}

.touch-instructions.hidden {
    opacity: 0;
    pointer-events: none;
}

.touch-instructions {
    pointer-events: none;
}

/* Prevent scrolling and bouncing */
#game-screen {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;
}

/* Prevent zoom and scrolling on touch devices */
* {
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    box-sizing: border-box;
}

/* Force no scrollbars */
*::-webkit-scrollbar {
    display: none !important;
}

* {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

.game-orientation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: #FFB400;
}

.game-orientation.show {
    opacity: 1;
}

/* Animations */

@keyframes playerEnter {
    0% {
        left: -10vw;
    }
    100% {
        left: 5vw;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }
}

/* Game Screen Mobile Adjustments */
@media screen and (max-width: 767px) and (orientation: portrait) {
    .game-orientation {
        opacity: 1;
    }
    
    .touch-instructions {
        font-size: 6vw;
        padding: 1.5rem;
    }
    
    .game-player {
        width: 8vw;
        height: 28vh;
        top: 36vh;
    }
}

/* Game UI Elements */
.hearts-container {
    position: fixed;
    bottom: min(10px, 2vh);
    right: min(10px, 2vw);
    display: flex;
    gap: min(5px, 1vw);
    z-index: 9999;
    max-width: calc(100vw - 4vw);
    max-height: calc(100vh - 4vh);
}

.heart {
    width: min(2.5rem, 6vw, 6vh);
    height: min(2.5rem, 6vw, 6vh);
    background-image: url('assets/sprites/tobi_face.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 1;
    transition: opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease;
    flex-shrink: 0;
}

#heart-1 {
    transform: rotate(3deg);
}

#heart-2 {
    transform: rotate(-2deg);
}

#heart-3 {
    transform: rotate(4deg);
}

.heart.empty {
    opacity: 0.3;
    filter: grayscale(100%);
}

.powerup-status {
    position: fixed;
    bottom: min(10px, 2vh);
    right: calc(min(10px, 2vw) + min(2.5rem, 6vw, 6vh) * 3 + min(5px, 1vw) * 3 + min(10px, 2vw));
    z-index: 9999;
    max-width: calc(100vw - 4vw);
    max-height: calc(100vh - 4vh);
}

.powerup-icon {
    width: min(2.5rem, 6vw, 6vh);
    height: min(2.5rem, 6vw, 6vh);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 1;
    transition: opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease;
    flex-shrink: 0;
    border-radius: 5px;
    animation: powerupPulse 2s ease-in-out infinite;
}

.powerup-icon.shoot {
    background-image: url('assets/sprites/powerups/poppers.png');
}

.powerup-icon.heal {
    background-image: url('assets/sprites/powerups/condoms_1.png');
}

.powerup-icon.invincible {
    background-image: url('assets/sprites/powerups/prep.png');
}

.game-timer {
    position: fixed;
    top: max(20px, 2vh);
    left: 50%;
    transform: translateX(-50%);
    font-size: min(2rem, 6vw);
    font-weight: bold;
    color: #FFB400;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    z-index: 9999;
}

.game-score {
    position: fixed;
    top: max(20px, 2vh);
    left: max(20px, 2vw);
    font-size: min(2rem, 6vw);
    font-weight: bold;
    color: #FFB400;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    z-index: 9999;
}

.sound-toggle {
    position: fixed;
    top: max(10px, 2vh);
    right: max(10px, 2vw);
    display: flex;
    align-items: center;
    gap: min(5px, 1vw);
    z-index: 10001;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    padding: min(5px, 1vw);
    border-radius: 10px;
    transition: background 0.3s ease;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.sound-toggle:hover {
    background: rgba(0, 0, 0, 0.7);
}

.sound-icon {
    width: min(2.5rem, 6vw, 6vh);
    height: min(2.5rem, 6vw, 6vh);
    font-size: min(1.5rem, 4vw, 4vh);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sound-text {
    font-size: min(0.8rem, 3vw);
    font-weight: bold;
    color: #FFB400;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
    white-space: nowrap;
}

#game-objects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    pointer-events: none;
}

.game-object {
    position: absolute;
    width: 5vw;
    height: 5vh;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    will-change: transform;
    transition: none;
}

.game-object.powerup {
    width: 20vh;
    height: 20vh;
}

.enemy {
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 5px;
    width: 5vw;
    height: 35vh;
}

.enemy.cruiser1 {
    background-image: url('assets/sprites/backgrounds/Level 1 BG/cruiser_1.png');
}

.enemy.cruiser2 {
    background-image: url('assets/sprites/backgrounds/Level 1 BG/cruiser_2.png');
}

.enemy.cruiser3 {
    background-image: url('assets/sprites/backgrounds/Level 1 BG/cruiser_3.png');
}

.enemy.fboy1 {
    background-image: url('assets/sprites/backgrounds/Level 2 BG/fboy_1.png');
}

.enemy.fboy2 {
    background-image: url('assets/sprites/backgrounds/Level 2 BG/fboy_2.png');
}

.enemy.dubai_brudi {
    background-image: url('assets/sprites/backgrounds/Level 3 BG/dubai_brudi.png');
}

.enemy.dubai_brudi_2 {
    background-image: url('assets/sprites/backgrounds/Level 3 BG/dubai_brudi_2.png');
}

.powerup {
    border-radius: 10px;
    width: 20vh;
    height: 20vh;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.powerup.shoot {
    background-image: url('assets/sprites/powerups/poppers.png');
}

.powerup.shoot.variant2 {
    background-image: url('assets/sprites/powerups/poppers2.png');
}

.powerup.heal {
    background-image: url('assets/sprites/powerups/condoms_1.png');
}

.powerup.heal.variant2 {
    background-image: url('assets/sprites/powerups/condoms_2.png');
}

.powerup.invincible {
    background-image: url('assets/sprites/powerups/prep.png');
}

.player-shooting {
    box-shadow: 0 0 20px #ffffff, 0 0 40px #ffffff;
    animation: shootingGlow 0.5s ease-in-out infinite alternate;
}

.player-invincible {
    box-shadow: 0 0 20px #00ff00, 0 0 40px #00ff00;
    animation: invincibleGlow 0.3s ease-in-out infinite alternate;
}

.bullet {
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    position: absolute;
    z-index: 6;
    box-shadow: 0 0 5px white;
}

@keyframes shootingGlow {
    from { filter: brightness(1); }
    to { filter: brightness(1.5); }
}

@keyframes invincibleGlow {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

.player-damage-blink {
    animation: damageBlink 1s ease-in-out;
}

@keyframes damageBlink {
    0%, 100% { opacity: 1; }
    10%, 30%, 50%, 70%, 90% { opacity: 0.3; }
    20%, 40%, 60%, 80% { opacity: 1; }
}

/* Game Over Screen */
#game-over-screen {
    background: #000;
    justify-content: center;
    align-items: center;
}

.game-over-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: relative;
    padding-top: 10vh;
}

.game-over-hearts {
    display: flex;
    gap: 2rem;
    height: 30vh;
    align-items: center;
    opacity: 0;
    position: absolute;
    top: 15vh;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
}

.game-over-heart {
    width: 25vw;
    height: 30vh;
    background-image: url('assets/sprites/tobi_face.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: grayscale(100%);
    opacity: 0.3;
    position: relative;
}

.game-over-heart.full {
    filter: none;
    opacity: 1;
}

.game-over-text {
    font-size: min(8rem, 15vw);
    font-weight: bold;
    color: #ff0000;
    text-shadow: 4px 4px 8px rgba(0,0,0,0.8);
    text-align: center;
    opacity: 0;
    transform: scale(0.5);
    position: absolute;
    top: 20vh;
    left: 50%;
    transform: translateX(-50%) scale(0.5);
    width: 100%;
}

.retry-button {
    opacity: 0;
    transform: translateY(50px);
    position: absolute;
    bottom: 20vh;
    left: 50%;
    transform: translateX(-50%) translateY(50px);
}

/* Game Over Animations */
.game-over-hearts.fade-in {
    animation: heartsAppear 1s ease-out forwards;
}

.game-over-heart.fade-out {
    animation: heartFadeOut 1s ease-out forwards;
}

.game-over-heart.fall-out {
    animation: heartFall 1.5s ease-in forwards;
}

.game-over-text.fade-in {
    animation: gameOverTextAppear 1s ease-out forwards;
}

.retry-button.appear {
    animation: retryButtonAppear 0.5s ease-out forwards;
}

@keyframes heartsAppear {
    to {
        opacity: 1;
    }
}

@keyframes heartFadeOut {
    to {
        filter: grayscale(100%);
        opacity: 0.3;
    }
}

@keyframes heartFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.3;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes gameOverTextAppear {
    to {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}

@keyframes retryButtonAppear {
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@media screen and (orientation: landscape) {
    .game-orientation {
        opacity: 0;
    }
    
    .game-over-heart {
        width: 15vw;
        height: 30vh;
    }
    
    .game-over-hearts {
        gap: 3rem;
    }
}

/* Level 3 Victory Animations */
@keyframes confettiFall {
    0% {
        transform: translateY(-10px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes thankYouFadeIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes powerupPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes level2Blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

.near-bg.level2-blinking {
    animation: level2Blink 1s ease-in-out infinite !important;
}

.background-layer.near-bg.level2-blinking {
    animation: level2Blink 1s ease-in-out infinite !important;
}

@keyframes level2SpriteSpin1 {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes level2SpriteSpin-1 {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(-360deg);
    }
}

@keyframes level2SpriteFly {
    from {
        left: 100vw;
    }
    to {
        left: -20vh;
    }
}

@keyframes nyanCatMoveMiddle {
    0% {
        top: 40vh;
    }
    50% {
        top: 55vh;
    }
    100% {
        top: 40vh;
    }
}

@keyframes nyanCatSizeMiddle {
    0% {
        width: 21vw;
    }
    50% {
        width: 17.5vw;
    }
    100% {
        width: 21vw;
    }
}

@keyframes nyanCatMoveTop {
    0% {
        top: 36vh;
    }
    50% {
        top: 51vh;
    }
    100% {
        top: 36vh;
    }
}

@keyframes nyanCatSizeTop {
    0% {
        width: 16.8vw;
    }
    50% {
        width: 14vw;
    }
    100% {
        width: 16.8vw;
    }
}

@keyframes nyanCatMoveBottom {
    0% {
        top: 50vh;
    }
    50% {
        top: 65vh;
    }
    100% {
        top: 50vh;
    }
}

@keyframes nyanCatSizeBottom {
    0% {
        width: 16.8vw;
    }
    50% {
        width: 14vw;
    }
    100% {
        width: 16.8vw;
    }
}

/* Enemy Speech Bubbles */
.enemy-speech-bubble {
    position: absolute;
    width: 10vw;
    min-height: 2vh;
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 0.3vh 0.5vw;
    font-size: min(0.7rem, 2.5vw);
    font-weight: bold;
    z-index: 7;
    pointer-events: none;
    word-wrap: break-word;
    line-height: 1.2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s ease;
    left: calc(100% + 0.5vw);
    top: -1vh;
}

.enemy-speech-bubble.show {
    opacity: 1;
    transform: scale(1);
}

.enemy-speech-bubble::after {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 6px solid rgba(255, 255, 255, 0.95);
}