body,
html {
    height: 100%;
    width: 100%;
}

body {
    background-color: #282A3A;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 500;
    color: #fff;
    letter-spacing: 3px;
    font-family: Chalkduster;
    text-shadow: 0 0 3px #2020208c;
    text-align: center;
}

.btn {
    font-family: Chalkduster;
}

.roll-count-display {
    font-family: Chalkduster;
}

.dice-sum-display {
    font-family: Chalkduster;
}

/* Dice Container */

.dice.stuck .dice-face[data-face="1"],
.dice.stuck .dice-face[data-face="2"],
.dice.stuck .dice-face[data-face="3"],
.dice.stuck .dice-face[data-face="4"],
.dice.stuck .dice-face[data-face="5"],
.dice.stuck .dice-face[data-face="6"] {
    border: 3px solid red;
}

.dice-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: auto;
    padding: 10px;
    margin: 0 auto;
}

/* Dice Element */

.dice {
    position: relative;
    width: 100px;
    height: 100px;
    transform-style: preserve-3d;
    transition: border-color 0.3s ease;
}

/* Dice Faces */
.dice-face {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: absolute;
    border-radius: 5px;
    background-color: #282A3A;
    backface-visibility: hidden;
}

/* Dice Dots */
.dot {
    height: 15px;
    width: 15px;
    background-color: #fff;
    border-radius: 50% 50%;
    box-shadow: 0 0 5px #ffffff94;
}

/* Organizing Dice Faces Dots */

.dice-face[data-face="1"] {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dice-face[data-face="2"] {
    display: flex;
    align-items: center;
}

.dice-face[data-face="2"] .dot:nth-child(1) {
    transform: translate(-10px, 20px);
}

.dice-face[data-face="2"] .dot:nth-child(2) {
    transform: translate(10px, -15px);
}

.dice-face[data-face="3"] {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dice-face[data-face="3"] .dot:nth-child(1) {
    transform: translate(22px, -10px);
}

.dice-face[data-face="3"] .dot:nth-child(3) {
    transform: translate(-22px, 10px);
}

.dice-face[data-face="4"] {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.dice-face[data-face="4"] .dot:nth-child(1) {
    transform: translate(0, -25px);
}

.dice-face[data-face="4"] .dot:nth-child(2) {
    transform: translate(30px, -25px);
}

.dice-face[data-face="4"] .dot:nth-child(3) {
    transform: translate(-30px, 25px);
}

.dice-face[data-face="4"] .dot:nth-child(4) {
    transform: translate(-0, 25px);
}

.d-flex.justify-content-evenly {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px 0;
}

.dice-face[data-face="5"] {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.dice-face[data-face="5"] .dot:nth-child(1) {
    transform: translate(5px, -25px);
}

.dice-face[data-face="5"] .dot:nth-child(2) {
    transform: translate(40px, -25px);
}

.dice-face[data-face="5"] .dot:nth-child(3) {
    transform: translate(0px, 1px);
}

.dice-face[data-face="5"] .dot:nth-child(4) {
    transform: translate(-40px, 25px);
}

.dice-face[data-face="5"] .dot:nth-child(5) {
    transform: translate(-5px, 25px);
}

.dice-face[data-face="6"] {
    flex-wrap: wrap;
    display: flex;
    grid-template-columns: auto auto;
}

.dice-face[data-face="6"] .dot:nth-child(1) {
    transform: translate(20px, -25px);
}

.dice-face[data-face="6"] .dot:nth-child(2) {
    transform: translate(5px, 2px);
}

.dice-face[data-face="6"] .dot:nth-child(3) {
    transform: translate(-10px, 27px);
}

.dice-face[data-face="6"] .dot:nth-child(4) {
    transform: translate(10px, -25px);
}

.dice-face[data-face="6"] .dot:nth-child(5) {
    transform: translate(-5px, 2px);
}

.dice-face[data-face="6"] .dot:nth-child(6) {
    transform: translate(-20px, 27px);
}


/* Dice Face to show if Face value is set */

.dice-face[data-face="1"] {
    transform: translateZ(3.1em);
}

.dice-face[data-face="6"] {
    transform: rotateY(90deg) translateZ(3.1em);
}

.dice-face[data-face="3"] {
    transform: rotateY(-90deg) translateZ(3.1em);
}

.dice-face[data-face="4"] {
    transform: rotateX(90deg) translateZ(3.1em);
}

.dice-face[data-face="5"] {
    transform: rotateX(-90deg) translateZ(3.1em);
}

.dice-face[data-face="2"] {
    transform: rotateY(-180deg) translateZ(3.1em);
}

/* Dice Rolling Animation */

.dice.rolling {
    animation: roll 1.0s ease-in-out infinite
}

@keyframes roll {
    0% {
        transform: rotateX(0deg) rotateZ(0deg);
    }

    25% {
        transform: rotateX(90deg) rotateZ(90deg);
    }

    50% {
        transform: rotateX(180deg) rotateZ(180deg);
    }

    75% {
        transform: rotateX(360deg) rotateZ(360deg);
    }

    100% {
        transform: rotateX(180deg) rotateZ(180deg);
    }
}

.dice[data-face="1"] {
    transform: rotateX(0deg) rotateZ(0deg);
}

.dice[data-face="2"] {
    transform: rotateX(180deg) rotateZ(0deg);
}

.dice[data-face="3"] {
    transform: rotateY(90deg) rotateZ(0deg);
}

.dice[data-face="4"] {
    transform: rotateX(270deg) rotateZ(0deg);
}

.dice[data-face="5"] {
    transform: rotateX(90deg) rotateZ(0deg);
}

.dice[data-face="6"] {
    transform: rotateY(270deg) rotateZ(0deg);
}

.player-buttons .round-button-circle {
    width: auto;
    padding: 14px 35px;
    border-radius: 50px;
    border: 10px solid #290786;
    overflow: hidden;
    background: #4679BD;
    box-shadow: 0 0 3px gray;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.player-buttons .round-button {
    color: #e2eaf3;
    font-family: 'Chalkduster', sans-serif;
    font-size: 1.2em;
    font-weight: bold;
    text-decoration: none;
    text-align: center;
}

.player-buttons {
    display: flex;
    justify-content: center;
}

.round-button-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    padding: 10px 20px;
    border-radius: 50px;
    border: none;
    background: #4679BD;
    color: #e2eaf3;
    font-family: 'Chalkduster', sans-serif;
    font-size: 1em;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    outline: none;
    box-shadow: 0 0 3px gray;
    transition: background-color 0.3s, transform 0.3s;
    margin: 5px;
}

.round-button-circle.lisanne {
    background: #8A2BE2;
}

.round-button-circle.max {
    background: #002a69;
}

.round-button-circle:hover {
    transform: scale(1.05);
}

.round-button-circle:active {
    background-color: #365899;
}

.round-button-circle.lisanne {
    background: #8A2BE2;
    border-color: #8A2BE2;
}

.round-button-circle.max {
    background: #002a69;
    border-color: #002a69;
}

.round-button {
    width: auto;
    min-width: 160px;
    display: inline-block;
    font-size: 14px;
}

#loginContainer {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    display: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border: 1px solid #ccc; 
    width: 300px;
    text-align: center;
}

#playerNameInput,
#loginButton {
    width: 100%;
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 5px;
    border: 1px solid #ddd;
    box-sizing: border-box;
    font-family: 'Chalkduster', sans-serif;
}

#loginButton {
    background-color: #007bff;
    color: white;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#loginButton:hover {
    background-color: #0056b3; /* Darker shade on hover for better interaction */
}


.card-footer {
    padding: 8px 12px;
    font-size: 0.8rem;
    background-color: var(--bs-card-color);
    color: var(--bs-card-color);
    border-top: 1px solid #e7e7e7;
}

#playerNameDisplay {
    font-size: 0.8rem;
    color: #343a40;
}

#usersContainer {
    max-width: 200px;
    border-radius: 0 0 0 10px;
    box-shadow: -2px 2px 5px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

#usersList {
    list-style-type: none;
    padding: 0;
    margin: 5px 0 0 0;
}

#usersList li {
    padding: 2px 5px;
    font-size: 0.9rem;
}

.kniffel-playcard {
    font-family: 'Arial', sans-serif;
    background-color: #f9f9f9;
    padding: 20px;
    width: 250px;
    margin: 0 auto;
}

.playcard-title {
    text-align: center;
    margin-bottom: 20px;
    font-family: 'Chalkduster', sans-serif;
}

.playcard-section {
    margin-bottom: 20px;
    font-family: 'Chalkduster', sans-serif;
}

.playcard-section h4 {
    border-bottom: 2px solid #666;
    padding-bottom: 5px;
    margin-bottom: 10px;
    font-family: 'Chalkduster', sans-serif;
}

.score-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.score-item.total,
.grand-total {
    font-weight: bold;
    border-top: 1px solid #666;
    padding-top: 5px;
    margin-top: 10px;
}

.score {
    background-color: #e6e6e6;
    padding: 2px 5px;
    border-radius: 5px;
    width: 50px;
    text-align: center;
}

.grand-total {
    font-size: 1.2em;
    text-align: center;
    margin-top: 20px;
    font-family: 'Chalkduster', sans-serif;
}

.score-input {
    width: 50px;
    border: 1px solid #ccc;
    border-radius: 5px;
    text-align: center;
    padding: 2px;
}

/* Chrome, Safari, Edge, Opera fixes */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox fixes */
input[type=number] {
    -moz-appearance: textfield;
}

.score-total {
    width: 60px;
    text-align: center;
    margin-left: auto;
    margin-right: 0;
}

.grand-total input {
    width: 60px;
    text-align: center;
    margin: 0 auto;
    display: block;
}

.score-item.bonus,
.score-item.total-with-bonus {
    font-weight: bold;
    margin-top: 10px;
}

.score-bonus,
.score-total-with-bonus {
    width: 60px;
    border: 1px solid #ccc;
    border-radius: 5px;
    text-align: center;
    padding: 2px;
    margin-left: 10px;
}

.score-item.bonus {
    border-top: 2px dotted #666;
    padding-top: 10px;
}

.score-item.total-with-bonus {
    border-top: 1px solid #666;
    padding-top: 5px;
}

.hide-scorecard {
    margin-top: 20px;
}

.reset-scorecard {
    margin-top: 20px;
}

.crossed-out {
    text-decoration: line-through;
    opacity: 0.6;
}

#leaderboard {
    background-color: #f9f9f9;
    border: 2px solid #000;
    padding: 20px;
    width: 250px;
    margin: 10px;
    font-family: 'Chalkduster', cursive;
    color: #000; 
    box-shadow: 0px 4px 8px rgba(0,0,0,0.2);
    border-radius: 8px;
}

.score {
    margin-top: 10px;
    font-size: 18px;
    display: flex;
    justify-content: space-between;
}

.score span {
    background-color: #000; 
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
}

#selectWinnerButton {
    margin: 10px;
    background-color: black;
    color: white;
    padding: 10px 20px;
    border: 2px solid white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-family: 'Chalkduster', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  }
  
  #selectWinnerButton:hover {
    background-color: white;
    color: black;
    border-color: black;
  }
  
  #winnerSelectionModal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
  }
  
  .modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
    transition: 0.3s;
  }
  
  button {
    padding: 10px 15px;
    margin-top: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
  }
  
  button:hover {
    background-color: #0056b3;
  }
  
  #modalCloseButton {
    background-color: #dc3545;
  }
  
  #modalCloseButton:hover {
    background-color: #c82333;
  }

  button#winnerLisanne {
    background-color: purple;
}

button#winnerMax {
    background-color: #0066CC;
}

.score-changed {
    border: 2px solid red !important;
  }

/* Overlay styles */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99;
    display: none;
  }