/* ============================================
   ANIMAL SYSTEM STYLES
   ============================================ */

/* ========================================
   MAIN ANIMALS PAGE
   ======================================== */

.animals-page {
    min-height: 100vh;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    padding-bottom: 30px;
}

.animals-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-bottom: 3px solid #4ade80;
    position: sticky;
    top: 0;
    z-index: 100;
}

.animals-header h1 {
    margin: 0;
    color: #4ade80;
    font-size: 28px;
}

.animals-stats {
    display: flex;
    gap: 20px;
}

.animals-stats .stat-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 16px;
    border-radius: 8px;
    color: #fbbf24;
    font-weight: bold;
}

/* ========================================
   FACILITY GRID
   ======================================== */

.facilities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.facility-card {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border: 2px solid #475569;
    border-radius: 16px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    gap: 20px;
    align-items: center;
}

.facility-card:hover:not(.locked) {
    transform: translateY(-5px);
    border-color: #4ade80;
    box-shadow: 0 10px 30px rgba(74, 222, 128, 0.2);
}

.facility-card.built {
    border-color: #4ade80;
    background: linear-gradient(135deg, #14532d 0%, #1e293b 100%);
}

.facility-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.facility-icon {
    font-size: 64px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.facility-info {
    flex: 1;
}

.facility-info h3 {
    margin: 0 0 10px 0;
    color: #e2e8f0;
    font-size: 22px;
}

.facility-info .locked-text {
    color: #94a3b8;
    font-style: italic;
}

.facility-info .not-built-text {
    color: #fbbf24;
    margin-bottom: 10px;
}

.facility-info .animal-count {
    color: #4ade80;
    font-size: 18px;
    margin: 0;
}

.facility-level {
    display: inline-block;
    background: #3b82f6;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    margin-top: 8px;
}

.build-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.build-btn:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    transform: scale(1.05);
}

.facility-status {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-end;
}

.status-icon {
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 14px;
}

.status-icon.ready {
    background: rgba(74, 222, 128, 0.3);
    color: #4ade80;
}

.status-icon.hungry {
    background: rgba(251, 191, 36, 0.3);
    color: #fbbf24;
}

.status-icon.unhappy {
    background: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.status-ok {
    color: #4ade80;
    font-size: 14px;
}

.status-empty {
    color: #94a3b8;
    font-size: 14px;
    font-style: italic;
}

/* ========================================
   TIPS SECTION
   ======================================== */

.animals-tips {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px 30px;
    background: rgba(59, 130, 246, 0.1);
    border: 2px solid #3b82f6;
    border-radius: 12px;
}

.animals-tips h3 {
    color: #60a5fa;
    margin: 0 0 15px 0;
}

.animals-tips ul {
    margin: 0;
    padding-left: 20px;
    color: #cbd5e1;
}

.animals-tips li {
    margin-bottom: 8px;
}

/* ========================================
   FACILITY VIEW (Interactive Pen)
   ======================================== */

.facility-view {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #0f172a;
}

.facility-view-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px 20px;
    background: #1e293b;
    border-bottom: 2px solid #334155;
}

.back-btn {
    background: #475569;
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
}

.back-btn:hover {
    background: #64748b;
}

.facility-view-header h1 {
    flex: 1;
    margin: 0;
    color: #4ade80;
    font-size: 24px;
}

.facility-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border: none;
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.action-btn:hover {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    transform: translateY(-2px);
}

.action-btn.feed-all {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.action-btn.feed-all:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.action-btn.collect-all {
    background: linear-gradient(135deg, #4ade80, #22c55e);
}

.action-btn.collect-all:hover {
    background: linear-gradient(135deg, #86efac, #4ade80);
}

.action-btn.breeding-btn {
    background: linear-gradient(135deg, #ec4899, #be185d);
}

.action-btn.breeding-btn:hover {
    background: linear-gradient(135deg, #f472b6, #ec4899);
}

/* Stats Bar */
.facility-stats-bar {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 15px;
    background: rgba(30, 41, 59, 0.8);
    border-bottom: 1px solid #334155;
}

.facility-stats-bar .stat {
    display: flex;
    gap: 8px;
    align-items: center;
}

.facility-stats-bar .label {
    color: #94a3b8;
}

.facility-stats-bar .value {
    color: #4ade80;
    font-weight: bold;
    font-size: 18px;
}

/* Canvas Container */
.facility-canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 400px;
}

#facilityCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

.interaction-hints {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 20px;
    color: #94a3b8;
    font-size: 13px;
}

/* Inventory Bar */
.animal-inventory-bar {
    background: #1e293b;
    border-top: 2px solid #334155;
    padding: 15px 20px;
}

.animal-inventory-bar h4 {
    margin: 0 0 10px 0;
    color: #94a3b8;
    font-size: 14px;
}

.inventory-items {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.inventory-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #334155;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: grab;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.inventory-item:hover:not(.empty) {
    background: #475569;
    border-color: #60a5fa;
}

.inventory-item.empty {
    opacity: 0.4;
    cursor: not-allowed;
}

.inventory-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.item-icon {
    font-size: 24px;
}

.item-name {
    color: #e2e8f0;
    font-weight: 500;
}

.item-qty {
    background: #4ade80;
    color: #0f172a;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
}

/* ========================================
   SELECTED ANIMAL PANEL
   ======================================== */

.selected-animal-panel {
    position: absolute;
    right: 20px;
    top: 150px;
    width: 320px;
    background: rgba(30, 41, 59, 0.95);
    border: 2px solid #4ade80;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 100;
    overflow: hidden;
}

.animal-panel-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #14532d 0%, #1e293b 100%);
    border-bottom: 2px solid #334155;
}

.animal-panel-header .animal-icon {
    font-size: 48px;
}

.animal-name-edit {
    flex: 1;
}

.animal-name-edit input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #475569;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 18px;
    font-weight: bold;
    padding: 6px 10px;
    width: 100%;
}

.animal-name-edit input:focus {
    outline: none;
    border-color: #4ade80;
}

.close-panel {
    background: #475569;
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
}

.close-panel:hover {
    background: #64748b;
}

/* Animal Stats */
.animal-stats {
    padding: 15px;
}

.stat-bar {
    margin-bottom: 12px;
}

.stat-bar .label {
    display: block;
    color: #94a3b8;
    font-size: 13px;
    margin-bottom: 5px;
}

.stat-bar .bar-container {
    height: 12px;
    background: #1e293b;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 3px;
}

.stat-bar .bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.3s;
}

.stat-bar .bar.happiness {
    background: linear-gradient(90deg, #f87171, #fbbf24, #4ade80);
}

.stat-bar .bar.hunger {
    background: linear-gradient(90deg, #f87171, #fbbf24, #4ade80);
}

.stat-bar .bar.production {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.stat-bar .value {
    color: #e2e8f0;
    font-size: 12px;
    font-weight: bold;
}

/* Animal Actions */
.animal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 15px 15px;
}

.animal-actions button {
    background: #334155;
    border: none;
    color: white;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.animal-actions button:hover:not(:disabled) {
    background: #475569;
}

.animal-actions button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.animal-actions .sell-btn {
    background: #991b1b;
}

.animal-actions .sell-btn:hover {
    background: #b91c1c;
}

/* Animal Info */
.animal-info {
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid #334155;
}

.animal-info p {
    margin: 5px 0;
    color: #94a3b8;
    font-size: 13px;
}

.animal-info strong {
    color: #e2e8f0;
}

/* ========================================
   ANIMAL MODALS
   ======================================== */

.animal-modal {
    max-width: 500px;
}

.animal-modal .modal-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 25px;
    background: linear-gradient(135deg, #14532d 0%, #1e293b 100%);
    border-bottom: 2px solid #334155;
}

.animal-modal .modal-header.warning {
    background: linear-gradient(135deg, #7f1d1d 0%, #1e293b 100%);
}

.animal-modal .modal-icon {
    font-size: 48px;
}

.animal-modal .modal-header h2 {
    margin: 0;
    color: #4ade80;
    font-size: 24px;
}

.animal-modal .modal-header.warning h2 {
    color: #fca5a5;
}

.animal-modal .modal-body {
    padding: 25px;
}

.animal-modal .modal-body p {
    color: #cbd5e1;
    margin-bottom: 15px;
}

.cost-display {
    background: rgba(251, 191, 36, 0.1);
    border: 2px solid #fbbf24;
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
}

.cost-display h4 {
    color: #fbbf24;
    margin: 0 0 10px 0;
}

.cost-display .has {
    color: #4ade80;
}

.cost-display .needs {
    color: #f87171;
}

.capacity-info {
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    padding: 12px;
    margin-top: 15px;
}

.capacity-info p {
    margin: 0;
    color: #60a5fa;
}

.capacity-info .warning {
    color: #fbbf24;
    margin-top: 10px;
}

.upgrade-benefits {
    background: rgba(74, 222, 128, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
}

.upgrade-benefits h4 {
    color: #4ade80;
    margin: 0 0 10px 0;
}

.upgrade-benefits ul {
    margin: 0;
    padding-left: 20px;
    color: #cbd5e1;
}

.upgrade-benefits li {
    margin-bottom: 5px;
}

.variant-select {
    margin: 15px 0;
}

.variant-select label {
    display: block;
    color: #94a3b8;
    margin-bottom: 8px;
}

.variant-select select {
    width: 100%;
    background: #334155;
    border: 2px solid #475569;
    border-radius: 8px;
    color: #e2e8f0;
    padding: 10px;
    font-size: 16px;
}

.variant-select select:focus {
    outline: none;
    border-color: #4ade80;
}

.animal-preview {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 15px 0;
}

.variant-preview {
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.variant-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Mystery Variant Box */
.variant-mystery {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(59, 130, 246, 0.2) 100%);
    border: 2px dashed #8b5cf6;
    border-radius: 12px;
    margin: 15px 0;
}

.mystery-box {
    font-size: 48px;
    animation: wiggle 1s ease-in-out infinite;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.mystery-text {
    color: #c4b5fd;
    font-size: 16px;
    font-style: italic;
    margin: 0;
}

.cost-display .not-enough {
    color: #f87171;
}

.sell-price {
    color: #fbbf24 !important;
    font-size: 18px;
    font-weight: bold;
}

.animal-modal .modal-footer {
    display: flex;
    gap: 15px;
    padding: 20px 25px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid #334155;
}

.btn-confirm {
    flex: 2;
    background: linear-gradient(135deg, #4ade80, #22c55e);
    border: none;
    color: #0f172a;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-confirm:hover:not(:disabled) {
    background: linear-gradient(135deg, #86efac, #4ade80);
    transform: translateY(-2px);
}

.btn-confirm:disabled {
    background: #475569;
    cursor: not-allowed;
}

.btn-cancel {
    flex: 1;
    background: #475569;
    border: none;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.btn-cancel:hover {
    background: #64748b;
}

.btn-danger {
    flex: 2;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    border: none;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #f87171, #ef4444);
}

/* ========================================
   LOADING STATE
   ======================================== */

.animals-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    color: #94a3b8;
}

/* ========================================
   RESPONSIVE
   ======================================== */

/* ========================================
   ANIMALS PAGE STATS BAR
   ======================================== */

.animals-stats-bar {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 12px 20px;
    background: rgba(30, 41, 59, 0.9);
    border-bottom: 1px solid #334155;
    flex-wrap: wrap;
}

.animals-stats-bar .stat-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 14px;
    border-radius: 8px;
    color: #e2e8f0;
    font-weight: 500;
    font-size: 14px;
    cursor: default;
}

.animals-stats-bar .stat-item:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* Shop Button in Header */
.shop-btn {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
}

.shop-btn:hover {
    background: linear-gradient(135deg, #a78bfa, #8b5cf6);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

/* ========================================
   HUSBANDRY STORE MODAL
   ======================================== */

.husbandry-store-modal {
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
}

.husbandry-store-modal .modal-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 25px;
    background: linear-gradient(135deg, #4c1d95 0%, #1e293b 100%);
    border-bottom: 2px solid #8b5cf6;
    position: sticky;
    top: 0;
    z-index: 10;
}

.husbandry-store-modal .modal-header h2 {
    margin: 0;
    color: #c4b5fd;
    font-size: 24px;
}

.husbandry-store-modal .modal-icon {
    font-size: 36px;
}

.store-balance {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: rgba(251, 191, 36, 0.1);
    border-bottom: 1px solid #334155;
}

.store-balance span {
    color: #94a3b8;
    font-size: 16px;
}

.store-balance .balance-amount {
    color: #fbbf24;
    font-weight: bold;
    font-size: 20px;
}

.store-content {
    padding: 20px;
}

.store-category {
    margin-bottom: 25px;
}

.store-category h3 {
    color: #e2e8f0;
    font-size: 18px;
    margin: 0 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #475569;
}

.store-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.store-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(51, 65, 85, 0.5);
    padding: 15px;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.store-item:hover:not(.cant-afford) {
    background: rgba(51, 65, 85, 0.8);
    border-color: #8b5cf6;
}

.store-item.cant-afford {
    opacity: 0.5;
}

.store-item-icon {
    font-size: 32px;
    width: 50px;
    text-align: center;
}

.store-item-info {
    flex: 1;
}

.store-item-name {
    color: #e2e8f0;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 4px;
}

.store-item-desc {
    color: #94a3b8;
    font-size: 13px;
    margin-bottom: 4px;
}

.store-item-owned {
    color: #4ade80;
    font-size: 12px;
}

.store-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.store-item-price {
    color: #fbbf24;
    font-weight: bold;
    font-size: 16px;
}

.store-buy-buttons {
    display: flex;
    gap: 6px;
}

.buy-btn {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    border: none;
    color: #0f172a;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.buy-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #86efac, #4ade80);
    transform: translateY(-1px);
}

.buy-btn:disabled {
    background: #475569;
    color: #94a3b8;
    cursor: not-allowed;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .facilities-grid {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .facility-card {
        padding: 15px;
    }

    .facility-icon {
        font-size: 48px;
    }

    .facility-view-header {
        flex-wrap: wrap;
    }

    .facility-actions {
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }

    .action-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .selected-animal-panel {
        position: fixed;
        right: 10px;
        left: 10px;
        top: auto;
        bottom: 10px;
        width: auto;
        max-height: 50vh;
        overflow-y: auto;
    }

    .facility-stats-bar {
        flex-wrap: wrap;
        gap: 15px;
    }

    .inventory-items {
        justify-content: center;
    }

    .animals-stats-bar {
        gap: 8px;
        padding: 10px 15px;
    }

    .animals-stats-bar .stat-item {
        padding: 6px 10px;
        font-size: 12px;
    }

    .shop-btn {
        padding: 8px 14px;
        font-size: 14px;
    }

    .husbandry-store-modal {
        max-width: 95vw;
        margin: 10px;
    }

    .store-item {
        flex-wrap: wrap;
    }

    .store-item-actions {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-top: 10px;
    }
}

/* ========================================
   GROOMING SYSTEM
   ======================================== */

.grooming-section {
    padding: 12px 15px;
    background: rgba(168, 85, 247, 0.1);
    border-top: 1px solid #7c3aed;
}

.grooming-section h4 {
    margin: 0 0 10px 0;
    color: #a855f7;
    font-size: 14px;
}

.grooming-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.groom-btn {
    padding: 8px 12px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.groom-btn:hover {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    transform: translateY(-1px);
}

.groom-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Grooming stat bar */
.stat-bar .bar.grooming {
    background: linear-gradient(90deg, #7c3aed, #a855f7);
}

/* ========================================
   HORSE TRAINING SYSTEM
   ======================================== */

.training-section {
    padding: 12px 15px;
    background: rgba(245, 158, 11, 0.1);
    border-top: 1px solid #f59e0b;
}

.training-section h4 {
    margin: 0 0 10px 0;
    color: #f59e0b;
    font-size: 14px;
}

.training-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.training-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #e2e8f0;
}

.training-stat span:first-child {
    min-width: 60px;
}

.mini-bar {
    flex: 1;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.mini-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    border-radius: 4px;
    transition: width 0.3s;
}

.race-record {
    text-align: center;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #fbbf24;
}

.training-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.train-btn {
    padding: 6px 10px;
    background: linear-gradient(135deg, #d97706, #b45309);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.train-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    transform: translateY(-1px);
}

.train-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.race-enter-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #059669, #047857);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s;
}

.race-enter-btn:hover {
    background: linear-gradient(135deg, #10b981, #059669);
    transform: translateY(-1px);
}

/* ========================================
   HORSE RACING MODALS
   ======================================== */

/* Base modal inside overlay - override display:none from components.css */
.modal-overlay .modal {
    display: block;
    background: #1e293b;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.race-modal {
    max-width: 500px;
}

.race-modal .modal-header {
    background: linear-gradient(135deg, #0ea5e9 0%, #1e293b 100%);
    padding: 20px;
    border-bottom: 2px solid #334155;
}

.race-modal .modal-header h3 {
    margin: 0;
    color: #38bdf8;
    font-size: 20px;
}

.race-modal .close-modal {
    position: absolute;
    right: 15px;
    top: 15px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
}

.race-modal .close-modal:hover {
    transform: none;
}

.race-modal .modal-body {
    padding: 20px;
}

.race-horse-info {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.race-horse-info h4 {
    margin: 0 0 12px 0;
    color: #38bdf8;
}

.perf-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #e2e8f0;
}

.tournament-status {
    background: rgba(14, 165, 233, 0.1);
    border: 2px solid #0ea5e9;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    text-align: center;
}

.tournament-status p {
    margin: 0 0 10px 0;
    color: #94a3b8;
}

.tournament-status .in-tournament {
    color: #4ade80;
    font-weight: bold;
}

.race-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s;
}

.race-btn:hover {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    transform: translateY(-1px);
}

.race-rewards-info {
    background: rgba(251, 191, 36, 0.1);
    border-radius: 10px;
    padding: 15px;
}

.race-rewards-info h4 {
    margin: 0 0 10px 0;
    color: #fbbf24;
}

.race-rewards-info ul {
    margin: 0;
    padding-left: 20px;
    color: #94a3b8;
    font-size: 13px;
}

.race-rewards-info li {
    margin: 5px 0;
}

/* Race Results Modal */
.race-results-modal {
    max-width: 400px;
    text-align: center;
}

.race-results-modal .modal-header {
    background: linear-gradient(135deg, #14532d 0%, #1e293b 100%);
    padding: 20px;
    border-bottom: 2px solid #334155;
}

.race-results-modal .modal-header h3 {
    margin: 0;
    font-size: 24px;
}

.race-result {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.race-result h4 {
    margin: 0 0 10px 0;
    color: #38bdf8;
}

.race-result p {
    margin: 5px 0;
    color: #e2e8f0;
}

.race-advancement {
    background: rgba(74, 222, 128, 0.1);
    border: 2px solid #4ade80;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.race-advancement p {
    margin: 0;
    color: #4ade80;
    font-weight: bold;
    font-size: 16px;
}

.race-elimination {
    background: rgba(248, 113, 113, 0.1);
    border: 2px solid #f87171;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.race-elimination p {
    margin: 0;
    color: #f87171;
}

.race-rewards {
    background: rgba(251, 191, 36, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.race-rewards h4 {
    margin: 0 0 10px 0;
    color: #fbbf24;
}

.race-rewards ul {
    list-style: none;
    padding: 0;
    margin: 0;
    color: #e2e8f0;
}

.race-rewards li {
    margin: 5px 0;
}

.race-results-modal .close-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #475569, #334155);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.race-results-modal .close-btn:hover {
    background: linear-gradient(135deg, #64748b, #475569);
    transform: none;
}

.race-standings {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    text-align: left;
}

.race-standings h4 {
    margin: 0 0 10px 0;
    color: #38bdf8;
    text-align: center;
}

.race-standings ol {
    margin: 0;
    padding-left: 25px;
    color: #94a3b8;
}

.race-standings li {
    margin: 5px 0;
    padding: 3px 0;
}

.race-standings li.player-result {
    color: #4ade80;
    font-weight: bold;
}

/* ========================================
   BREEDING SYSTEM
   ======================================== */

.breeding-modal {
    max-width: 500px;
}

.breeding-modal .modal-header {
    background: linear-gradient(135deg, #ec4899 0%, #1e293b 100%);
    padding: 20px;
    border-bottom: 2px solid #334155;
}

.breeding-modal .modal-header h3 {
    margin: 0;
    color: #f472b6;
    font-size: 20px;
}

.breeding-modal .close-modal {
    position: absolute;
    right: 15px;
    top: 15px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
}

.breeding-modal .modal-body {
    padding: 20px;
}

/* Unlock Section */
.breeding-unlock {
    text-align: center;
}

.breeding-unlock h4 {
    color: #f472b6;
    margin: 0 0 15px 0;
}

.breeding-unlock p {
    color: #94a3b8;
    margin: 10px 0;
}

.unlock-cost {
    background: rgba(251, 191, 36, 0.1);
    border: 2px solid #fbbf24;
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
}

.unlock-cost h5 {
    margin: 0 0 10px 0;
    color: #fbbf24;
}

.unlock-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #ec4899, #be185d);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s;
}

.unlock-btn:hover {
    background: linear-gradient(135deg, #f472b6, #ec4899);
    transform: translateY(-1px);
}

/* Incubator Interface */
.incubator-interface h4 {
    color: #fbbf24;
    margin: 0 0 15px 0;
}

.incubator-interface p {
    color: #94a3b8;
    margin: 5px 0;
}

.incubation-slots {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.incubation-slot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #334155;
}

.incubation-slot.complete {
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
}

.incubation-slot button {
    padding: 8px 16px;
    background: linear-gradient(135deg, #4ade80, #22c55e);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
}

.incubate-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #fbbf24, #d97706);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s;
}

.incubate-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #fcd34d, #fbbf24);
    transform: translateY(-1px);
}

.incubate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Breeding Interface */
.breeding-interface h4 {
    color: #f472b6;
    margin: 0 0 15px 0;
}

.active-breeding {
    margin-bottom: 20px;
}

.active-breeding h5 {
    color: #94a3b8;
    margin: 0 0 10px 0;
}

.breeding-progress {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #334155;
    text-align: center;
}

.breeding-progress.complete {
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
}

.breeding-progress p {
    color: #e2e8f0;
    margin: 5px 0;
}

.breeding-progress button {
    margin-top: 10px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #4ade80, #22c55e);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
}

.start-breeding h5 {
    color: #94a3b8;
    margin: 0 0 10px 0;
}

.parent-selection {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.parent-selection span {
    font-size: 24px;
}

.parent-select {
    flex: 1;
    padding: 10px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 13px;
}

.breed-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #ec4899, #be185d);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s;
}

.breed-btn:hover {
    background: linear-gradient(135deg, #f472b6, #ec4899);
    transform: translateY(-1px);
}

.no-breeding {
    color: #94a3b8;
    text-align: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.breeding-info {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.breeding-info p {
    color: #94a3b8;
    margin: 5px 0;
    font-size: 13px;
}

/* New Animal Modal */
.new-animal-modal {
    max-width: 400px;
    text-align: center;
}

.new-animal-modal .modal-header {
    background: linear-gradient(135deg, #4ade80 0%, #1e293b 100%);
    padding: 20px;
    border-bottom: 2px solid #334155;
}

.new-animal-modal .modal-header h3 {
    margin: 0;
    font-size: 24px;
    color: #4ade80;
}

.new-animal-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    text-align: left;
}

.new-animal-card h4 {
    margin: 0 0 10px 0;
    color: #4ade80;
}

.new-animal-card p {
    margin: 5px 0;
    color: #e2e8f0;
    font-size: 13px;
}

.new-animal-card em {
    color: #94a3b8;
}
