:root {
    --bg: #0b0e11;
    --panel: #1e2329;
    --green: #0ecb81;
    --red: #f6465d;
    --text: #eaecef;
    --yellow: #f0b90b;
    --gray: #2b3139;
    --light-gray: #848e9c;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', sans-serif;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 340px;
    background: var(--panel);
    padding: 24px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--gray);
    overflow-y: auto;
    z-index: 10;
}

.wallet {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray);
}

.wallet-amount {
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--yellow);
}

.input-group {
    margin-bottom: 24px;
    background: var(--bg);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--gray);
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--light-gray);
    font-size: 0.9rem;
    font-weight: 600;
}

input {
    width: 100%;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    outline: none;
}

.btn {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.btn-buy {
    background: var(--green);
    color: #fff;
    display: block;
}

.btn-buy:hover:not(:disabled) {
    background: #0da86b;
    transform: translateY(-2px);
}

.btn-buy:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-sell {
    background: var(--yellow);
    color: #000;
    display: none;
}

.btn-sell:hover:not(:disabled) {
    background: #d9a70a;
    transform: translateY(-2px);
}

.btn-sell:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Mode Selector */
.mode-selector {
    margin-bottom: 24px;
    background: var(--bg);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--gray);
}

.mode-buttons {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}

.mode-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--panel);
    color: var(--light-gray);
    border: 1px solid var(--gray);
}

.mode-btn.active {
    background: var(--yellow);
    color: #000;
    border-color: var(--yellow);
}

.mode-btn.mode-basic.active {
    background: var(--green);
    border-color: var(--green);
    color: white;
}

.mode-btn.mode-hard.active {
    background: var(--red);
    border-color: var(--red);
    color: white;
}

.mode-description {
    font-size: 0.8rem;
    color: var(--light-gray);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--gray);
}

/* Main Content */
.main-content {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    background: #161a1e;
    height: 100vh;
}

.history-bar {
    height: 45px;
    background: var(--panel);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
    overflow-x: auto;
    border-bottom: 1px solid var(--gray);
}

.history-bar::-webkit-scrollbar {
    display: none;
}

.history-pill {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
    flex-shrink: 0;
}

.pill-green {
    background: rgba(14, 203, 129, 0.15);
    color: var(--green);
    border: 1px solid rgba(14, 203, 129, 0.3);
}

.pill-red {
    background: rgba(246, 70, 93, 0.15);
    color: var(--red);
    border: 1px solid rgba(246, 70, 93, 0.3);
}

.multiplier-panel {
    position: absolute;
    top: 60px;
    left: 35px;
    z-index: 30;
    background: rgba(0, 0, 0, 0.8);
    padding: 20px 30px;
    border-radius: 12px;
    border-left: 5px solid var(--yellow);
    backdrop-filter: blur(10px);
    pointer-events: none;
}

.current-mult {
    font-size: 4rem;
    font-weight: 800;
    color: white;
    line-height: 1;
    margin-bottom: 8px;
}

.potential-win {
    font-size: 1.4rem;
    color: var(--green);
    font-weight: 600;
}

#chart-box {
    flex: 1;
    position: relative;
    padding: 15px;
}

#candleChart {
    width: 100%;
    height: 100%;
}

/* Chart Overlay */
#chartOverlay {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    background: rgba(11, 14, 17, 0.9);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 40;
    border-radius: 8px;
}

.overlay-content {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--gray);
    border-top-color: var(--yellow);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.overlay-text {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
}

#cooldownTimer {
    color: var(--yellow);
    font-size: 2rem;
    margin-left: 5px;
}

/* Chart Messages */
.chart-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 50;
    pointer-events: none;
    display: none;
    padding: 30px 50px;
    border-radius: 20px;
    backdrop-filter: blur(15px);
    animation: messagePop 0.3s ease-out;
}

@keyframes messagePop {
    from {
        opacity: 0;
        transform: translate(-50%, -30%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.profit-message {
    background: rgba(14, 203, 129, 0.2);
    border: 3px solid var(--green);
}

.crash-message {
    background: rgba(246, 70, 93, 0.2);
    border: 3px solid var(--red);
}

.chart-message .message-title {
    font-size: 4rem;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 15px;
}

.chart-message .message-amount {
    font-size: 2.5rem;
    font-weight: 700;
}

.profit-message .message-title,
.profit-message .message-amount {
    color: var(--green);
}

.crash-message .message-title,
.crash-message .message-amount {
    color: var(--red);
}

/* Squeeze Modal (по центру, без таймера) */
.squeeze-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.squeeze-container {
    background: var(--panel);
    padding: 40px;
    border-radius: 16px;
    width: 500px;
    max-width: 90%;
    border: 1px solid var(--gray);
    position: relative;
    animation: squeezePop 0.3s ease-out;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

@keyframes squeezePop {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.squeeze-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--yellow);
    text-transform: uppercase;
    text-align: center;
}

.squeeze-message {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 30px;
    color: white;
    text-align: center;
    padding: 20px;
    background: var(--bg);
    border-radius: 8px;
    border-left: 4px solid var(--yellow);
}

.squeeze-type {
    text-align: center;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 1.2rem;
}

.squeeze-type.bullish {
    color: var(--green);
}

.squeeze-type.bearish {
    color: var(--red);
}

.squeeze-type.neutral {
    color: var(--yellow);
}

.squeeze-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.squeeze-btn {
    flex: 1;
    padding: 18px;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.squeeze-btn.hold {
    background: var(--green);
    color: white;
}

.squeeze-btn.hold:hover {
    background: #0da86b;
    transform: translateY(-2px);
}

.squeeze-btn.dump {
    background: var(--red);
    color: white;
}

.squeeze-btn.dump:hover {
    background: #d43f51;
    transform: translateY(-2px);
}

/* Auth Modal */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.auth-container {
    background: var(--panel);
    padding: 40px;
    border-radius: 16px;
    width: 400px;
    max-width: 90%;
    border: 1px solid var(--gray);
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    color: var(--light-gray);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.auth-tab.active {
    color: var(--yellow);
    border-bottom-color: var(--yellow);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--light-gray);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px;
    background: var(--bg);
    border: 1px solid var(--gray);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
}

.form-group input:focus {
    border-color: var(--yellow);
    outline: none;
}

.auth-btn {
    width: 100%;
    padding: 14px;
    background: var(--yellow);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-btn:hover {
    background: #d9a70a;
    transform: translateY(-2px);
}

.auth-error {
    margin-top: 15px;
    color: var(--red);
    text-align: center;
    font-size: 0.9rem;
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--gray);
}

#username {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--yellow);
}

.logout-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--red);
    color: var(--red);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: var(--red);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        padding: 16px;
    }
    
    body {
        flex-direction: column;
    }
    
    .multiplier-panel {
        top: 70px;
        left: 15px;
        padding: 12px 20px;
    }
    
    .current-mult {
        font-size: 2.5rem;
    }
    
    .chart-message {
        padding: 20px 30px;
    }
    
    .chart-message .message-title {
        font-size: 2.5rem;
    }
    
    .chart-message .message-amount {
        font-size: 1.5rem;
    }
    
    .squeeze-container {
        padding: 20px;
    }
    
    .squeeze-title {
        font-size: 1.4rem;
    }
    
    .squeeze-message {
        font-size: 1rem;
    }
    
    .squeeze-btn {
        padding: 14px;
        font-size: 1rem;
    }
}