* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    user-select: none;
    /* Metin seçimini engelle */
}

body {
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 50%, #0f1429 100%);
    background-attachment: fixed;
    color: #e0e0e0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
    padding-bottom: 20px;
}

/* SAYAÇ VE PARA BİLGİSİ */
.turn-timer {
    width: 90%;
    max-width: 800px;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.timer-bar {
    width: 100%;
    height: 10px;
    background-color: #666;
    border-radius: 5px;
    overflow: hidden;
}

#timer-fill {
    height: 100%;
    width: 100%;
    background-color: #ef5350;
    transition: width 0.1s linear;
}

.money-display {
    font-weight: bold;
    font-size: 1.2rem;
    color: #43a047;
}

.container {
    width: 95%;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
}

/* --- MAIN BAR STYLES --- */
.main-bar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 100px;
}

.bar-label {
    font-weight: 800;
    font-size: 1.2rem;
    width: 200px;
    text-align: center;
    line-height: 1.4;
}

.bar-label.left {
    color: #0277bd;
}

.bar-label.right {
    color: #c62828;
}

.progress-track {
    flex-grow: 1;
    height: 70px;
    background-color: #555;
    border-radius: 10px;
    overflow: visible;
    display: flex;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
    margin: 0 30px;
    border: 2px solid #444;
}

.progress-fill {
    pointer-events: none;
    z-index: 1;
    height: 100%;
    /* transition kaldirildi */
}

.progress-fill.blue {
    display: none;
}

.progress-fill.red {
    display: none;
}

/* --- ALT BÖLÜM --- */
.bottom-section {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* Dikey hizalama üstten başlasın */
    gap: 100px;
    width: 100%;
    padding: 0 20px;
}

/* SOL TARAF: KÜÇÜK BARLAR */
.small-bars-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 30px;
    width: 500px;
}

.small-bar-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.small-label {
    font-size: 0.9rem;
    font-weight: bold;
    color: #666;
    margin-left: 10px;
}

.small-track {
    width: 100%;
    height: 35px;
    background-color: #555;
    border-radius: 17px;
    overflow: visible;
    display: flex;
    border: 1px solid #444;
}

.small-fill {
    pointer-events: none;
    z-index: 1;
    height: 100%;
    /* transition kaldirildi */
}

.small-fill.blue {
    display: none;
}

.small-fill.red {
    display: none;
}

/* SAĞ TARAF: BUTONLAR */
.buttons-wrapper {
    display: flex;
    flex-wrap: wrap;
    /* Butonlar sığmazsa aşağı kaysın */
    justify-content: center;
    gap: 20px;
    width: 500px;
}

.square-btn {
    width: 110px;
    height: 130px;
    /* Yazı ve maliyet sığsın diye uzattık */
    background-color: #ffffff;
    border: 3px solid #d7ccc8;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.05);
    position: relative;
}

.square-btn:hover {
    border-color: #0277bd;
    transform: translateY(-5px);
    background-color: #f0f8ff;
}

.square-btn:active {
    transform: scale(0.95);
}

/* Yetersiz para durumu için class */
.square-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
    border-color: #ccc;
    background-color: #eee;
}

.square-btn img {
    width: 50px;
    height: 50px;
    margin-bottom: 5px;
    object-fit: contain;
}

.btn-name {
    font-size: 12px;
    font-weight: 800;
    color: #555;
    text-align: center;
}

.btn-cost {
    font-size: 11px;
    color: #d32f2f;
    font-weight: bold;
    margin-top: 3px;
}

/* ===================== */
/* HAREKETLI KUTULAR     */
/* ===================== */
.progress-track,
.small-track {
    position: relative;
    overflow: visible;
}

.moving-box {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    opacity: 0.95;
}

.moving-box.player {
    background: linear-gradient(135deg, #00bcd4, #0288d1);
    animation: moveToEnemy 3s linear forwards;
    box-shadow:
        0 0 8px rgba(0, 188, 212, 0.8),
        0 0 15px rgba(0, 188, 212, 0.6),
        0 0 25px rgba(0, 188, 212, 0.4);
}

.moving-box.enemy {
    background: linear-gradient(135deg, #ff5252, #f44336);
    animation: moveToPlayer 3s linear forwards;
    box-shadow:
        0 0 8px rgba(255, 82, 82, 0.8),
        0 0 15px rgba(255, 82, 82, 0.6),
        0 0 25px rgba(255, 82, 82, 0.4);
}

.moving-box.collide {
    animation-name: collisionEffect !important;
    animation-duration: 0.3s !important;
    animation-timing-function: ease-out !important;
    animation-fill-mode: forwards !important;
}

@keyframes moveToEnemy {
    from {
        left: -5%;
    }

    to {
        left: 105%;
    }
}

@keyframes moveToPlayer {
    from {
        left: 105%;
    }

    to {
        left: -5%;
    }
}

@keyframes collisionEffect {
    0% {
        transform: translateY(-50%) scale(1);
        opacity: 0.95;
        box-shadow: 0 0 15px rgba(255, 255, 100, 0.8);
    }

    50% {
        transform: translateY(-50%) scale(2);
        opacity: 1;
        box-shadow:
            0 0 30px rgba(255, 255, 255, 1),
            0 0 50px rgba(255, 215, 0, 0.8),
            0 0 70px rgba(255, 165, 0, 0.6);
    }

    100% {
        transform: translateY(-50%) scale(0);
        opacity: 0;
    }
}

/* ===================== */
/* ALTIGEN BUTONLAR      */
/* ===================== */
.hex-btn {
    width: 120px;
    height: 140px;
    background: linear-gradient(145deg, rgba(30, 40, 70, 0.8), rgba(20, 30, 50, 0.9));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    border: none;
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(100, 150, 255, 0.3),
        inset 0 0 15px rgba(100, 150, 255, 0.1);
}

.hex-btn::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    background: linear-gradient(145deg, rgba(40, 50, 80, 0.9), rgba(25, 35, 60, 0.95));
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    z-index: -1;
}

.hex-btn:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow:
        0 15px 35px rgba(0, 188, 212, 0.4),
        0 0 30px rgba(0, 188, 212, 0.6),
        0 0 50px rgba(0, 188, 212, 0.3),
        inset 0 0 20px rgba(0, 188, 212, 0.2);
    background: linear-gradient(145deg, rgba(0, 188, 212, 0.3), rgba(0, 150, 180, 0.4));
}

.hex-btn:active {
    transform: translateY(-2px) scale(0.98);
}

.hex-btn.disabled {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(50%);
}

.hex-btn img {
    width: 45px;
    height: 45px;
    margin-bottom: 8px;
    object-fit: contain;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.1));
}

.hex-btn .btn-name {
    font-size: 11px;
    font-weight: 800;
    color: #90caf9;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 0 8px rgba(144, 202, 249, 0.6);
}

.hex-btn .btn-cost {
    font-size: 10px;
    color: #ff5252;
    font-weight: bold;
    margin-top: 4px;
    text-shadow: 0 0 8px rgba(255, 82, 82, 0.6);
}