:root {
    --die-fg: #5b5b5b;
    --die-bg: #fff;
    --die-font: "Kranky", serif;
    --alt-fg: #fff;
    --alt-bg: #000;
    --accent-color: #daa520;
    --accent-light: #e7cd89;
    --accent-dark: #b88608;
    --main-color: #181633;
    --main-dark: #0c0b1a;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    color: white;
    background: var(--main-color);
    font-family: system-ui;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

input,
button,
textarea,
select {
    font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
    overflow-wrap: break-word;
}

p {
    text-wrap: pretty;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    text-wrap: balance;
}

h2,
h3,
h4,
h5,
h6 {
    font-weight: 400;
}

h1 {
    width: 100%;
    font-family: var(--die-font);
    color: var(--accent-color);
    text-align: center;
}

label {
    color: var(--accent-color);
}

.currentTurn {
    color: var(--accent-color);
    font-weight: bold;
}

.wrapper {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 4fr 1fr 7fr;
    row-gap: 2rem;
    width: 40%;
    height: 100vh;
    margin: 0 auto;
    /* border: 1px solid greenyellow; */
}

.overlay {
    position: absolute;
    z-index: 999;
    width: 100vw;
    height: 100vh;
    background: var(--main-dark);
    color: white;
    transition: all 1s ease;
}

.slide-hide {
    transform: translateX(-100vw);
    transition: all 1s ease;
}

.container {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 0.75fr 1fr 0.75fr 1fr 2fr;
    width: 100vw;
    height: 100vh;
    justify-items: center;
}

.playerProgress {
    height: 16px;
    -webkit-appearance: none;
    appearance: none;
}

.playerProgress::-webkit-progress-bar {
    background-color: #eee;
    border-radius: 2px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25) inset;
  }

.playerProgress::-webkit-progress-value {
    background-color: var(--accent-color);
}

.playerScore {
    font-weight: bold;
}

.playerSpan h3 {
    font-size: 1.05em;
}

#dice-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-around;
    padding: 0;
    width: 90%;
    max-width: 600px;
}

#menu-hide,
#menu-title,
#title,
#roll,
#wimp,
#turn-container,
#menu-options,
#menu-buttons,
#menu-container h1,
#title-container {
    place-self: center;
}

#menu-container {
    display: flex;
    height: 100%;
    background-image: url('cosmos.gif');
    background-size: cover;
    background-position: center top;
    background-color: #444357;
    background-blend-mode: multiply;
    flex-direction: column;
    justify-content: space-evenly;
}

#letsPlay {
    font-size: 1rem;
    font-family: system-ui;
    font-weight: 500;
    letter-spacing: 5px;
    color: #ffffff;
    line-height: 1em;
    text-transform: uppercase;
}

#finishline {
    text-align: center;
    line-height: 1em;
    letter-spacing: 5px;
}

#menu-title,
#title {
    margin: 1.75rem 0 0 0;
}

input {
    width: 100%;
}

#button-container,
#menu-options,
#player-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 1em;
    width: 100%;
    justify-items: center;
}

.btn {
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: transparent;
    border: 2px solid var(--accent-color);
    border-radius: 0.6em;
    color: var(--accent-color);
    cursor: pointer;
    display: flex;
    align-self: center;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1;
    padding: 1.2em 1.2em;
    text-decoration: none;
    text-align: center;
    text-transform: uppercase;
    font-weight: 700;
    transition: box-shadow 300ms ease-in-out, color 300ms ease-in-out;
}

.btn:hover {
    color: #1d1d1d;
    outline: 0;
    box-shadow: 0 0 40px 40px var(--accent-color) inset;
}

#replay-btn {
    display: none;
}

#reset-btn {
    display: none;
}

.playerDiv {
    width: 100%;
    margin: 0 0 0.5em 0;
}

.playerLabel {
    width: 10%;
}

.playerInput,
input {
    outline: 0;
    color: var(--alt-fg);
    font-size: 1em;
    padding: 4px;
    width: 100%;
    border-radius: 8px;
    border: 2px solid var(--accent-color);
    background-color: var(--main-dark);
}

.playerInput:active,
.playerInput:focus,
input:active,
input:focus {
    background-color: var(--main-dark);
    color: var(--alt-fg);
    border: 2px solid var(--accent-color);
}

.playerScore {
    color: white;
    margin-left: 0.5rem;
}

.playerSpan {
    display: flex;
}

#turn-score {
    transition: all 0.5s ease;
}

.die {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--die-font);
    font-size: 2rem;
    font-weight: 700;
    border: 2px solid var(--die-fg);
    border-radius: 8px;
    cursor: pointer;
    background: var(--die-bg);
    color: var(--die-fg);
    transition: background-color 0.3s;
}

.held {
    transition: all 0.5s ease;
    transform: translateY(-25px);
    position: relative;
}

.held::after {
    content: "";
    position: absolute;
    bottom: -16px;
    left: 0;
    width: 100%;
    height: 8px;
    background-color: var(--accent-color);
    transition: all 0.5s ease;
}

.fifth-die {
    background: var(--alt-bg);
    color: var(--alt-fg);
    border: 2px solid #2f2f2f;
}

.bounce-top {
    -webkit-animation: bounce-top 0.9s both;
    animation: bounce-top 0.9s both;
}

.die-image {
    width: 75%;
    margin: auto;
}

.invertColor {
    filter: invert(1);
}

.showoff {
    font-weight: 900;
    font-size: 3rem;
    transition: all 1s ease;
    -webkit-animation: jello-horizontal 0.9s both;
    animation: jello-horizontal 0.9s both;
}

@media (max-width: 1080px) {
    .wrapper {
        width: 90%;
    }

    #menu-container {
        width: 100%;
        text-align: center;
        background-position: center bottom;
    }

    .playerLabel {
        width: 25%;
    }
}

@-webkit-keyframes bounce-top {
    0% {
        -webkit-transform: translateY(-45px);
        transform: translateY(-45px);
        -webkit-animation-timing-function: ease-in;
        animation-timing-function: ease-in;
        opacity: 1;
    }

    24% {
        opacity: 1;
    }

    40% {
        -webkit-transform: translateY(-24px);
        transform: translateY(-24px);
        -webkit-animation-timing-function: ease-in;
        animation-timing-function: ease-in;
    }

    65% {
        -webkit-transform: translateY(-12px);
        transform: translateY(-12px);
        -webkit-animation-timing-function: ease-in;
        animation-timing-function: ease-in;
    }

    82% {
        -webkit-transform: translateY(-6px);
        transform: translateY(-6px);
        -webkit-animation-timing-function: ease-in;
        animation-timing-function: ease-in;
    }

    93% {
        -webkit-transform: translateY(-4px);
        transform: translateY(-4px);
        -webkit-animation-timing-function: ease-in;
        animation-timing-function: ease-in;
    }

    25%,
    55%,
    75%,
    87% {
        -webkit-transform: translateY(0px);
        transform: translateY(0px);
        -webkit-animation-timing-function: ease-out;
        animation-timing-function: ease-out;
    }

    100% {
        -webkit-transform: translateY(0px);
        transform: translateY(0px);
        -webkit-animation-timing-function: ease-out;
        animation-timing-function: ease-out;
        opacity: 1;
    }
}

@keyframes bounce-top {
    0% {
        -webkit-transform: translateY(-45px);
        transform: translateY(-45px);
        -webkit-animation-timing-function: ease-in;
        animation-timing-function: ease-in;
        opacity: 1;
    }

    24% {
        opacity: 1;
        -webkit-transform: rotate(180deg);
        transform: rotate(180deg);
        -webkit-animation-timing-function: ease-in;
        animation-timing-function: ease-in;
    }

    40% {
        -webkit-transform: translateY(-24px);
        transform: translateY(-24px);
        -webkit-animation-timing-function: ease-in;
        animation-timing-function: ease-in;
    }

    65% {
        -webkit-transform: translateY(-12px);
        transform: translateY(-12px);
        -webkit-animation-timing-function: ease-in;
        animation-timing-function: ease-in;
    }

    82% {
        -webkit-transform: translateY(-6px);
        transform: translateY(-6px);
        -webkit-animation-timing-function: ease-in;
        animation-timing-function: ease-in;
    }

    93% {
        -webkit-transform: translateY(-4px);
        transform: translateY(-4px);
        -webkit-animation-timing-function: ease-in;
        animation-timing-function: ease-in;
    }

    25%,
    55%,
    75%,
    87% {
        -webkit-transform: translateY(0px);
        transform: translateY(0px);
        -webkit-animation-timing-function: ease-out;
        animation-timing-function: ease-out;
    }

    100% {
        -webkit-transform: translateY(0px);
        transform: translateY(0px);
        -webkit-animation-timing-function: ease-out;
        animation-timing-function: ease-out;
        opacity: 1;
    }
}

@-webkit-keyframes jello-horizontal {
    0% {
        -webkit-transform: scale3d(1, 1, 1);
        transform: scale3d(1, 1, 1);
    }

    30% {
        -webkit-transform: scale3d(1.25, 0.75, 1);
        transform: scale3d(1.25, 0.75, 1);
    }

    40% {
        -webkit-transform: scale3d(0.75, 1.25, 1);
        transform: scale3d(0.75, 1.25, 1);
    }

    50% {
        -webkit-transform: scale3d(1.15, 0.85, 1);
        transform: scale3d(1.15, 0.85, 1);
    }

    65% {
        -webkit-transform: scale3d(0.95, 1.05, 1);
        transform: scale3d(0.95, 1.05, 1);
    }

    75% {
        -webkit-transform: scale3d(1.05, 0.95, 1);
        transform: scale3d(1.05, 0.95, 1);
    }

    100% {
        -webkit-transform: scale3d(1, 1, 1);
        transform: scale3d(1, 1, 1);
    }
}

@keyframes jello-horizontal {
    0% {
        -webkit-transform: scale3d(1, 1, 1);
        transform: scale3d(1, 1, 1);
    }

    30% {
        -webkit-transform: scale3d(1.25, 0.75, 1);
        transform: scale3d(1.25, 0.75, 1);
        color: var(--accent-color);
    }

    40% {
        -webkit-transform: scale3d(0.75, 1.25, 1);
        transform: scale3d(0.75, 1.25, 1);
        color: var(--accent-dark);
    }

    50% {
        -webkit-transform: scale3d(1.15, 0.85, 1);
        transform: scale3d(1.15, 0.85, 1);
        color: var(--accent-color);
    }

    65% {
        -webkit-transform: scale3d(0.95, 1.05, 1);
        transform: scale3d(0.95, 1.05, 1);
        color: var(--accent-light);
    }

    75% {
        -webkit-transform: scale3d(1.05, 0.95, 1);
        transform: scale3d(1.05, 0.95, 1);
        color: var(--accent-color);
    }

    100% {
        -webkit-transform: scale3d(1, 1, 1);
        transform: scale3d(1, 1, 1);
        color: var(--die-bg);
    }
}

#wimp-btn {
    display: none;
}

.flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    z-index: 9999; /* Ensures it's above other elements */
    animation: flash-animation 0.3s ease-out;
    pointer-events: none; /* Prevents interaction */
}

  @keyframes flash-animation {
    0% {
        opacity: 0;
      }
      10% {
        opacity: 0;
      }
      12% {
        opacity: 0.3;
      }
      14% {
        opacity: 0;
      }
      20% {
        opacity: 0;
      }
      22% {
        opacity: 0.6;
      }
      26% {
        opacity: 0;
      }
  }