* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    color: #eee;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

#game-container {
    background-color: #1a1a1a;
    border: 4px solid #ff00ff;
    box-shadow: 0 0 30px #ff00ff, inset 0 0 20px rgba(255, 0, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 90%;
    max-width: 1400px;
    height: 90vh;
    position: relative;
    overflow: hidden;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(90deg, rgba(255, 0, 255, 0.1) 0%, rgba(0, 255, 255, 0.1) 100%);
    border-bottom: 2px solid #00ffff;
    border-radius: 10px;
}

.header-left, .header-center, .header-right {
    flex: 1;
}

.header-center {
    text-align: center;
}

.header-right {
    text-align: right;
}

h1 {
    color: #00ff00;
    text-shadow: 0 0 15px #00ff00, 0 0 30px #00ff00;
    margin: 0;
    font-size: 2.5em;
    letter-spacing: 2px;
}

#bankroll-display {
    font-size: 1.8em;
    font-weight: bold;
    color: #ffff00;
    text-shadow: 0 0 10px #ffff00;
}

.icon-button {
    background-color: transparent;
    color: #eee;
    border: 2px solid #888;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.3s;
}

.icon-button:hover {
    background-color: #444;
    border-color: #00ffff;
    box-shadow: 0 0 10px #00ffff;
}

/* Main Game Area */
main {
    display: flex;
    align-items: center;
    justify-content: space-around;
    flex-grow: 1;
    gap: 20px;
    position: relative;
}

#daniel-character {
    width: 180px;
    height: 280px;
    background: linear-gradient(135deg, #333 0%, #222 100%);
    border: 3px solid #00ff00;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

#daniel-character svg {
    width: 100%;
    height: 100%;
}

#craps-table {
    flex: 1;
    height: 100%;
    background: linear-gradient(135deg, #004d00 0%, #003300 100%);
    border: 5px solid #8b4513;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 69, 19, 0.3);
}

#dice-area {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
}

.die {
    width: 100px;
    height: 100px;
    background-color: #fff;
    border: 3px solid #333;
    border-radius: 12px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: transform 0.1s;
    perspective: 1000px;
}

.die:hover {
    transform: rotateX(5deg) rotateY(5deg);
}

.dot {
    width: 18px;
    height: 18px;
    background-color: #333;
    border-radius: 50%;
}

#point-marker {
    position: absolute;
    top: 20px;
    background: linear-gradient(135deg, #ff0000, #ff6600);
    color: #fff;
    padding: 12px 25px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 1.3em;
    box-shadow: 0 0 20px #ff0000;
    text-shadow: 0 0 5px #000;
}

#game-messages {
    position: absolute;
    font-size: 2.5em;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 15px #fff, 0 0 30px rgba(255, 255, 255, 0.5);
    z-index: 10;
    min-height: 60px;
    text-align: center;
    animation: slideIn 0.4s ease-out;
}

/* Footer */
footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 15px 20px;
    background: linear-gradient(90deg, rgba(255, 0, 255, 0.1) 0%, rgba(0, 255, 255, 0.1) 100%);
    border-top: 2px solid #00ffff;
    border-radius: 10px;
}

#left-stats {
    flex: 0 0 auto;
}

#game-stats {
    font-size: 0.9em;
}

#game-stats p {
    margin: 5px 0;
    color: #00ffff;
}

#center-controls {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

#bet-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.bet-button {
    background: linear-gradient(135deg, #8a2be2, #9932cc);
    color: #fff;
    border: 2px solid #9932cc;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.bet-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #9932cc, #aa33dd);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.bet-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#roll-button {
    background: linear-gradient(135deg, #00aa00, #00dd00);
    color: #000;
    border: 3px solid #00dd00;
    padding: 15px 40px;
    border-radius: 10px;
    font-size: 1.3em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 20px rgba(0, 221, 0, 0.5);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

#roll-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #00dd00, #00ff00);
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.8);
}

#roll-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

@keyframes smokeExpand {
    0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}

@keyframes diceRoll {
    0% { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
    100% { transform: rotateX(720deg) rotateY(720deg) rotateZ(720deg); }
}

@keyframes floatUp {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-80px); }
}

@keyframes confetti {
    0% { opacity: 1; transform: translateY(-20px) rotate(0deg); }
    100% { opacity: 0; transform: translateY(150px) rotate(360deg); }
}

@keyframes screenFlash {
    0% { background-color: rgba(255, 255, 255, 0); }
    50% { background-color: rgba(255, 255, 255, 0.4); }
    100% { background-color: rgba(255, 255, 255, 0); }
}

@keyframes slideIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.pulse {
    animation: pulse 1.2s infinite !important;
}

.shake {
    animation: shake 0.5s !important;
}

.dice-roll {
    animation: diceRoll 0.6s ease-out !important;
}

.float-up {
    animation: floatUp 1s ease-out forwards !important;
}

.confetti {
    animation: confetti 1s ease-out forwards !important;
}

.screen-flash {
    animation: screenFlash 0.3s ease-out !important;
}

.slide-in {
    animation: slideIn 0.4s ease-out !important;
}

/* Overlay & Game Over */
.hidden {
    display: none !important;
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-over-screen {
    background: linear-gradient(135deg, #330000, #660000);
    border: 5px solid #ff0000;
    box-shadow: 0 0 40px #ff0000;
    border-radius: 20px;
    padding: 50px;
    text-align: center;
    z-index: 101;
}

#game-over-screen h2 {
    color: #ff0000;
    font-size: 4em;
    margin: 0 0 20px 0;
    text-shadow: 0 0 20px #ff0000;
}

#game-over-screen p {
    font-size: 1.8em;
    margin-bottom: 40px;
    color: #ffff00;
}

#restart-button {
    background: linear-gradient(135deg, #00aa00, #00dd00);
    color: #000;
    border: 3px solid #00dd00;
    padding: 18px 40px;
    border-radius: 10px;
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 20px rgba(0, 221, 0, 0.5);
}

#restart-button:hover {
    background: linear-gradient(135deg, #00dd00, #00ff00);
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.8);
}

/* Responsive */
@media (max-width: 1024px) {
    main {
        flex-direction: column;
    }

    #daniel-character {
        width: 150px;
        height: 230px;
    }

    #craps-table {
        width: 100%;
    }

    .die {
        width: 80px;
        height: 80px;
    }

    h1 {
        font-size: 2em;
    }

    #game-messages {
        font-size: 1.8em;
    }
}

@media (max-width: 768px) {
    #game-container {
        padding: 15px;
        gap: 10px;
        height: auto;
    }

    header {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    .header-left, .header-center, .header-right {
        width: 100%;
        text-align: center;
    }

    h1 {
        font-size: 1.5em;
    }

    #bankroll-display {
        font-size: 1.3em;
    }

    footer {
        flex-direction: column;
        gap: 10px;
    }

    #left-stats {
        width: 100%;
    }

    #center-controls {
        width: 100%;
        flex-direction: column;
    }

    #bet-controls {
        width: 100%;
    }

    .bet-button {
        flex: 1;
        min-width: 60px;
    }

    #roll-button {
        width: 100%;
    }

    #dice-area {
        gap: 15px;
    }

    .die {
        width: 70px;
        height: 70px;
    }

    #game-messages {
        font-size: 1.3em;
    }

    #game-over-screen {
        padding: 30px;
    }

    #game-over-screen h2 {
        font-size: 2.5em;
    }

    #game-over-screen p {
        font-size: 1.2em;
    }
}
