/* Dice Roller (Yahtzee-style) Game Styles */

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#game-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#game-canvas {
    max-width: 100%;
    max-height: 100%;
}

/* Dice container */
.dice-area {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 15px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
}

.die-wrapper {
    position: relative;
}

.die {
    width: 70px;
    height: 70px;
    background: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    color: #1a1a2e;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    user-select: none;
}

.die:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.die.held {
    background: linear-gradient(135deg, #20c997, #17a881);
    color: #fff;
    border: 3px solid #fff;
}

.die.rolling {
    animation: dice-shake 0.5s ease infinite;
}

@keyframes dice-shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(15deg) scale(1.05); }
    50% { transform: rotate(-15deg); }
    75% { transform: rotate(10deg) scale(1.05); }
}

.hold-indicator {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: #20c997;
    font-weight: bold;
}

/* Game controls */
.game-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 100;
}

.control-btn {
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover {
    transform: translateY(-2px);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.control-btn.roll {
    background: linear-gradient(135deg, #6f42c1, #5a32a3);
    color: #fff;
}

.roll-counter {
    position: absolute;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 1.1rem;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 20px;
    border-radius: 20px;
}

/* Scorecard */
.scorecard {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.85);
    border-radius: 12px;
    padding: 15px;
    min-width: 280px;
    z-index: 50;
}

.scorecard h3 {
    color: #fff;
    margin: 0 0 15px 0;
    text-align: center;
    font-size: 1.1rem;
}

.score-section {
    margin-bottom: 15px;
}

.score-section-title {
    color: #6f42c1;
    font-size: 0.8rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    margin: 2px 0;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.score-row:hover:not(.scored):not(.disabled) {
    background: rgba(111, 66, 193, 0.3);
}

.score-row.scored {
    background: rgba(32, 201, 151, 0.2);
    cursor: default;
}

.score-row.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.score-row.potential {
    background: rgba(255, 193, 7, 0.2);
}

.score-row .name {
    color: #ccc;
    font-size: 0.85rem;
}

.score-row .value {
    color: #fff;
    font-weight: bold;
    min-width: 30px;
    text-align: right;
}

.score-row.scored .value {
    color: #20c997;
}

.score-row.potential .value {
    color: #ffc107;
}

.score-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 10px 0;
}

.score-total {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: rgba(111, 66, 193, 0.3);
    border-radius: 5px;
    margin-top: 10px;
}

.score-total .name {
    color: #fff;
    font-weight: bold;
}

.score-total .value {
    color: #ffc107;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Player panels for multiplayer */
.player-tabs {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 50;
}

.player-tab {
    padding: 10px 25px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    color: #aaa;
    font-weight: bold;
    transition: all 0.2s ease;
}

.player-tab.active {
    background: linear-gradient(135deg, #6f42c1, #5a32a3);
    color: #fff;
}

.player-tab .score {
    font-size: 0.9rem;
    color: #ffc107;
    margin-left: 10px;
}

/* Turn indicator */
.turn-indicator {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    color: #20c997;
    font-size: 1.2rem;
    font-weight: bold;
}

/* Game over overlay */
.gameover-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    padding: 40px 60px;
    border-radius: 16px;
    text-align: center;
    z-index: 200;
    animation: pop-in 0.3s ease;
}

@keyframes pop-in {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.gameover-overlay h2 {
    color: #ffd700;
    font-size: 2rem;
    margin-bottom: 10px;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.gameover-overlay .final-score {
    color: #20c997;
    font-size: 3rem;
    font-weight: bold;
    margin: 20px 0;
}

.gameover-overlay .score-breakdown {
    color: #aaa;
    font-size: 0.9rem;
    margin-bottom: 25px;
}

.gameover-overlay button {
    padding: 15px 50px;
    background: linear-gradient(135deg, #6f42c1, #5a32a3);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gameover-overlay button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(111, 66, 193, 0.5);
}

/* Setup modal */
.setup-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(22, 33, 62, 0.98);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid rgba(111, 66, 193, 0.5);
    text-align: center;
    z-index: 200;
    min-width: 300px;
}

.setup-modal h3 {
    color: #fff;
    margin-bottom: 20px;
}

.setup-modal .option-group {
    margin-bottom: 20px;
    text-align: left;
}

.setup-modal label {
    color: #ccc;
    display: block;
    margin-bottom: 8px;
}

.setup-modal select {
    width: 100%;
    padding: 10px;
    border: 2px solid #6f42c1;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1rem;
}

.setup-modal .start-btn {
    padding: 15px 50px;
    background: linear-gradient(135deg, #20c997, #17a881);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.setup-modal .start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(32, 201, 151, 0.5);
}

/* Hidden class */
.hidden {
    display: none !important;
}
