body {
    background-image: url(images/pattern.jpg);
    background-repeat: repeat;

    font-family: "Comfortaa", sans-serif;
    font-weight: 500;
    color: white;
}

main {
    max-width: 1200px;
    max-height: 750px;
    margin: 0 auto;
}

h1, h2, h3 {
    font-family: "Audiowide", sans-serif;
    font-weight: 400;
    color: #5CFFFF;
    text-align: center;
    margin-top: 20px;
    font-size: 48px;
}

h2 {
    font-size: 32px;
}

.off {
    display: none;
}

.on {
    display: block;
}

button {
    cursor: pointer;
}

/* rules styling */

li {
    line-height: 1.3em;
    margin-top: 10px;
}

#rules {
    /* padding: 10px; */
    background-color: #171e26d9;
    position: absolute;
    left: 50%;
    transform: translate(-50%);
    top: 10%;
    width: 90vw;
    height: 86vh;
    z-index: 2;
}

#rules article {
    background-color: #2c4f71c7;
    width: 1000px;
    position: relative;
    margin: 20px auto;
    padding:15px;
    height: 600px;
}

#rules button {
    position: absolute;
    background-color: #FFFF5C;
    border: none;
    /* padding: 10px 20px; */
    width: 50px;
    height: 50px;
    font-size: 16px;
    border-radius: 50%;
    top: -10px;
    right: -10px;
}

.overlay {
    display: block;
}

/* start screen styling */

#start .readRules {
    margin-bottom: 20px;
}

form {
    width: 80%;
    margin: auto;
}

legend {
    color: #FFFF5C;
}

.formField {
    display: flex;
    gap: 20px;
}

.formField fieldset {
    display: block;
    flex: 1;
    border: none;
    margin-bottom: 20px;
    background-color: #0c2a4d8d;
}

input[name='npc'], input[name='hp'] {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border:#5CFFFF solid 2px;
    margin-left: 10px;
    margin-top: -5px;
    vertical-align: middle;
    cursor: pointer;
}

input[name='npc']:checked, input[name='hp']:checked {
    border: #5CFFFF solid 10px;
}

label {
    margin: 0;
    padding: 0;
    cursor: pointer;
}

form img {
    width: 20%;
    transform: rotateZ(-90deg);
    padding: 5px;
    border: transparent solid 2px;
    cursor: pointer;
}

.playerSelection input[type='radio'] {
    appearance: none;
}

.playerSelection input[type='radio']:checked + label img {
    border: #5CFFFF solid 2px;
    background-color: #5cffff48;
}

#start button{
    display: block;
    background-color: #FFFF5C;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 20px;
    margin: 20px auto;
}

#sounds {
    position: absolute;
    bottom: 0;
    right: 0;
    display: flex;
    gap: 10px;
    margin: 10px;
    /* line-height: 1.2em; */
    z-index: -1;
}

#sounds p {
    margin: 5px;
}

#startSound.soundOn, #gameSound.soundOn {
    background-color: #FFFF5C;
}

#gameSound.soundOff, #startSound.soundOff {
    background-color: white;
}

#audioSources.on {
    display: flex;
    gap: 10px;
    position: absolute;
    bottom: 0;
    left: 0;
    max-width: 50%;
    padding: 10px;
    line-height: 1.3em;
    z-index: -1;
    background-color: rgba(0, 0, 0, 0.6);
}

#audioSources h3 {
    font-family:"Comfortaa", sans-serif ;
    font-size: 20px;
}

/* main game screen styling */

#gameScreen.on {
    display: flex;
    gap: 20px;
    padding:0px 10px;
}

.players {
    position: relative;
    flex: 1;
    height: 80vh;
}

#center {
    position: relative;
    flex: 2;
}

.players h2 {
    text-align: center;
    font-size: 48px;
}

.playerImage {
    position: absolute;
    max-width: 60%;
    max-height: 40%;
    bottom: 50%;
    left: 50%;
    transform: translate(-50%);
}

.model {
    width: 100%;
    height: 100%;
}

.modelHit {
    width: 100%;
    height: 100%;
    animation: playerHit 0.5s 2 forwards;
    opacity: 80%;
}

.modelDefeated {
    width: 100%;
    height: 100%;
    opacity: 0;
    transition:all 2s;
}

.modelHeal {
    width: 100%;
    height: 100%;
    animation: playerHeal 0.25s alternate 4 forwards;
}

@keyframes playerHit {
    0% {
        translate: 0 0;
    }
    20% {
        translate: -5% -5%;
    }
    40% {
        translate: 5% 5%;
    }
    60% {
        translate: -5% 5%;
    }
    80% {
        translate: 5% -5%;
    }
    100% {
        translate: 0 0;
    }
}

@keyframes playerHeal {
    from {border:none; background: none;}
    to {border: lime solid 2px; background-color: rgba(0, 255, 0, 0.276);}
}

.laserOn {
    position: absolute;
    top: 50%;
    height: 6px;
    transform: translateY(-50%);
    /* width: 200px; */
    background-color: white;
    border-top: solid 5px lime;
    border-bottom: solid 5px lime;
    animation: animateLaser 2s forwards;
}

.bigLaser {
    position: absolute;
    top: 50%;
    height: 20px;
    transform: translateY(-50%);
    background-color: white;
    border-top: solid 5px red;
    border-bottom: solid 5px red;
    animation: animateLaser 2s forwards;
}

#laser1.laserOn, #laser1.bigLaser{
    left: 120%;
}

#laser2.laserOn, #laser2.bigLaser {
    right: 120%;   
}

@keyframes animateLaser {
    0% {
        width: 0;
        opacity: 1;
    }
    50% {
        width: 100vw;
        opacity: 1;
    }
    100% {
        width: 100vw;
        opacity: 0;
    }
}

#p2image {
    transform: rotateZ(180deg);
}

.hp-bar {
    position: absolute;
    width: 100%;
    top: 60%;
    height: 5%;
    
    border: solid white 2px;
}

#player1HP {
    height: 100%;
    width: 100%;
    background-color: lime;
    transition: all 1s ease;
}

#player2HP {
    height: 100%;
    width: 100%;
    background-color: lime;
    transition: all 1s ease;
}

.players h3 {
    color: white;
    position: absolute;
    font-size: 64px;
    top: 70%;
    left: 50%;
    transform: translateX(-50%);
}

#diceDisplay {
    margin-top: 50px;
    position: relative;
    height: 20%;
    margin-top: 5px;
}

#diceDisplay img {
    position: absolute;
    height: 100%;
    width: auto;
}

#dice1 {
    right:52%;
}

#dice2 {
    left: 52%;
}

#gameConsole {
    text-align: center;
    font-size: 24px;
    background-color: #0051a3e5;
    line-height: 1.5em;
    padding-top: 10px;
}

#gameConsole p {
    margin: 0;
}

#miniRule {
    background-color:#5cffffd7;
    color: rgb(47, 47, 47);
    margin: 0 30px;
}

#miniRule ul {
    padding: 5px 10px 10px;
    list-style-type:none;
}

#control {
    display: flex;
    position: absolute;
    bottom: 0;
    width: 90%;
    left:50%;
    transform: translateX(-50%);
    background-color: #0051a3e5;
}

#control div{
    flex: 1;
    position: relative;
}

#controlButtons {
    position: absolute;
    left: 5%;
}

#control button{
    display: block;
    width: 80%;
    height: 40%;
    margin-top: 10px;
    background-color: white;
    border: solid #8AC4FF 2px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 24px;
}

#control button:hover {
    background-color: #FFFF5C;
}

#multiplier {
    text-align: center;
    font-size: 24px;
}

#number {
    font-size: 36px;
}

#bottomMenu {
    position: absolute;
    bottom: 5%;
    right: 5%;
}

#bottomMenu button {
    background-color: white;
    border: none;
    font-size: 20px;
    border-radius: 3px;
}

#again.on {
    /* display: block; */
    background-color: #FFFF5C;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 24px;
    font-weight: 500;
    margin: 40px auto;
}

#controlButtons p {
    /* margin: auto; */
    text-align: center;
    font-size: 24px;
    line-height: 1.4em;
    font-weight: 600;
    margin: 25px 0;
}