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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a1a;
    color: #ffffff;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px;
}

.header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 5px;
    padding: 5px;
}

.header h1 {
    color: #ffffff;
    font-size: 2rem;
    font-weight: 600;
}

.stats {
    display: flex;
    gap: 30px;
}

.stat {
    text-align: center;
}

.stat .label {
    display: block;
    font-size: 0.9rem;
    color: #bbb;
    margin-bottom: 5px;
}

.stat .value {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
}

.profit {
    color: #4caf50;
}

.loss {
    color: #f44336;
}

.main-content {
    margin-bottom: 30px;
}

.chart-container {
    position: relative;
    margin-bottom: 10px;
}

#chart {
    width: 100%;
    height: 600px;
    cursor: crosshair;
    border-radius: 8px;
    background: #1e1e1e;
    border: 2px solid #777;
}


.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    gap: 15px;
}

.trade-info {
    text-align: center;
}

.trade-status {
    font-size: 1.1rem;
    color: #bbb;
    margin-bottom: 5px;
}

.entry-price {
    font-size: 1rem;
    color: #ffffff;
    font-weight: 600;
}

.buttons {
    display: flex;
    gap: 30px;
    justify-content: center;
}

.btn {
    padding: 20px 40px;
    border: none;
    border-radius: 8px;
    font-size: 1.6rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    color: white;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border-radius: 4px;
    z-index: 0;
}

.btn span {
    position: relative;
    z-index: 1;
}

.reset-btn {
    background: #f44336;
    color: white;
}

.reset-btn:hover {
    background: #d32f2f;
}

.speed-btn {
    background: #2196f3;
    color: white;
}

.speed-btn:hover {
    background: #1976d2;
}

.trade-btn.buy-state {
    background: #4caf50;
}

.trade-btn.buy-state::before {
    background: #1b5e20;
}

.trade-btn.buy-state:hover {
    background: #45a049;
}

.trade-btn.sell-state {
    background: #f44336;
}

.trade-btn.sell-state::before {
    background: #b71c1c;
}

.trade-btn.sell-state:hover {
    background: #d32f2f;
}

.trade-btn.flash-yellow {
    background: #ffeb3b !important;
}

.trade-btn.flash-yellow::before {
    background: #ffeb3b !important;
}

.trade-btn.flash-white {
    background: #ffffff !important;
    color: #000000 !important;
}

.trade-btn.flash-white::before {
    background: #ffffff !important;
}

.start-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 40px;
}

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

.start-btn {
    background: #4caf50;
    font-size: 2.4rem !important;
    padding: 25px 50px;
    min-width: 200px;
}

.start-btn::before {
    background: #1b5e20;
}

.start-btn:hover {
    background: #45a049;
}

.terms-text {
    color: #888;
    font-size: 0.9rem;
    text-align: center;
    margin-top: 10px;
}

.terms-link {
    text-decoration: underline;
    cursor: pointer;
    color: #888;
}

.terms-link:hover {
    color: #bbb;
}

.trade-history {
    display: none;
    background: #2a2a2a;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.trade-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.trade-overlay-content {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.trade-overlay-content h2 {
    color: #ffffff;
    margin-bottom: 20px;
    font-size: 1.8rem;
    text-align: center;
}

.trade-overlay .trade-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.trade-overlay .trade-item {
    text-align: center;
}

.close-overlay {
    background: #2196f3;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1.4rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-overlay::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border-radius: 4px;
    background: #0d47a1;
    z-index: 0;
}

.close-overlay span {
    position: relative;
    z-index: 1;
}

.close-overlay:hover {
    background: #1976d2;
}

.terms-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.terms-overlay-content {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    max-height: 80vh;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    text-align: center;
    display: flex;
    flex-direction: column;
}

.terms-overlay-content h2 {
    color: #ffffff;
    margin-bottom: 20px;
    font-size: 1.8rem;
    text-align: center;
}

.terms-content {
    color: #ffffff;
    font-size: 1rem;
    line-height: 1.5;
    overflow-y: auto;
    max-height: 400px;
    margin-bottom: 20px;
    text-align: left;
    padding: 10px;
}

.close-terms-overlay {
    background: #2196f3;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1.4rem;
    font-weight: bold;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.close-terms-overlay::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border-radius: 4px;
    background: #0d47a1;
    z-index: 0;
}

.close-terms-overlay span {
    position: relative;
    z-index: 1;
}

.close-terms-overlay:hover {
    background: #1976d2;
}

.trade-history h3 {
    color: #ffffff;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.trade-list {
    max-height: 200px;
    overflow-y: auto;
}

.trade-item {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #444;
    font-size: 0.9rem;
    text-align: center;
}

.trade-item.header {
    font-weight: 600;
    color: #bbb;
    border-bottom: 2px solid #ffffff;
}

.trading {
    background: rgba(255, 107, 53, 0.1);
    border: 2px solid #ff6b35;
}

.position-indicator {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #ff6b35;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 20px;
    }
    
    .stats {
        justify-content: center;
    }
    
    .controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .buttons {
        justify-content: center;
    }
    
    #chart {
        height: 450px;
    }
}