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

:root {
    --bg-color: #1a1a2e;
    --panel-color: #16213e;
    --accent-gold: #f0c040;
    --accent-green: #39ff14;
    --accent-red: #ff4444;
}

body {
    background-color: var(--bg-color);
    color: #e0e0e0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    overflow-x: hidden;
    transition: background-color 0.5s ease;
}

body.summer-sale {
    background-color: #051a0a;
    background-image: url('images/1920x1080-steam-summer-sale-2023-background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

body.valve-time {
    /* Filter animations on body cause position:fixed descendants to be
       repositioned relative to the body instead of the viewport. Apply the
       visual effect to .game-container instead so overlays and the debug
       panel stay put. */
}
.game-container.valve-time {
    animation: slowPulse 2s ease-in-out infinite;
}

/* Ensure position:fixed elements are not affected by body-level filters */
#case-overlay,
.debug-panel,
.debug-toggle {
    transform: translateZ(0);
}

.game-container {
    max-width: 1100px;
    width: 100%;
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 8px;
    line-height: 0;
    color: var(--accent-gold);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    transition: color 0.4s ease, text-shadow 0.4s ease;
}

.game-logo {
    max-width: 256px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    image-rendering: pixelated;
}

body.summer-sale h1 {
    color: var(--accent-green);
    text-shadow: 0 0 10px var(--accent-green), 0 0 20px var(--accent-green);
}

.main-area {
    display: grid;
    grid-template-columns: 1fr 1.1fr 1fr;
    gap: 30px;
    justify-items: center;
    align-items: flex-start;
}

@media (max-width: 1050px) {
    .main-area {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* Mobile order: Gaben on top, Generators in the middle, Click/Open Case/Prestige at the bottom */
    .gaben-clicker {
        order: 1;
        width: 100%;
        max-width: 420px;
    }

    .shop {
        order: 2;
        width: 100%;
        max-width: 420px;
        max-height: 60vh;
    }

    .left-panel {
        order: 3;
        max-width: 420px;
    }
}

.left-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 320px;
    max-width: 360px;
    width: 100%;
}

.gaben-clicker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    min-width: 320px;
    width: 100%;
    order: 0;
}

.inventory-section {
    width: 100%;
    max-width: 360px;
    max-height: 40vh;
    background-color: var(--panel-color);
    border-radius: 12px;
    padding: 14px;
    border: 1px solid #0f3460;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

.inventory-section h2 {
    margin: 0;
    color: var(--accent-gold);
    font-size: 1.2rem;
}

.inventory-list-inline {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
    overflow-y: auto;
    padding-right: 4px;
    max-height: 100%;
}

.inventory-section .inventory-empty {
    text-align: center;
    color: #a0a0a0;
    padding: 18px 0;
    font-size: 0.95rem;
}

.inventory-section .inventory-empty.hidden {
    display: none;
}

.inventory-section .inventory-card {
    padding: 10px 6px;
    gap: 6px;
}

.inventory-section .inventory-card-icon {
    width: 48px;
    height: 48px;
}

.inventory-section .inventory-card-icon img {
    width: 40px;
    height: 40px;
}

.inventory-section .inventory-card-name {
    font-size: 0.7rem;
    min-height: 2.8em;
}

.inventory-section .inventory-card-rarity {
    font-size: 0.6rem;
}

.inventory-section .inventory-card-quantity {
    top: 4px;
    right: 4px;
    font-size: 0.7rem;
    padding: 1px 4px;
}

/* News Ticker */
.news-ticker {
    width: 100%;
    max-width: 360px;
    background: linear-gradient(90deg, rgba(15, 52, 96, 0.8), rgba(22, 33, 62, 0.9));
    border: 1px solid #0f3460;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #d0e0f0;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    overflow: hidden;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    position: relative;
}

.news-ticker:hover {
    border-color: var(--accent-gold);
    background: linear-gradient(90deg, rgba(26, 74, 122, 0.85), rgba(22, 33, 62, 0.95));
    box-shadow: 0 0 12px rgba(240, 192, 64, 0.15);
}

.news-ticker:active {
    transform: scale(0.995);
}

.news-label {
    flex-shrink: 0;
    background: #0f3460;
    color: var(--accent-gold);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 1px;
    padding: 3px 7px;
    border-radius: 5px;
    text-shadow: none;
}

.news-text-wrapper {
    flex: 1;
    overflow: hidden;
}

#news-text {
    display: inline-block;
    white-space: nowrap;
    padding-left: 100%;
    animation: newsScroll 15s linear infinite;
}

.news-ticker:hover #news-text {
    animation-play-state: paused;
}

@keyframes newsScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.news-ticker.news-ticker-secret {
    border-color: #7a4a9a;
    background: linear-gradient(90deg, rgba(50, 20, 60, 0.9), rgba(22, 33, 62, 0.95));
    animation: secretTickerPulse 3s ease-in-out infinite;
}

.news-ticker.news-ticker-secret .news-label {
    background: #5a2060;
    color: #e8a8ff;
}

.news-ticker.news-ticker-secret #news-text {
    color: #e8c8ff;
    text-shadow: 0 0 6px rgba(168, 70, 210, 0.4);
}

@keyframes secretTickerPulse {
    0%, 100% { box-shadow: 0 0 0 rgba(168, 70, 210, 0); }
    50% { box-shadow: 0 0 14px rgba(168, 70, 210, 0.25); }
}

body.summer-sale .news-ticker {
    background: linear-gradient(90deg, rgba(13, 60, 30, 0.85), rgba(5, 26, 10, 0.92));
    border-color: var(--accent-green);
    color: #b0ffc0;
}

body.summer-sale .news-ticker:hover {
    background: linear-gradient(90deg, rgba(29, 82, 51, 0.9), rgba(5, 26, 10, 0.95));
    box-shadow: 0 0 12px rgba(57, 255, 20, 0.2);
}

body.summer-sale .news-label {
    background: #1d5233;
    color: var(--accent-green);
}

body.summer-sale .news-ticker.news-ticker-secret {
    border-color: #c040ff;
    background: linear-gradient(90deg, rgba(60, 10, 60, 0.9), rgba(5, 26, 10, 0.95));
}

body.summer-sale .news-ticker.news-ticker-secret .news-label {
    background: #4a0a50;
    color: #f0b0ff;
}

body.summer-sale .news-ticker.news-ticker-secret #news-text {
    color: #f0d0ff;
}

@media (max-width: 1050px) {
    .news-ticker {
        max-width: 100%;
    }
}

.top-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.money-display {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-gold);
    min-height: 2.5rem;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

body.summer-sale .money-display {
    color: var(--accent-green);
    text-shadow: 0 0 8px var(--accent-green);
}

.cps-display {
    font-size: 1rem;
    color: #a0a0a0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
}

.auto-click-display {
    font-size: 0.85rem;
    color: #8fd68f;
    font-style: italic;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
}

body.summer-sale .cps-display {
    color: #e0ffe0;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.8), 1px 1px 3px rgba(0, 0, 0, 0.8);
}

body.summer-sale .auto-click-display {
    color: #bfffbf;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.8), 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.gaben-container {
    position: relative;
    display: inline-block;
    cursor: pointer;
    user-select: none;
    /* Allow vertical scrolling/swiping over Gaben while preventing double-tap zoom. */
    touch-action: pan-y;
}

.gaben-container img {
    pointer-events: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

.gaben-body {
    width: 300px;
    height: auto;
    display: block;
    margin-top: 80px;
    transition: transform 0.05s ease;
    image-rendering: pixelated;
}

.gaben-head {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: auto;
    transition: transform 0.05s ease;
    z-index: 10;
    image-rendering: pixelated;
}

.gaben-container:hover .gaben-head {
    transform: translateX(-50%) scale(1.05);
}

.gaben-container:active .gaben-head,
.gaben-container.clicked .gaben-head {
    transform: translateX(-50%) scale(0.92);
}

.gaben-container:active .gaben-body,
.gaben-container.clicked .gaben-body {
    transform: scale(0.95);
}

.click-upgrades {
    width: 100%;
    max-width: 360px;
    background-color: var(--panel-color);
    border-radius: 12px;
    padding: 14px;
    border: 1px solid #0f3460;
}

.click-upgrades h2 {
    margin-bottom: 12px;
    color: var(--accent-gold);
    font-size: 1.2rem;
}

.click-upgrade-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.click-upgrade-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #0f3460;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease, transform 0.1s ease, border-color 0.2s ease;
    border: 1px solid transparent;
}

.click-upgrade-item:hover {
    background-color: #1a4a7a;
    border-color: var(--accent-gold);
}

.click-upgrade-item:active {
    transform: scale(0.97);
}

.click-upgrade-item.cannot-afford {
    opacity: 0.5;
    cursor: not-allowed;
}

.click-upgrade-item.cannot-afford:hover {
    background-color: #0f3460;
    border-color: transparent;
}

.click-upgrade-item.bought {
    opacity: 0.6;
    cursor: default;
    background-color: #1a3d2e;
    border-color: #39ff14;
}

.click-upgrade-item.bought:hover {
    background-color: #1a3d2e;
    border-color: #39ff14;
}

.click-upgrade-item.vac-active {
    border-color: var(--accent-red);
    background: linear-gradient(90deg, #4a1515, #0f3460);
}

.click-upgrade-item.golden-pan-muted {
    border-color: #888888;
    background: linear-gradient(90deg, #2a2a2a, #0f3460);
}

.click-upgrade-item.golden-pan-muted .click-upgrade-name,
.click-upgrade-item.golden-pan-muted .click-upgrade-description {
    color: #b0b0b0;
}

.click-upgrade-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.click-upgrade-info {
    flex: 1;
    text-align: left;
}

.click-upgrade-name {
    font-weight: bold;
    font-size: 0.95rem;
    color: #e0e0e0;
}

.click-upgrade-description {
    font-size: 0.75rem;
    color: #a0a0a0;
    margin-top: 2px;
}

.click-upgrade-buy-block {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.open-case-btn {
    width: 100%;
    max-width: 360px;
    background: linear-gradient(180deg, #5c3a1e, #3d2412);
    color: var(--accent-gold);
    border: 2px solid #8b5a2b;
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.open-case-btn:hover {
    box-shadow: 0 0 15px rgba(240, 192, 64, 0.4);
}

.open-case-btn:active {
    transform: scale(0.97);
}

.case-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--accent-gold);
    color: #3d2412;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.prestige-section {
    width: 100%;
    max-width: 360px;
    background-color: var(--panel-color);
    border-radius: 12px;
    padding: 14px;
    border: 1px solid #0f3460;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.prestige-btn {
    width: 100%;
    background: linear-gradient(90deg, #1a0f3a, #2a1a5a);
    color: #e0e0e0;
    border: 1px solid #5a4a9a;
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.prestige-btn:hover:not(:disabled) {
    background: linear-gradient(90deg, #25155a, #3a2580);
    box-shadow: 0 0 12px rgba(90, 74, 154, 0.6);
}

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

.prestige-icon {
    width: 48px;
    height: auto;
    object-fit: contain;
}

.prestige-upgrades {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prestige-upgrade {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #0f3460;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease, transform 0.1s ease, border-color 0.2s ease;
    border: 1px solid transparent;
}

.prestige-upgrade:hover {
    background-color: #1a4a7a;
    border-color: var(--accent-gold);
}

.prestige-upgrade:active {
    transform: scale(0.97);
}

.prestige-upgrade.cannot-afford {
    opacity: 0.5;
    cursor: not-allowed;
}

.prestige-upgrade-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.prestige-upgrade-info {
    flex: 1;
    text-align: left;
}

.prestige-upgrade-name {
    font-weight: bold;
    font-size: 0.9rem;
}

.prestige-upgrade-description {
    font-size: 0.75rem;
    color: #a0a0a0;
}

.prestige-upgrade-buy-block {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.copium-display {
    font-size: 0.9rem;
    color: #c0a0ff;
    font-weight: bold;
}

.shop {
    background-color: var(--panel-color);
    border-radius: 12px;
    padding: 20px;
    min-width: 320px;
    max-width: 420px;
    flex: 1;
    border: 1px solid #0f3460;
    max-height: 80vh;
    overflow-y: auto;
}

.shop h2 {
    margin-bottom: 15px;
    color: var(--accent-gold);
    font-size: 1.4rem;
}

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.shop-header h2 {
    margin-bottom: 0;
}

.buy-multiplier-toggle {
    display: flex;
    gap: 4px;
    background-color: #0f3460;
    border-radius: 6px;
    padding: 3px;
}

.multiplier-btn {
    background: transparent;
    border: none;
    color: #e0e0e0;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.multiplier-btn:hover {
    background-color: rgba(240, 192, 64, 0.15);
}

.multiplier-btn.active {
    background-color: var(--accent-gold);
    color: #1a1a2e;
}

body.summer-sale .buy-multiplier-toggle {
    background-color: #143d26;
}

body.summer-sale .multiplier-btn:hover {
    background-color: rgba(57, 255, 20, 0.15);
}

body.summer-sale .multiplier-btn.active {
    background-color: var(--accent-green);
    color: #0d2f1b;
}

body.summer-sale .shop h2,
body.summer-sale .click-upgrades h2,
body.summer-sale .inventory-section h2 {
    color: var(--accent-green);
    text-shadow: 0 0 4px var(--accent-green);
}

body.summer-sale .inventory-section {
    background-color: #0d2f1b;
    border-color: var(--accent-green);
}

body.summer-sale .inventory-section .inventory-empty {
    color: #b0d0b0;
}

body.summer-sale .inventory-section .inventory-list-inline::-webkit-scrollbar {
    width: 6px;
}

body.summer-sale .inventory-section .inventory-list-inline::-webkit-scrollbar-thumb {
    background-color: var(--accent-green);
    border-radius: 3px;
}

body.summer-sale .click-upgrades,
body.summer-sale .shop,
body.summer-sale .prestige-section {
    border-color: var(--accent-green);
    background-color: #0d2f1b;
}

body.summer-sale .upgrade-item,
body.summer-sale .click-upgrade-item,
body.summer-sale .prestige-upgrade {
    background-color: #143d26;
    border-color: transparent;
}

body.summer-sale .upgrade-item:hover,
body.summer-sale .click-upgrade-item:hover,
body.summer-sale .prestige-upgrade:hover {
    background-color: #1d5233;
    border-color: var(--accent-green);
}

body.summer-sale .upgrade-item.cannot-afford:hover,
body.summer-sale .click-upgrade-item.cannot-afford:hover,
body.summer-sale .prestige-upgrade.cannot-afford:hover {
    background-color: #143d26;
    border-color: transparent;
}

body.summer-sale .click-upgrade-item.bought {
    background-color: #1a3d2e;
    border-color: #39ff14;
}

body.summer-sale .click-upgrade-item.bought:hover {
    background-color: #1a3d2e;
    border-color: #39ff14;
}

.upgrade-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upgrade-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #0f3460;
    border-radius: 8px;
    padding: 12px 14px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease, transform 0.1s ease, border-color 0.2s ease;
    border: 1px solid transparent;
}

.upgrade-item:hover {
    background-color: #1a4a7a;
    border-color: var(--accent-gold);
}

.upgrade-item:active {
    transform: scale(0.97);
}

.upgrade-item.cannot-afford {
    opacity: 0.5;
    cursor: not-allowed;
}

.upgrade-item.cannot-afford:hover {
    background-color: #0f3460;
    border-color: transparent;
}

.generator-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.generator-icon.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #16213e;
    border-radius: 6px;
    font-size: 1.2rem;
}

.upgrade-info {
    flex: 1;
    text-align: left;
    min-width: 0;
}

.upgrade-name {
    font-weight: bold;
    font-size: 1rem;
    color: #e0e0e0;
}

.upgrade-stats,
.upgrade-description {
    font-size: 0.75rem;
    color: #a0a0a0;
    margin-top: 2px;
}

.upgrade-buy-block {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}

.upgrade-cost {
    font-weight: bold;
    font-size: 0.95rem;
    color: var(--accent-gold);
    white-space: nowrap;
}

body.summer-sale.sale-cost .upgrade-cost {
    color: var(--accent-green);
    text-shadow: 0 0 4px var(--accent-green);
}

.upgrade-owned {
    font-size: 0.8rem;
    color: #a0a0a0;
    min-width: 24px;
    text-align: right;
}

/* Generator tier upgrade block (CPS-doubling tiers, Ricochet excluded). */
.tier-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    margin-top: 4px;
}

.tier-button {
    cursor: pointer;
    background: linear-gradient(180deg, #2a1a4a, #1a1030);
    color: var(--accent-gold);
    border: 1px solid #5a3a8a;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 0.72rem;
    font-weight: bold;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.tier-button:hover {
    background: linear-gradient(180deg, #3a2a5a, #2a1840);
    border-color: var(--accent-gold);
}

.tier-button:active {
    transform: scale(0.96);
}

.tier-button.cannot-afford {
    opacity: 0.5;
    cursor: not-allowed;
}

.tier-button.cannot-afford:hover {
    background: linear-gradient(180deg, #2a1a4a, #1a1030);
    border-color: #5a3a8a;
}

.tier-button.bought {
    background: linear-gradient(180deg, #1a3d2e, #0d2f1b);
    color: var(--accent-green);
    border-color: var(--accent-green);
    cursor: default;
    text-shadow: 0 0 4px rgba(57, 255, 20, 0.5);
}

.tier-button.bought:hover {
    background: linear-gradient(180deg, #1a3d2e, #0d2f1b);
    border-color: var(--accent-green);
}

.tier-cost {
    font-size: 0.72rem;
    font-weight: bold;
    color: var(--accent-gold);
    white-space: nowrap;
}

body.summer-sale.sale-cost .tier-cost {
    color: var(--accent-green);
    text-shadow: 0 0 4px var(--accent-green);
}

body.summer-sale .tier-button {
    border-color: #2a6a4a;
}

body.summer-sale .tier-button:hover {
    border-color: var(--accent-green);
}

.click-particle {
    position: absolute;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-gold);
    pointer-events: none;
    animation: floatUp 0.8s ease-out forwards;
    z-index: 100;
}

.click-particle.crit-particle {
    color: #ffd700;
    text-shadow:
        0 0 6px #ffd700,
        0 0 12px #ff8c00,
        0 0 18px #ff4500;
    font-size: 1.5rem;
    animation: floatUpCrit 1s ease-out forwards;
}

body.summer-sale.sale-click .click-particle {
    color: var(--accent-green);
    text-shadow: 0 0 6px var(--accent-green);
}

body.summer-sale.sale-click .click-particle.crit-particle {
    color: #ffd700;
    text-shadow:
        0 0 6px #ffd700,
        0 0 12px #ff8c00,
        0 0 18px #ff4500;
}

.gaben-container.crit-flash {
    animation: critFlash 0.25s ease-out;
}

.gaben-container.crit-flash-max {
    animation: critFlashMax 0.25s ease-out;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-60px);
    }
}

@keyframes floatUpCrit {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-40px) scale(1.15);
    }
    100% {
        opacity: 0;
        transform: translateY(-90px) scale(1);
    }
}

@keyframes critFlash {
    0% { filter: brightness(1) drop-shadow(0 0 0 transparent); }
    30% { filter: brightness(1.4) drop-shadow(0 0 20px #ffd700); }
    100% { filter: brightness(1) drop-shadow(0 0 0 transparent); }
}

@keyframes critFlashMax {
    0% { filter: brightness(1) drop-shadow(0 0 0 transparent); }
    30% { filter: brightness(1.8) drop-shadow(0 0 35px #ffd700) drop-shadow(0 0 50px #ff4500); }
    100% { filter: brightness(1) drop-shadow(0 0 0 transparent); }
}

/* Steam Sale Bill Rain */
.bill-rain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1500;
    overflow: hidden;
}

.bill-rain.hidden {
    display: none;
}

.bill {
    position: absolute;
    top: -80px;
    height: auto;
    opacity: 0.95;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
    animation-name: billFall;
    animation-timing-function: linear;
    animation-iteration-count: 1;
    animation-fill-mode: forwards;
    will-change: transform, opacity;
}

@keyframes billFall {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.95;
    }
    25% {
        transform: translateY(25vh) translateX(calc(var(--bill-sway) * -0.5)) rotate(90deg);
    }
    50% {
        transform: translateY(50vh) translateX(var(--bill-sway)) rotate(180deg);
    }
    75% {
        transform: translateY(75vh) translateX(calc(var(--bill-sway) * 0.3)) rotate(270deg);
        opacity: 0.9;
    }
    100% {
        transform: translateY(calc(100vh + 80px)) translateX(0) rotate(360deg);
        opacity: 0;
    }
}

/* Steam Sale Sticker */
.steam-sale-sticker {
    position: fixed;
    top: 100px;
    left: 0;
    z-index: 2000;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #2a9d2a, #0f5a0f);
    color: #ccff00;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    box-shadow: 0 0 20px #39ff14, inset 0 0 20px rgba(0,0,0,0.3);
    cursor: pointer;
    user-select: none;
    border: 4px solid #39ff14;
    text-shadow: 0 0 10px #39ff14;
    transform: translateX(0);
}

.steam-sale-sticker.hidden {
    display: none;
}

.sticker-percent {
    font-size: 1.8rem;
    line-height: 1;
}

.sticker-off {
    font-size: 0.8rem;
    letter-spacing: 2px;
}

@keyframes driftLeft {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(calc(-100vw - 140px));
    }
}

/* Valve Time indicator */
.valve-time-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    background: rgba(20, 10, 40, 0.95);
    border: 2px solid #7a6aff;
    border-radius: 12px;
    padding: 10px 16px;
    color: #a89bff;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 0 15px rgba(122, 106, 255, 0.6);
}

.valve-time-indicator.hidden {
    display: none;
}

.valve-time-clock {
    display: inline-block;
    animation: slowClock 2s linear infinite;
}

@keyframes slowClock {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes slowPulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.1); }
}

/* Case Opening Overlay */
.case-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.95);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.case-overlay.hidden {
    display: none;
}

.case-machine {
    position: relative;
    width: 90%;
    max-width: 500px;
    background: linear-gradient(180deg, #1b1510, #0f0c09);
    border: 3px solid #5a4a30;
    border-radius: 20px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
}

.case-glow {
    position: absolute;
    inset: -6px;
    border-radius: 24px;
    filter: blur(18px);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.case-glow.grey { background: radial-gradient(circle, rgba(160,160,160,0.8), transparent 60%); opacity: 1; }
.case-glow.lightblue { background: radial-gradient(circle, rgba(176,196,222,0.9), transparent 60%); opacity: 1; }
.case-glow.blue { background: radial-gradient(circle, rgba(65,105,225,0.9), transparent 60%); opacity: 1; }
.case-glow.purple { background: radial-gradient(circle, rgba(138,43,226,0.9), transparent 60%); opacity: 1; }
.case-glow.pink { background: radial-gradient(circle, rgba(255,105,180,0.9), transparent 60%); opacity: 1; }
.case-glow.red { background: radial-gradient(circle, rgba(220,20,60,0.9), transparent 60%); opacity: 1; }
.case-glow.gold { background: radial-gradient(circle, rgba(255,215,0,0.95), transparent 60%); opacity: 1; }

.case-box {
    position: relative;
    width: 110px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
    transition: transform 0.2s ease;
    perspective: 800px;
}

.case-box-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(255, 165, 0, 0.5));
}

.case-lid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 45%;
    background: linear-gradient(180deg, #6b5030, #4a3515);
    border-radius: 8px 8px 0 0;
    transform-origin: bottom;
    transform: rotateX(-90deg);
    opacity: 0.95;
    transition: transform 0.5s ease, opacity 0.3s ease;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.case-box.open .case-lid {
    transform: rotateX(-110deg);
}

.case-ticker-window {
    position: relative;
    width: 100%;
    height: 90px;
    background: #0a0a0a;
    border: 2px solid #3a3020;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.9);
}

.case-ticker {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    height: 100%;
    padding-left: 50%;
    transform: translate3d(0, 0, 0);
}

.case-ticker-item {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: rgba(255,255,255,0.05);
    border: 2px solid currentColor;
    margin-right: 12px;
}

.case-ticker-item:last-child {
    margin-right: 0;
}

.case-ticker-item img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.case-ticker-item.p250 { color: #7d6e58; border-color: #7d6e58; background: rgba(125,110,88,0.12); }
.case-ticker-item.industrial { color: #b0c4de; border-color: #b0c4de; background: rgba(176,196,222,0.12); }
.case-ticker-item.milspec { color: #4169e1; border-color: #4169e1; background: rgba(65,105,225,0.12); }
.case-ticker-item.restricted { color: #8a2be2; border-color: #8a2be2; background: rgba(138,43,226,0.12); }
.case-ticker-item.classified { color: #ff69b4; border-color: #ff69b4; background: rgba(255,105,180,0.12); }
.case-ticker-item.covert { color: #dc143c; border-color: #dc143c; background: rgba(220,20,60,0.12); }
.case-ticker-item.gold { color: #ffd700; border-color: #ffd700; background: rgba(255,215,0,0.15); box-shadow: 0 0 12px #ffd700; }

.case-ticker-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255,255,255,0.8);
    font-size: 1.25rem;
    text-shadow: 0 0 6px white;
    pointer-events: none;
    z-index: 2;
}

.case-ticker-window::before,
.case-ticker-window::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    z-index: 1;
    pointer-events: none;
}

.case-ticker-window::before {
    left: 0;
    background: linear-gradient(90deg, rgba(10,10,10,0.95), transparent);
}

.case-ticker-window::after {
    right: 0;
    background: linear-gradient(270deg, rgba(10,10,10,0.95), transparent);
}

.case-result-payload {
    text-align: center;
    animation: casePop 0.4s ease-out;
}

.case-result-payload.hidden {
    display: none;
}

.case-result-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: rgba(255,255,255,0.05);
    border: 3px solid currentColor;
}

.case-result-icon img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.case-result-icon.p250 { color: #7d6e58; border-color: #7d6e58; }
.case-result-icon.industrial { color: #b0c4de; border-color: #b0c4de; }
.case-result-icon.milspec { color: #4169e1; border-color: #4169e1; }
.case-result-icon.restricted { color: #8a2be2; border-color: #8a2be2; }
.case-result-icon.classified { color: #ff69b4; border-color: #ff69b4; }
.case-result-icon.covert { color: #dc143c; border-color: #dc143c; }
.case-result-icon.gold { color: #ffd700; border-color: #ffd700; box-shadow: 0 0 20px #ffd700; }

/* Inventory Overlay */
.inventory-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.92);
    z-index: 3001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.inventory-overlay.hidden {
    display: none;
}

.inventory-panel {
    width: 100%;
    max-width: 720px;
    max-height: 85vh;
    background: linear-gradient(180deg, #1b1528, #121020);
    border: 2px solid #5a4a7a;
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
}

.inventory-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #3a3050;
    padding-bottom: 14px;
}

.inventory-header h2 {
    color: var(--accent-gold);
    font-size: 1.5rem;
    margin: 0;
}

.inventory-close {
    background: #3a3050;
    color: #e0e0e0;
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s ease;
}

.inventory-close:hover {
    background: #5a5080;
}

.inventory-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
    overflow-y: auto;
    padding-right: 6px;
}

.inventory-empty {
    text-align: center;
    color: #a0a0a0;
    padding: 30px 0;
    font-size: 1rem;
}

.inventory-card {
    position: relative;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 14px 10px;
    text-align: center;
    border: 2px solid currentColor;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.inventory-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.inventory-card-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inventory-card-icon img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.inventory-card-rarity {
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.inventory-card-name {
    font-size: 0.8rem;
    color: #e0e0e0;
    min-height: 2.6em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inventory-card-quantity {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: bold;
}

.inventory-card.p250 { color: #7d6e58; border-color: #7d6e58; background: rgba(125,110,88,0.1); }
.inventory-card.p250 .inventory-card-rarity { color: #a89a82; }
.inventory-card.industrial { color: #b0c4de; border-color: #b0c4de; background: rgba(176,196,222,0.1); }
.inventory-card.industrial .inventory-card-rarity { color: #c8d8e8; }
.inventory-card.milspec { color: #4169e1; border-color: #4169e1; background: rgba(65,105,225,0.1); }
.inventory-card.milspec .inventory-card-rarity { color: #6b8cff; }
.inventory-card.restricted { color: #8a2be2; border-color: #8a2be2; background: rgba(138,43,226,0.1); }
.inventory-card.restricted .inventory-card-rarity { color: #b06aff; }
.inventory-card.classified { color: #ff69b4; border-color: #ff69b4; background: rgba(255,105,180,0.1); }
.inventory-card.classified .inventory-card-rarity { color: #ff9bd2; }
.inventory-card.covert { color: #dc143c; border-color: #dc143c; background: rgba(220,20,60,0.1); }
.inventory-card.covert .inventory-card-rarity { color: #ff4d6d; }
.inventory-card.gold { color: #ffd700; border-color: #ffd700; background: rgba(255,215,0,0.1); box-shadow: inset 0 0 12px rgba(255,215,0,0.05); animation: goldShimmerCard 2.5s ease-in-out infinite; }
.inventory-card.gold .inventory-card-rarity { color: #ffe45c; }

@keyframes goldShimmerCard {
    0%, 100% { box-shadow: inset 0 0 12px rgba(255, 215, 0, 0.05); }
    50% { box-shadow: inset 0 0 24px rgba(255, 215, 0, 0.2); }
}

.case-result-icon.gold::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: radial-gradient(circle, rgba(255,215,0,0.2), transparent 70%);
    animation: goldShimmer 1.5s ease-in-out infinite;
}

.case-result-icon.unusual {
    position: relative;
    animation: unusualOrbit 3s linear infinite;
}

@keyframes unusualOrbit {
    0% { box-shadow: 0 0 20px #ff4500; }
    33% { box-shadow: 0 0 25px #ffd700; }
    66% { box-shadow: 0 0 20px #7cfc00; }
    100% { box-shadow: 0 0 20px #ff4500; }
}

@keyframes goldShimmer {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.case-result-text {
    font-size: 1.1rem;
    color: #e0e0e0;
    line-height: 1.5;
}

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

/* Toast Container - holds multiple stacked toasts */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    pointer-events: none;
}

/* Individual Toast */
.game-toast {
    background: rgba(20, 40, 20, 0.95);
    color: var(--accent-green);
    border: 1px solid var(--accent-green);
    border-radius: 8px;
    padding: 10px 18px;
    font-weight: bold;
    text-shadow: 0 0 6px var(--accent-green);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    max-width: 90vw;
    white-space: normal;
    text-align: center;
}

.game-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.game-toast.hidden {
    display: none;
}

/* Debug Panel Styles */
.debug-toggle.hidden {
    display: none;
}

.debug-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #333;
    color: #888;
    border: 1px solid #555;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    z-index: 1000;
    transition: all 0.2s ease;
}

.debug-toggle:hover {
    background-color: #444;
    color: #aaa;
    border-color: #777;
}

.debug-panel {
    position: fixed;
    bottom: 70px;
    right: 20px;
    background-color: var(--bg-color);
    border: 1px solid #0f3460;
    border-radius: 12px;
    padding: 20px;
    min-width: 280px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.debug-panel.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

.debug-panel h3 {
    color: var(--accent-gold);
    margin-bottom: 15px;
    font-size: 1.1rem;
    border-bottom: 1px solid #0f3460;
    padding-bottom: 10px;
}

.debug-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.debug-row:last-child {
    margin-bottom: 0;
}

.debug-row input[type="number"] {
    flex: 1;
    background-color: #0f3460;
    border: 1px solid #1a4a7a;
    color: #e0e0e0;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.debug-row input[type="number"]:focus {
    border-color: var(--accent-gold);
}

.debug-row button {
    background-color: #0f3460;
    color: #e0e0e0;
    border: 1px solid #1a4a7a;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.debug-row button:hover {
    background-color: #1a4a7a;
    border-color: var(--accent-gold);
}

.debug-row button.danger {
    background-color: #4a1a1a;
    border-color: #8b2020;
    color: #ff6b6b;
    width: 100%;
}

.debug-row button.danger:hover {
    background-color: #6a2020;
    border-color: #cc3030;
}

/* Changelog Section */
.changelog-section {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 1100px;
    margin: 30px auto 0;
    background-color: var(--panel-color);
    border: 1px solid #0f3460;
    border-radius: 12px;
    text-align: left;
    color: #e0e0e0;
    overflow: hidden;
}

.changelog-section summary {
    padding: 14px 18px;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--accent-gold);
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.2s ease;
}

.changelog-section summary::-webkit-details-marker {
    display: none;
}

.changelog-section summary::after {
    content: '▸';
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.changelog-section[open] summary::after {
    transform: rotate(90deg);
}

.changelog-section summary:hover {
    background-color: #0f3460;
}

.changelog-content {
    padding: 18px;
    border-top: 1px solid #0f3460;
    max-height: 60vh;
    overflow-y: auto;
}

.changelog-content h3 {
    color: var(--accent-gold);
    font-size: 1rem;
    margin: 18px 0 8px;
}

.changelog-content h3:first-child {
    margin-top: 0;
}

.changelog-date {
    font-size: 0.8rem;
    color: #888;
    font-weight: normal;
    margin-left: 6px;
}

.changelog-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.changelog-content li {
    font-size: 0.85rem;
    line-height: 1.4;
    color: #d0d0d0;
}

.changelog-content a {
    color: #6ab3ff;
    text-decoration: none;
    word-break: break-word;
}

.changelog-content a:hover {
    text-decoration: underline;
}

.changelog-content code {
    background-color: #0f3460;
    color: #f0c040;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.8em;
}

body.summer-sale .changelog-section {
    background-color: #0d2f1b;
    border-color: var(--accent-green);
}

body.summer-sale .changelog-section summary {
    color: var(--accent-green);
}

body.summer-sale .changelog-section summary:hover {
    background-color: #143d26;
}

body.summer-sale .changelog-content {
    border-top-color: var(--accent-green);
}

body.summer-sale .changelog-content h3 {
    color: var(--accent-green);
}

body.summer-sale .changelog-content code {
    background-color: #143d26;
    color: var(--accent-green);
}

/* Credits Section */
.credits-section {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 1100px;
    margin: 30px auto 0;
    background-color: var(--panel-color);
    border: 1px solid #0f3460;
    border-radius: 12px;
    text-align: left;
    color: #e0e0e0;
    overflow: hidden;
}

.credits-section summary {
    padding: 14px 18px;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--accent-gold);
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.2s ease;
}

.credits-section summary::-webkit-details-marker {
    display: none;
}

.credits-section summary::after {
    content: '▸';
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.credits-section[open] summary::after {
    transform: rotate(90deg);
}

.credits-section summary:hover {
    background-color: #0f3460;
}

.credits-content {
    padding: 18px;
    border-top: 1px solid #0f3460;
    max-height: 60vh;
    overflow-y: auto;
}

.credits-content h3 {
    color: var(--accent-gold);
    font-size: 1rem;
    margin: 18px 0 8px;
}

.credits-content h3:first-child {
    margin-top: 0;
}

.credits-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.credits-content li {
    font-size: 0.85rem;
    line-height: 1.4;
    color: #d0d0d0;
}

.credits-content a {
    color: #6ab3ff;
    text-decoration: none;
    word-break: break-word;
}

.credits-content a:hover {
    text-decoration: underline;
}

.credits-content code {
    background-color: #0f3460;
    color: #f0c040;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.8em;
}

body.summer-sale .credits-section {
    background-color: #0d2f1b;
    border-color: var(--accent-green);
}

body.summer-sale .credits-section summary {
    color: var(--accent-green);
}

body.summer-sale .credits-section summary:hover {
    background-color: #143d26;
}

body.summer-sale .credits-content {
    border-top-color: var(--accent-green);
}

body.summer-sale .credits-content h3 {
    color: var(--accent-green);
}

body.summer-sale .credits-content code {
    background-color: #143d26;
    color: var(--accent-green);
}

/* Game Footer */
.game-footer {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 1100px;
    margin: 20px auto 0;
    padding: 14px 18px;
    text-align: center;
    font-size: 0.85rem;
    color: #a0a0a0;
    background-color: var(--panel-color);
    border: 1px solid #0f3460;
    border-radius: 12px;
}

.mute-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.mute-btn {
    background-color: #0f3460;
    color: #e0e0e0;
    border: 1px solid #1a4a7a;
    border-radius: 8px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    user-select: none;
}

.mute-btn:hover {
    background-color: #1a4a7a;
    border-color: var(--accent-gold);
}

.mute-btn.muted {
    background-color: #4a1a1a;
    border-color: #8b2020;
    color: #ff9999;
}

.mute-btn.muted:hover {
    background-color: #6a2020;
    border-color: #cc3030;
}

/* Summer Sale event styling for mute buttons */
body.summer-sale .mute-btn {
    background-color: #143d26;
    border-color: var(--accent-green);
    color: #e0ffe0;
}

body.summer-sale .mute-btn:hover {
    background-color: #1d5233;
    border-color: var(--accent-green);
    box-shadow: 0 0 8px rgba(57, 255, 20, 0.4);
}

body.summer-sale .mute-btn.muted {
    background-color: #4a1a1a;
    border-color: #8b2020;
    color: #ff9999;
}

body.summer-sale .mute-btn.muted:hover {
    background-color: #6a2020;
    border-color: #cc3030;
}

.game-footer p {
    margin: 2px 0;
}

.footer-links {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.footer-links a {
    color: #6ab3ff;
    text-decoration: none;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.footer-links a:hover {
    color: #9dceff;
    text-decoration: underline;
}

.reset-progress-link {
    background: none;
    border: none;
    color: #ff6b6b;
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
    padding: 0;
    transition: color 0.2s ease;
}

.reset-progress-link:hover {
    color: #ff9999;
}

.footer-divider {
    color: #606060;
    user-select: none;
}

.footer-disclaimer {
    font-size: 0.8rem;
    color: #808080;
    font-style: italic;
    margin: 4px 0;
}

body.summer-sale .game-footer {
    background-color: #0d2f1b;
    border-color: var(--accent-green);
    color: #b0d0b0;
}

body.summer-sale .footer-links a {
    color: #7ef57e;
}

body.summer-sale .footer-links a:hover {
    color: #b3ffb3;
    text-decoration: underline;
}

body.summer-sale .footer-divider {
    color: #4a8a4a;
}

/* Achievements Section */
.achievements-section {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 1100px;
    margin: 30px auto 0;
    background-color: var(--panel-color);
    border: 1px solid #0f3460;
    border-radius: 12px;
    text-align: left;
    color: #e0e0e0;
    overflow: hidden;
}

.achievements-section summary {
    padding: 14px 18px;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--accent-gold);
    cursor: pointer;
    user-select: none;
    list-style: none;
    transition: background-color 0.2s ease;
}

#achievements-counter {
    font-variant-numeric: tabular-nums;
}

.achievements-section summary::-webkit-details-marker {
    display: none;
}

.achievements-section summary::after {
    content: '▸';
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.achievements-section[open] summary::after {
    transform: rotate(90deg);
}

.achievements-section summary:hover {
    background-color: #0f3460;
}

.achievements-content {
    padding: 18px;
    border-top: 1px solid #0f3460;
    max-height: 60vh;
    overflow-y: auto;
}

.achievements-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.achievement-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #0f3460;
    border-radius: 10px;
    padding: 14px 16px;
    border: 1px solid transparent;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.achievement-card.locked {
    opacity: 0.45;
    cursor: default;
}

.achievement-card.locked:hover {
    background-color: #0f3460;
    border-color: transparent;
}

.achievement-card.unlocked {
    background-color: #1a3d2e;
    border-color: var(--accent-gold);
    box-shadow: 0 0 12px rgba(240, 192, 64, 0.25);
}

.achievement-card.unlocked:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 18px rgba(240, 192, 64, 0.35);
}

.achievement-icon {
    font-size: 2rem;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.achievement-info {
    flex: 1;
    min-width: 0;
}

.achievement-name {
    font-weight: bold;
    font-size: 0.95rem;
    color: #e0e0e0;
}

.achievement-desc {
    font-size: 0.8rem;
    color: #a0a0a0;
    margin-top: 2px;
    line-height: 1.35;
}

.achievement-unlocked-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--accent-gold);
    color: #1a1a2e;
    font-weight: bold;
    font-size: 0.75rem;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 6px rgba(240, 192, 64, 0.6);
}

body.summer-sale .achievements-section {
    background-color: #0d2f1b;
    border-color: var(--accent-green);
}

body.summer-sale .achievements-section summary {
    color: var(--accent-green);
}

body.summer-sale .achievements-section summary:hover {
    background-color: #143d26;
}

body.summer-sale .achievements-content {
    border-top-color: var(--accent-green);
}

body.summer-sale .achievement-card {
    background-color: #143d26;
}

body.summer-sale .achievement-card.locked {
    background-color: #143d26;
}

body.summer-sale .achievement-card.unlocked {
    background-color: #1a3d2e;
    border-color: var(--accent-green);
    box-shadow: 0 0 12px rgba(57, 255, 20, 0.25);
}

body.summer-sale .achievement-unlocked-badge {
    background: var(--accent-green);
    box-shadow: 0 0 6px rgba(57, 255, 20, 0.6);
}

/* Achievement Toast */
.game-toast.achievement-toast {
    background: rgba(20, 40, 20, 0.95);
    color: var(--accent-gold);
    border-color: var(--accent-gold);
    text-shadow: 0 0 8px rgba(240, 192, 64, 0.6);
    font-size: 1.05rem;
    padding: 14px 22px;
    max-width: 90vw;
    white-space: normal;
    text-align: center;
}

body.summer-sale .game-toast.achievement-toast {
    background: rgba(10, 50, 10, 0.95);
    color: var(--accent-green);
    border-color: var(--accent-green);
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.6);
}

/* Statistics Section */
.statistics-section {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 1100px;
    margin: 30px auto 0;
    background-color: var(--panel-color);
    border: 1px solid #0f3460;
    border-radius: 12px;
    text-align: left;
    color: #e0e0e0;
    overflow: hidden;
}

.statistics-section summary {
    padding: 14px 18px;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--accent-gold);
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.2s ease;
}

.statistics-section summary::-webkit-details-marker {
    display: none;
}

.statistics-section summary::after {
    content: '▸';
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.statistics-section[open] summary::after {
    transform: rotate(90deg);
}

.statistics-section summary:hover {
    background-color: #0f3460;
}

.statistics-content {
    padding: 18px;
    border-top: 1px solid #0f3460;
    max-height: 60vh;
    overflow-y: auto;
}

.statistics-content h3 {
    color: var(--accent-gold);
    font-size: 1rem;
    margin: 18px 0 10px;
}

/* Stats grid — 2-column layout */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 24px;
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 6px 0;
    border-bottom: 1px solid rgba(15, 52, 96, 0.5);
}

.stat-label {
    font-size: 0.9rem;
    color: #a0a0a0;
}

.stat-value {
    font-size: 0.95rem;
    font-weight: bold;
    color: #e0e0e0;
    text-align: right;
    word-break: break-word;
}

/* Rarity breakdown table */
.rarity-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 4px;
}

.rarity-table thead th {
    font-size: 0.85rem;
    color: #888;
    text-align: left;
    padding: 6px 10px;
    border-bottom: 2px solid #0f3460;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rarity-table thead th:last-child {
    text-align: right;
}

.rarity-table tbody td {
    padding: 8px 10px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(15, 52, 96, 0.3);
}

.rarity-table tbody td:last-child {
    text-align: right;
    font-weight: bold;
}

/* Rarity row colors matching case item colors */
.rarity-table tbody tr.rarity-p250 { color: #7d6e58; }
.rarity-table tbody tr.rarity-industrial { color: #b0c4de; }
.rarity-table tbody tr.rarity-milspec { color: #4169e1; }
.rarity-table tbody tr.rarity-restricted { color: #8a2be2; }
.rarity-table tbody tr.rarity-classified { color: #ff69b4; }
.rarity-table tbody tr.rarity-covert { color: #dc143c; }
.rarity-table tbody tr.rarity-gold { color: #ffd700; }

.rarity-table tbody tr.rarity-gold td:last-child {
    text-shadow: 0 0 6px rgba(255, 215, 0, 0.4);
}

/* Summer sale theme variants */
body.summer-sale .statistics-section {
    background-color: #0d2f1b;
    border-color: var(--accent-green);
}

body.summer-sale .statistics-section summary {
    color: var(--accent-green);
}

body.summer-sale .statistics-section summary:hover {
    background-color: #143d26;
}

body.summer-sale .statistics-content {
    border-top-color: var(--accent-green);
}

body.summer-sale .statistics-content h3 {
    color: var(--accent-green);
}

body.summer-sale .rarity-table thead th {
    border-bottom-color: var(--accent-green);
}
