body {
    margin: 0;
    padding: 0;
    background: #000;
    font-family: 'Arial', sans-serif;
    overflow: hidden;
    cursor: none;
}

/* Show cursor when game is not running */
body.show-cursor {
    cursor: auto;
    z-index: 9999;
}

#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#gameCanvas {
    display: block;
    background: #000;
    width: 100vw;
    height: 100vh;
}

#ui {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #00ffff;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    z-index: 10;
    pointer-events: none; /* Allow clicking through the UI */
}

/* Stats container styling */
#ui > div:not(#funding-goals):not(#goal-celebrations) {
    background: rgba(0,0,0,0.8);
    border: 2px solid #00ffff;
    border-radius: 10px;
    padding: 10px 15px;
    margin-bottom: 10px;
    min-width: 200px;
    pointer-events: auto;
}

/* Pledge history specific styling */
#ui > div:not(#funding-goals):not(#goal-celebrations):has(.startup-messages) {
    border-radius: 10px;
}

#funding-goals {
    background: rgba(0,0,0,0.8);
    border: 2px solid #00ffff;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    min-width: 300px;
    z-index: 1000;
    pointer-events: auto; /* Allow interaction with funding goals */
}

#funding-goals h3 {
    margin: 0 0 10px 0;
    color: #00ffff;
    font-size: 20px;
    text-align: center;
    border-bottom: 1px solid #00ffff;
    padding-bottom: 5px;
}

#goals-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.goal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.goal-item.completed {
    background: rgba(0, 255, 0, 0.2);
    border-color: #00ff00;
    color: #00ff00;
}

.goal-item.current {
    background: rgba(255, 215, 0, 0.2);
    border-color: #FFD700;
    color: #FFD700;
    animation: pulse 2s infinite;
}

.goal-item.future {
    background: rgba(128, 128, 128, 0.2);
    border-color: #808080;
    color: #808080;
}

.goal-summary {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    margin: 5px 0;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
}

.goal-summary.top-summary {
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid #00ff00;
}

.goal-summary.bottom-summary {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid #00ffff;
}

.goal-description {
    font-size: 14px;
    flex: 1;
}

.goal-amount {
    font-size: 16px;
    font-weight: bold;
    margin-left: 10px;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

#goal-celebrations {
    margin-top: 10px;
    min-height: 150px;
}

.celebration-gif {
    width: 150px;
    height: 150px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 2px solid #00ffff;
    animation: fadeInOut 5s ease-in-out;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: scale(0.8); }
    10% { opacity: 1; transform: scale(1); }
    80% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.1); }
}

#gameOver {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.9);
    color: #00ffff;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    display: none;
    border: 3px solid #00ffff;
    z-index: 20;
    font-size: 18px;
    min-width: 800px;
}

.game-over-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.game-over-left {
    flex: 1;
    text-align: left;
}

.game-over-right {
    flex: 1;
    text-align: left;
    max-width: 350px;
}

#highScores {
    background: rgba(0,0,0,0.8);
    border: 2px solid #00ffff;
    border-radius: 10px;
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
}

#highScores h3 {
    margin: 0 0 15px 0;
    color: #00ffff;
    font-size: 18px;
    text-align: center;
    border-bottom: 1px solid #00ffff;
    padding-bottom: 5px;
}

.highest-score {
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid #FFD700;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 15px;
    text-align: center;
}

.highest-score h4 {
    margin: 0 0 8px 0;
    color: #FFD700;
    font-size: 16px;
}

.highest-score p {
    margin: 5px 0;
    font-size: 14px;
}

.scores-list {
    margin-bottom: 15px;
}

.scores-list h4 {
    margin: 0 0 10px 0;
    color: #00ffff;
    font-size: 16px;
    text-align: center;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    margin-bottom: 5px;
    background: rgba(0, 255, 255, 0.1);
    border-radius: 5px;
    font-size: 12px;
    border: 1px solid transparent;
}

.score-item.highest {
    background: rgba(255, 215, 0, 0.2);
    border-color: #FFD700;
}

.score-item .medal {
    font-size: 14px;
    margin-right: 5px;
}

.score-item .money {
    font-weight: bold;
    color: #FFD700;
    flex: 1;
    text-align: center;
}

.score-item .date {
    color: #00ffff;
    font-size: 10px;
    margin: 0 5px;
}

.score-item .time {
    color: #00ffff;
    font-size: 10px;
    margin: 0 5px;
}

.score-item .result {
    font-size: 12px;
    margin-left: 5px;
}

.clear-scores-btn {
    background: #ff6b6b;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    width: 100%;
    transition: all 0.3s ease;
}

.clear-scores-btn:hover {
    background: #ff4444;
}

#gameOver h2 {
    margin: 0 0 15px 0;
    color: #ff6b6b;
    font-size: 28px;
}

#gameOver button {
    background: #00ff00;
    color: #000;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    margin-top: 15px;
    font-weight: bold;
}

#gameOver button:hover {
    background: #00cc00;
}

#gameOver .share-text {
    margin: 15px 0;
    font-size: 14px;
    color: #00ffff;
    text-align: center;
    /* Debug: Make sure it's visible */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#gameOver .share-text a {
    color: #FFD700;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

#gameOver .share-text a:hover {
    color: #ffaa00;
    text-decoration: underline;
}

/* Upgrade Menu Styles */
#upgradeMenu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 30;
}

.upgrade-menu-content {
    background: #000;
    border: 3px solid #00ffff;
    border-radius: 15px;
    padding: 30px;
    width: 700px;
    height: 620px;
    position: relative;
}

.upgrade-menu-content h2 {
    color: #00ffff;
    text-align: center;
    margin: 0 0 20px 0;
    font-size: 24px;
}

#upgradeGrid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 20px;
    height: 520px;
}

.upgrade-item {
    background: #333;
    border: 2px solid #00ffff;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upgrade-item:hover {
    background: #444;
    transform: scale(1.05);
}

.upgrade-item.purchased {
    background: rgba(0, 255, 0, 0.15);
    border-color: #00ff00;
    color: #000;
}

.upgrade-item.unavailable {
    background: rgba(128, 128, 128, 0.3);
    border-color: #666;
    color: #999;
    cursor: not-allowed;
    opacity: 0.7;
}

.upgrade-item.unavailable:hover {
    background: rgba(128, 128, 128, 0.4);
    transform: none;
}

.upgrade-item.unavailable .description {
    color: #ccc;
}

.upgrade-item.unavailable .cost {
    color: #999;
}

.upgrade-item.unavailable .speed-increase {
    color: #999;
}

.money-banner {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff6b6b;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 10;
    border: 1px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.upgrade-item img {
    width: 60px;
    height: 60px;
    margin-bottom: 10px;
}

.upgrade-item .description {
    font-size: 10px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #fff;
}

.upgrade-item .cost {
    font-size: 12px;
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 3px;
}

.upgrade-item .speed-increase {
    font-size: 10px;
    color: #00ffff;
}

.upgrade-item .checkmark {
    position: absolute;
    top: 5px;
    right: 5px;
    color: #00ff00;
    font-size: 20px;
    font-weight: bold;
}

.upgrade-menu-footer {
    text-align: center;
    margin-top: 20px;
    color: #00ffff;
    font-size: 16px;
    font-weight: bold;
}

/* Game Menu Styles */
#gameMenu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
}

.menu-content {
    background: #000;
    border: 3px solid #00ffff;
    border-radius: 15px;
    padding: 40px;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    text-align: center;
    color: #00ffff;
}

.menu-content h1 {
    color: #00ffff;
    font-size: 32px;
    margin: 0 0 30px 0;
    text-shadow: 0 0 10px #00ffff;
}

.menu-section {
    margin-bottom: 25px;
    text-align: left;
}

.menu-section h2 {
    color: #FFD700;
    font-size: 20px;
    margin: 0 0 10px 0;
    border-bottom: 1px solid #FFD700;
    padding-bottom: 5px;
}

.menu-section ul {
    margin: 0;
    padding-left: 20px;
}

.menu-section li {
    margin-bottom: 8px;
    font-size: 16px;
    line-height: 1.4;
}

.menu-section strong {
    color: #FFD700;
}

#startGameBtn {
    background: #00ff00;
    color: #000;
    border: none;
    padding: 20px 40px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    margin-top: 20px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#startGameBtn:hover {
    background: #00cc00;
    transform: scale(1.05);
    box-shadow: 0 0 20px #00ff00;
}

/* Investor Popup Styles */
#investorPopup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.investor-popup-content {
    background: #000;
    border: 3px solid #FFD700;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    color: #00ffff;
    max-width: 500px;
    position: relative;
}

.investor-popup-content h2 {
    color: #FFD700;
    font-size: 20px;
    margin: 20px 0;
    line-height: 1.4;
}

#acceptInvestmentBtn {
    background: #00ff00;
    color: #000;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    margin-top: 20px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#acceptInvestmentBtn:hover {
    background: #00cc00;
    transform: scale(1.05);
    box-shadow: 0 0 15px #00ff00;
}