/* --- Global Reset & Page Layout --- */
body {
    margin: 0;
    padding: 0;
    width: 100%; 
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100dvh;
    overflow-y: auto;
    font-family: 'Press Start 2P', cursive;
    background-image: url('assets/background/background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-color: #1a1a1a;
}

.top-banner-wrapper {
    position: relative; /* Added to constrain the absolute positioned logo */
    width: 100%;
    background-color: rgba(26, 51, 28, 0.8);
    border-bottom: 3px solid #FFD700; 
    padding: 10px;
    display: flex;
    justify-content: space-between; /* Spreads logo and social icons apart */
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px; /* Pushes the game canvas down slightly */
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.3); 
}

.top-banner-wrapper .top-logo-link {    
    margin-left: 20px;            
    top: auto;             
    transform: none;       
    z-index: auto;        
    transition: transform 0.2s;
}

.top-banner-wrapper .top-logo-link:hover {
    transform: scale(1.1); 
}

.top-logo-link img {
    width: 80px;    
    height: auto;   
    display: block;
}

/* --- Top Banner Specific Ticker --- */
.top-news-ticker {
    flex: 1;                /* Allows it to fill the middle space */
    text-align: center;     /* Centers the text */
    overflow: hidden;
    white-space: normal; 
    line-height: 1.25;
    color: #faeb89; 
    font-size: 16px;        /* Slightly larger for visibility */
    font-weight: bold;      /* Makes the text bold */
    padding: 8px;
    margin-right: 80px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.top-ticker-content {
    display: inline-block;
    padding-left: 0;        /* Removes the scroll offset */
    animation: none;        /* Stops the animation */
}

/* --- Title Wrapper --- */
.title-wrapper {
    display: flex;
    justify-content: center;
    margin-top: -10px;
    margin-bottom: -15px;
    width: 100%;
}

.title-wrapper img {
    width: 60vw;
    max-width: 680px;
    max-height: 80vh;
    height: auto;
    object-fit: contain;
    display: block;
    transform: scale(1); 
    image-rendering: pixelated; 
}


/* --- Game Container --- */
#game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 0px;
    width: 100%;
}

#gameCanvas {
    aspect-ratio: 16 / 9;
    width: 90vw;
    max-width: 960px;
    max-height: 80vh;
    height: auto;
    display: block; /* Cleaned up duplicate */
    background-color: #87CEEB;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    image-rendering: pixelated;

    box-sizing: border-box; 
    border: none;
    outline: none;
}


/* --- Bottom Banner --- */
.bottom-banner-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    overflow-x: hidden;
    align-self: stretch;
    background-color: rgba(26, 51, 28, 0.8);
    border-top: 3px solid #FFD700; 

    flex-wrap: wrap;
    justify-content: center;
    padding-top: 20px; 
    padding-bottom: 0px;
    margin-top: auto;
    box-shadow: 0px -4px 10px rgba(0, 0, 0, 0.3);
}

.news-ticker {
    width: 90%;
    overflow: hidden; /* Hides the text as it scrolls out of view */
    white-space: nowrap; /* Keeps text on one line */
    color: #faeb89; /* Matches your yellow theme */
    font-size: 10px; /* Small font size for the ticker */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    padding: 4px;
    border-radius: 4px;
    align-self: center; 
    margin-top: 0;
    margin-bottom: 0;
}

/* The Scrolling Animation */
.ticker-content {
    display: inline-block;
    padding-left: 100%;
    animation-name: marquee;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

@keyframes marquee {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-75%, 0); }
}


/* --- Social Footer UI --- */
#social-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 15px;
    gap: 0px;
}

.footer-content {
    display: flex;
    gap: 20px;
}

.icon-square {
    width: 45px;
    height: 45px;
    background-image: url('assets/ui/btn.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s;
}

.icon-square:hover {
    transform: scale(1.1);
}

#social-footer img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    transition: transform 0.2s;
}

#social-footer img:hover {
    transform: scale(1.1);
}

.footer-links {
    display: flex;
    gap: 20px;
}

.copyright {
    color: #faeb89;
    text-align: center;
    font-size: 6px;
    margin-top: 15px;
    padding-bottom: 6px;
    font-family: 'Press Start 2P', cursive;
    letter-spacing: 0.1px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);

    max-width: 500px; /* Adjust this to control when it breaks */
    word-wrap: break-word;
    line-height: 1.5;
    margin-left: auto;
    margin-right: auto;
}

.icon-square button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Ensures the share icon inside the button matches your other social icons */
.icon-square button img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    transition: transform 0.2s;
}



/* --- Controls UI --- */
#controls {
    display: flex;
    justify-content: center;
    gap: 3px;
    margin-top: 25px;
    width: 100%;
    margin-bottom: 25px;
}

.control-btn {
    font-family: 'Press Start 2P', cursive;
    font-size: 16px;
    width: 160px;
    height: 120px;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #faeb89;
    text-shadow: 3px 3px 2px black;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent;
}

.control-btn:active { 
    transform: scale(1.05); 
    filter: brightness(1.5); 
}

#leftBtn { background-image: url('assets/ui/btn_tap.png'); }
#jumpBtn { background-image: url('assets/ui/btn_tap.png'); }
#rightBtn { background-image: url('assets/ui/btn_tap.png'); }


