@font-face {
    font-family: 'Area InkTrap';
    src: url("../fonts/AreaInktrapSemibold/AreaInktrap-Semibold.woff2") format('woff2'),
         url("../fonts/AreaInktrapSemibold/AreaInktrap-Semibold.woff") format('woff');
    font-weight: 400;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Area InkTrap';
    /* overflow-x: hidden; */
}

body {
    /* font-size: smaller; */
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    background-color: #000000;
    font-size: smaller;
    overflow-x: hidden;
}

html {
    overflow-x: hidden;
}

.fullscreen {
    cursor: none;
    overflow: hidden;
}

body {
    overflow: auto;
    scrollbar-width: none; /* For Firefox */
}

/* For Webkit browsers (Chrome, Safari, Opera) */
body::-webkit-scrollbar {
    display: none;
}

#text2imagepanel {
    border: 1px solid #505050;
    width: 90%;
    height: 450px;
    margin: 0px 0 0px 0;
}

button {
    text-transform: uppercase;
    padding: 4px 7px 4px 7px;
    border: 1px solid #707070;
    width: 60px;
    height: 40px;
    background: #3C3C3C;
    color: white;
    overflow:hidden;

}

button:hover {
    background: #00f256;
    color: #000000;
}

button:active {
    color: white;
}

button.down {
    color: black;
    background-color: white;
}

button.selected {
    background: #00f256;
    color: #000000 !important;
}

#leftButton,
#rightButton {
    width: 24px;
    height: 20px;
    line-height: 10px;
}

#autoButton,
#resetButton,
#randomPlantsButton,
#randomEmittersButton,
#randomHerbivoresButton,
#randomDiseaseButton,
#dataButton,
#messagingButton,
#loggingButton,
#saveScreenshotButton,
#fullscreenButton,
#randomOffspringButton,
#endlessButton,
#databaseButton,
#latestGardenButton,
#previewPlantsButton,
#listsButton {
    height: 21px;
    line-height: 12px;
    text-wrap: nowrap;
    width: auto;
}

#selectionLists {
    display: none;
}

label {
    color: white;
    text-wrap: nowrap;
}

h1 {
    font-size: 34px;
    margin-bottom: 0px;
    padding-bottom: 0px;
    line-height: 1em;
}

h2 {
    font-size: 24px;
    margin: 0px 0px 20px 0px
}

a {
    color: white;
}

a:visited {
    color: white;
}

#page {
    margin: 10px 20px 10px 20px;
    display: block;
    justify-content: center;
    align-items: center;
}

#headerpage {
    margin: 0px 0px 0px 0px;
    display: block;
    justify-content: center;
    align-items: center;
}

#header-container {
    width: 90%;
    text-align: left;
    margin: 30px 0 1px 0;
}

#header-container span {
    background-color: #b2a358;
    /* padding: 1px 7px; */
}

#headerpanel {
    margin: 0px 0px -8px 0px;
}

#aiconsole {
    height: 200px;
    overflow-y: hidden;
}

#statuspanel {
    width: 90%;
    text-align: right;
    margin: 0px 0 36px 0;
}

#statuspanel span {
    background-color: #19b4c5;
    padding: 0px 0px;
    display: inline-flex;
}

#statuspanel span ul li:first-child {
    padding: 1px 0px 1px 7px;
}

#statuspanel span ul li:last-child {
    padding: 1px 7px 1px 0px;
}

#statuspanel ul li {
    display: inline-block;
    text-transform: uppercase;
}

#simulationCanvas {
    border: 1px solid #505050;
    width: 90%;
    height: 450px;
    margin: 0px 0 0px 0;
}

#header-container {
    width: 90%;
    text-align: left;
    margin: 30px 0 1px 0;
}

#header-container span {
    background-color: #00f256;
    padding: 1px 7px 1px 7px;
    color: #000000 !important;
}

#timer-container {
    width: 90%;
    text-align: right;
    margin: 1px 0 28px 0;
}

#timer-container span {
    background-color: #19b4c5;
    padding: 1px 7px;
}

#timeLabel {
    width: 3ch;
    display: inline-flex;
}

.scenario-selector {
    /* margin: 8px 0 8px -3px; */
    min-width: 180px;
    height: 21px;
    line-height: 10px;
    -webkit-appearance: none;
    appearance: none;
    -webkit-border-radius: 1px;
    border-radius: 1px;
    background: url(../images/dropdown.svg) no-repeat;
    background-position: right center;
    background-color: #3C3C3C;
    color: white;
    border: 1px solid #707070;
    padding: 1px 24px 0px 4px;
    /* font-family: 'Courier New', Courier, monospace; */
    font-family: area-inktrap, sans-serif;
    /* font-size: small; */
    text-transform: uppercase;
}

.slider-label {
    display: inline-block;
    width: 200px;

}

.scenario-selector label {
    display: inline-block;
    width: 270px;
}

.scenario-selector select {
    width: 170px;
    height: 20px;
    -webkit-appearance: none;
    appearance: none;
    -webkit-border-radius: 1px;
    border-radius: 1px;
    background: url(dropdown.svg) no-repeat;
    background-position: right center;
    background-color: #3C3C3C;
    color: white;
    border: 1px solid #707070;
    padding: 1px 0 1px 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: small;
}

.slider-value {
    display: inline-block;
    width: 60px;
}

input[type=range] {
    width: 50vw;
    background-color: #b2a358;
}

#header-container span.navigation {
    float: right;
    padding: 0px;
    background: none;
    overflow: auto;
}

@keyframes flash {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.flashing-word {
    animation: flash 1s infinite;
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.fade-out {
    animation: fadeOut 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}
/* Apply the animation to messages */
.message {
    opacity: 1; /* Ensure messages are fully visible after fading in */
}

/*Chrome*/
@media screen and (-webkit-min-device-pixel-ratio:0) {
    input[type='range'] {
        overflow: hidden;
        -webkit-appearance: none;
        background-color: #ff9770;
    }

    input[type='range']::-webkit-slider-runnable-track {
        height: 10px;
        -webkit-appearance: none;
        color: #a2d2ff;
        margin-top: -1px;
    }

    input[type='range']::-webkit-slider-thumb {
        width: 10px;
        -webkit-appearance: none;
        height: 10px;
        cursor: ew-resize;
        background: #a2d2ff;
        box-shadow: -200px 0 0 200px #4F4F4F;
    }

}

/* CSS for fullscreen in landscape mode */
@media screen and (orientation: landscape) {
    #gardenCanvas {
        width: 100vw;
        height: 100vh;
    }
}

@media screen and (orientation: portrait) {
    #gardenCanvas {
        width: 100%;
        height: auto;
    }
}

.buttons-container {
    display: inline-table;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    width: 90%;
}

.slider-container {
    display: inline-table;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    width: 90%;
}

.slider-container input[type="range"] {
    width: 300px;
    margin: 0 10px;
}

.debug-panel {
    width: 90%;
    margin-top: 20px;
    white-space: pre-wrap;
    display: none;
}

#messageQueue {
    width: 90%;
    margin-top: 20px;
    margin-bottom: 20px;
    display: none;    
    overflow: hidden;
    font-size: 11px;
    color: #B0B0B0;
    line-height: 17px;
    height: calc(9lh);
}

.white {
    color:white;
}

.orange {
    color:#FF9770;
}

.green {
    color:#00f256;
}

.pink {
    color:#F49FBC;
}

.blue {
    color:#A2D2ff;
}

.important {
    color:#0dcbc8;
}

.simulation-container {
    display: flex;
    width: 90%;
    height: 550px;
}

#gardenCanvas,
#resourceCanvas,
#typesCanvas {
    height: 550px;
    border: 1px solid #505050;
}

#gardenCanvas {
    width: 50%;
    z-index: 1;
    position: static;
}

#resourceCanvas {
    width: 35%;
    position: static;
    z-index: 1;
}

#typesCanvas {
    width: 15%;
    position: static;
    z-index: 1;
}

/* Fullscreen mode styles */
.fullscreen #gardenCanvas {
    width: 100%;
    height: 100%;
}

/* Fullscreen mode styles */
.fullscreen #resourceCanvas,
.fullscreen #typesCanvas {
    width: 450px;
    /* Smaller size */
    height: 400px;
    position: fixed;
    top: 20px;
    z-index: 2;
}

.fullscreen #resourceCanvas {
    left: 20px;
}

.fullscreen #typesCanvas {
    right: 20px;
}

#progressBar {
    display: none;
}

.fullscreen #progressBar {
    left: 72px;
    position: fixed;
    bottom: 250px;
    z-index: 999;
    width: 1px;
    height: 1px;
    display: block;
    background-color: #FF9770;
}

.fullscreen #messageQueue {
    font-size: 11px;
    left: 72px;
    position: fixed;
    bottom: 90px;
    z-index: 999;
    width: 500px;
    height: 140px;
    color: #B0B0B0;
    padding-top: 6px;
}

.fullscreen #messageQueue::before {
    content: ''; /* Required for the pseudo-element */
    position: absolute;
    top: 0px;
    width: 360px;
    height: 1px;
    background-color: #505050;
}

/* Mobile view: Make canvases fill 100% of the width */
@media screen and (max-width: 768px) {

    #autoButton {
        width: 170px;
    }

    #header-container {
        width: 100%;
        /* padding: 8px; */
    }

    .buttons-container {
        display: grid;
        width: 100%;
        margin-top: 14px;
    }

    .slider-container {
        display: flex;
        width: 100%;
        padding: 8px;
        margin-top: 0px;
    }

    .simulation-container {
        display: block;
        width: 100%;
        height: auto;
    }

    .debug-panel {
        display: block;
        width: 100%;
        /* height: 550px; */
        padding: 0px 10px;
    }

    #gardenCanvas,
    #resourceCanvas,
    #typesCanvas {
        width: 100%;
        /* Full viewport width */
        height: 100vh;
        /* position: relative; */
        z-index: 1;
        border: none;
        /* display: block; */
    }

    #resourceCanvas,
    #typesCanvas {
        height: 50vh;
        /* position: relative; */
        z-index: 1;
        border: none;
        /* display: block; */
    }

    /* Stack canvases vertically on smartphones */
    #gardenCanvas {}

    #resourceCanvas {}

    #typesCanvas {}

    /* Fullscreen mode styles */
    .fullscreen #resourceCanvas,
    .fullscreen #typesCanvas {
        display: none;
    }

    #messageQueue {
        padding: 0px 0px 0px 12px;
        /* border: 1px solid red; */
        width: 100%;
        color: #B0B0B0;
    }

    .fullscreen #resourceCanvas {}

    .fullscreen #typesCanvas {}

    .fullscreen #messageQueue {}

}

@media screen and (orientation: landscape) and (max-width: 768px) {

    #resourceCanvas,
    #typesCanvas,
    #messageQueue {
        width: 49vw;
        height: 100vh;
    }
}