:root {
    /* Color Variables */
    --dark-blue: hsl(210, 30%, 15%);
    --neon-blue: hsl(200, 80%, 50%);
    --grey: hsl(0, 0%, 40%);
    --dark-grey: hsl(0, 0%, 20%);
    --pink: #ff006e;

    /* Gradient Variables */
    --background-gradient: linear-gradient(135deg, hsl(210, 30%, 15%) 0%, hsl(210, 45%, 20%) 50%, hsl(210, 30%, 15%) 100%);
}

/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Disable Scrolling */
html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: Comfortaa, sans-serif;
    background-color: #ff006e;
    background: linear-gradient(135deg, hsl(210, 30%, 15%) 0%, hsl(210, 45%, 20%) 50%, hsl(210, 30%, 15%) 100%);
    background: linear-gradient(to right, #495057, #343a40, #212529);
    color: white;
    display: flex;
    justify-content: center;
}

.page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100vw;
    max-width: 500px;
    /* max width for larger screens */
    padding-inline: 30px;
    text-align: center;
    /* padding-top: env(safe-area-inset-top);  */
    /* Use safe area insets to avoid content being under the notch */
    padding-top: 1em;
    padding-bottom: 0em;
    /* Adjusts for bottom navigation bars */
}

.scrollable-list {
    overflow-y: scroll;
}

/* Responsive Design */
@media (max-width: 1768px) {
    .page {
        width: 90%;
    }
}

@media (max-width: 480px) {
    .page {
        width: 100%;
        border-radius: 0;
    }
}

h1 {
    font-size: clamp(1em, 2rem, 25px);
}

.logo-image {
    width: 25vh;
    filter: grayscale(80%);
}

.slogan {
    padding-block: 5%;
    padding-inline: 5%;
    font-size: clamp(1em, 2vh, 20px);
}

#pathAnimation {
    stroke-dasharray: 0, 1000;
    stroke-dashoffset: 0;
    animation: draw 10s infinite;
}

@keyframes draw {
    0%, 100% {
        stroke-dasharray: 0, 1000;
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dasharray: 1000, 1000;
        stroke-dashoffset: 0;
    }
}

button {
    width: calc(100% - 22px);
    /* Account for padding and border */
    padding: 10px;
    margin-top: 20px;
    font-size: clamp(1em, 16px, 25px);
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    background-color: black;
    color: white;
}

button:hover {
    background-color: white;
    color: black;
}

.funny-button {
    background-color: #ff006e;
    background-color: #1f2224;
    /* color: #ffbe0b; */
    font-family: Comfortaa, sans-serif;
    font-size: clamp(1em, 2vh, 25px);
    font-weight: bold;
    border-radius: 10% / 50%;
    border: 15px solid white;
}

.funny-button:disabled {
    background-color: #dddddd;
    font-size: clamp(1em, 2vh, 25px);
    color: rgba(255, 255, 255, 0.445)
}

.black {
    background-color: black;
    background-color: #1f2224;
}

label {
    display: block;
    color: rgb(255, 255, 255);
    font-size: clamp(1em, 2vh, 25px);
}

input[type=text], input[type=color] {
    width: calc(100% - 22px);
    height: 70px;
    margin: 10px 0;
    padding: 10px;
    border: 10px solid #ffffff;
    border-radius: 5px;
    background-color: #00000000;
    color: rgb(255, 255, 255);
    font-size: clamp(1em, 9.5vw, 25px);
    letter-spacing: 10px;
    text-transform: uppercase;
}

input[type=color] {
    width: calc(30% - 22px);
    height: 70px;
    border: 2px solid #ffffff;
    border-radius: 1px;
}

input::placeholder {
    color: rgb(255, 255, 255);
    font-size: clamp(.5em, 1vw, 25px);
}

#colorPicker {
    padding: 0px;
    min-height: 70px;
    min-width: 120px;
}

.room-message {
    min-height: 3em;
    line-height: 1.5em;
}

#playersList {
    width: 90%;
    border-collapse: collapse;
    margin-bottom: 20px;
    /* background-color: #ff006e; */
}

#playersList tr:focus, #playersList tr:active {
    background-color: lightblue;
    /* or any other color you want */
    outline: none;
    /* removes the outline */
}

#playersList th, #playersList td {
    text-align: left;
    padding: 8px;
    border-bottom: 1px solid #ddd;
}

#emptyBottom {
    /* flex: 0 0 15vh; */
    height: 1vh;
}

#gamePage{
    width:100%;
}

#gameHeader {
    width: 100%;
    display: flex;
    /* flex: 0 0 4.5vh; */
    height: 3.5vh;
    margin-top: 5px;
    margin-bottom: 0;
    /* Fixed height */
    justify-content:space-evenly;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: larger;
    /* background: hsla(211, 30%, 15%, 0.08); */
    /* box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); */
}

.player-detail, #playerInfo {
    max-width: 100%;
    display: flex;
    font-weight: bold;
    /* background: hsla(200, 80%, 50%, 0.076); */
    padding: 5px 1px;
    border-radius: 10px;
    /* box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 2px 6px rgba(0, 0, 0, 0.3); */
    align-items: center;
    color: white;
    font-weight: bold;
    margin-right: 20px;
}

.player-detail i {
    margin-right: 5px;
}

.player-name, .player-score, .player-rank {
    display: inline-block;
}

/* FontAwesome icons styling */
.player-detail .fas {
    font-size: clamp(1em, 1.2em, 25px);
}

/* Player name specific styling */
#playerNameDisplay {
    min-width: 35%;
    max-width: 55%;
    text-wrap: wrap;
}

/* Player name specific styling */
#playerNameDisplay.player-name {
    max-width: 2%;
    text-wrap: wrap;
}

#gameOptionsDisplay {
    /* display: flex; */
    display: none;
    flex-direction: column;
}

#gameLengthText {
    color: red;
    border-bottom: 1px solid white;
    ;
}

#gameLevelText {
    color: red;
}

.game-area {
    display: flex;
    /* flex: 0 0 65vh; */
    height: 85vh;
    margin-top: 0;
    width: 100%;
    /* background: linear-gradient(to right, #495057, #343a40, #212529); */
}

.game-action-area {
    position: relative;
    padding-top: 20px;
}

.engraved-image {
    display: hidden;
    position: absolute;
    top: 70%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Adjust the size as needed */
    width: 150px;
    /* scale: .2; */
    height: auto;
    opacity: 10%;
    /* border-radius: 30%; */
    /* border: 2px solid white; */
    -webkit-filter: drop-shadow(5px 5px 5px #ffffff);
    filter: drop-shadow(1px 1px 1px #dcdcdc) grayscale(80%);
    /* Outer glow for 3D effect */
    /* animation: glowing 50s infinite alternate; */
}

@keyframes glowing {
    0% {
        box-shadow: 0 0 5px #daf26c;
        color: #daf26c;
    }

    50% {
        box-shadow: 0 0 5px #d10c0c;
        color: #d10c0c;
    }

    100% {
        box-shadow: 0 0 20px #0d34f4;
        color: #0d34f4;
    }
}

.main-game-area {
    display: flex;
    position: relative;
    align-items: center;
    justify-content: center;
    flex: 0 0 95%;
}

.game-action-area {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-line-area {
    flex: 0 0 5%;
    /* background: linear-gradient(135deg, hsl(210, 30%, 15%) 0%, hsl(210, 45%, 20%) 50%, hsl(210, 30%, 15%) 100%); */
    position: relative;
    /* display: flex; */
    display:none;
    justify-content: center;
}

.score-line {
    position: absolute;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom,
            hsl(200, 80%, 60%) 0%,
            hsl(200, 80%, 60%) 3%,
            transparent 3%,
            transparent 100%);
    background-size: 100% 3.33%;
    z-index: 5;
}

/* Ticks for every 10th interval */
.score-line::after {
    content: '';
    position: absolute;
    /* left: 50%; */
    /* bottom: -20%; */
    width: 5px;
    /* Width of the largest ticks */
    height: 100%;
    background: linear-gradient(to bottom,
            hsl(0, 100%, 50%) 0%,
            hsl(0, 100%, 50%) 10%,
            transparent 10%,
            transparent 100%);
    background-size: 100% 10%;
    transform: translateX(-50%);
    z-index: 1;
}

/* Add spans for the numbers manually or with JS */
.score-tick-number {
    position: absolute;
    right: -95%;
    color: white;
    font-size: 10px;
    text-align: right;
    /* writing-mode: vertical-lr; */
    /* transform: rotate(180deg); */
}

/* Position each number next to the larger tick */
.score-tick-number:nth-child(1) {
    top: 90%;
}

.score-tick-number:nth-child(2) {
    top: 80%;
}

.score-tick-number:nth-child(3) {
    top: 70%;
}

.score-tick-number:nth-child(4) {
    top: 60%;
}

.score-tick-number:nth-child(5) {
    top: 50%;
}

.score-tick-number:nth-child(6) {
    top: 40%;
}

.score-tick-number:nth-child(7) {
    top: 30%;
}

.score-tick-number:nth-child(8) {
    top: 20%;
}

.score-tick-number:nth-child(9) {
    top: 10%;
}

.score-tick-number:nth-child(10) {
    top: 0%;
}

#countdownContainer {
    width: 100%;
    font-size: clamp(1em, 4em, 40px);
    text-align: center;
    text-shadow: 0px 0px 10px rgba(0, 0, 0, 0.7);
    z-index: 10;
}

#countdown {
    animation: pulse 1s infinite;
}

#roundTimerContainer {
    width: 100%;
    /* flex: 0 0 1.5vh; */
    height: 1.5vh;
    margin-top: 0;
    border: 2px solid var(--neon-blue);
    border: 2px solid whitesmoke;
    border-radius: 30px;
}

#roundTimer {
    width: 100%;
    background-color: var(--neon-blue);
    background-color: whitesmoke;

    /* border-radius: 0px; */
    height: 100%;
    transition: width 0.1s linear;
}

.message-container {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
}

.message {
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 5px;
    text-align: center;
    z-index: 10;
}

.message-container .top {
    font-size: larger;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

#usedActionsDisplay {
    /* display: flex; */
    display: none;
    /* flex: 0 0 7vh; */
    height: 7.5vh;
    min-width: 60%;
    justify-content: center;
    align-items: center;
    gap: 50px;
    padding: 1px;
    margin: 2px;
    /* background: var(--background-gradient); */
    border-radius: 100% 100% 0% 0%;
    border: 2px solid rgba(255, 255, 255, 0.05)
}

#gameFooter {
    /* display: flex; */
    display: none;
    /* flex: 0 0 7vh; */
    height: 7.5vh;
    min-width: 100%;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 0px;
    margin: 0px;
    /* background: var(--background-gradient); */
    /* border-radius: 100% 100% 0% 0%; */
    border-radius: 5%;
    border: 2px solid rgba(255, 255, 255, 0.05)
}

#hallOfFameBtn{
    display: none;
}

/* other pages are centered - scores and hall of fame tables should appear at top of their page */
#scoresPage, #hallOfFamePage {
    justify-content: flex-start;
    padding-top: 5%;
    padding-inline: 5%;
}

.player-modal-content {
    width: 90%
}

.hall-of-fame {
    display: flex;
    width: 100%;
    margin: 0;
    justify-content: center;
}

#winnerName {
    padding-block: 10px;
    margin-bottom: 20px;
    font-size: clamp(2em, 4rem, 40px);
    color: rgb(244, 224, 5);
    animation: glowing 5s ease-in-out infinite alternate, text-glow 5s ease-in-out infinite alternate;
}

#isTheWinner {
    font-size: clamp(1em, 2rem, 25px);
}

#winningDuration {
    font-size: clamp(0.5em, 1rem, 25px);
    margin-bottom: 20px;
}

#hallOfFameMessage1 {
    font-size: clamp(0.7em, 1.2rem, 25px);
    margin-top: 20px;
    margin-bottom: 10px;
}

#hallOfFameMessage2 {
    font-size: clamp(0.5em, 1.2rem, 25px);
    color: var(--pink);
}

@-webkit-keyframes text-glow {
    from {
        text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #e60073, 0 0 40px #e60073, 0 0 50px #e60073, 0 0 60px #e60073, 0 0 70px #e60073;
    }

    to {
        text-shadow: 0 0 20px #fff, 0 0 30px #ff4da6, 0 0 40px #ff4da6, 0 0 50px #ff4da6, 0 0 60px #ff4da6, 0 0 70px #ff4da6, 0 0 80px #ff4da6;
    }
}

#playerList, #scoresList, #hallOfFameList {
    border: 5px solid rgba(248, 248, 248, 0.188);
    min-height: 10vh;
    max-height: 50vh;
    margin-block: 10px;
}

.player-item {
    display: flex;
    justify-content: space-between;
    margin-block: 10px;
    padding: 10px;
    background-color: rgba(253, 252, 252, 0.083);
    color: white;
}

/* Add specific styles for child elements . child 1 is rank, child 2 is name. and child 3 is score */
.player-item>div:nth-child(1) {
    /* Rank */
    flex: 0 1 7.5%;
    text-align: center;
}

.player-item>div:nth-child(2) {
    /* Name */
    flex: 0 1 72.5%;
    padding: 0 10px;
    text-align: left;
}

.player-item>div:nth-child(3) {
    /* Score */
    flex: 0 1 20%;
    text-align: left;
}

#scoresDoneBtn, #hallOfFameDoneBtn {
    background-color: #ff006e;
    background-color: #1f2224;

    font-family: Comfortaa, sans-serif;
    font-size: clamp(1em, 5vw, 25px);
    font-weight: bold;
    border-radius: 10% / 50%;
    border: 10px solid white;
    cursor: pointer;
    user-select: none;
    /* Prevent text selection */
}

.popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 400px;
}

.hall-of-fame-content {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    padding: 5px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.option-button {
    padding: 5px 10px;
    margin-block: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    user-select: none;
    /* Prevent text selection */
}

.option-button.selected {
    border-color: hsl(210, 30%, 15%);
    background-color: hsl(210, 30%, 15%);
    color: white;
    outline: none;
}

.include-ai-switch-container {
    display: inline-flex;
    align-items: center;
    /* Center the items vertically */
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

/* Hide default HTML checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.switch-label {
    margin-right: 10px;
    color:black;
}

input:checked+.slider {
    background-color: #2196F3;
}

input:checked+.slider:before {
    transform: translateX(26px);
}

/* Optional: styling for focus outline */
input:focus+.slider {
    box-shadow: 0 0 1px #2196F3;
}

/* Rounded sliders */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}


.mini-games-list {
    max-height: 300px;
    overflow-y: scroll;
    border: 1px solid #ccc;
    padding: 10px;
    min-height: 200px;
}

.selectable-options {
    display: flex;
    gap: 10px;
    color: black;
}

.mini-game-option {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    color: black;
}

.game-options-label {
    margin-bottom: 10px;
    color: black;
    font-size: clamp(1em, 1rem, 25px);
    cursor: pointer;
}

.mini-game-label {
    margin-left: 8px;
    /* Adds space between checkbox and label */
    color: black;
    font-size: clamp(1em, 1rem, 25px);
    cursor: pointer;
}

#doneBtn:disabled {
    opacity: 10%;
}

#gameOptionsMessage {
    color: red;
}

input[type="checkbox"] {
    cursor: pointer;
}

.action-button {
    margin-top: 0;
    border: 1px solid #1e78b3;
    text-transform: uppercase;
    font-size: clamp(1em, 24px, 30px);
    /* background: linear-gradient(145deg, #1e78b3, #2a9df4); */
    background: transparent;
    position: relative;
    /* overflow: hidden; */
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 0 0 10px #0f5c9d,
        0 0 20px #0f5c9d,
        0 0 30px #0f5c9d,
        0 0 40px #0f5c9d,
        0 0 70px #0f5c9d;
    /* Remove outline */
    cursor: pointer;
    background-size: cover;
    background-position: center;
    transition: transform 0.3s;
}

/* Add a click effect */
.action-button:active {
    transform: scale(0.9);
    background: transparent;
}

/* Add a click effect */
.action-button:hover {
    transform: scale(0.9);
    background: transparent;
}

.action-button:disabled {
    opacity: 10%;
}

#actionBtn1 {
    background-image: url('../assets/images/actions/ink.png');
}

#actionBtn2 {
    background-image: url('../assets/images/actions/bomb.png');
    background-size: cover;
}

/* #actionBtn3 { */
/* background-image: url('../assets/images/favicon.png'); */
/* } */

#actionBtn4 {
    background-image: url('../assets/images/actions/turbo.png');
}

.action-count {
    position: absolute;
    top: -10px;
    /* Position it above the button */
    right: -5px;
    /* Position it to the right of the button */
    background-color: red;
    border-radius: 50%;
    color: white;
    padding: 5px;
    font-size: 12px;
    /* Adjust font size as needed without covering the icon */
    z-index: 1;
    /* Ensure it's above the button */
}

.avatar {
    position: absolute;
    bottom: 0;
    width: 200%;
    height: auto;
    /* Keep the aspect ratio of the avatar */
    left: 50%;
    transform: translateX(-50%);
    transition: bottom 0.5s ease-out;
    /* Smooth movement for the avatar */
}

/* Modal CSS */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    padding-top: 60px;
}

.modal-content {
    background-color: #fefefe;
    color: black;
    margin: 5% auto;
    padding: 10px;
    width: 90%;
}

.close {
    color: #aaaaaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

.icon-btn {
    margin: 0;
    padding: 0;
    background-color: #333333;
    border: none;
    color: white;
    /* Adjust the color to fit your design */
    border: 1px solid #424242;
    border-radius: 50%;
    height: 34px;
    width: 34px;
    text-align: center;
    cursor: pointer;
    font-size: 25px;
    /* Adjust size as needed */
    /* margin: 0 10px; Add some space around the icons */
}

.icon-btn:hover {
    color: #ccc;
    /* Change color on hover for visual feedback */
}

.icon-btn:disabled {
    color: #515151;
    /* Change color on hover for visual feedback */
}

@keyframes rotate {
    from {
        transform: rotate(0deg) translateY(0);
    }

    to {
        transform: rotate(360deg) translateY(1800px);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes shake {
    0% {
        transform: translate(1px, 1px) rotate(0deg);
    }

    10% {
        transform: translate(-1px, -2px) rotate(-1deg);
    }

    20% {
        transform: translate(-13px, 0px) rotate(1deg);
    }

    30% {
        transform: translate(13px, 12px) rotate(0deg);
    }

    40% {
        transform: translate(1px, -1px) rotate(1deg);
    }

    50% {
        transform: translate(-1px, 12px) rotate(-1deg);
    }

    60% {
        transform: translate(-3px, 1px) rotate(0deg);
    }

    70% {
        transform: translate(13px, 1px) rotate(-1deg);
    }

    80% {
        transform: translate(-1px, -1px) rotate(1deg);
    }

    90% {
        transform: translate(1px, 12px) rotate(0deg);
    }

    100% {
        transform: translate(1px, -12px) rotate(-1deg);
    }
}

.shake {
    animation: shake .1s;
    animation-iteration-count: infinite;
}

/* keep this at bottom to override others */
.hidden {
    display: none;
}

.floaty-message {
    position: absolute;
    width: 100px;
    height: 100px;
    padding: 10px;
    padding-top: 20px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1rem;
    text-align: center;
    color: #197DB9;
    opacity: 0;
    border-radius: 50%;
    /* border: 1px solid #197DB9; */
    /* background-color: #ff006e; */

    /* background: radial-gradient(#ff006e, hsla(210, 45%, 20%, 0.931) 50%, hsla(211, 30%, 15%, 0.318) 50%); */
    ;
    /* text-shadow: 2px 2px 5px #ff006e; */
    /* text-shadow: 0 0 1px #FF0000, 0 0 5px white; */
    background-color: #ff006e;
    transition: all 0.5s ease;
    animation: jumpAndFade 1.5s ease forwards;
}

@keyframes jumpAndFade {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: .8;
    }

    20% {
        transform: rotateZ(45deg);
        opacity: 1;
    }

    30%, 90% {
        transform: translate(-50%, -20%) scale(3.5) rotateZ(0deg);
        opacity: 1;
    }

    100% {
        transform: translate(-400%, 700%) scale(20) rotateX(0deg);
        opacity: .1;
    }
}

.shard {
    position: absolute;
    width: 5px;
    height: 15px;
    opacity: 1;
}

@keyframes flyAndFade {
    to {
        transform: translate(var(--translateX), var(--translateY)) scale(var(--scale)) rotate(var(--rotate));
        opacity: 0;
    }
}