/* Billion Pound Clicker Game Styles */

:root {
    --bg-dark: #222222;
    --brand-blue: #3454D1;
    --brand-sage: #9BC1BC;
    --text-cream: #E6EBE0;
    --radius: 8px;
    --border: rgba(230,235,224,.18);
    --shadow: 0 10px 25px rgba(0,0,0,.35);
    --glow-blue: rgba(52, 84, 209, 0.4);
    --glow-sage: rgba(155, 193, 188, 0.4);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

html {
    scroll-behavior: smooth;
}

.game-panel {
    padding: 0;
    max-width: 1000px;
    margin: 0 auto;
    backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.game-container {
    width: 100%;
    animation: fadeIn 0.6s ease-out;
    position: relative;
    pointer-events: auto;
}

.game-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    border-bottom: 2px solid var(--border);
    background: linear-gradient(135deg, rgba(52, 84, 209, 0.05) 0%, rgba(155, 193, 188, 0.05) 100%);
}

.phase-toggle {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.mode-toggle {
    background: linear-gradient(135deg, rgba(52, 84, 209, 0.2), rgba(52, 84, 209, 0.1));
    color: #ffffff;
    border: 1px solid var(--brand-blue);
    padding: 0.65rem 1.2rem;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 6px 20px rgba(52, 84, 209, 0.25);
}

.mode-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(52, 84, 209, 0.35);
}

.mode-toggle:active {
    transform: translateY(0);
}

.phase-toggle-note {
    font-size: 0.9rem;
    color: rgba(230, 235, 224, 0.8);
}

.balance-display {
    background: linear-gradient(135deg, rgba(52, 84, 209, 0.15) 0%, rgba(52, 84, 209, 0.05) 100%);
    border: 2px solid var(--glass-border);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 
        0 8px 32px rgba(52, 84, 209, 0.2),
        0 0 20px var(--glow-blue),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    margin: 0 auto;
    max-width: 400px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.balance-display:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(52, 84, 209, 0.3),
        0 0 30px var(--glow-blue),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.balance-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--brand-sage);
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.balance-amount {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--brand-blue), #5a7beb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    word-break: keep-all;
    white-space: nowrap;
    overflow-wrap: normal;
    filter: drop-shadow(0 2px 8px rgba(52, 84, 209, 0.5));
}

/* Phase Styles */
.phase {
    transition: opacity 0.3s ease;
}

.hidden {
    display: none !important;
}

.phase-content {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Phase 1: Earning Phase */
#phase1 {
    text-align: center;
}

.click-button {
    font-size: 1.6rem;
    font-weight: 800;
    padding: 2.75rem 2.25rem;
    margin: 2rem auto;
    background: radial-gradient(circle at 30% 30%, rgba(155, 193, 188, 0.25), transparent 45%),
                linear-gradient(135deg, #4ade80 0%, #5a7beb 45%, #3454D1 100%);
    color: white;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease, transform 0.2s ease;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    will-change: transform, box-shadow;
    box-shadow:
        0 12px 32px rgba(52, 84, 209, 0.55),
        0 0 45px var(--glow-blue),
        0 8px 20px rgba(0, 0, 0, 0.35),
        inset 0 -4px 14px rgba(0, 0, 0, 0.25),
        inset 0 2px 0 rgba(255, 255, 255, 0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-width: 280px;
    min-height: 280px;
    position: relative;
    overflow: visible;
    animation: gentlePulse 2.4s ease-in-out infinite;
}

@keyframes gentlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.click-button::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: linear-gradient(135deg, transparent, rgba(52, 84, 209, 0.2));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.click-button:hover:not(:active)::before {
    opacity: 1;
}

.click-button:hover:not(:active) {
    transform: translateY(-6px) scale(1.05);
    animation: none;
    box-shadow:
        0 16px 44px rgba(52, 84, 209, 0.75),
        0 0 70px var(--glow-blue),
        0 10px 24px rgba(0, 0, 0, 0.45),
        inset 0 -4px 14px rgba(0, 0, 0, 0.25),
        inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

.click-button:active {
    transform: scale(0.94);
    box-shadow:
        0 8px 28px rgba(52, 84, 209, 0.65),
        0 0 36px var(--glow-blue),
        0 3px 12px rgba(0, 0, 0, 0.35),
        inset 0 4px 12px rgba(0, 0, 0, 0.45);
    animation: pulse 0.3s ease-out;
}

@keyframes pulse {
    0% {
        box-shadow: 
            0 5px 15px rgba(52, 84, 209, 0.3),
            0 0 0 0 rgba(52, 84, 209, 0.7),
            inset 0 3px 10px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 
            0 5px 15px rgba(52, 84, 209, 0.3),
            0 0 0 20px rgba(52, 84, 209, 0),
            inset 0 3px 10px rgba(0, 0, 0, 0.3);
    }
    100% {
        box-shadow: 
            0 5px 15px rgba(52, 84, 209, 0.3),
            0 0 0 0 rgba(52, 84, 209, 0),
            inset 0 3px 10px rgba(0, 0, 0, 0.3);
    }
}

.click-text {
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.click-value {
    font-size: 1rem;
    opacity: 0.92;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}

.income-display {
    font-size: 1rem;
    margin: 1.5rem auto;
    padding: 1.2rem 1.5rem;
    background: linear-gradient(135deg, var(--glass-bg), rgba(52, 84, 209, 0.08));
    border: 2px solid var(--glass-border);
    border-radius: 10px;
    color: var(--brand-blue);
    font-weight: 700;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(52, 84, 209, 0.2);
    max-width: 300px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.upgrades-section {
    margin-top: 2rem;
    text-align: left;
    padding: 0 1rem;
}

.upgrades-section h2 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--brand-blue);
    font-weight: 700;
}

.upgrades-section h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    margin: 0.5rem auto 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #4ade80, #5a7beb);
    opacity: 0.8;
}

.loopholes-section {
    margin-top: 3rem;
    text-align: left;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.loopholes-section h2 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    text-align: center;
    color: var(--brand-sage);
    font-weight: 700;
}

.loopholes-subtitle {
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.7;
    margin-bottom: 1.5rem;
}

.loopholes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.loophole-item {
    background: linear-gradient(135deg, rgba(155, 193, 188, 0.15), rgba(155, 193, 188, 0.05));
    border: 2px solid var(--brand-sage);
    padding: 1.2rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-align: center;
    color: #ffffff;
    box-shadow: 
        0 4px 15px rgba(155, 193, 188, 0.2),
        0 0 15px rgba(155, 193, 188, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.loophole-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(155, 193, 188, 0.2), transparent);
    transition: left 0.5s ease;
}

.loophole-item:hover::before {
    left: 100%;
}

.loophole-item:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(155, 193, 188, 0.25), rgba(155, 193, 188, 0.15));
    border-color: var(--brand-sage);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 
        0 10px 30px rgba(155, 193, 188, 0.4),
        0 0 25px var(--glow-sage);
}

.loophole-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.loophole-name {
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--brand-sage);
}

.loophole-description {
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
    opacity: 0.9;
    line-height: 1.4;
}

.loophole-cost {
    font-size: 0.9rem;
    color: var(--brand-sage);
    font-weight: 700;
}

.upgrades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.25rem 0.5rem;
}

.upgrade-item {
    background: linear-gradient(160deg, rgba(52, 84, 209, 0.12), rgba(0, 0, 0, 0.25));
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.2rem 1rem 1.1rem;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.22s ease;
    text-align: center;
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.upgrade-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(155, 193, 188, 0.2), transparent 45%);
    opacity: 0.85;
    z-index: -1;
}


.upgrade-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4ade80, #5a7beb, #3454D1);
    opacity: 0.9;
    box-shadow: 0 6px 18px rgba(52, 84, 209, 0.35);
}

.upgrade-item:hover:not(:disabled) {
    background: linear-gradient(150deg, rgba(52, 84, 209, 0.28), rgba(74, 222, 128, 0.15));
    border-color: rgba(52, 84, 209, 0.7);
    transform: translateY(-4px) scale(1.01);
    box-shadow: 
        0 14px 32px rgba(52, 84, 209, 0.45),
        0 0 26px var(--glow-blue);
}

.upgrade-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.upgrade-name {
    font-weight: bold;
    margin-bottom: 0.35rem;
    font-size: 1rem;
}

.upgrade-income {
    font-size: 0.9rem;
    color: var(--brand-sage);
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.upgrade-cost {
    font-size: 0.85rem;
    color: #e5e7eb;
    margin-bottom: 0.4rem;
}

.upgrade-owned {
    font-size: 0.8rem;
    color: var(--brand-sage);
    font-weight: 700;
}

/* Phase 2: Spending Phase */
#phase2 {
    width: 100%;
}

.phase-transition {
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid var(--border);
    padding: 2.5rem;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.phase-transition h2 {
    font-size: 2rem;
    color: var(--brand-blue);
    margin-bottom: 1rem;
    font-weight: 700;
}

.phase-transition p {
    margin: 0.5rem 0;
    font-size: 1.05rem;
}

.phase-description {
    opacity: 0.8;
    font-size: 0.95rem;
}

.spending-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat {
    background: rgba(0, 0, 0, 0.18);
    padding: 1.5rem;
    border-radius: var(--radius);
    border-left: 3px solid var(--brand-blue);
    border: 1px solid var(--border);
    border-left: 3px solid var(--brand-blue);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--brand-sage);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--brand-blue);
    word-break: break-all;
}

.purchases-section {
    margin-top: 2rem;
}

.purchases-section h2 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--brand-blue);
    font-weight: 700;
}

.purchase-categories {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.category-tab {
    padding: 0.75rem 1.5rem;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid var(--border);
    color: var(--text-cream);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 0.95rem;
}

.category-tab:hover {
    background: rgba(52, 84, 209, 0.15);
    border-color: var(--brand-blue);
}

.category-tab.active {
    background: var(--brand-blue);
    color: white;
    border-color: var(--brand-blue);
}

.purchases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.purchase-item {
    background: linear-gradient(135deg, var(--glass-bg), rgba(0, 0, 0, 0.25));
    border: 2px solid var(--glass-border);
    padding: 1.2rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-align: center;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.purchase-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.purchase-item:hover::before {
    left: 100%;
}

.purchase-item:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(52, 84, 209, 0.2), rgba(52, 84, 209, 0.1));
    border-color: var(--brand-blue);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 
        0 10px 30px rgba(52, 84, 209, 0.4),
        0 0 20px var(--glow-blue);
}

.upgrade-item,
.loophole-item,
.purchase-item,
.category-tab,
.faq-question {
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.purchase-item:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.purchase-item.unaffordable {
    opacity: 0.5;
    cursor: not-allowed;
}

.purchase-name {
    font-weight: bold;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.purchase-price {
    font-size: 1rem;
    color: var(--brand-sage);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.purchase-quantity {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-bottom: 0.5rem;
}

.purchase-description {
    font-size: 0.75rem;
    color: #d1d5db;
    margin-bottom: 0.5rem;
}

.purchase-unaffordable-text {
    color: #ff8787;
    font-size: 0.8rem;
    font-weight: 700;
}

.context-feedback {
    background: rgba(52, 84, 209, 0.1);
    border-left: 3px solid var(--brand-blue);
    border: 1px solid var(--border);
    border-left: 3px solid var(--brand-blue);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-top: 2rem;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.feedback-message {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-cream);
}

.ending-message {
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: var(--radius);
    margin-top: 2rem;
    text-align: center;
    animation: slideUp 0.5s ease;
    box-shadow: var(--shadow);
}

.ending-message.hidden {
    display: none;
}

.ending-message h3 {
    font-size: 1.8rem;
    color: var(--brand-blue);
    margin-bottom: 1rem;
    font-weight: 700;
}

.ending-message p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
    color: var(--text-cream);
}

.ending-summary {
    background: rgba(52, 84, 209, 0.1);
    padding: 1rem;
    border-radius: var(--radius);
    margin: 1rem 0;
    font-size: 0.95rem;
    border: 1px solid var(--border);
}

.purchase-breakdown {
    margin: 1.5rem 0;
    text-align: left;
}

.purchase-breakdown h4 {
    font-size: 1.2rem;
    color: var(--brand-sage);
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 700;
}

.purchase-summary-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(155, 193, 188, 0.15);
    border: 1px solid var(--brand-sage);
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--brand-sage);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.purchase-summary-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.2);
}

.purchase-summary-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
    font-size: 0.9rem;
}

.purchase-summary-item:last-child {
    border-bottom: none;
}

.purchase-summary-item:hover {
    background: rgba(52, 84, 209, 0.1);
}

.purchase-summary-name {
    color: var(--text-cream);
    font-weight: 600;
}

.purchase-summary-count {
    color: var(--brand-sage);
    font-weight: 700;
    text-align: center;
}

.purchase-summary-total {
    color: var(--brand-blue);
    font-weight: 700;
    text-align: right;
}

.purchase-summary-list::-webkit-scrollbar {
    width: 8px;
}

.purchase-summary-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.purchase-summary-list::-webkit-scrollbar-thumb {
    background: var(--brand-blue);
    border-radius: 4px;
}

.purchase-summary-list::-webkit-scrollbar-thumb:hover {
    background: var(--brand-sage);
}

.ending-lesson {
    color: var(--brand-sage);
    font-style: italic;
    margin-top: 1rem;
    font-weight: 600;
}

/* FAQ Section Styles */
.faq-panel {
    margin-top: 3rem;
    padding: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeIn 0.8s ease-out;
}

.faq-panel h2 {
    font-size: 2rem;
    color: var(--brand-blue);
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-sage));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background: linear-gradient(135deg, var(--glass-bg), rgba(0, 0, 0, 0.25));
    border: 2px solid var(--glass-border);
    border-radius: 10px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.faq-item:hover {
    border-color: var(--brand-blue);
    box-shadow: 0 8px 25px rgba(52, 84, 209, 0.3);
    transform: translateY(-2px);
}

.faq-question {
    width: 100%;
    padding: 1.2rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-cream);
    font-size: 1.05rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.faq-question:hover {
    color: var(--brand-blue);
}

.faq-question[aria-expanded="true"] {
    color: var(--brand-blue);
    padding-bottom: 1rem;
}

.faq-icon {
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    color: var(--brand-sage);
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(180deg);
    color: var(--brand-blue);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
                padding 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
                opacity 0.3s ease;
    opacity: 0;
}

.faq-answer.open {
    max-height: 300px;
    padding: 0 1.5rem 1.5rem 1.5rem;
    opacity: 1;
}

.faq-answer p {
    margin: 0;
    color: rgba(230, 235, 224, 0.9);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Responsive Design */

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
    .game-panel {
        max-width: 1200px;
    }
    
    .upgrades-grid,
    .loopholes-grid,
    .purchases-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

/* Laptop/Desktop (1024px - 1439px) */
@media (min-width: 1024px) and (max-width: 1439px) {
    .game-panel {
        max-width: 1000px;
    }
    
    .upgrades-grid,
    .loopholes-grid,
    .purchases-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .game-panel {
        max-width: 100%;
        padding: 1.5rem;
    }
    
    .game-header {
        padding: 1.5rem;
    }
    
    .balance-display {
        max-width: 350px;
        padding: 1.5rem;
    }
    
    .balance-amount {
        font-size: 2.2rem;
    }
    
    .click-button {
        min-width: 240px;
        min-height: 240px;
        font-size: 1.3rem;
    }
    
    .upgrades-grid,
    .loopholes-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1rem;
    }
    
    .purchases-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 1rem;
    }
    
    .spending-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* Mobile (up to 767px) */
@media (max-width: 767px) {
    .game-panel {
        padding: 0;
        margin: 0;
        border-radius: 0;
    }
    
    .game-header {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .balance-display {
        max-width: 100%;
        padding: 1.2rem;
        border-radius: 8px;
    }

    .balance-amount {
        font-size: 1.8rem;
    }
    
    .balance-label {
        font-size: 0.7rem;
    }

    .click-button {
        font-size: 1.2rem;
        padding: 2rem 1.5rem;
        min-width: 200px;
        min-height: 200px;
        margin: 1.5rem auto;
    }
    
    .click-text {
        font-size: 1.3rem;
    }
    
    .click-value {
        font-size: 0.9rem;
    }
    
    .income-display {
        font-size: 0.9rem;
        padding: 1rem;
        margin: 1rem 0.5rem;
    }

    .upgrades-section,
    .loopholes-section,
    .purchases-section {
        padding: 0 0.5rem;
    }
    
    .upgrades-section h2,
    .loopholes-section h2,
    .purchases-section h2 {
        font-size: 1.1rem;
    }

    .upgrades-grid,
    .loopholes-grid,
    .purchases-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.6rem;
    }
    
    .upgrade-item,
    .loophole-item,
    .purchase-item {
        padding: 0.9rem;
        border-radius: 8px;
    }
    
    .upgrade-name,
    .loophole-name,
    .purchase-name {
        font-size: 0.85rem;
    }
    
    .upgrade-income,
    .loophole-description,
    .purchase-description {
        font-size: 0.75rem;
    }
    
    .upgrade-cost,
    .loophole-cost,
    .purchase-price {
        font-size: 0.75rem;
    }

    .spending-stats {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        padding: 0 0.5rem;
    }
    
    .stat {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }

    .purchase-categories {
        gap: 0.3rem;
        padding: 0 0.5rem;
    }

    .category-tab {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
        flex: 1;
        min-width: 0;
    }
    
    .phase-transition {
        padding: 1.5rem 1rem;
        margin: 0.5rem;
    }
    
    .phase-transition h2 {
        font-size: 1.5rem;
    }
    
    .phase-transition p {
        font-size: 0.95rem;
    }
}

/* Small Mobile (up to 480px) */
@media (max-width: 480px) {
    .balance-amount {
        font-size: 1.5rem;
    }
    
    .click-button {
        min-width: 180px;
        min-height: 180px;
        font-size: 1.1rem;
    }
    
    .click-text {
        font-size: 1.1rem;
    }
    
    .upgrades-grid,
    .loopholes-grid,
    .purchases-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .category-tab {
        font-size: 0.75rem;
        padding: 0.5rem 0.6rem;
    }
    
    .faq-panel {
        padding: 1rem;
        margin-top: 2rem;
    }
    
    .faq-panel h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .faq-question {
        font-size: 0.95rem;
        padding: 1rem;
    }
    
    .faq-answer p {
        font-size: 0.9rem;
    }
}

/* Animation for price updates */
@keyframes priceFlash {
    0% {
        background: rgba(74, 222, 128, 0.3);
    }
    100% {
        background: transparent;
    }
}

.price-updated {
    animation: priceFlash 0.5s ease;
}
