/* ===== COIN FLIPPER STYLES ===== */
.coin-flipper-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    position: relative;
}

.coin-flipper-content {
    text-align: center;
    position: relative;
}

/* Floating Back to Game Button at TOP of window */
.btn-back-floating {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-back-floating:hover {
    background: #000;
    transform: translateX(-50%) scale(1.05);
}

.btn-back-floating i {
    font-size: 14px;
}

.coin {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 2s ease-in-out;
}

.coin-side {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: none; /* Clean, simple - no border */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
    backface-visibility: hidden;
}

.coin-heads {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
}

.coin-tails {
    background: linear-gradient(135deg, #C0C0C0 0%, #808080 100%);
    color: #fff;
    transform: rotateY(180deg);
}

/* Flip animations */
.coin.flip-heads {
    animation: flipToHeads 2s ease-in-out forwards;
}

.coin.flip-tails {
    animation: flipToTails 2s ease-in-out forwards;
}

@keyframes flipToHeads {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(1800deg); } /* 5 full rotations */
}

@keyframes flipToTails {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(1980deg); } /* 5.5 rotations to show tails */
}

.coin-result {
    font-size: 20px;
    font-weight: bold;
    margin: 15px 0;
    min-height: 25px;
    color: var(--brand-text, #000);
}

/* Circular flip button - NO TEXT */
.btn-flip-coin {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #FFD700;
    border: 2px solid #000;
    color: transparent; /* Hide any text */
    font-size: 0; /* Hide icon */
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-flip-coin:hover:not(:disabled) {
    background: #FFA500;
    transform: scale(1.1);
}

.btn-flip-coin:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== PRIZE BOX SETTINGS ===== */
.prize-list {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 8px;
}

.prize-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 6px;
}

.prize-list-item img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.prize-list-item-name {
    flex: 1;
    font-size: 12px;
    font-weight: 600;
}

.prize-list-item-delete {
    padding: 4px 8px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
}

.prize-list-item-delete:hover {
    background: #c82333;
}

/* ===== PRIZE BOX STYLES ===== */
.prize-box-container {
    padding: 50px 20px 20px;
    position: relative;
}

.prize-grid {
    display: grid;
    gap: 10px;
    max-width: 550px;
    margin: 0 auto;
}

/* Responsive columns based on item count */
.prize-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.prize-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.prize-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.prize-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.prize-grid.cols-6 { grid-template-columns: repeat(6, 1fr); }

.prize-cell {
    aspect-ratio: 1;
    position: relative;
    border: 2px solid var(--board-border-color, #000);
    border-radius: var(--board-radius, 8px);
    background: var(--board-bg, #fff);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
}

.prize-cell:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.prize-cell.selected {
    border-color: #FFD700;
    border-width: 4px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.prize-cell.revealed {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
}

.prize-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #fff;
    transition: opacity 0.5s ease;
}

.prize-cell.revealed .prize-cover {
    opacity: 0;
    pointer-events: none;
}

.prize-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.5s ease 0.3s;
}

.prize-cell.revealed .prize-content {
    opacity: 1;
    transform: scale(1);
}

.prize-image {
    max-width: 80%;
    max-height: 60%;
    object-fit: contain;
    margin-bottom: 10px;
}

.prize-name {
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    color: var(--brand-text, #000);
    word-wrap: break-word;
}

/* Highlight animation for randomizer */
.prize-cell.highlighting {
    animation: highlight-pulse 0.3s ease-in-out;
}

@keyframes highlight-pulse {
    0%, 100% { 
        border-color: var(--board-border-color, #000);
        box-shadow: none;
    }
    50% { 
        border-color: #FFD700;
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
        transform: scale(1.1);
    }
}

/* Fireworks and confetti */
.fireworks-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #f00;
    animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}
