* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
}

html, body {
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background: #000;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
}
/* --- Poker Chip Bet Indicator Styles --- */
.chip-indicator {
    width: 4.5vh;
    height: 4.5vh;
    position: absolute;
    background-image: url('/images/greenchip.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.chip-amount {
    color: #000;
    font-weight: bold;
    font-size: 1.4vh;
    text-shadow: 0px 0px 2px rgba(255, 255, 255, 0.7);
}

/* --- Main Layout --- */
#bannerCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2000;
    pointer-events: none;
    display: block;
}
/* --- STYLES FOR 3D ROLL ANIMATION --- */
.roll-animation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

#shaker-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Adapted 3D CSS Dice styles */
:root {
    --dice-size: 120px;
}

.scene-css-dice {
    display: flex;
    gap: 50px;
    perspective: 1000px;
}

.cube {
    width: var(--dice-size);
    height: var(--dice-size);
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1.5s ease-out;
}

.face {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid #888;
    border-radius: 15px;
    background-color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    box-sizing: border-box;
}

.face img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
/* Positions each face to form a cube */
.face-1 {
    transform: rotateY(0deg) translateZ(calc(var(--dice-size) / 2));
}

.face-2 {
    transform: rotateX(-90deg) translateZ(calc(var(--dice-size) / 2));
}

.face-3 {
    transform: rotateY(90deg) translateZ(calc(var(--dice-size) / 2));
}

.face-4 {
    transform: rotateY(-90deg) translateZ(calc(var(--dice-size) / 2));
}

.face-5 {
    transform: rotateX(90deg) translateZ(calc(var(--dice-size) / 2));
}

.face-6 {
    transform: rotateY(180deg) translateZ(calc(var(--dice-size) / 2));
}

.game-container {
    width: 100%;
    height: 100%;
    max-width: 1920px;
    max-height: 1080px;
    background: #0c3710 radial-gradient(circle, #0c3710 0%, #082309 70%);
    border: 8px solid #d4af37;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
}

.header {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5vw;
    background: linear-gradient(135deg, #1e3c5f, #152642);
    padding: 0.8vh 0.8vw;
    border-bottom: 3px solid #d4af37;
    flex-shrink: 0;
}

.header > div {
    text-align: center;
    padding: 0.4vh 0.5vw;
    background: rgba(13, 71, 161, 0.8);
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.6vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5vw;
}

.timer, .player-name, .bet-limits, .win-bet, .credit {
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 0.5vh;
}

.limit-line {
    font-size: 1.5vh;
    white-space: nowrap;
    display: flex;
    gap: 0.3vw;
}

.limit-label {
    color: #aab8c2;
}

.win-bet > div {
    font-size: 1.6vh;
}

.credit-label, .player-label, .timer-label {
    font-size: 1.6vh;
    line-height: 1.2;
}

.buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1vw;
    margin-top: 1.5vh;
}

.button {
    background: linear-gradient(145deg, #0d47a1, #0a3a87);
    color: white;
    padding: 1vh 1.5vw;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.5vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5vw;
    transition: all 0.2s ease-in-out;
}

.button:hover {
    transform: translateY(-2px);
}

/* Styles for the Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 4000;
}

.modal-content {
    background: radial-gradient(circle, #2a3b52 0%, #1b263b 100%);
    border: 2px solid #d4af37;
    border-radius: 15px;
    padding: 30px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    color: #f0f0f0;
}

.modal-content h2 {
    color: #ffd700;
    text-transform: uppercase;
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.modal-content .form-group, .modal-content .modal-input-container {
    margin-bottom: 15px;
    text-align: left;
}

.modal-content label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #aab8c2;
}

.modal-content input, .modal-content select {
    width: 100%;
    padding: 12px 15px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid #5d8aa8;
    border-radius: 8px;
    color: #ffffff;
    font-size: 1.1rem;
}

.quick-amounts {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
}

.quick-amount-btn {
    background: #495057;
    color: white;
    border: 1px solid #6c757d;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.quick-amount-btn:hover {
    background: #d4af37;
    color: #111;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.button-cancel {
    background: linear-gradient(145deg, #6c757d, #495057);
}

.notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(25, 135, 84, 0.9);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    z-index: 5000;
    display: none;
}

.player-controls {
    flex-shrink: 0;
    padding: 1vh 1vw;
    background: #0d1b2a;
}

.table-layout {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 2vh 2vw;
    gap: 2vh;
}

/* --- Betting Board --- */
.betting-board {
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 20px;
}

.bet-area {
    background: linear-gradient(145deg, #1e3c5f, #152642);
    border: 2px solid #5d8aa8;
    border-radius: 15px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    position: relative;
    padding-top: 20px;
}

.bet-area:hover {
    border-color: #d4af37;
    transform: scale(1.03);
}

.bet-symbol {
    height: 15vh;
    width: 15vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.bet-symbol img {

    max-width: 100%;
    max-height: 100%;
    object-fit: contain;

}

.bet-name {
    font-size: 2.5vh;
    text-transform: uppercase;
    font-weight: bold;
    margin-top: 1vh;
}

.bet-indicator-container {
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    height: 20px;
    display: flex;
    justify-content: center;
    gap: 5px;
}

/* --- Dice Result Area --- */
.dice-result-tray {
    flex-shrink: 0;
    background: rgba(0,0,0,0.3);
    border-radius: 15px;
    padding: 1.5vh;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2vw;
    min-height: 12vh;
    border: 2px solid #5d8aa8;
}

.result-die {
    font-size: 8vh;
    color: #d4af37;
}

.result-die img {
    height: 10vh;
    width: auto;
}

.credit-value {
    font-size: 2.8vh !important;
    font-weight: bold;
    color: #ffd700;
}

.player-value {
    font-size: 2.5vh !important;
    font-weight: bold;
    color: #ffd700;
}

.timer-value {
    font-size: 4vh !important;
    font-weight: bold;
    color: #ffd700;
}

.chips {
    display: flex;
    justify-content: center;
    gap: 1vw;
    margin-bottom: 1vh;
}

.chip {
    width: 6vh;
    height: 6vh;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.8vh;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.chip.selected {
    box-shadow: 0 0 20px #ffd700, 0 0 30px #ffd700;
    transform: scale(1.15);
}

.chip-1 {
    background: linear-gradient(145deg, #feca57, #ff9f43);
}

.chip-1::after {
    content: '$1';
}

.chip-5 {
    background: linear-gradient(145deg, #1dd1a1, #10ac84);
}

.chip-5::after {
    content: '$5';
}

.chip-10 {
    background: linear-gradient(145deg, #ff6b6b, #ee5253);
}

.chip-10::after {
    content: '$10';
}

.chip-25 {
    background: linear-gradient(145deg, #5758BB, #3B3C9A);
}

.chip-25::after {
    content: '$25';
}

#name-prompt {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #1b263b;
    padding: 20px;
    border: 2px solid #ffd700;
    z-index: 1000;
    text-align: center;
}

#name-prompt input {
    margin: 10px 0;
    padding: 5px;
    width: 100%;
    font-size: 1.2rem;
}

#name-prompt button {
    background-color: #0d47a1;
    color: white;
    padding: 10px 20px;
    border: 1px solid #ffd700;
    cursor: pointer;
    font-size: 1.1rem;
    border-radius: 5px;
    margin-top: 10px;
}

.hidden {
    display: none !important;
}

.bottom-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1vw;
    margin-top: 1.5vh;
}

.roll-history-container {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #5d8aa8;
    border-radius: 10px;
    padding: 0.8vh 1vw;
    font-size: 1.5vh;
    display: flex;
    align-items: center;
    gap: 1vw;
    min-height: 45px;
}

.roll-list, .player-list-scroller {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 10px;
    align-items: center;
    overflow-x: auto;
}

.roll-item {
    position: relative;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    background-color: #0d1b2a;
    padding: 0.5vh 1vh;
    border-radius: 6px;
}

.roll-item img {
    height: 2.5vh;
    width: auto;
}

.new-roll-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ffd700;
    color: #111;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    z-index: 10;
}

.history-separator {
    font-size: 1.5rem;
    color: #5d8aa8;
    font-weight: bold;
    align-self: center;
}

.player-list-item {
    background-color: #0d1b2a;
    padding: 0.5vh 1vh;
    border-radius: 6px;
    white-space: nowrap;
    color: #ffd700;
}
/* --- SOUND CONTROL STYLES --- */
.sound-controls-container {
    display: flex;
    align-items: center;
    gap: 0.8vw;
    padding: 0 1vw;
    background: rgba(0,0,0,0.2);
    border-radius: 50px;
}

.sound-icon {
    color: #aab8c2;
}

#volume-slider {
    cursor: pointer;
}

#exit-to-home-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    font-size: 2.5rem;
    color: #aab8c2;
    text-decoration: none;
    z-index: 1001;
    transition: color 0.3s ease, transform 0.3s ease;
}

#exit-to-home-btn:hover {

    transform: scale(1.1);
}

.exit-icon-img {
    width: 50px;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.button-exit {
    background: linear-gradient(145deg, #dc3545, #bd2130);
}
/* Styles for the Rules Modal */
.rules-content {
    height: 70vh;
    width: 60vw;
    max-width: 800px;
    display: flex;
    flex-direction: column;
}

.rules-close-btn {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2.5rem;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
}

.swiper {
    width: 100%;
    height: 100%;
}

.swiper-slide {
    text-align: left;
    font-size: 1rem;
    padding: 20px;
    overflow-y: auto;
}

.swiper-slide h4 {
    color: #ffd700;
    margin-bottom: 15px;
}

.swiper-button-next, .swiper-button-prev {
    color: #d4af37;
}

.swiper-pagination-bullet-active {
    background: #d4af37;
}

/* --- STYLES FOR THE WIN BANNER --- */
.banner {
    position: fixed;
    padding: 25px 80px;
    border-radius: 15px;
    font-size: 3.5rem;
    font-weight: bold;
    text-transform: uppercase;
    color: white;
    text-shadow: 0 3px 6px rgba(0,0,0,0.5);
    z-index: 2000;
    display: none;
    left: 50%;
}

.banner-win {
    top: 20px;
    transform: translateX(-50%);
    background: linear-gradient(145deg, #1e90ff, #0d47a1);
    border: 4px solid #add8e6;
    font-size: 3rem;
    padding: 20px 60px;
    animation: banner-fade 4s ease-in-out;
    --banner-transform: translateX(-50%);
}

#win-banner-amount {
    color: #ffd700;
    font-weight: bold;
}

@@keyframes banner-fade {
    0%, 100% {
        opacity: 0;
        transform: var(--banner-transform, translate(-50%, -50%)) scale(0.8);
    }

    15%, 85% {
        opacity: 1;
        transform: var(--banner-transform, translate(-50%, -50%)) scale(1);
    }
}