/* ===== COIN FLIP GAME - KOMPLETNĚ OPRAVENÝ ===== */
.coin-game {
    width: 100%;
    max-width: 100%;
    padding: 10px;
    font-family: 'Cinzel', 'Mafia', serif;
    height: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.coin-game .game-layout {
    display: flex;
    gap: 20px;
    flex: 1;
    min-height: 0;
    height: 100%;
}

/* ===== LEVÝ PANEL ===== */
.coin-game .left-panel {
    flex: 0 0 50%;
    max-width: 50%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.bills-section {
    background: rgba(0, 0, 0, 0.25);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.bill-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
}

.bill-icon {
    width: 80px;
    height: 40px;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bill-icon:hover {
    transform: scale(1.05);
    border-color: #ffd700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.bill-controls {
    display: flex;
    gap: 5px;
    margin-left: auto;
}

.bill-control-btn {
    width: 32px;
    height: 32px;
    border-radius: 5px;
    border: 2px solid;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bill-control-btn.plus { border-color: #4caf50; }
.bill-control-btn.plus:hover { background: #4caf50; }
.bill-control-btn.minus { border-color: #f44336; }
.bill-control-btn.minus:hover { background: #f44336; }

.bet-section {
    background: rgba(0, 0, 0, 0.25);
    border: 2px solid var(--border-color);
    border-radius: 30px;
    padding: 10px 15px;
}

.bet-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bet-label {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-color, #e0d3b0);
    white-space: nowrap;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.bet-input-wrapper {
    flex: 1;
}

#bet-amount {
    width: 100%;
    padding: 6px 8px;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    background: rgba(0,0,0,0.4);
    color: #ffd700;
}

.bet-controls-group {
    display: flex;
    gap: 5px;
    margin-left: auto;
}

.reset-bet-btn, .allin-bet-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: rgba(0,0,0,0.3);
    color: var(--text-color);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.allin-bet-btn {
    background: linear-gradient(145deg, #8b4513, #cd7f32);
    border-color: #ffd700;
    color: #ffd700;
    font-size: 20px;
}

.reset-bet-btn:hover {
    transform: rotate(180deg);
    border-color: #ffd700;
    color: #ffd700;
}

.allin-bet-btn:hover {
    transform: scale(1.1);
    background: #ffd700;
    color: #8b4513;
    border-color: #8b4513;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 110px;
}

.flip-btn {
    background: linear-gradient(145deg, #8b5a2b, #a67c52);
    border: 2px solid #d4a574;
    color: #ffd700;
    font-size: 22px;
    padding: 12px;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 0 #5a3a1a;
}

.flip-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #5a3a1a;
}

.flip-btn:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #5a3a1a;
}

.flip-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.secondary-buttons {
    min-height: 46px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tryagain-btn, .collect-btn {
    font-size: 18px;
    padding: 10px;
    width: 100%;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 700;
}

.tryagain-btn {
    background: linear-gradient(145deg, #8b3a3a, #c97070);
    border: 2px solid #f44336;
    color: #fff;
    box-shadow: 0 3px 0 #5a2a2a;
}

.tryagain-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 #5a2a2a;
}

.collect-btn {
    background: linear-gradient(145deg, #1a4620, #2d7a3a);
    border: 2px solid #4caf50;
    color: #fff;
    box-shadow: 0 3px 0 #1a3a1a;
}

.collect-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 #1a3a1a;
}

/* Admin tlačítka */
.admin-controls {
    display: flex;
    gap: 8px;
    margin-top: 5px;
}

.admin-btn {
    flex: 1;
    padding: 8px;
    font-size: 14px;
    border: 2px solid;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.admin-win {
    background: linear-gradient(145deg, #1a4620, #2d7a3a);
    border-color: #4caf50;
    color: #fff;
}

.admin-lose {
    background: linear-gradient(145deg, #8b3a3a, #c97070);
    border-color: #f44336;
    color: #fff;
}

/* ===== PRAVÝ PANEL ===== */
.right-panel {
    flex: 0 0 50%;
    max-width: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 5px 0;
}

/* ===== COIN ===== */
.coin-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 10px 0;
}

#coin-element {
    width: 260px;
    height: 260px;
    perspective: 900px;
    position: relative;
}

#coin-element.idle #coin-inner {
    animation: idleSpin 10s infinite linear;
}

@keyframes idleSpin {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

#coin-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.9s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}

.coin-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5), inset 0 -3px 10px rgba(0,0,0,0.3);
    border: 3px solid #ffd700;
}

.coin-front { background-image: url('../../images/coinFront.png'); }
.coin-back { background-image: url('../../images/coinBack.png'); transform: rotateY(180deg); }

#coin-element.drop {
    animation: smoothDrop 0.3s ease-in forwards;
}

@keyframes smoothDrop {
    0% { transform: translateY(0); }
    70% { transform: translateY(12px); }
    100% { transform: translateY(8px); }
}

#coin-element.win-effect {
    animation: winPop 0.4s ease;
}

@keyframes winPop {
    0% { transform: scale(1); filter: drop-shadow(0 0 0 gold); }
    50% { transform: scale(1.15); filter: drop-shadow(0 0 20px gold) drop-shadow(0 0 40px gold); }
    100% { transform: scale(1); filter: drop-shadow(0 0 0 gold); }
}

.win-sparkles {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255,215,0,0.8) 0%, rgba(255,215,0,0) 70%);
    border-radius: 50%;
    animation: sparkle 0.8s ease-out forwards;
    z-index: 5;
}

.win-sparkles.tier-1 { opacity: .72; }
.win-sparkles.tier-2 { opacity: .85; transform: translate(-50%, -50%) scale(1.1); }
.win-sparkles.tier-3 { opacity: .95; transform: translate(-50%, -50%) scale(1.2); }
.win-sparkles.tier-4 { opacity: 1; transform: translate(-50%, -50%) scale(1.28); }
.win-sparkles.tier-max {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.45);
    background: radial-gradient(circle, rgba(255,230,120,0.95) 0%, rgba(255,180,30,0.72) 40%, rgba(255,120,20,0) 75%);
}

@keyframes sparkle {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    20% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.2); }
    80% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.5); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(2); }
}

#coin-element.win-idle {
    animation: idleShake 2s infinite ease-in-out;
}

@keyframes idleShake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    15% { transform: translateX(-3px) rotate(-1deg); }
    30% { transform: translateX(3px) rotate(1deg); }
    45% { transform: translateX(-2px) rotate(-0.5deg); }
    60% { transform: translateX(2px) rotate(0.5deg); }
}

#coin-element.lose-effect {
    animation: loseShake 0.5s ease;
}

@keyframes loseShake {
    0%, 100% { transform: translateX(0); filter: drop-shadow(0 0 0 #f44336); }
    20% { transform: translateX(-8px); filter: drop-shadow(0 0 15px #f44336); }
    40% { transform: translateX(8px); filter: drop-shadow(0 0 15px #f44336); }
    60% { transform: translateX(-4px); filter: drop-shadow(0 0 10px #f44336); }
    80% { transform: translateX(4px); filter: drop-shadow(0 0 10px #f44336); }
}

.lose-skull {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    opacity: 0;
    pointer-events: none;
    animation: skullFloat 0.6s ease-out forwards;
    z-index: 10;
    text-shadow: 0 0 20px red;
}

@keyframes skullFloat {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    20% { opacity: 1; transform: translate(-50%, -80%) scale(1.2); }
    80% { opacity: 1; transform: translate(-50%, -120%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -150%) scale(0.8); }
}

/* ===== MULTIPLIERY - KOMPAKTNÍ ===== */
.multipliers-container {
    width: 100%;
    max-width: 450px;
    margin: 10px auto;
    transition: transform .22s ease, filter .22s ease;
}

.multipliers-container.impact {
    transform: scale(1.02);
}

.multipliers-container.lose-impact {
    animation: multLoseImpact .52s ease-out;
}

.multipliers-container.stage-3,
.multipliers-container.stage-4,
.multipliers-container.stage-5 {
    filter: drop-shadow(0 0 12px rgba(255, 215, 100, 0.35));
}

@keyframes multLoseImpact {
    0%, 100% { transform: translateX(0); filter: none; }
    25% { transform: translateX(-3px); filter: drop-shadow(0 0 10px rgba(244,67,54,0.5)); }
    50% { transform: translateX(3px); }
    75% { transform: translateX(-2px); }
}

.multipliers {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 3px solid var(--border-color, #b89b7a);
    border-radius: 100px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5), 0 4px 0 #0a0806;
    width: fit-content;
    margin: 0 auto;
    max-width: 100%;
}

.mult-item {
    padding: 8px 12px;
    border-radius: 40px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--text-color, #e0d3b0);
    font-weight: 800;
    font-size: 1rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: default;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
    white-space: nowrap;
    min-width: 45px;
    border: 1px solid rgba(255,215,0,0.3);
}

/* Aktuální násobič (dosažen) */
.mult-item.current {
    background: linear-gradient(145deg, #2a4a2a, #1a2e1a);
    color: #4caf50;
    border: 2px solid #4caf50;
    transform: scale(1.08);
    box-shadow: 0 0 18px #4caf50, 0 0 5px rgba(76,175,80,0.5) inset;
    font-size: 1.1rem;
    padding: 8px 15px;
    margin: -1px 0;
}

/* Budoucí násobič — zatlumený, ale viditelný */
.mult-item.future {
    opacity: 0.5;
    color: #888;
    border-color: rgba(255,215,0,0.15);
}

/* Překonaný násobič — crossed out */
.mult-item.past {
    opacity: 0.35;
    color: #555;
    text-decoration: line-through;
    border-color: rgba(255,255,255,0.1);
}

/* 0× base node — dimmer than the real multipliers */
.mult-item.mult-zero {
    font-size: 0.82rem;
    opacity: 0.55;
    min-width: 38px;
    border-color: rgba(255,255,255,0.12);
    background: rgba(0,0,0,0.4);
}
.mult-item.mult-zero.current {
    background: rgba(80,60,20,0.6);
    color: #b89b50;
    border-color: rgba(184,155,80,0.55);
    box-shadow: 0 0 10px rgba(184,155,80,0.25);
    transform: scale(1.04);
    font-size: 0.85rem;
    opacity: 1;
}

.mult-item.current.win-highlight {
    background: linear-gradient(145deg, #4caf50, #2e7d32);
    color: gold;
    border-color: gold;
    box-shadow: 0 0 25px gold;
    animation: multiplierPulse 0.8s infinite alternate;
}

@keyframes multiplierPulse {
    from { transform: scale(1.02); box-shadow: 0 0 15px #4caf50; }
    to { transform: scale(1.05); box-shadow: 0 0 30px gold; }
}

/* Responzivita */
@media (max-width: 600px) {
    .multipliers {
        gap: 3px;
        padding: 5px 8px;
    }
    
    .mult-item {
        padding: 6px 8px;
        font-size: 0.9rem;
        min-width: 38px;
    }
    
    .mult-item.current {
        padding: 6px 12px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .multipliers {
        gap: 2px;
        padding: 4px 6px;
    }
    
    .mult-item {
        padding: 5px 6px;
        font-size: 0.8rem;
        min-width: 32px;
    }
    
    .mult-item.current {
        padding: 5px 10px;
        font-size: 0.9rem;
    }
}

/* ===== MESSAGE ===== */
.message-container {
    width: 100%;
    max-width: 400px;
}

#coin-message {
    min-height: 90px;
    padding: 15px 20px;
    border: 3px solid var(--border-color);
    border-radius: 12px;
    background: rgba(0,0,0,0.6);
    text-align: center;
    font-size: 20px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
}

#coin-message.win {
    border-color: #4caf50;
    background: rgba(0, 30, 0, 0.7);
    color: #4caf50;
}

#coin-message.lose {
    border-color: #f44336;
    background: rgba(30, 0, 0, 0.7);
    color: #f44336;
}

.win-message { font-size: 24px; }
.lose-message { font-size: 22px; }
.win-message-small { font-size: 20px; }
.small-text { font-size: 14px; opacity: 0.9; }

.mult-5-message {
    font-size: 26px;
    font-weight: 900;
    color: gold;
    text-shadow: 0 0 20px gold, 0 0 40px orange;
    animation: pulseGold 1.5s infinite;
}

@keyframes pulseGold {
    0%, 100% { text-shadow: 0 0 20px gold, 0 0 40px orange; }
    50% { text-shadow: 0 0 40px gold, 0 0 80px orange, 0 0 120px red; }
}

/* ===== RESPONZIVITA LAYOUTU ===== */
@media (max-width: 800px) {
    .coin-game .game-layout {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }
    
    .coin-game .left-panel {
        width: 100%;
        max-width: 320px;
    }
    
    .coin-game .right-panel {
        width: 100%;
    }
}

@media (max-width: 700px) {
    .coin-game {
        padding: 6px;
    }

    .coin-game .game-layout {
        gap: 14px;
    }

    .coin-game .left-panel,
    .coin-game .right-panel {
        max-width: 100%;
    }

    .coin-container {
        min-height: 200px;
        padding: 6px;
    }

    #coin-element {
        width: 180px;
        height: 180px;
    }

    #coin-message {
        min-height: 68px;
        font-size: 17px;
        padding: 10px 12px;
    }
}

.coin-game .left-panel,
.coin-game .right-panel {
    min-height: 0;
}

.coin-game .right-panel {
    justify-content: space-between;
    padding: 5px 0 0;
}

.coin-game .coin-container {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
}

.coin-game .message-container {
    margin-top: auto;
}