html, body { /**preventing double-tap zoom on mobile**/
  touch-action: manipulation; 
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    color: white;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.background-pattern {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255, 218, 185, 0.1), transparent 50%);
    pointer-events: none;
}

.container {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
}

header {
    text-align: center;
    padding: 20px 0;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(to right, #ffaa00, #ff6b9d, #ff4785);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 800;
}

.peach-counter {
    font-size: 1.8rem;
    font-weight: bold;
    color: #ffaa00;
    margin: 10px 0;
}

.rate-counter {
    color: #aaa;
    font-size: 1rem;
    margin-bottom: 20px;
}

.game-area {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 50px; /* Increased horizontal spacing */
    min-height: 70vh;
    padding: 20px 0;
}

.visuals-panel {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
    width: 350px;
    background: rgba(30, 30, 46, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(128, 128, 128, 0.3);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.empire-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin-bottom: 20px;
}

.empire-header:hover .panel-title {
    color: #ffb7c5;
}

.empire-toggle {
    font-size: 1.2rem;
    color: #ffaa00;
    transition: transform 0.3s ease;
    transform: rotate(-90deg);
}

.empire-toggle.expanded {
    transform: rotate(0deg);
}

.empire-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    width: 100%;
}

.empire-content.expanded {
    max-height: 1000px;
}

.empire-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
    padding: 15px 0;
    width: 100%;
}

.empire-compact.hidden {
    display: none;
}

.compact-entity {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 60px;
}

.compact-emoji {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.compact-count {
    font-size: 0.7rem;
    color: #aaa;
    font-weight: 600;
}

.panel-title {
    text-align: center;
    font-size: 1.3rem;
    color: #ffaa00;
    margin-bottom: 20px;
    font-weight: 600;
}

.empire-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    width: 100%;
}

.empire-item {
    background: rgba(50, 50, 70, 0.5);
    border: 1px solid rgba(128, 128, 128, 0.2);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: transform 0.2s ease;
}

.empire-item:hover {
    transform: translateY(-2px);
}

.item-emoji {
    font-size: 2rem;
    margin-bottom: 8px;
}

.item-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffaa00;
    margin-bottom: 5px;
}

.item-count {
    font-size: 0.8rem;
    color: #aaa;
}

.empty-empire {
    grid-column: span 2;
    text-align: center;
    color: #888;
    padding: 30px 0;
}

.peach-clicker {
    position: relative;
    width: 250px;
    height: 250px;
}

.peach-button {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ffb7c5, #ff6b9d 70%, #ff4785);
    border: none;
    cursor: pointer;
    box-shadow: 0 15px 35px rgba(255, 107, 157, 0.4);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.peach-button:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 40px rgba(255, 107, 157, 0.6);
}

.peach-button:active {
    transform: scale(0.95);
}

.peach-emoji {
    font-size: 5rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.notification {
    position: absolute;
    color: #ffdd00;
    font-weight: bold;
    font-size: 1.2rem;
    pointer-events: none;
    animation: floatUp 1s ease-out forwards;
}

.top-buttons {
    position: fixed;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 10px;
    z-index: 1000;
}

.top-buttons button {
    font-size: 20px;
    padding: 6px 10px;
    background-color: rgba(255, 255, 255, 0.3);
    border: 1px solid #fff;
    border-radius: 10px;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: background-color 0.2s;
}

.top-buttons button:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.popup.visible {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: rgba(30, 30, 46, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 170, 0, 0.3);
    border-radius: 20px;
    padding: 0;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    /* Ensure scrollbar is contained within the popup */
    box-sizing: border-box;
    /* Ensure scrollbar respects border radius */
    overflow: hidden;
}

.popup-inner {
    padding: 30px;
    max-height: 80vh;
    overflow-y: auto;
    height: 100%;
    /* Ensure content doesn't shift when scrollbar appears */
    box-sizing: border-box;
}

.popup.visible .popup-content {
    transform: scale(1);
}

.popup .close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #ffaa00;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.popup .close:hover {
    background: rgba(255, 170, 0, 0.2);
}

.popup h2 {
    color: #ffaa00;
    font-size: 1.6rem;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 700;
}

.popup h3 {
    color: #ffaa00;
    font-size: 1.1rem;
    margin: 20px 0 10px 0;
    font-weight: 600;
}

.popup p {
    color: #fff;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 8px 0;
}

.popup ul {
    list-style: disc;
    padding-left: 20px;
    margin: 10px 0;
}

.popup li {
    padding: 5px 0;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #fff;
    border: none;
}

.popup li:hover {
    background: none;
    margin: 0;
    padding: 5px 0;
    border-radius: 0;
}

/* Collapsible sections */
.collapsible {
    cursor: pointer;
    user-select: none;
}

.collapsible:hover {
    color: #ffb7c5;
}

.collapsible::after {
    content: ' ▼';
    font-size: 0.8rem;
    color: #ffaa00;
    transition: transform 0.3s ease;
}

.collapsible.collapsed::after {
    transform: rotate(-90deg);
}

.collapsible-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.collapsible-content.collapsed {
    max-height: 0;
}

.popup strong {
    color: #ffaa00;
    font-weight: 600;
}

.popup em {
    color: #aaa;
    font-style: italic;
}

.popup hr {
    border: none;
    border-top: 1px solid rgba(255, 170, 0, 0.2);
    margin: 20px 0;
}

.loading {
    text-align: center;
    color: #aaa;
    font-style: italic;
    padding: 20px;
}

/* Custom scrollbar for the popup inner content */
.popup-inner::-webkit-scrollbar {
    width: 6px;
}

.popup-inner::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
    margin: 20px 0;
}

.popup-inner::-webkit-scrollbar-thumb {
    background: rgba(255, 170, 0, 0.4);
    border-radius: 3px;
    border: 1px solid rgba(255, 170, 0, 0.1);
    min-height: 30px;
    margin: 0 2px;
}

.popup-inner::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 170, 0, 0.6);
}

/* Hide scrollbar buttons/arrows */
.popup-inner::-webkit-scrollbar-button {
    display: none;
}

/* Firefox scrollbar */
.popup-inner {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 170, 0, 0.4) transparent;
}

/* Update log popup specific styling */
#updatePopup .popup-content {
    max-width: 600px;
    width: 90%;
}

/* Reward popup specific styling */
#rewardPopup .popup-content {
    max-width: 350px;
    width: 90%;
}

/* Reward popup button hover effects */
#redeemButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 170, 0, 0.4);
}

#redeemButton:active {
    transform: translateY(0);
}

#codeInput:focus {
    outline: none;
    border-color: rgba(255, 170, 0, 0.6);
    box-shadow: 0 0 10px rgba(255, 170, 0, 0.3);
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -150%);
    }
}

.click-power {
    text-align: center;
    margin-top: 25px;
    margin-bottom: 20px; /* Added space below */
    color: #aaa;
    font-size: 0.9rem;
}

.entities-panel {
    width: 320px;
    background: rgba(30, 30, 46, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(128, 128, 128, 0.3);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-height: 400px;
    overflow-y: auto;
    /* Hide scrollbar for Chrome, Safari and Opera */
    scrollbar-width: none; /* For Firefox */
    -ms-overflow-style: none; /* For Internet Explorer and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.entities-panel::-webkit-scrollbar {
    display: none;
}

.entities-title {
    text-align: center;
    font-size: 1.3rem;
    color: #ffaa00;
    margin-bottom: 15px;
    font-weight: 600;
}

.entity-item {
    background: rgba(50, 50, 70, 0.5);
    border: 1px solid rgba(128, 128, 128, 0.2);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.entity-item:hover {
    background: rgba(70, 70, 90, 0.5);
    border-color: rgba(255, 170, 0, 0.3);
}

.entity-item.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.entity-item.disabled:hover {
    background: rgba(50, 50, 70, 0.5);
    border-color: rgba(128, 128, 128, 0.2);
}

.entity-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.entity-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.entity-emoji {
    font-size: 1.5rem;
}

.entity-text {
    flex: 1;
}

.entity-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 3px;
}

.entity-owned {
    font-size: 0.8rem;
    color: #888;
}

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

.cost-amount {
    color: #ffaa00;
    font-weight: bold;
    font-size: 0.9rem;
}

.rate-bonus {
    font-size: 0.75rem;
    color: #4ade80;
}

footer {
    text-align: center;
    padding: 20px;
    color: #888;
    font-size: 0.9rem;
    background: rgba(10, 10, 20, 0.7);
    border-top: 1px solid rgba(255, 170, 0, 0.1);
    margin-top: auto;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.footer-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.hearts {
    display: flex;
    gap: 4px;
}

.heart {
    color: #ff6b9d;
    animation: pulse 1.5s infinite;
}

.heart:nth-child(2) {
    animation-delay: 0.5s;
}

.heart:nth-child(3) {
    animation-delay: 1s;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.footer-links {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.footer-link {
    color: #ffaa00;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-link:hover {
    color: #ffb7c5;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .game-area {
        flex-direction: column;
        gap: 30px; /* Adjusted for mobile */
    }
    .peach-clicker {
        width: 200px;
        height: 200px;
    }
    .peach-emoji {
        font-size: 4rem;
    }
    .entities-panel, .visuals-panel {
        width: 100%;
        max-width: 400px;
    }
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
} 
