/* ===== KOŠÍKOVÁ - RESPONZIVNÍ ===== */
:root {
    --border-color: #8b4513;
}

.basket-game {
    width: 100%;
    max-width: 100%;
    padding: 10px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    height: 100%;
    min-height: 100%;
}

.basket-game * {
    box-sizing: border-box;
    user-select: none;
}

.basket-game .game-layout {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
    min-height: 0;
}

/* ===== HEADER ===== */
.basket-game .game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--border-color);
    border-radius: 40px;
    padding: 8px 15px;
}

.basket-game .header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.basket-game .timer {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffd700;
    background: rgba(0, 0, 0, 0.4);
    padding: 5px 15px;
    border-radius: 30px;
    border: 2px solid #ffd700;
    min-width: 70px;
    text-align: center;
}

.basket-game .score {
    font-size: 1.2rem;
    font-weight: 700;
    color: #4caf50;
    background: rgba(0, 0, 0, 0.4);
    padding: 5px 15px;
    border-radius: 30px;
    border: 2px solid #4caf50;
}

.basket-game .start-btn {
    background: linear-gradient(145deg, #8b5a2b, #a67c52);
    border: 2px solid #ffd700;
    border-radius: 30px;
    padding: 5px 20px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffd700;
    cursor: pointer;
    text-shadow: 1px 1px 0 #000;
    white-space: nowrap;
    box-shadow: 0 3px 0 #5a3a1a;
}

.basket-game .start-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== SBĚRAČI ===== */
.basket-game .collectors-row {
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 10px;
}

.basket-game .collector-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 60px;
    border: 2px solid var(--border-color);
    cursor: grab;
    transition: all 0.2s ease;
    flex: 0 1 auto;
    touch-action: none;
}

.basket-game .collector-item.dragging {
    opacity: 0.5;
    transform: scale(1.05);
}

.basket-game .collector-item:hover {
    border-color: #ffd700;
    background: rgba(0, 0, 0, 0.4);
}

.basket-game .collector-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #666;
    background: rgba(0, 0, 0, 0.5);
}

.basket-game .collector-image {
    width: 40px !important;
    height: 45px !important;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
}

.basket-game .collector-1 {
    background-image: url('../../images/basket/collector1.png');
}

.basket-game .collector-2 {
    background-image: url('../../images/basket/collector2.png');
}

.basket-game .collector-dead {
    background-image: url('../../images/basket/collector_dead.png');
}

.basket-game .collector-lives {
    display: flex;
    gap: 3px;
    font-size: 0.9rem;
    pointer-events: none;
}

.basket-game .collector-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    pointer-events: none;
}

.basket-game .collector-number {
    font-weight: bold;
    color: #ffd700;
    font-size: 0.9rem;
}

/* ===== GRID ===== */
.basket-game .grid-container {
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 15px;
    width: 100%;
    flex: 1;
    min-height: 370px;
    height: 100%;
}

.basket-game .columns-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.basket-game .column {
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    transition: all 0.2s ease;
    height: 100%;
    min-height: 0;
    width: 100%;
}

.basket-game .column.drop-highlight {
    border: 2px solid #4caf50;
    box-shadow: 0 0 15px #4caf50;
}

.basket-game .column.drop-invalid {
    border: 2px solid #f44336;
    box-shadow: 0 0 15px #f44336;
}

.basket-game .drop-zone {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(0, 0, 0, 0.5);
    border-top: 2px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.basket-game .drop-zone.empty {
    background-image: url('../../images/basket/drop_zone.png');
    background-size: 30px 35px;
    background-position: center;
    background-repeat: no-repeat;
    background-color: rgba(0, 0, 0, 0.4);
    opacity: 0.8;
}

.basket-game .drop-zone.drop-active {
    background-color: rgba(76, 175, 80, 0.3);
    border-color: #4caf50;
    transform: scale(1.02);
}

.basket-game .drop-zone .collector-placed {
    width: 40px !important;
    height: 50px !important;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    pointer-events: none;
}

.basket-game .drop-zone .collector-lives {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2px;
    font-size: 0.7rem;
    background: rgba(0,0,0,0.8);
    padding: 2px 6px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    white-space: nowrap;
    pointer-events: none;
}

/* ===== FALLING ITEM - OPRAVENÉ ANIMACE ===== */
.falling-item {
    position: absolute;
    width: 24px !important;
    height: 24px !important;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 20;
    left: 50%;
    transform: translateX(-50%);
    animation: moneyFloat 2.2s linear forwards !important;
    top: 0;
}

/* ZÁKLADNÍ ANIMACE PRO VŠECHNY PENÍZE - každá hodnota má vlastní keyframes */
.falling-item.money-100 {
    animation: moneyFloat 2.2s linear forwards, moneySpin100 0.42s steps(10) infinite !important;
    filter: drop-shadow(0 0 5px rgba(245, 245, 245, 0.45));
}

.falling-item.money-200 {
    animation: moneyFloat 2.2s linear forwards, moneySpin200 0.42s steps(10) infinite !important;
    filter: drop-shadow(0 0 6px rgba(150, 255, 170, 0.5));
}

.falling-item.money-500 {
    animation: moneyFloat 2.2s linear forwards, moneySpin500 0.42s steps(10) infinite !important;
    filter: drop-shadow(0 0 7px rgba(125, 225, 255, 0.55));
}

.falling-item.money-1000 {
    animation: moneyFloat 2.2s linear forwards, moneySpin1000 0.42s steps(10) infinite !important;
    filter: drop-shadow(0 0 8px rgba(145, 170, 255, 0.58));
}

.falling-item.money-2000 {
    animation: moneyFloat 2.2s linear forwards, moneySpin2000 0.42s steps(10) infinite !important;
    filter: drop-shadow(0 0 9px rgba(255, 190, 120, 0.65));
}

.falling-item.money-5000 {
    animation: moneyFloat 2.2s linear forwards, moneySpin5000 0.36s steps(10) infinite !important;
    filter: drop-shadow(0 0 12px rgba(255, 215, 90, 0.85));
}

/* SPECIÁLNÍ ITEMY */
.falling-item.pearl {
    animation: moneyFloat 2.2s linear forwards !important;
    background-image: url('../../images/basket/item_pearl.png') !important;
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.85));
}

.falling-item.bag {
    animation: moneyFloat 2.2s linear forwards !important;
    background-image: url('../../images/basket/item_bag_of_money.png') !important;
    filter: drop-shadow(0 0 12px rgba(255, 225, 115, 0.85));
}

.falling-item.heal {
    animation: moneyFloat 2.2s linear forwards !important;
    background-image: url('../../images/basket/item_heal.png') !important;
    filter: drop-shadow(0 0 11px rgba(76, 240, 120, 0.88));
}

.falling-item.bomb {
    animation: moneyFloat 2.2s linear forwards, bombWarningPulse 0.28s ease-in-out infinite !important;
    background-image: url('../../images/basket/bomb.png') !important;
    filter: drop-shadow(0 0 9px rgba(255, 60, 60, 0.82));
}

@keyframes bombWarningPulse {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(255, 70, 70, 0.72));
        transform: translateX(-50%) scale(1);
    }
    45% {
        filter: drop-shadow(0 0 18px rgba(255, 0, 0, 0.95)) drop-shadow(0 0 28px rgba(255, 30, 30, 0.6));
        transform: translateX(-50%) scale(1.08);
    }
}

/* KEYFRAMES PRO VŠECHNY HODNOTY */
@keyframes moneySpin100 {
    0% { background-image: url('../../images/basket/money_100_1.png'); }
    10% { background-image: url('../../images/basket/money_100_2.png'); }
    20% { background-image: url('../../images/basket/money_100_3.png'); }
    30% { background-image: url('../../images/basket/money_100_4.png'); }
    40% { background-image: url('../../images/basket/money_100_5.png'); }
    50% { background-image: url('../../images/basket/money_100_6.png'); }
    60% { background-image: url('../../images/basket/money_100_7.png'); }
    70% { background-image: url('../../images/basket/money_100_8.png'); }
    80% { background-image: url('../../images/basket/money_100_9.png'); }
    90% { background-image: url('../../images/basket/money_100_10.png'); }
    100% { background-image: url('../../images/basket/money_100_10.png'); }
}

@keyframes moneySpin200 {
    0% { background-image: url('../../images/basket/money_200_1.png'); }
    10% { background-image: url('../../images/basket/money_200_2.png'); }
    20% { background-image: url('../../images/basket/money_200_3.png'); }
    30% { background-image: url('../../images/basket/money_200_4.png'); }
    40% { background-image: url('../../images/basket/money_200_5.png'); }
    50% { background-image: url('../../images/basket/money_200_6.png'); }
    60% { background-image: url('../../images/basket/money_200_7.png'); }
    70% { background-image: url('../../images/basket/money_200_8.png'); }
    80% { background-image: url('../../images/basket/money_200_9.png'); }
    90% { background-image: url('../../images/basket/money_200_10.png'); }
    100% { background-image: url('../../images/basket/money_200_10.png'); }
}

@keyframes moneySpin500 {
    0% { background-image: url('../../images/basket/money_500_1.png'); }
    10% { background-image: url('../../images/basket/money_500_2.png'); }
    20% { background-image: url('../../images/basket/money_500_3.png'); }
    30% { background-image: url('../../images/basket/money_500_4.png'); }
    40% { background-image: url('../../images/basket/money_500_5.png'); }
    50% { background-image: url('../../images/basket/money_500_6.png'); }
    60% { background-image: url('../../images/basket/money_500_7.png'); }
    70% { background-image: url('../../images/basket/money_500_8.png'); }
    80% { background-image: url('../../images/basket/money_500_9.png'); }
    90% { background-image: url('../../images/basket/money_500_10.png'); }
    100% { background-image: url('../../images/basket/money_500_10.png'); }
}

@keyframes moneySpin1000 {
    0% { background-image: url('../../images/basket/money_1000_1.png'); }
    10% { background-image: url('../../images/basket/money_1000_2.png'); }
    20% { background-image: url('../../images/basket/money_1000_3.png'); }
    30% { background-image: url('../../images/basket/money_1000_4.png'); }
    40% { background-image: url('../../images/basket/money_1000_5.png'); }
    50% { background-image: url('../../images/basket/money_1000_6.png'); }
    60% { background-image: url('../../images/basket/money_1000_7.png'); }
    70% { background-image: url('../../images/basket/money_1000_8.png'); }
    80% { background-image: url('../../images/basket/money_1000_9.png'); }
    90% { background-image: url('../../images/basket/money_1000_10.png'); }
    100% { background-image: url('../../images/basket/money_1000_10.png'); }
}

@keyframes moneySpin2000 {
    0% { background-image: url('../../images/basket/money_2000_1.png'); }
    10% { background-image: url('../../images/basket/money_2000_2.png'); }
    20% { background-image: url('../../images/basket/money_2000_3.png'); }
    30% { background-image: url('../../images/basket/money_2000_4.png'); }
    40% { background-image: url('../../images/basket/money_2000_5.png'); }
    50% { background-image: url('../../images/basket/money_2000_6.png'); }
    60% { background-image: url('../../images/basket/money_2000_7.png'); }
    70% { background-image: url('../../images/basket/money_2000_8.png'); }
    80% { background-image: url('../../images/basket/money_2000_9.png'); }
    90% { background-image: url('../../images/basket/money_2000_10.png'); }
    100% { background-image: url('../../images/basket/money_2000_10.png'); }
}

@keyframes moneySpin5000 {
    0% { background-image: url('../../images/basket/money_5000_1.png'); }
    10% { background-image: url('../../images/basket/money_5000_2.png'); }
    20% { background-image: url('../../images/basket/money_5000_3.png'); }
    30% { background-image: url('../../images/basket/money_5000_4.png'); }
    40% { background-image: url('../../images/basket/money_5000_5.png'); }
    50% { background-image: url('../../images/basket/money_5000_6.png'); }
    60% { background-image: url('../../images/basket/money_5000_7.png'); }
    70% { background-image: url('../../images/basket/money_5000_8.png'); }
    80% { background-image: url('../../images/basket/money_5000_9.png'); }
    90% { background-image: url('../../images/basket/money_5000_10.png'); }
    100% { background-image: url('../../images/basket/money_5000_10.png'); }
}

@keyframes moneyFloat {
    0% { top: 0; opacity: 1; }
    90% { opacity: 1; }
    100% { top: calc(100% - 75px); opacity: 1; }
}

@keyframes pearlGlow {
    0% { filter: drop-shadow(0 0 12px #e91e63) drop-shadow(0 0 20px #ff9800); }
    50% { filter: drop-shadow(0 0 20px #ff9800) drop-shadow(0 0 30px #e91e63) drop-shadow(0 0 10px #ffffff); }
    100% { filter: drop-shadow(0 0 12px #e91e63) drop-shadow(0 0 20px #ff9800); }
}

@keyframes bagGlow {
    0% { filter: drop-shadow(0 0 15px #ffd700) drop-shadow(0 0 25px #ff9800); }
    50% { filter: drop-shadow(0 0 25px #ff9800) drop-shadow(0 0 35px #ffd700) drop-shadow(0 0 15px #ff5722); }
    100% { filter: drop-shadow(0 0 15px #ffd700) drop-shadow(0 0 25px #ff9800); }
}

/* ===== FLOATING TEXT ===== */
.basket-floating {
    position: fixed;
    font-weight: bold;
    font-size: 1.1rem;
    pointer-events: none;
    z-index: 9999;
    text-shadow: 2px 2px 3px #000;
    animation: basketFloat 1s ease-out forwards;
    white-space: nowrap;
}

.basket-floating.win { color: #4caf50; }
.basket-floating.lose { color: #f44336; }
.basket-floating.special { color: #ffd700; }

@keyframes basketFloat {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    20% { opacity: 1; transform: translate(-50%, -40px) scale(1.2); }
    80% { opacity: 1; transform: translate(-50%, -70px) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -100px) scale(0.8); }
}

/* ===== MAFIA POPUP ===== */
.basket-game .mafia-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(145deg, #1e1a1a, #2a1f1a);
    border: 3px solid #8b4513;
    border-radius: 15px;
    padding: 20px;
    z-index: 10001;
    min-width: 260px;
    text-align: center;
    color: #f5e6d3;
}

.basket-game .mafia-popup .popup-icon { font-size: 3rem; margin-bottom: 5px; }
.basket-game .mafia-popup .popup-title { font-size: 1.3rem; color: #cd7f32; margin-bottom: 10px; }
.basket-game .mafia-popup .popup-button {
    background: linear-gradient(145deg, #8b4513, #cd7f32);
    border: none;
    border-radius: 30px;
    padding: 8px 25px;
    font-size: 1rem;
    font-weight: bold;
    color: #000;
    cursor: pointer;
    border: 1px solid #ffd700;
    margin-top: 10px;
}

/* ===== RESPONZIVITA ===== */
@media (max-width: 700px) {
    .basket-game {
        height: auto !important;
        min-height: 420px;
        padding: 10px;
    }
    
    .basket-game .game-layout {
        gap: 12px;
    }
    
    .basket-game .game-header {
        height: auto !important;
        padding: 8px 15px !important;
        flex-wrap: nowrap;
        justify-content: space-between;
    }
    
    .basket-game .header-left {
        flex: 1;
        gap: 8px;
    }
    
    .basket-game .timer,
    .basket-game .score {
        font-size: 0.9rem;
        padding: 4px 8px;
        min-width: 50px;
        line-height: 20px;
    }
    
    .basket-game .start-btn {
        font-size: 0.9rem;
        padding: 4px 12px;
        line-height: 20px;
        white-space: nowrap;
    }
    
    .basket-game .play-area {
        flex-direction: column;
        height: auto !important;
    }
    
    .basket-game .collectors-panel {
        width: 100%;
        height: auto !important;
        flex-direction: row;
        justify-content: space-between;
        padding: 8px 12px;
        gap: 10px;
    }
    
    .basket-game .collectors-title {
        display: none;
    }
    
    .basket-game .collector-item {
        flex: 1;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        padding: 6px 8px !important;
        gap: 8px !important;
        min-height: 60px;
        margin: 0;
        touch-action: none;
    }
    
    .basket-game .collector-image {
        width: 35px !important;
        height: 40px !important;
    }
    
    .basket-game .collector-lives {
        font-size: 0.9rem;
        gap: 2px;
    }
    
    .basket-game .collector-item div:last-child {
        font-size: 0.8rem;
    }
    
    .basket-game .grid-container {
        height: auto !important;
        min-height: 300px;
        width: 100%;
        padding: 8px !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .basket-game .columns-grid {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 6px;
        width: 100%;
        height: 100%;
        min-height: 280px;
    }
    
    .basket-game .column {
        width: 100%;
        height: 100%;
        min-height: 260px;
        aspect-ratio: auto;
    }
    
    .basket-game .drop-zone {
        height: 55px !important;
    }
    
    .basket-game .drop-zone .collector-placed {
        width: 40px !important;
        height: 45px !important;
    }
    
    .basket-game .drop-zone .collector-lives {
        top: -18px !important;
        font-size: 0.65rem !important;
        padding: 2px 4px !important;
    }
    
    .falling-item {
        width: 22px !important;
        height: 22px !important;
    }
    
    @keyframes moneyFloat {
        0% { top: 0; }
        100% { top: calc(100% - 60px); }
    }
}

@media (max-width: 600px) {
    .basket-game .game-header {
        padding: 6px 12px !important;
    }
    
    .basket-game .timer,
    .basket-game .score {
        font-size: 0.85rem;
        padding: 3px 6px;
        min-width: 45px;
    }
    
    .basket-game .start-btn {
        font-size: 0.85rem;
        padding: 3px 10px;
    }
    
    .basket-game .collectors-panel {
        padding: 6px 10px;
    }
    
    .basket-game .collector-item {
        padding: 4px 6px !important;
        gap: 5px !important;
    }
    
    .basket-game .collector-image {
        width: 30px !important;
        height: 35px !important;
    }
    
    .basket-game .collector-lives {
        font-size: 0.8rem;
    }
    
    .basket-game .grid-container {
        min-height: 280px;
    }
    
    .basket-game .columns-grid {
        min-height: 260px;
    }
    
    .basket-game .column {
        min-height: 230px;
    }
    
    .basket-game .drop-zone {
        height: 50px !important;
    }
    
    .falling-item {
        width: 20px !important;
        height: 20px !important;
    }
    
    @keyframes moneyFloat {
        100% { top: calc(100% - 55px); }
    }
}

@media (max-width: 480px) {
    .basket-game .game-header {
        padding: 5px 10px !important;
    }
    
    .basket-game .timer,
    .basket-game .score {
        font-size: 0.75rem;
        padding: 2px 5px;
        min-width: 40px;
    }
    
    .basket-game .start-btn {
        font-size: 0.75rem;
        padding: 2px 8px;
    }
    
    .basket-game .collectors-panel {
        padding: 5px 8px;
    }
    
    .basket-game .collector-item {
        padding: 3px 5px !important;
        gap: 4px !important;
    }
    
    .basket-game .collector-image {
        width: 25px !important;
        height: 30px !important;
    }
    
    .basket-game .collector-lives {
        font-size: 0.7rem;
        gap: 1px;
    }
    
    .basket-game .grid-container {
        min-height: 240px;
    }
    
    .basket-game .columns-grid {
        min-height: 220px;
        gap: 4px;
    }
    
    .basket-game .column {
        min-height: 190px;
    }
    
    .basket-game .drop-zone {
        height: 45px !important;
    }
    
    .basket-game .drop-zone .collector-placed {
        width: 30px !important;
        height: 35px !important;
    }
    
    .falling-item {
        width: 18px !important;
        height: 18px !important;
    }
    
    @keyframes moneyFloat {
        100% { top: calc(100% - 50px); }
    }
}

@media (min-width: 701px) and (max-width: 900px) {
    .basket-game {
        max-width: 100%;
    }
    
    .basket-game .collectors-panel {
        width: 120px;
    }
    
    .basket-game .collector-image {
        width: 40px !important;
        height: 45px !important;
    }
}