/* Ant Swarm - Style System */

:root {
    --font-outfit: 'Outfit', sans-serif;
    --color-coin: #ffb703;
    --color-coin-dark: #fb8500;
    --color-ant: #00b4d8;
    --color-bg-pill: rgba(255, 255, 255, 0.85);
    --color-text-main: #2b2d42;
    --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: var(--font-outfit); user-select: none; -webkit-user-drag: none; }
body, html { width: 100vw; height: 100vh; overflow: hidden; background-color: #6a994e; }

#gameCanvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: block; z-index: 1; }
#ui-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; pointer-events: none; }
.hud-top-left, .hud-top-right, .hud-bottom, .overlay-modal, #colony-management-panel { pointer-events: auto; }

.hud-top-left { position: absolute; top: 20px; left: 20px; display: flex; gap: 15px; }
.stat-pill {
    background: var(--color-bg-pill); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 3px solid white; border-radius: 30px; padding: 8px 20px; display: flex; align-items: center; gap: 8px;
    box-shadow: var(--shadow-soft); transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.stat-pill:hover { transform: scale(1.05); }
.emoji-icon { font-size: 1.8rem; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }
.stat-value { font-size: 1.8rem; font-weight: 900; color: var(--color-text-main); }
.stat-label { font-size: 0.9rem; font-weight: 700; color: #8d99ae; text-transform: uppercase; margin-top: 4px; }

#pill-coins { border-color: var(--color-coin); }
#pill-colony { border-color: var(--color-ant); }
#pill-food { border-color: #6a994e; }
#pill-dirt { border-color: #9c6644; }

.hud-top-right { position: absolute; top: 20px; right: 20px; }
.btn-primary {
    background: linear-gradient(135deg, #ff4d6d 0%, #c1121f 100%); color: white; font-size: 1.2rem; font-weight: 900;
    border: 3px solid white; border-radius: 30px; padding: 12px 24px; cursor: pointer; box-shadow: var(--shadow-soft);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.btn-primary:hover { transform: scale(1.05) translateY(-2px); box-shadow: 0 12px 28px rgba(193, 18, 31, 0.4); }
.btn-primary:active { transform: scale(0.95); }

/* --- Job Management Panel --- */
#colony-management-panel {
    position: absolute; right: 20px; top: 90px; width: 320px;
    background: rgba(255,255,255,0.9); backdrop-filter: blur(10px);
    border: 4px solid var(--color-ant); border-radius: 20px; padding: 20px;
    box-shadow: var(--shadow-soft); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#colony-management-panel.hidden { transform: translateX(400px); display: block !important; }
#colony-management-panel h2 { color: var(--color-text-main); font-size: 1.5rem; margin-bottom: 5px; }
.panel-subtitle { color: #d90429; font-weight: bold; margin-bottom: 15px; }

.job-row {
    background: white; border: 2px solid #e9ecef; border-radius: 15px; padding: 10px;
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;
}
.job-info { display: flex; align-items: center; gap: 10px; }
.job-icon { font-size: 1.8rem; }
.job-text h4 { font-size: 1.1rem; color: var(--color-text-main); margin: 0; }
.job-text small { color: #6c757d; font-size: 0.8rem; }
.job-controls { display: flex; align-items: center; gap: 8px; }
.btn-job {
    background: #e9ecef; border: none; border-radius: 8px; width: 30px; height: 30px;
    font-size: 1.2rem; font-weight: bold; cursor: pointer; color: var(--color-text-main);
}
.btn-job:hover { background: #ced4da; }
.btn-job:active { transform: scale(0.9); }
.job-count { font-weight: 900; font-size: 1.2rem; width: 25px; text-align: center; color: var(--color-ant); }

.hud-bottom { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 15px; }
.controls-hint { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); border-radius: 20px; padding: 10px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: white; }
.key-hint { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.primary-hint { font-size: 1.2rem; color: var(--color-coin); }
.key { background: white; color: #2b2d42; padding: 4px 10px; border-radius: 8px; font-size: 0.9rem; box-shadow: 0 4px 0 #d9d9d9; font-weight: 900; }
.key.spacebar { padding: 4px 30px; }
.mobile-hint { display: none; }
.hidden { display: none !important; }

/* --- Modals --- */
.overlay-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 100; display: flex; justify-content: center; align-items: center; }
.modal-card { background: white; border-radius: 30px; padding: 40px; max-width: 450px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,0.3); border: 5px solid var(--color-coin); animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.wide-card { max-width: 600px; position: relative; }
.modal-card h1 { font-size: 2.5rem; color: var(--color-text-main); margin-bottom: 15px; }
.modal-card h2 { font-size: 2rem; color: var(--color-text-main); margin-bottom: 20px; }
.modal-card p { font-size: 1.2rem; color: #4a4e69; line-height: 1.5; margin-bottom: 15px; }
.btn-action { background: var(--color-coin); color: white; font-size: 1.5rem; font-weight: 900; border: none; border-radius: 40px; padding: 15px 40px; margin-top: 20px; cursor: pointer; box-shadow: 0 8px 0 var(--color-coin-dark); transition: transform 0.1s; }
.btn-action:active { transform: translateY(8px); box-shadow: 0 0 0 var(--color-coin-dark); }
.btn-close { position: absolute; top: 15px; right: 15px; background: none; border: none; font-size: 1.5rem; cursor: pointer; transition: transform 0.2s; }
.btn-close:hover { transform: scale(1.2) rotate(90deg); }

.upgrades-grid { display: flex; flex-direction: column; gap: 15px; }
.upgrade-item { background: #f8f9fa; border: 2px solid #e9ecef; border-radius: 20px; padding: 15px; display: flex; align-items: center; gap: 15px; text-align: left; }
.upg-icon { font-size: 2.5rem; }
.upg-info { flex: 1; }
.upg-info h3 { font-size: 1.2rem; color: var(--color-text-main); }
.upg-info p { font-size: 0.9rem; color: #6c757d; margin: 0; }
.btn-buy { background: var(--color-coin); color: white; border: none; font-weight: 900; font-size: 1.1rem; padding: 10px 20px; border-radius: 20px; box-shadow: 0 5px 0 var(--color-coin-dark); cursor: pointer; }
.btn-buy:active { transform: translateY(5px); box-shadow: 0 0 0 var(--color-coin-dark); }
.btn-buy:disabled { background: #ced4da; box-shadow: 0 5px 0 #adb5bd; cursor: not-allowed; }

.hats-section { margin-top: 10px; text-align: left; }
.hats-section h3 { margin-bottom: 10px; }
.hats-list { display: flex; gap: 10px; }
.btn-hat { background: #f8f9fa; border: 2px solid #e9ecef; padding: 10px; border-radius: 15px; font-weight: 700; cursor: pointer; transition: all 0.2s; }
.btn-hat.active { background: var(--color-coin); color: white; border-color: var(--color-coin-dark); }

@keyframes popIn { 0% { transform: scale(0.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
