* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(to bottom, #4ec0ca 0%, #87ceeb 100%);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    -webkit-user-select: none;
}

#gameContainer {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 500px;
    max-height: 800px;
    margin: 0 auto;
    background: #4ec0ca;
    overflow: hidden;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #4ec0ca 0%, #87ceeb 50%, #4ec0ca 100%);
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(19, 23, 34, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.menu.hidden {
    display: none;
}

.menu-content {
    text-align: center;
    color: #d1d4dc;
    padding: 48px 40px;
    background: #1a1e29;
    border: 1px solid #2a2e39;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    max-width: 520px;
    width: 90%;
}

.menu-content h1 {
    font-size: 2.4em;
    margin-bottom: 32px;
    margin-top: 0;
    color: #ffd700;
    font-weight: 600;
    letter-spacing: -0.5px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.menu-content h2 {
    font-size: 1.6em;
    margin-bottom: 32px;
    color: #ef5350;
    font-weight: 600;
    letter-spacing: -0.3px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.button {
    background: #2962ff;
    color: #ffffff;
    padding: 14px 32px;
    font-size: 0.95em;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    margin: 8px auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid #2962ff;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 200px;
    box-shadow: 0 2px 8px rgba(41, 98, 255, 0.3);
}

.button:hover {
    background: #1e88e5;
    border-color: #1e88e5;
    box-shadow: 0 4px 12px rgba(41, 98, 255, 0.4);
    transform: translateY(-1px);
}

.button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(41, 98, 255, 0.3);
}

.start-button {
    font-size: 1.15em !important;
    padding: 16px 40px !important;
    min-height: 52px !important;
    min-width: 240px;
    box-shadow: 0 4px 16px rgba(41, 98, 255, 0.4) !important;
    transition: all 0.2s ease !important;
    line-height: 1.4 !important;
    letter-spacing: 1px !important;
}

.start-button::before {
    content: '▶';
    display: inline-block;
    font-size: 1.1em;
    line-height: 1;
    font-weight: normal;
}

.start-button:hover {
    box-shadow: 0 6px 20px rgba(41, 98, 255, 0.5) !important;
    transform: translateY(-2px) !important;
}

.start-button:active {
    transform: translateY(0) !important;
    box-shadow: 0 3px 12px rgba(41, 98, 255, 0.4) !important;
}

#instructions {
    margin-top: 32px;
    font-size: 0.9em;
    line-height: 1.6;
    color: #868993;
    text-align: center;
    padding: 20px;
    background: rgba(26, 30, 41, 0.5);
    border: 1px solid #2a2e39;
    border-radius: 4px;
}

#instructions p {
    margin: 8px 0;
    color: #d1d4dc;
}

#instructions p:first-child {
    margin-top: 0;
    font-size: 1.05em;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    animation: pulse-hint 2s ease-in-out infinite;
}

#instructions p:last-child {
    margin-bottom: 0;
}

@keyframes pulse-hint {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.02);
    }
}

#yoloMessage {
    font-size: 0.75em;
    margin: 0 0 24px 0;
    color: #868993;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

#finalScore {
    font-size: 2.4em;
    margin: 0 0 8px 0;
    color: #d1d4dc;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    letter-spacing: -0.5px;
}

#finalScore.positive {
    color: #26a69a;
}

#finalScore.negative {
    color: #ef5350;
}

#highScore {
    font-size: 1.8em;
    margin: 0 0 32px 0;
    color: #ff9800;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: -0.3px;
    text-shadow: 0 0 12px rgba(255, 152, 0, 0.5);
    padding: 12px 20px;
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: 4px;
    display: inline-block;
}

/* Total Playtime Display - Top Right Corner */
#totalPlaytime {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.85em;
    color: #868993;
    font-weight: 500;
    font-family: 'Courier New', monospace;
    padding: 6px 12px;
    background: rgba(26, 30, 41, 0.6);
    border: 1px solid rgba(42, 46, 57, 0.5);
    border-radius: 4px;
    z-index: 12;
    backdrop-filter: blur(4px);
    letter-spacing: 0.3px;
}

/* Game Over Screen Top Buttons */
.game-over-buttons-top {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding: 0 20px;
    z-index: 11;
}

.top-button {
    background: rgba(42, 46, 57, 0.6);
    color: #d1d4dc;
    padding: 10px 20px;
    font-size: 0.85em;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #2a2e39;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 8px auto;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.top-button:hover {
    background: rgba(42, 46, 57, 0.8);
    border-color: #3a3e4f;
    color: #ffffff;
}

.top-button:active {
    transform: translateY(0);
}

.donate-button {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    font-size: 0.85em;
    padding: 12px 18px;
    position: relative;
    overflow: hidden;
}

.donate-button::before {
    content: '💝';
    margin-right: 5px;
}

.donate-button:hover {
    background: linear-gradient(135deg, #ff5252 0%, #e53935 100%);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
    transform: translateY(-2px);
}

.donate-button:active {
    transform: translateY(0) scale(0.95);
}

.opinion-button {
    background: #5c6bc0 !important;
    color: #ffffff !important;
    border: 1px solid #5c6bc0 !important;
    box-shadow: 0 2px 8px rgba(92, 107, 192, 0.3) !important;
    font-size: 0.9em !important;
    padding: 12px 28px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    transition: all 0.2s ease !important;
    min-width: 240px;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px;
    margin: 8px auto !important;
}

.opinion-button::before {
    content: '✉';
    display: inline-block;
    font-size: 1.1em;
    line-height: 1;
    font-weight: normal;
}

.opinion-button:hover {
    background: #4c5aa8 !important;
    border-color: #4c5aa8 !important;
    box-shadow: 0 4px 12px rgba(92, 107, 192, 0.4) !important;
    transform: translateY(-1px);
}

.opinion-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(92, 107, 192, 0.3) !important;
}

.restart-button {
    background: #2962ff !important;
    color: #ffffff !important;
    font-size: 1.05em !important;
    min-height: 48px !important;
    min-width: 240px;
    padding: 14px 32px !important;
    margin: 0 auto 12px auto !important;
    font-weight: 600 !important;
    border: 1px solid #2962ff !important;
    box-shadow: 0 2px 8px rgba(41, 98, 255, 0.3) !important;
    transition: all 0.2s ease !important;
    line-height: 1.4 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px;
}

.restart-button::before {
    content: '↻';
    display: inline-block;
    font-size: 1.2em;
    line-height: 1;
    font-weight: normal;
}

.restart-button:hover {
    background: #1e88e5 !important;
    border-color: #1e88e5 !important;
    box-shadow: 0 4px 12px rgba(41, 98, 255, 0.4) !important;
    transform: translateY(-1px);
}

.restart-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(41, 98, 255, 0.3) !important;
}

.share-button {
    background: #26a69a !important;
    color: #ffffff !important;
    font-size: 0.95em !important;
    padding: 12px 28px !important;
    border: 1px solid #26a69a !important;
    box-shadow: 0 2px 8px rgba(38, 166, 154, 0.3) !important;
    transition: all 0.2s ease !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    font-weight: 600 !important;
    min-width: 240px;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px;
}

.share-button::before {
    content: '↗';
    display: inline-block;
    font-size: 1.2em;
    line-height: 1;
    font-weight: normal;
    transform: rotate(-45deg);
}

.share-button:hover {
    background: #1e8a7f !important;
    border-color: #1e8a7f !important;
    box-shadow: 0 4px 12px rgba(38, 166, 154, 0.4) !important;
    transform: translateY(-1px);
}

.share-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(38, 166, 154, 0.3) !important;
}

/* TradingView-style Header Bar */
.trading-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: rgba(26, 30, 41, 0.95);
    border-bottom: 1px solid #2a2e39;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    z-index: 6;
    backdrop-filter: blur(10px);
}

.trading-header.hidden {
    display: none;
}

.header-left, .header-center, .header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.symbol-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.symbol-name {
    font-size: 0.9em;
    color: #868993;
    font-weight: 500;
}

.price-value {
    font-size: 1.1em;
    color: #ffffff;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.price-change {
    font-size: 0.85em;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 3px;
}

.price-change.positive {
    color: #26a69a;
    background: rgba(38, 166, 154, 0.1);
}

.price-change.negative {
    color: #ef5350;
    background: rgba(239, 83, 80, 0.1);
}

.position-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 4px;
    background: rgba(41, 98, 255, 0.1);
    border: 1px solid rgba(41, 98, 255, 0.2);
}

.position-label {
    font-size: 0.8em;
    color: #868993;
}

.position-value {
    font-size: 0.85em;
    font-weight: bold;
    text-transform: uppercase;
}

.position-value.long {
    color: #26a69a;
}

.position-value.short {
    color: #ef5350;
}

.position-value.neutral {
    color: #868993;
}

.session-time {
    font-size: 0.85em;
    color: #868993;
    font-family: 'Courier New', monospace;
}

/* TradingView-style Score Card */
.score-card {
    position: absolute;
    top: 60px;
    left: 10px;
    background: rgba(26, 30, 41, 0.6);
    border: 1px solid rgba(42, 46, 57, 0.5);
    border-radius: 4px;
    padding: 6px 12px;
    z-index: 5;
    min-width: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.score-card.hidden {
    display: none;
}

.score-label {
    font-size: 0.6em;
    color: #868993;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

.score-content {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 0;
}

.score-value {
    font-size: 1.4em;
    font-weight: bold;
    color: #ffffff;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 8px rgba(0, 212, 170, 0.3);
    transition: color 0.3s ease, text-shadow 0.3s ease;
    line-height: 1.2;
}

.score-value.positive {
    color: #26a69a;
    text-shadow: 0 0 10px rgba(38, 166, 154, 0.5);
}

.score-value.negative {
    color: #ef5350;
    text-shadow: 0 0 10px rgba(239, 83, 80, 0.5);
}

.score-value.neutral {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.score-change {
    font-size: 0.9em;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.score-change.positive {
    color: #26a69a;
    background: rgba(38, 166, 154, 0.15);
}

.score-change.negative {
    color: #ef5350;
    background: rgba(239, 83, 80, 0.15);
}

.score-sparkline {
    width: 100%;
    height: 20px;
    margin-top: 4px;
    opacity: 0.6;
}

#scoreDisplay {
    /* Legacy support - keeping for compatibility */
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
}

.tap-reminder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4em;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    z-index: 20;
    animation: pulse 1s ease-in-out infinite;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.tap-reminder.hidden {
    display: none;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Mobile optimizations */
@media (max-width: 500px) {
    .menu-content h1 {
        font-size: 2em;
    }
    
    .menu-content h2 {
        font-size: 1.5em;
    }
    
    .button {
        font-size: 1.2em;
        padding: 12px 30px;
    }
    
    .restart-button {
        font-size: 1.05em !important;
        min-height: 48px !important;
        padding: 14px 32px !important;
    }
    
    #scoreDisplay {
        font-size: 2.5em;
    }
}

@media (max-height: 600px) {
    .menu-content h1 {
        font-size: 1.8em;
        margin-bottom: 20px;
    }
    
    .menu-content h2 {
        font-size: 1.3em;
    }
    
    .button {
        font-size: 0.9em;
        padding: 12px 28px;
        margin: 8px auto;
    }
    
    .restart-button {
        font-size: 1.05em !important;
        min-height: 48px !important;
        padding: 14px 32px !important;
    }
    
    .restart-button {
        font-size: 2.2em !important;
        min-height: 60px !important;
        padding: 22px 60px !important;
    }
    
    #instructions {
        margin-top: 20px;
        font-size: 1em;
    }
}


