@font-face {
    font-family: "jfont";
    src: url("assets/roboto-remix-font/Minecraftchmc-dBlX.ttf");
    size-adjust: 150%;
}

@font-face {
    font-family: "digital";
    src: url("assets/digital-font/DigitalNormal-xO6j.otf");
}

@font-face {
    font-family: "moonhouse";
    src: url("assets/moonhouse-font/Moonhouse-yE5M.ttf");
}

@font-face {
    font-family: "text-me-one";
    src: url("assets/text-me-one/TextMeOne-yZa3.ttf");
    size-adjust: 120%;
}


li{
    list-style-type: none;
    padding: 0.1em;
}

input[type="text"]{
    appearance: none;
}

body{
    background-image: url('assets/spaceBG_tilable.jpg');
    background-position: center;
    color: white;
    font-weight: bold;
}

#game{
    font-family: 'text-me-one';
}

#title-banner{
    font-family: 'jfont';
    font-size: 6.5em;
    line-height: 1em;
    text-align: center;
    margin: 1rem;
    padding: 0.1rem;

    transform: perspective(200px) rotate3d(1,0,0,25deg);
}

@media screen and (max-width:500px){
    #title-banner{
	font-size: 3.5em;
    }
}

#jokes ul{
    padding: 0;
    font-size: 1.25rem;
    text-align: center;

    width: 100%;
}

#jokes li{
    width: 14.28%;
}

/* following is to reduce cheating chances */
@media screen and (max-width: 750px){
    #jokes li{
	font-size: 0.6em;
	line-height: 2em;
    }
}

@media screen and (max-width: 500px){
    #jokes li{
	font-size: 0.5em;
	line-height: 1.5em;
    }
}

#playfield{
    max-width: 50rem;
    margin: auto;
    position: relative; /* hack so that game-over-line remains in normal flow under this */
}

#controls {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 800px;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.8) 50%, rgba(0,0,0,0.9) 100%);
    box-sizing: border-box;
}

#game-over-line {
    position: absolute;
    top: 30em;
    width: 100%;
    border-color: red;
    box-shadow: 0 0 10px red;
}

#game-over-line::after {
    content: "DEAD LINE";
    position: absolute;
    color: red;
    font-size: 1.2rem;
    font-weight: bold;
    top: -0.7em;
    left: 50%;
    transform: translateX(-50%);
    text-shadow: 0 0 5px black, 0 0 10px red;
    background-color: rgba(0,0,0,0.5);
    padding: 0 10px;
    border-radius: 5px;
}

.target {
    background-image: url('assets/crosshair.png');
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    background-blend-mode:darken;
}

.score-container, #target-field-container {
    color: cyan;
    font-weight: bold;
    text-shadow: 0 0 10px cyan;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 1.2rem;
}

.audio-btns {
    display: flex;
    gap: 10px;
    margin-bottom: 5px;
}

#score-field, #high-score-field, #target-field {
    font-family: 'digital';
    font-size: 1.5em;
    margin-top: 0.2rem;
}

.high-score {
    color: gold;
    text-shadow: 0 0 10px gold;
}

#typing-field {
    background-color: rgba(0,255,255,0.1); 
    color: lime;
    outline: none;
    border: 2px solid rgba(0,255,255,0.5);
    border-radius: 0.5em;
    height: 2.5em;
    width: 40%;
    font-size: 1.5rem;
    text-align: center;
    text-shadow: inherit;
    font-weight: inherit;
    box-shadow: 0 0 15px cyan, inset 0 0 10px cyan;
}

#game-over-screen{
    font-family: 'digital';
}

#game-over-text{
    font-size: 5em;
    margin: 1rem;
}

#game-over-display-score{
    font-size: 2.5em;
}

#start-screen,
#game-over-screen{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    height: 90vh;
}

#start-button,
#restart-button,
#start-screen-button{
    border: 3px solid #ffffff;
    color: #ffffff;
    background-color: transparent;
    padding: 0.75em;
    border-radius: 15px;
    cursor: pointer;
    text-align: center;
    font-family: 'jfont'; 
    font-size: 1.5rem;
    transition: background-color 200ms ;
}

#start-button:hover,
#restart-button:hover,
#start-screen-button:hover{
    color: #000000;
    background-color: #ffffff;
}

#lore{
    max-width: 50em;
    text-align: center;
    border-radius: 1.5em 0.4em 1.5em 0.4em;
    padding: 1em;
    background-color: rgba(255,255,255,0.2);
    box-shadow: 0 0 15px rgba(0,127,192,0.5);
    backdrop-filter: blur(5px);
    font-family: 'jfont';
}

#playPauseBtn,
#soundEffectBtn{
    position: relative;
    color: white;
    border: none;
    background-color:transparent;
    width: 2rem;
    height: 2rem;
    background-size: cover;
    cursor: pointer;
}

#soundEffectBtn.on{
    background-image: url('assets/filled-voice-on.png');
}

#soundEffectBtn.off{
    background-image: url('assets/filled-voice-off.png');
}

#playPauseBtn.on{
    background-image: url('assets/music-on.png');
}

#playPauseBtn.off{
    background-image: url('assets/music-off.png');
}

#difficulty-selector{
    position:absolute;
    bottom: 1vw;
    right: 1vw;
}

#difficulty-level{
    appearance: none;
    color: white;
    border: none;
    background-color:transparent;
    font-weight: bold;
    font-size: 1rem;
}

/* Enhanced Mobile Responsiveness */
@media screen and (max-width: 600px){
    #lore {
        font-size: 0.8rem;
        padding: 0.8em;
        margin: 0 1rem;
    }

    #start-button, #restart-button, #start-screen-button {
        font-size: 1.2rem;
        padding: 0.5em;
    }

    #controls {
        padding: 0.5rem;
        flex-direction: column;
        gap: 0.5rem;
        background: rgba(0,0,0,0.85);
    }

    .score-container {
        font-size: 1rem;
        flex-direction: row;
        gap: 1rem;
    }

    #target-field-container {
        display: none;
    }

    #typing-field {
        height: 2em;
        width: 80%;
        font-size: 1.2rem;
    }

    #game-over-text {
        font-size: 3em;
    }

    #game-over-display-score {
        font-size: 1.8em;
    }
    
    #playPauseBtn, #soundEffectBtn {
        width: 1.8rem;
        height: 1.8rem;
    }
}
