/* Updated CSS */

/* Basic layout and styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@font-face {
    font-family: 'Showboat';
    src: url('frontend/font-library/Showboat.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* Body Styling */
body {
    font-family: 'Showboat', sans-serif;
    color: rgb(42, 1, 1);
    font-size: 1.5rem; 
    text-shadow: 0 0 23px #f4bd1a;
    line-height: 1.6;
    border-style:solid;
    border-width:2px;
    border-color:black;
    min-height: 100vh; 
    display: flex;
    flex-direction: column;
    z-index: 25;
}

/* Header Styling */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-image: url('frontend/images/banner.png');
    background-size: cover;
    background-position: center;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.header-content h1 {
    color: rgb(14, 8, 1);
    font-size: 4rem; 
    text-shadow: 0 0 16px #ffd700;
}

/* Game Container - Ensure players stay side by side */
#game-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100vh;
    position: relative;
    overflow: hidden; /* Prevent images from overflowing out of the screen */
    /* Game Container Background */
#game-container {
    position: relative;
    z-index: 1; /* Ensures content is above the background */
    background: linear-gradient(135deg, #3e2c2f, #7a4f3e, #b5a18d, #e6d2b3); /* Antique smoky gradient */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 100vh;
    filter: blur(1px); /* Slight blur effect for the background */
}

/* Optional: Add a dark semi-transparent overlay to keep content clear */
#game-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2); /* Dark overlay */
    z-index: -1; /* Keeps it behind the content */
}

/* Smoke Animation */
@keyframes smoke {
    0% {
        opacity: 0.4;
        transform: translateY(-10px);
    }
    50% {
        opacity: 0.6;
        transform: translateY(5px);
    }
    100% {
        opacity: 0.4;
        transform: translateY(-10px);
    }
}

/* Smoke Effect */
.smoke {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.3); /* Light smoke color */
    border-radius: 50%;
    animation: smoke 5s infinite ease-in-out;
    filter: blur(5px);
    transform: translate(-50%, -50%);
    opacity: 0.5;
    animation-delay: 0s;
}

.smoke:nth-child(2) {
    animation-delay: 2s;
    left: 60%;
}

.smoke:nth-child(3) {
    animation-delay: 4s;
    left: 40%;
}

/* Optional: Adjust visibility or transparency for elements */
#game-container * {
    position: relative;
    z-index: 2; /* Ensures game content stays above the background */
}

}

/* Players Container - Position images side by side */
#players-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    position: absolute;
    width: 70%; /* Keep both players side by side */
    max-width: 100%; /* Ensure it doesn't overflow */
    transition: transform 0.5s ease-in-out; /* Smooth gliding effect */
}

/* Player 1 image */
#player1-strongman {
    width: 300px;
    height: 300px;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease-in-out;
}

/* Player 2 image */
#player2-strongman {
    width: 300px;
    height: 300px;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease-in-out;
}

#player1-strongman {
    background-image: url('images/player1.png');
}

#player2-strongman {
    background-image: url('images/player2.png');
}

/* Game info container  */
#game-info-container {
    position: absolute;
    top: 15%; 
    right: 10%;
    width: 30%;
    text-align: center;
    z-index: 17; 
    font-size: 1rem;
    background-color:cream;
    color: brown;
    padding: 10px;
    border-radius: 10px;
}

/* Match Info Section */
#match-info {
    margin-bottom: 10px;
}

#back-to-arcade-btn {
    background-color: #f44336; /* Red color for "Back to Arcade" */
}

#back-to-arcade-btn:hover {
    background-color: #e53935;
}

/* Match Count and Winner Section */
#match-count, #winner, #trophy {
    text-align: center;
    font-family: 'Showboat';
}


/* Strength bar */
.strength-bar {
    width: 80%;
    height: 30px;
    margin: 200px auto;
    background-color: #e74d4d;
}

#player1-strength-bar, #player2-strength-bar {
    margin-top: 15px;
    left: 40%;
    background-color: rgb(237, 10, 52);
    box-shadow: #f4c405 0px 10px 30px 50px;;
    
}
    

/* FIXED: Comic Book Style Chat Bubbles */
#player1-chat, #player2-chat {
    position: absolute;
    width: 180px;
    padding: 15px;
    background-color: #fff;
    color: #000;
    border: 3px solid #000;
    border-radius: 20px;
    font-size: 14px; /* Reduced font size */
    z-index: 25;
    visibility: hidden; /* Initially hidden */
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
    /* Comic book style */
    font-family: 'Comic Sans MS', cursive, sans-serif;
    text-shadow: none; /* Remove text shadow for better readability */
}

/* Position the chat bubbles above each character */
#player1-chat {
    top: 100px;
    left: 20%;
}

#player2-chat {
    top: 100px;
    right: 20%;
}

/* Add speech bubble tails */
#player1-chat::after, #player2-chat::after {
    content: '';
    position: absolute;
    bottom: -15px;
    width: 20px;
    height: 20px;
    background-color: #fff;
    border-right: 3px solid #000;
    border-bottom: 3px solid #000;
    transform: rotate(45deg);
}

#player1-chat::after {
    left: 30px;
}

#player2-chat::after {
    right: 30px;
}

#crowd-bar {
    width: 0%;
    height: 20px;
    background-color: #ff0066;
}

/* FIXED: Mash Button Container - Positioning */
#mash-button-container {
    position: fixed;
    top: 70%; 
    left: 10%; 
    transform: translate(-50%, -50%);
    z-index: 2000;
}

/* FIXED: Large, Round, Glowing Mash Button */
#mash-button {
    position: relative;
    width: 140px;
    height: 140px;
    font-size: 1.5em;
    background-color: #268b7e;
    color: rgb(237, 154, 10);
    border: none;
    outline: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(255, 0, 102, 0.7);
    font-weight: bold;
    text-shadow: 0 0 8px #000;
    z-index: 2000;
    transition: transform 0.1s, box-shadow 0.1s;
}

#mash-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 70px rgba(71, 11, 35, 0.9);
}

#mash-button:active {
    transform: scale(0.95);
}

/* FIXED: Button bubbles animations */
#mash-button::before, #mash-button::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    pointer-events: none;
}

#mash-button::before {
    top: -70%;
    background-image:
        radial-gradient(circle, transparent 15%, #ff0066 20%, transparent 30%),
        radial-gradient(circle, transparent 15%, #ff0066 20%, transparent 30%),
        radial-gradient(circle, transparent 15%, #ff0066 20%, transparent 30%),
        radial-gradient(circle, transparent 15%, #ff0066 20%, transparent 30%);
    background-size: 20% 20%, 15% 15%, 18% 18%, 20% 20%;
    background-position: 20% 40%, 40% 60%, 60% 80%, 80% 20%;
}

#mash-button::after {
    bottom: -70%;
    background-image:
        radial-gradient(circle, transparent 15%, #ff0066 20%, transparent 30%),
        radial-gradient(circle, transparent 15%, #ff0066 20%, transparent 30%),
        radial-gradient(circle, transparent 15%, #ff0066 20%, transparent 30%),
        radial-gradient(circle, transparent 15%, #ff0066 20%, transparent 30%);
    background-size: 20% 20%, 15% 15%, 18% 18%, 20% 20%;
    background-position: 20% 60%, 40% 80%, 60% 20%, 80% 40%;
}

/* FIXED: Bubble animations */
@keyframes topBubbles {
    0% {
        background-position: 20% 40%, 40% 60%, 60% 80%, 80% 20%;
        opacity: 0;
    }
    50% {
        background-position: 10% 30%, 30% 50%, 50% 70%, 70% 10%;
        opacity: 1;
    }
    100% {
        background-position: 0% 20%, 20% 40%, 40% 60%, 60% 0%;
        opacity: 0;
    }
}

@keyframes bottomBubbles {
    0% {
        background-position: 20% 60%, 40% 80%, 60% 20%, 80% 40%;
        opacity: 0;
    }
    50% {
        background-position: 10% 50%, 30% 70%, 50% 10%, 70% 30%;
        opacity: 1;
    }
    100% {
        background-position: 0% 40%, 20% 60%, 40% 0%, 60% 20%;
        opacity: 0;
    }
}

#mash-button.bubble-animate::before {
    animation: topBubbles 1s ease-in-out forwards;
}

#mash-button.bubble-animate::after {
    animation: bottomBubbles 1s ease-in-out forwards;
}

/* Container for Trophy */
#trophy-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    display: none;
    text-align: center;
    font-size: 3rem;
}

/* Style for the trophy element */
#trophy {
    display: none;
    font-size: 3rem;
    color: gold;
    text-align: center;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(255, 223, 0, 0.8);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    animation: trophy-glow 1.5s ease-in-out infinite;
}

/* Animation for glowing effect */
@keyframes trophy-glow {
    0% {
        text-shadow: 0 0 15px gold, 0 0 25px gold, 0 0 35px gold;
    }
    50% {
        text-shadow: 0 0 25px gold, 0 0 35px gold, 0 0 45px gold;
    }
    100% {
        text-shadow: 0 0 15px gold, 0 0 25px gold, 0 0 35px gold;
    }
}


/* Cigar-shaped Back to Arcade Button */
#back-to-arcade-btn {
    position: fixed;
    right: 40px;
    top: 50%;
    transform: rotate(45deg) translateY(-50%);
    z-index: 2000;
    background: linear-gradient(to right, #8B4513, #A0522D, #CD853F);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 15px 30px;
    font-family: 'Showboat', sans-serif;
    font-size: 1.2rem;
    text-shadow: 0 0 5px #FFF;
    box-shadow: 
        0 0 10px 2px rgba(255, 165, 0, 0.6),
        0 0 20px 5px rgba(255, 69, 0, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    /* Make it look like a cigar */
    width: 200px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Cigar glow effect */
#back-to-arcade-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at 15% 50%, 
        rgba(255, 69, 0, 0.8) 0%, 
        rgba(255, 69, 0, 0) 60%
    );
    animation: cigarGlow 2s infinite alternate;
}

/* Cigar ash tip */
#back-to-arcade-btn::after {
    content: '';
    position: absolute;
    left: 5px;
    width: 12px;
    height: 80%;
    background: rgba(169, 169, 169, 0.8);
    border-radius: 50% 0 0 50%;
}

/* Hover effect */
#back-to-arcade-btn:hover {
    background: linear-gradient(to right, #A0522D, #CD853F, #DEB887);
    box-shadow: 
        0 0 15px 4px rgba(255, 165, 0, 0.8),
        0 0 30px 8px rgba(255, 69, 0, 0.6);
    transform: rotate(45deg) translateY(-50%) scale(1.05);
}

@keyframes cigarGlow {
    0% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.7;
    }
}

/* Cigar "smoke" animation */
#back-to-arcade-btn .smoke {
    position: absolute;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    right: -10px;
    top: -10px;
    pointer-events: none;
    opacity: 0;
}

#back-to-arcade-btn .smoke:nth-child(1) {
    animation: smoke 3s linear infinite;
}

#back-to-arcade-btn .smoke:nth-child(2) {
    animation: smoke 3s linear 1s infinite;
}

#back-to-arcade-btn .smoke:nth-child(3) {
    animation: smoke 3s linear 2s infinite;
}

@keyframes smoke {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(1);
    }
    10% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
        transform: translate(20px, -60px) scale(3);
    }
}

/* Enhanced Beer Mug Button (Play Game Button)*/ 
#play-game-btn {
    position: fixed;
    top: -20%; 
    left: calc(10.5% - 650px); 
    transform: translateY(-50%);
    width: 100px; 
    height: 180px;
    background: linear-gradient(180deg, rgba(255,223,0,0.8) 0%, rgba(255,190,0,0.9) 50%, rgb(249, 160, 5) 100%); /* Amber beer color */
    border: none;
    border-radius: 5px 5px 15px 15px;  
    cursor: pointer;
    transition: transform 0.3s ease;
    position: relative;
    box-shadow: 0 0 10px rgba(70, 42, 3, 0.3) inset;
    overflow: visible;;
    z-index: 2000;
}

/* Beer foam */
#play-game-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background-color: rgb(218, 201, 149);
    border-radius: 5px 5px 0 0;
    box-shadow: 0 0 5px rgba(192, 121, 15, 0.8) inset;
    z-index:2030
}

/*Mug handle */
#play-game-btn::after {
    content: "";
    position: absolute;
    top: 20px;
    right: -30%;
    width: 25px;
    height: 100px;
    background: transparent;
    border: 9px solid #836c28;
    border-left: none;
    border-radius: 0 10px 10px 0;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5) inset;
    z-index:3000;
}

/* Text "Play" in cursive */
.play-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-20deg);
    font-family: 'Showboat', cursive;
    font-size: 24px;
    color: rgb(85, 12, 12);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    z-index: 10;
}
 /* Beer bubbles */
 .bubble {
    position: absolute;
    background: rgba(255, 270, 290, 0.7);
    border-radius: 50%;
    animation: bubble 3s infinite ease-in;
    z-index:2050;
}

@keyframes bubble {
    0% {
        transform: translateY(60px);
        opacity: 0;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(5px);
        opacity: 0;
    }
}

 /* Glass shine effect */
.shine {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(237, 231, 183, 0.3) 0%, rgba(255,255,255,0) 50%);
    pointer-events: none;
    z-index: 2070;
}

 /*Hover effects */
#play-game-btn:hover {
    transform: scale(1.05) translateY(-50%);
}
/* Active effects */
#play-game-btn:active {
    transform: scale(0.95) translateY(-50%);
}

/* Footer Styling */
#footer {
    background-color: #eaaf0c;
    color: #ee076b;
    font-family: 'Showboat', sans-serif;
    font-size: 1rem;
    text-shadow: 0 0 13px #edece7;
    padding: 2px 0;
    text-align: center;
    position: fixed;
    left: 0;
    bottom: 90%;
    width: 100%;
    z-index: 2050;
}