:root {
    --bg-color: #0b1121;
    --hex-bg: #1e293b;
    --accent: #38bdf8;
    --gold: #fbbf24;
    --danger: #f87171;
    --panel-bg: rgba(15, 23, 42, 0.85);
    --font-main: 'Outfit', sans-serif;
    --turret-yellow: #fbbf24;
    --turret-red: #ef4444;
    --turret-blue: #3b82f6;
}

body {
    margin: 0;
    overflow: hidden;
    background-color: var(--bg-color);
    font-family: var(--font-main);
    color: white;
    user-select: none;
}

canvas {
    display: block;
}

#game-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Top Bar - centered */
.top-bar {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    padding: 1rem;
    pointer-events: auto;
}

.stat-box {
    background: var(--panel-bg);
    backdrop-filter: blur(8px);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.stat-box .label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.05em;
}

.stat-box .value {
    font-size: 1.2rem;
    font-weight: 800;
}

.stat-box .value.yellow {
    color: var(--gold);
}

.stat-box .value.red {
    color: var(--danger);
}

/* Turret Info Panel - top right */
.turret-info-panel {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--panel-bg);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem;
    pointer-events: auto;
    display: flex;
    flex-direction: row;
    gap: 1rem;
}

.info-left {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 160px;
}

.info-right {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 120px;
    padding-left: 1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.control-section {
    padding: 0.4rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

.control-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 0.2rem;
}

.control-desc {
    font-size: 0.6rem;
    color: #94a3b8;
    line-height: 1.3;
    margin-bottom: 0.2rem;
}

.control-hint {
    font-size: 0.6rem;
    color: #e2e8f0;
}

.turret-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.turret-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    flex-shrink: 0;
}

.yellow-icon {
    background: var(--turret-yellow);
}

.red-icon {
    background: var(--turret-red);
}

.blue-icon {
    background: var(--turret-blue);
}

.turret-details {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.turret-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: #e2e8f0;
}

.turret-desc {
    font-size: 0.6rem;
    color: #94a3b8;
}

.merge-info {
    font-size: 0.6rem;
    color: #22c55e;
    font-weight: 600;
}

.panel-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.3rem;
}

/* Shop - right bottom */
.shop-container {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.75rem;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

.shop-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.shop-header span {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e2e8f0;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Shop items - vertical */
.shop-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.shop-slot {
    width: 90px;
    height: 90px;
    background: rgba(30, 41, 59, 0.6);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.shop-slot:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(30, 41, 59, 0.8);
}

.shop-slot.empty {
    opacity: 0.3;
    pointer-events: none;
}

.shop-slot canvas {
    width: 80px;
    height: 80px;
}

.price-tag {
    position: absolute;
    bottom: -8px;
    background: var(--bg-color);
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 1px 6px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
}

/* Start Wave Button */
.btn-primary {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-family: var(--font-main);
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    transition: all 0.2s;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    animation: pulse-btn 2s infinite;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.6);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(0);
}

@keyframes pulse-btn {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}