/* ==========================================
   RUBBER DUCK DEBUGGER - Idle Clicker Game
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
    overflow-x: hidden;
}

.back-link {
    position: fixed;
    top: 20px;
    left: 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    z-index: 100;
}

.back-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-5px);
}

.reset-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(220, 53, 69, 0.2);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reset-btn:hover {
    background: rgba(220, 53, 69, 0.8);
    color: #fff;
    transform: rotate(-180deg);
}

/* ==========================================
   Game Container
   ========================================== */
.game-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 80px 20px 40px;
}

/* ==========================================
   Header Stats
   ========================================== */
.game-header {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.stat-box {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 16px;
    padding: 15px 25px;
    text-align: center;
    min-width: 140px;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    color: #ffc107;
    font-variant-numeric: tabular-nums;
}

/* ==========================================
   Click Area
   ========================================== */
.click-area {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    margin-bottom: 30px;
}

.click-message {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.main-duck {
    font-size: 8rem;
    cursor: pointer;
    user-select: none;
    transition: transform 0.1s ease;
    filter: drop-shadow(0 10px 30px rgba(255, 193, 7, 0.4));
    animation: duck-idle 2s ease-in-out infinite;
}

.main-duck:hover {
    transform: scale(1.05);
}

.main-duck:active {
    transform: scale(0.95);
    animation: none;
}

@keyframes duck-idle {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

.main-duck.quack {
    animation: quack 0.2s ease;
}

@keyframes quack {
    0% { transform: scale(1) rotate(0); }
    25% { transform: scale(1.2) rotate(-10deg); }
    50% { transform: scale(0.9) rotate(10deg); }
    75% { transform: scale(1.1) rotate(-5deg); }
    100% { transform: scale(1) rotate(0); }
}

/* Click Particles */
.click-particles {
    position: absolute;
    top: 50%;
    left: 50%;
    pointer-events: none;
}

.particle {
    position: absolute;
    font-size: 1.5rem;
    animation: particle-fly 1s ease-out forwards;
    pointer-events: none;
}

@keyframes particle-fly {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0.5);
    }
}

/* Floating Ducks */
.floating-ducks {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
}

.floating-duck {
    position: absolute;
    font-size: 2rem;
    opacity: 0.3;
    animation: float-duck 15s linear infinite;
}

@keyframes float-duck {
    0% {
        transform: translateY(100vh) rotate(0deg);
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
    }
}

/* ==========================================
   Phase Display
   ========================================== */
.phase-display {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.phase-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffc107;
    margin-bottom: 15px;
}

.phase-progress {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    overflow: hidden;
    margin-bottom: 10px;
}

.phase-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ffc107, #ff9800);
    border-radius: 50px;
    transition: width 0.3s ease;
}

.phase-next {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ==========================================
   Upgrades Panel
   ========================================== */
.upgrades-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    overflow: hidden;
}

.panel-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-btn {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: #ffc107;
    background: rgba(255, 193, 7, 0.1);
    border-bottom: 2px solid #ffc107;
}

.tab-content {
    display: none;
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.tab-content.active {
    display: block;
}

/* Upgrades List */
.upgrades-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upgrade-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upgrade-item:hover:not(.locked) {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
    transform: translateX(5px);
}

.upgrade-item.locked {
    opacity: 0.4;
    cursor: not-allowed;
}

.upgrade-item.maxed {
    border-color: rgba(76, 175, 80, 0.5);
    background: rgba(76, 175, 80, 0.1);
}

.upgrade-icon {
    font-size: 2.5rem;
    width: 60px;
    text-align: center;
}

.upgrade-info {
    flex: 1;
}

.upgrade-name {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
}

.upgrade-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 4px;
}

.upgrade-owned {
    font-size: 0.8rem;
    color: #4caf50;
}

.upgrade-cost {
    text-align: right;
}

.upgrade-price {
    display: block;
    font-weight: 700;
    color: #ffc107;
    font-size: 1.1rem;
}

.upgrade-production {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Achievements */
.achievements-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.achievement-item {
    text-align: center;
    padding: 20px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.achievement-item.unlocked {
    background: rgba(255, 193, 7, 0.15);
    border-color: rgba(255, 193, 7, 0.4);
}

.achievement-item.locked {
    opacity: 0.3;
}

.achievement-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: block;
}

.achievement-item.locked .achievement-icon {
    filter: grayscale(100%);
}

.achievement-name {
    font-size: 0.8rem;
    font-weight: 600;
}

/* Prestige */
.prestige-info {
    text-align: center;
    padding: 40px 20px;
}

.prestige-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: prestige-glow 2s ease-in-out infinite;
}

@keyframes prestige-glow {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(147, 51, 234, 0.5)); }
    50% { filter: drop-shadow(0 0 40px rgba(147, 51, 234, 0.8)); }
}

.prestige-info h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #a855f7;
}

.prestige-info p {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
}

.prestige-bonus {
    color: #a855f7 !important;
    font-size: 0.9rem;
}

.prestige-current {
    margin-top: 20px;
    font-size: 1.1rem;
}

.prestige-current span {
    color: #a855f7;
    font-weight: 700;
}

.btn-prestige {
    margin-top: 25px;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #9333ea, #7c3aed);
    border: none;
    border-radius: 50px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-prestige:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(147, 51, 234, 0.5);
}

.btn-prestige:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #444;
}

/* ==========================================
   Toast Notifications
   ========================================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 15px 25px;
    background: rgba(255, 193, 7, 0.9);
    color: #000;
    border-radius: 12px;
    font-weight: 600;
    animation: toast-in 0.3s ease, toast-out 0.3s ease 2.7s forwards;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.achievement {
    background: linear-gradient(135deg, #ffc107, #ff9800);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* ==========================================
   Scrollbar
   ========================================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 193, 7, 0.5);
    border-radius: 10px;
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 600px) {
    .game-header {
        flex-direction: column;
        align-items: center;
    }

    .stat-box {
        width: 100%;
        max-width: 200px;
    }

    .main-duck {
        font-size: 6rem;
    }

    .panel-tabs {
        flex-direction: column;
    }

    .tab-btn {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .tab-btn.active {
        border-bottom: 1px solid #ffc107;
    }
}
