:root {
    --dark-color: rgb(77, 77, 77);
    --color: rgb(255, 255, 255);
    --success: rgb(99, 251, 99);
    --danger: rgb(252, 116, 116);
    --accent-color: var(--success);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    accent-color: var(--accent-color) !important;
    font-family: 'Play', sans-serif;
}

body {
    user-select: none;
    background-color: var(--dark-color);
    color: white;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    position: relative;
}

canvas {
    border: 2px solid rgb(255, 255, 255);
    border-radius: 10px;
    box-shadow: 0px 0px 40px 0px var(--color);
    background: rgb(0, 0, 0) !important;
    cursor: none !important;
}

.sub-text {
    font-size: 14px !important;
}

.text {
    font-size: 16px !important;
}

.large-text {
    font-size: 17px !important;
}

.xl-text {
    font-size: 19px !important;
}

.sub-heading {
    font-size: 19px !important;
    font-weight: bold !important;
}

.heading {
    font-size: 24px !important;
    font-weight: bold !important;
}

.header {
    display: grid;
    grid-template-rows: auto;
    grid-template-columns: 30% auto 30%;
    align-items: center;
    justify-items: center;
    padding: 10px 0px 15px 0px;
    height: 105px;
}

/* LEFT HEADER */
.header .title {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header .game-name {
    cursor: pointer;
}

.header .game-name:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: var(--accent-color);
}

.header .title img {
    filter: brightness(10) drop-shadow(0px 0px 15px var(--color));
    margin: -10px 7px;
    width: 50px;
    cursor: pointer;
}

@keyframes beat {
    50% {
        filter: brightness(10) drop-shadow(0px 0px 0px var(--color));
    }
}

/* CENTER HEADER */
.header .score-box,
.detailed-score-box {

    border: 2px solid #fff;
    box-shadow: 0px 0px 4px 0px #fff;
    border-radius: 5px;
    padding: 4px 10px;
    width: max-content;
    cursor: pointer;
}

.score-box:hover,
.detailed-score-box:hover {
    border-color: var(--accent-color);
    box-shadow: 0px 0px 6px 0px var(--accent-color);
}

.detailed-score-box {
    display: none;
}

.detailed-score-box table {
    border-collapse: collapse;
    border-style: hidden;
}

.detailed-score-box td,
.detailed-score-box th {
    border: 1px solid white;
    text-align: center;
    padding: 5px 15px;
    width: max-content;
}


/* RIGHT HEADER */
.modes {
    display: flex;
    justify-content: center;
    align-items: center;
}

.mode-btn {
    margin: 0px 7px;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}

.mode-btn:hover {
    box-shadow: 0px 0px 5px 1px var(--accent-color);
}

.mode-btn.active {
    font-weight: bolder;
    border: 2px solid #fff;
    letter-spacing: 0.5px;
    font-size: 17px !important;
    box-shadow: 0px 0px 4px 0px #fff;
}

/* TIME BAR CONTROL */

.time-bar-container {
    position: absolute;
    top: -35px;
    z-index: 10;
    display: none;
    margin: 0px auto;
    width: 580px;
    height: 5px;
    border-radius: 10px;
    background-color: black;
    margin-top: 20px;
    margin-bottom: 10px;
}

.time-bar {
    height: 100%;
    width: 100%;
    background-color: white;
    border-radius: 10px;
}

.game-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    margin-top: 30px;
    padding-bottom: 70px;
}

.restart-container,
.start-container {
    width: 600px;
    height: 400px;
    display: none;
    position: absolute;
    color: white;
    background-color: transparent;
    align-items: center;
    flex-direction: column;
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    user-select: none;
}

.start-container {
    display: flex;
}

.start-container .logo-snake {
    margin: 30px 0px;
    height: 125px;
}

.restart-container .game-over {
    margin-top: 60px;
    margin-bottom: 10px;
    font-size: 50px;
}

.restart-container .reason {

    color: #ff8282;
    margin-bottom: 40px;
}

.tip,
.welcome {
    width: 70%;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 40px;
}

.game-btn {
    width: max-content;
    border-radius: 5px;
    padding: 7px 14px;
    font-weight: bold;
    text-transform: uppercase;
    background-color: var(--accent-color);
    color: black;
    border: none;
    box-shadow: 0px 0px 4px 0px var(--accent-color);
    cursor: pointer;
}

.game-btn:hover {
    letter-spacing: 1px;
}

#restartBtn {
    background-color: var(--danger);
    box-shadow: 0px 0px 4px 0px var(--danger);
    position: relative;
}

.footer {
    position: absolute;
    bottom: 0;
    display: grid;
    grid-template-rows: auto;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    justify-items: center;
    height: 60px;
    width: 100%;
    z-index: 1000;
}

.creator a {
    color: white;
    text-underline-offset: 2px;
}

.creator a:hover {
    text-decoration-color: var(--accent-color);
    text-underline-offset: 3px;
}

/* MUSIC CONTROL */
.music-setting {
    justify-self: end;
    margin-right: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.music-setting img {
    width: 35px;
    padding: 5px;
    margin: -5px 10px;
    cursor: pointer;
}

.music-setting img:hover {
    /* border: 1px solid var(--accent-color); */
    box-shadow: 0px 0px 5px 1px var(--accent-color);
    border-radius: 50%;
}

.music-setting-container {
    display: none;
    flex-direction: column;
    position: absolute;
    bottom: 45px;
    right: 10px;
    width: max-content;
    height: max-content;
    background-color: rgba(0, 0, 0, 0.9);
    border-radius: 5px;
    box-shadow: 0px 0px 5px 1px var(--color);
    z-index: 100000;
    padding: 20px 15px 10px 15px;
}

.music-setting-container select {
    background-color: var(--accent-color);
    border-radius: 3px;
    border: none;
    height: 20px;
    font-weight: bold;
    cursor: pointer;
}

.music-setting-container input {
    cursor: pointer;
}

.music-setting-container option {
    background-color: rgb(208, 208, 208);
}

.music-setting-container label {
    font-size: 15px;
    margin-bottom: 10px;
    text-align: center;
}

.music-setting-container hr {
    margin: 20px 0px;
    border-color: var(--accent-color);
}

.volume-adjust {
    display: grid;
    flex-direction: column;
    grid-template-columns: 1fr 2fr;
    grid-template-rows: auto auto auto;
    justify-items: center;
    row-gap: 10px;
}

.volume-adjust label {
    grid-column: 1/-1;
}

/* Loader */
.lds-ring {
    display: none;
    position: absolute;
    right: 55px;
    bottom: 0;
    width: 50px;
    height: 30px;
}

.lds-ring div {
    box-sizing: border-box;
    display: block;
    position: absolute;
    width: 35px;
    height: 35px;
    margin: 0px 5px;
    border: 3px solid #fff;
    border-radius: 50%;
    animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    border-color: #fff transparent transparent transparent;
}

.lds-ring div:nth-child(1) {
    animation-delay: -0.45s;
}

.lds-ring div:nth-child(2) {
    animation-delay: -0.3s;
}

.lds-ring div:nth-child(3) {
    animation-delay: -0.15s;
}

#warning-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    grid-template-columns: auto;
    grid-template-rows: 1fr 4fr;
    row-gap: 20px;
    align-items: start;
    justify-items: center;
    padding: 20px;
    background-color: #151515;
    text-align: center;
    z-index: 100;
}

.logo-header {
    align-self: center;
    width: 90%;
    display: grid;
    grid-template-columns: auto auto;
    grid-template-rows: auto auto;
    align-items: center;
    text-align: start;
    column-gap: 20px;
}

.logo-header img {
    grid-row: 1/ -1;
    width: 70px;
    justify-self: end;
}

.warn-header img {
    filter: hue-rotate(239deg) saturate(5);
}

.logo-header p {
    color: rgba(255, 255, 255, 0.9);
}

.warn-content {
    width: min(95%, 500px);
    height: max-content;
    display: none;
    grid-template-rows: 20px auto auto auto;
    row-gap: 30px;
    align-items: center;
    justify-items: center;
    border: 2px solid red;
    box-shadow: 0px 0px 20px 0px red;
    border-radius: 10px;
    padding: 40px 20px;
}

.warn-content .warn-title {
    text-decoration: underline;
    text-decoration-color: red;
    text-underline-offset: 3px;
}

.warn-content .warn-image {
    width: 120px;
}

.warn-content .warn-description {
    color: #ff3030;
    font-weight: bolder;
    font-size: 18px;
}

@keyframes lds-ring {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Instructions */
#instructions-container {
    display: none;
    width: 100%;
    margin: 0px auto;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px 20px 70px 20px;
    /* background-color: #474747; */
}

#instructions-container .title {
    color: var(--success);
    margin: 30px 0px;

}

.instructions-header {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    position: sticky;
    z-index: 10;
    top: 0px;
    padding: 20px;
    background-color: rgba(16, 16, 16, 0.98);
    border-radius: 10px;
    width: 100%;
}

.instructions-header .logo-header {
    width: 55%;
}

.instructions-header .skip-instructions {
    width: 45%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.instructions-header .game-btn {
    width: fit-content;
    animation: glow 2s infinite;
}

@keyframes glow {
    50% {
        box-shadow: 0px 0px 15px white;
    }
}


.features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    grid-gap: 20px;
    padding: 0px 10px;
}

.feature-container {
    width: min(95%, 550px);
    display: grid;
    grid-template-columns: auto;
    grid-template-rows: auto auto auto;
    align-items: center;
    justify-content: center;
    margin: 10px;
    row-gap: 10px;
    text-align: center;
    border: 2px solid var(--success);
    box-shadow: 0px 0px 5px 0px var(--success);
    background-color: rgba(119, 255, 119, 0.05);
    border-radius: 5px;
    padding: 10px 20px;
}

.feature-title {
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: var(--success);
    text-align: start;
    margin-bottom: 10px;
}

.feature-img {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.feature-img img {
    margin: 10px;
    z-index: 0;
    border-radius: 10px;
}

.feature-content {
    margin: 10px 10px 10px 20px;
    text-align: justify;
}

.copyright {
    text-align: justify;
    display: flex;
    align-items: center;
    flex-direction: column;
    width: min(90%, 700px);
}

.copyright-content {
    color: rgb(242, 242, 242);
    padding-bottom: 40px;
}

.copyright-content i {
    color: var(--success);
}

.feature-content li {
    margin: 7px 0px;
}

/* Responsiveness */
@media (max-width: 1050px) {
    .header .title {
        justify-self: start;
        margin-left: 20px;
    }

    .header .modes {
        justify-self: end;
    }
}

@media (max-width: 1000px) {
    .header {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 80px 40px;
        height: max-content;
        margin-bottom: -10px;
    }

    .header .title {
        margin-left: 30px;
        justify-self: start;
    }

    .header .score {
        margin-right: 30px;
        justify-self: end;
    }

    .header .modes {
        grid-column: 1/ -1;
        width: 100%;
    }

    .music-setting {
        margin-right: 20px;
    }
}

@media (max-width: 720px) {
    .sub-text {
        font-size: 13px !important;
    }

    .text {
        font-size: 15px !important;
    }

    .large-text {
        font-size: 16px !important;
    }

    .xl-text {
        font-size: 17px !important;
    }

    .sub-heading {
        font-size: 18px !important;
        font-weight: bold !important;
    }

    .heading {
        font-size: 22px !important;
        font-weight: bold !important;
    }

    .header .title {
        margin-left: 10px;
    }

    .header .score {
        margin-right: 20px;
    }


    .music-setting {
        margin-right: 10px;
    }

    .mode-btn.active {
        font-size: 16px !important;
    }
}

/* Small Screen Size */
@media (max-width: 620px),
(max-height: 420px) {
    :root {
        --accent-color: RED !important;
    }

    .sub-text {
        font-size: 13px !important;
    }

    .text {
        font-size: 14px !important;
    }

    .large-text {
        font-size: 15px !important;
    }

    .xl-text {
        font-size: 16px !important;
    }

    .sub-heading {
        font-size: 17px !important;
        font-weight: bold !important;
    }

    .heading {
        font-size: 20px !important;
        font-weight: bold !important;
    }

    .footer {
        grid-template-columns: auto;
    }

    #main-container,
    #instructions-container,
    .warn-mobile,
    .music-setting {
        display: none !important;
    }
    
    #warning-container,
    .warn-screensize {
        display: grid !important;
    }
}

/* Mobile or Touch screens */
@media (hover: none) {
    :root {
        --accent-color: RED !important;
    }

    .footer {
        grid-template-columns: auto;
    }

    #main-container,
    #instructions-container,
    .warn-screensize,
    .music-setting {
        display: none !important;
    }

    #warning-container,
    .warn-mobile {
        display: grid !important;
    }
}

@media (max-width: 320px) {
    .sub-text {
        font-size: 12px !important;
    }

    .text {
        font-size: 13px !important;
    }

    .large-text {
        font-size: 14px !important;
    }

    .xl-text {
        font-size: 15px !important;
    }

    .sub-heading {
        font-size: 16px !important;
        font-weight: bold !important;
    }

    .heading {
        font-size: 18px !important;
        font-weight: bold !important;
    }
}

/* width */
::-webkit-scrollbar {
    width: 7px;
    background-color: transparent;
    background-color: #151515;
}

/* Handle */
::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 2px;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
    background: white;
}