/* ==================== SAFARI ZONE SECTION ==================== */
.safari-zone {
    padding: 80px 20px;
    max-width: 600px;
    margin: 0 auto;
}

.safari-container {
    text-align: center;
}

.section-title {
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(18px, 4vw, 28px);
    color: #fff;
    margin-bottom: 40px;
}

.section-title .highlight {
    background: linear-gradient(90deg, var(--gold), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.safari-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(0, 255, 136, 0.2);
    border-radius: 24px;
    padding: 40px 30px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(0, 255, 136, 0.1);
}

.safari-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--grass), var(--cyan));
}

.demo-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--gold), #ff9500);
    color: #000;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
}

.safari-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
}

.safari-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.4));
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.safari-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.safari-tokens {
    font-family: 'Press Start 2P', cursive;
    font-size: 20px;
    color: var(--gold);
}

.safari-tokens .highlight {
    color: var(--cyan);
}

.safari-equals {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.4);
}

.safari-reward {
    font-family: 'Press Start 2P', cursive;
    font-size: 14px;
    color: var(--grass);
}

.safari-desc {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 25px;
}

.ticket-display {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 12px;
    padding: 15px 25px;
    margin-bottom: 25px;
    font-size: 14px;
    color: #fff;
}

.ticket-display .count {
    font-family: 'Press Start 2P', cursive;
    color: var(--gold);
    font-size: 18px;
}

/* ==================== SAFARI MODAL ==================== */
.safari-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 6000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
}

.safari-modal.active {
    display: flex;
}

.safari-game-container {
    width: 95%;
    max-width: 700px;
    max-height: 90vh;
    background: linear-gradient(180deg, #0d2818 0%, #1a3a2a 50%, #0d2818 100%);
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid rgba(0, 255, 136, 0.3);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 60px rgba(0, 255, 136, 0.15);
    display: flex;
    flex-direction: column;
}

/* Safari Header */
.safari-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(0, 255, 136, 0.2);
}

.safari-biome-name {
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    color: var(--grass);
    display: flex;
    align-items: center;
    gap: 10px;
}

.biome-header-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.safari-header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.safari-actions-left {
    font-size: 13px;
    color: var(--gold);
    font-weight: 700;
}

.safari-exit-btn {
    background: rgba(255, 77, 77, 0.2);
    border: 1px solid rgba(255, 77, 77, 0.4);
    color: #ff6b6b;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.safari-exit-btn:hover {
    background: rgba(255, 77, 77, 0.4);
}

/* Safari Game Area */
.safari-game-area {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.safari-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 300px;
}

.safari-screen.hidden {
    display: none;
}

.safari-screen-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 16px;
    color: var(--gold);
    margin-bottom: 30px;
    text-align: center;
}

/* Biome Grid */
.biome-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    width: 100%;
}

.biome-card {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.biome-card:hover {
    border-color: var(--grass);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.2);
}

.biome-card .biome-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 15px;
}

.biome-card .biome-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s ease;
}

.biome-card:hover .biome-icon img {
    transform: scale(1.1);
}

.biome-card .biome-name {
    font-family: 'Press Start 2P', cursive;
    font-size: 9px;
    color: #fff;
    margin-bottom: 8px;
}

.biome-card .biome-creatures {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}

/* Exploration Screen */
.safari-environment {
    width: 100%;
    height: 200px;
    background: 
        linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.4) 100%),
        url('../assets/safari-bg.png') center/cover no-repeat;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    border: 2px solid rgba(0, 255, 136, 0.2);
}

/* Fallback if no image */
.safari-environment::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, #87CEEB 0%, #87CEEB 60%, #228B22 60%, #228B22 100%);
    z-index: -1;
}

.safari-message {
    font-size: 14px;
    color: #fff;
    text-align: center;
    margin-bottom: 20px;
    min-height: 40px;
    line-height: 1.6;
}

.safari-explore-btn {
    font-size: 14px;
    padding: 15px 40px;
}

/* Encounter Screen */
.encounter-scene {
    width: 100%;
    height: 220px;
    background: linear-gradient(180deg, #1a5276 0%, #2e86ab 50%, #a8d8ea 100%);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    margin-bottom: 15px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
}

.creature-info-overlay {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.creature-name {
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.creature-rarity {
    font-size: 10px;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 700;
    width: fit-content;
}

.creature-rarity.common { background: #888; color: #fff; }
.creature-rarity.uncommon { background: #4ade80; color: #000; }
.creature-rarity.rare { background: #60a5fa; color: #000; }
.creature-rarity.epic { background: #c084fc; color: #000; }
.creature-rarity.legendary { background: linear-gradient(90deg, #ffd700, #ff9500); color: #000; }

.creature-status {
    font-size: 10px;
    color: var(--gold);
}

.encounter-creature {
    animation: creatureIdle 2s ease-in-out infinite;
}

.encounter-creature img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.4));
}

#encounter-creature-img {
    width: 150px;
    height: 150px;
    object-fit: contain;
}

@keyframes creatureIdle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.encounter-creature.shake {
    animation: creatureShake 0.3s ease-out;
}

@keyframes creatureShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.encounter-creature.caught {
    animation: creatureCaught 0.5s ease-out forwards;
}

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

/* Encounter UI Panel */
.encounter-ui-panel {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 15px;
}

.encounter-log {
    min-height: 50px;
    max-height: 80px;
    overflow-y: auto;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    font-size: 12px;
    color: #4ade80;
}

.encounter-log::-webkit-scrollbar { width: 4px; }
.encounter-log::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

.encounter-log .log-line {
    margin-bottom: 5px;
    line-height: 1.4;
}

.encounter-log .log-line.success { color: #4ade80; }
.encounter-log .log-line.warning { color: #fbbf24; }
.encounter-log .log-line.danger { color: #f87171; }

.encounter-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.encounter-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(50, 50, 70, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
}

.encounter-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    border-color: var(--gold);
}

.encounter-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.encounter-btn.capsule { border-color: rgba(255, 100, 100, 0.4); }
.encounter-btn.capsule:hover:not(:disabled) { border-color: #ff6b6b; background: rgba(255, 100, 100, 0.2); }

.encounter-btn.bait { border-color: rgba(255, 180, 100, 0.4); }
.encounter-btn.bait:hover:not(:disabled) { border-color: #ffb464; background: rgba(255, 180, 100, 0.2); }

.encounter-btn.rock { border-color: rgba(150, 150, 150, 0.4); }
.encounter-btn.rock:hover:not(:disabled) { border-color: #aaa; background: rgba(150, 150, 150, 0.2); }

.encounter-btn.run { border-color: rgba(100, 200, 255, 0.4); }
.encounter-btn.run:hover:not(:disabled) { border-color: #64c8ff; background: rgba(100, 200, 255, 0.2); }

.encounter-btn-icon {
    font-size: 28px;
    line-height: 1;
}

.encounter-btn.capsule .encounter-btn-icon { color: #ff6b6b; }
.encounter-btn.bait .encounter-btn-icon { color: #ffb347; }
.encounter-btn.rock .encounter-btn-icon { color: #aaa; }
.encounter-btn.run .encounter-btn-icon { color: #64c8ff; }

.encounter-btn-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.encounter-btn-label {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

.encounter-btn-count {
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    color: var(--gold);
}

/* Results Screen */
.results-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.result-stat {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 15px 25px;
    text-align: center;
}

.result-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    display: block;
    margin-bottom: 8px;
}

.result-value {
    font-family: 'Press Start 2P', cursive;
    font-size: 20px;
    color: var(--grass);
}

.result-value.fled { color: #f87171; }
.result-value.rare { color: var(--gold); }

.results-creatures {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.results-creature {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 10px;
    text-align: center;
}

.results-creature img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.3));
}

.results-creature .name {
    font-size: 8px;
    color: #fff;
    margin-top: 5px;
}

.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Safari Inventory Bar */
.safari-inventory {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(0, 255, 136, 0.2);
}

.inventory-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 15px;
    border-radius: 20px;
}

.inventory-item.caught {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.inv-icon {
    font-size: 20px;
    line-height: 1;
}

.inv-icon.capsule-icon { color: #ff6b6b; }
.inv-icon.bait-icon { color: #ffb347; }
.inv-icon.rock-icon { color: #aaa; }
.inv-icon.caught-icon { color: var(--gold); }

.inv-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.inv-count {
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    color: #fff;
}

.inventory-divider {
    width: 1px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
}

/* Responsive */
@media (max-width: 600px) {
    .safari-game-container {
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .encounter-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .biome-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .safari-inventory {
        gap: 10px;
        flex-wrap: wrap;
    }
}