/* rollbet — dark crash UI */
:root {
    --bg-main: #0d0b1e;
    --bg-panel: #14112a;
    --bg-card: #1c1838;
    --bg-input: #241f45;
    --bg-input-2: #2f2857;
    --text-main: #ffffff;
    --text-muted: #8b84bc;
    --accent-green: #22e08a;
    --accent-red: #ff5470;
    /* Marken-Akzent: Violett + Türkis */
    --accent: #7c5cff;
    --accent-2: #00e0c6;
    --accent-gradient: linear-gradient(135deg, #7c5cff 0%, #00e0c6 100%);
    /* Legacy-Alias, damit alte Regeln weiter funktionieren */
    --accent-yellow: #7c5cff;
    --border-color: #29244a;
    --rail: #100d24;
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Nunito Sans', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Top Navigation */
.top-nav {
    height: 64px;
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
    flex-shrink: 0;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 100%;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 20px;
}

.logo-text {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 26px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.logo-accent {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--accent-2);
}

.nav-right {
    display: flex;
    align-items: center;
}

/* Auth / User Profile */
.auth-forms {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 9px 17px;
    border-radius: 5px;
    border: none;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.2s;
    text-transform: uppercase;
}

.btn:hover { opacity: 0.9; }

.btn-login { background-color: transparent; color: var(--text-main); }
.btn-login:hover { background-color: rgba(255,255,255,0.1); }
.btn-register { background-color: var(--accent-yellow); color: #000; }
.btn-logout { background-color: transparent; color: var(--text-muted); }

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.balance-badge {
    display: flex;
    align-items: center;
    background-color: var(--bg-input);
    border-radius: 6px;
    padding: 6px 12px;
    gap: 8px;
}

.balance-label {
    color: var(--text-muted);
    font-weight: 800;
    font-size: 0.85rem;
}

/* Demo-Kennzeichnung an der Balance */
.demo-tag {
    background: var(--accent-gradient);
    color: #0d0b1e;
    font-weight: 900;
    font-size: 0.62rem;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.balance-unit {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.78rem;
}

.balance-amount {
    color: var(--text-main);
    font-weight: 800;
    font-size: 0.95rem;
    font-family: 'Courier New', monospace; /* Monospace für Zahlen */
}

/* Täglicher Demo-Faucet Button */
.btn-claim {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    background: var(--accent-gradient);
    color: #0d0b1e;
    font-weight: 800;
    font-size: 0.8rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: filter 0.2s, opacity 0.2s;
}

.btn-claim:hover:not(:disabled) {
    filter: brightness(1.1);
}

.btn-claim:disabled {
    background: var(--bg-input);
    color: var(--text-muted);
    cursor: not-allowed;
}

.btn-claim svg {
    flex-shrink: 0;
}

.wallet-icon {
    fill: none;
    stroke: var(--accent-yellow);
    stroke-width: 1.5;
    margin-left: 5px;
}

.user-dropdown {
    display: flex;
    align-items: center;
    background-color: var(--bg-input);
    border-radius: 6px;
    padding: 8px 15px;
    gap: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.user-dropdown:hover {
    background-color: rgba(255,255,255,0.1);
}

.username {
    font-weight: 800;
    color: var(--text-main);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.dropdown-arrow {
    stroke: var(--text-main);
}

.app-shell {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.app-container {
    flex: 1;
    display: flex;
    min-width: 0;
    overflow: hidden;
    padding: 0 12px 12px 12px;
    gap: 12px;
    justify-content: stretch;
}

.main-content-wrapper {
    width: 100%;
    max-width: none;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

/* Game Section (Top) */
.game-section {
    background-color: transparent;
    border-radius: 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 28px;
    gap: 4px 12px;
}

.graph-container {
    height: clamp(238px, 31vh, 330px);
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--bg-card);
    box-shadow: var(--shadow);
}

.graph-header {
    position: absolute;
    top: 13px;
    left: 14px;
    right: 14px;
    display: flex;
    justify-content: space-between;
    z-index: 20;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.max-profit {
    display: flex;
    align-items: center;
    gap: 3px;
    font-weight: 600;
}

#maxProfitValue {
    color: #bfb8ef;
}

.bitcoin-icon {
    color: var(--accent-yellow);
    display: inline-grid;
    place-items: center;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--accent-yellow);
    color: #140d05;
    font-size: 9px;
    font-weight: 950;
    line-height: 1;
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.multiplier-display {
    position: absolute;
    max-width: 92%;
    text-align: center;
    font-size: clamp(3.4rem, 10vw, 7rem);
    font-weight: 400;
    color: var(--text-main);
    z-index: 10;
    letter-spacing: -0.08em;
    line-height: 1;
}

.multiplier-display.crashed {
    color: var(--accent-red);
    font-size: clamp(2.1rem, 6vw, 4.8rem);
    letter-spacing: 0.015em;
    font-weight: 400;
    white-space: nowrap;
}

.status-message {
    position: absolute;
    top: calc(50% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    text-align: center;
    font-size: clamp(1.8rem, 4vw, 3.4rem);
    font-weight: 400;
    color: rgba(214, 210, 230, 0.66);
    z-index: 10;
    pointer-events: none;
}

/* History Bar */
.history-bar {
    grid-column: 1;
    grid-row: 2;
    height: 28px;
    display: flex;
    gap: 3px;
    overflow: hidden;
    background-color: transparent;
}

.history-item {
    min-width: 67px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.86rem;
    font-weight: 900;
    color: var(--text-muted);
    border-right: 0;
    border-radius: 4px;
    background: #282646;
}
.history-item.good { color: var(--accent-green); background: rgba(0, 215, 122, 0.13); }
.history-item.bad { color: var(--accent-red); background: rgba(255, 78, 78, 0.13); }

/* Controls */
.controls-container {
    grid-column: 2;
    grid-row: 1 / span 2;
    padding: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.login-prompt {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e8e5ff;
}

.login-prompt .highlight {
    color: var(--accent-yellow);
    cursor: pointer;
}

.demo-note {
    margin-top: 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 360px;
}

.demo-note-tag {
    display: inline-block;
    background: var(--accent-gradient);
    color: #0d0b1e;
    font-weight: 900;
    font-size: 0.62rem;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 4px;
    vertical-align: middle;
}

.demo-note-soon {
    display: block;
    margin-top: 4px;
    color: var(--accent-2);
    font-weight: 700;
}

.betting-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    height: 100%;
}

.bet-mode-tabs {
    display: flex;
    border-bottom: 1px solid rgba(128, 122, 178, 0.15);
    margin-bottom: 12px;
}

.bet-mode-tab {
    flex: 1;
    background: none;
    border: none;
    color: rgb(165, 159, 202);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 10px 0;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    text-align: center;
}

.bet-mode-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.bet-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bet-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bet-label {
    color: rgb(165, 159, 202);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.bet-input-row {
    display: flex;
    align-items: stretch;
    height: 40px;
    background: var(--bg-input);
    border-radius: 6px;
    border: 1px solid rgba(128, 122, 178, 0.15);
    overflow: hidden;
}

.bet-input {
    flex: 1;
    min-width: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    padding: 0 12px;
    outline: none;
    font-family: 'Nunito Sans', sans-serif;
}

.bet-input::-webkit-inner-spin-button,
.bet-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.bet-input-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    padding-right: 4px;
}

.bet-arrow-btn {
    background: none;
    border: none;
    color: rgb(165, 159, 202);
    font-size: 18px;
    cursor: pointer;
    padding: 0 6px;
    height: 100%;
}

.q-btn {
    background: none;
    border: none;
    color: rgb(165, 159, 202);
    padding: 4px 8px;
    cursor: pointer;
    font-weight: 800;
    font-size: 12px;
    border-radius: 4px;
}

.q-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.unit-toggle {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border-radius: 6px;
    overflow: hidden;
    height: 30px;
    margin-left: 4px;
}

.unit-opt {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    height: 100%;
    font-size: 11px;
    font-weight: 800;
    color: rgb(165, 159, 202);
    cursor: pointer;
    min-width: 38px;
}

.unit-opt.active {
    background: var(--accent);
    color: #fff;
    border-radius: 5px;
}

.unit-opt svg {
    fill: currentColor;
}

.bet-spinners {
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(128, 122, 178, 0.15);
}

.spin-btn {
    flex: 1;
    background: none;
    border: none;
    color: rgb(165, 159, 202);
    font-size: 9px;
    cursor: pointer;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spin-btn:hover {
    color: #fff;
}

.bet-input-suffix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    color: rgb(165, 159, 202);
    font-size: 14px;
    font-weight: 700;
}

.bet-info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 2px;
}

.bet-info {
    font-size: 11px;
}

.info-label {
    color: rgb(165, 159, 202);
}

.info-value {
    color: #fff;
    font-weight: 700;
}

.btn-bet-massive {
    width: 100%;
    min-width: 0;
    height: 44px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
    background: var(--accent-gradient);
    color: #fff;
    transition: filter 0.2s;
    margin-top: auto;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-bet-massive:hover { filter: brightness(1.1); }

.bet-icon {
    fill: #fff;
    width: 17px;
    height: 17px;
}

.bet-text {
    font-weight: 900;
    letter-spacing: 1px;
}

.bet-hotkeys {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    padding: 8px 2px 0;
}

.hotkeys-label {
    color: rgb(165, 159, 202);
    font-size: 11px;
    font-weight: 700;
}

.hotkeys-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border: 1px solid rgba(128, 122, 178, 0.25);
    border-radius: 4px;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    width: 22px;
    height: 22px;
}

.btn-bet-massive.cashout {
    background-color: var(--accent-green);
    color: #06140d;
}

.btn-bet-massive.disabled {
    background-color: var(--bg-card);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* Bottom Section (Tabs) */
.bottom-section {
    flex: 1;
    background-color: var(--bg-card);
    border-radius: 5px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.tabs-header {
    display: flex;
    border-bottom: none;
    background-color: transparent;
    height: 40px;
    min-height: 40px;
    padding-left: 24px;
    align-items: stretch;
}

.tab {
    background: none;
    border: none;
    color: rgb(165, 159, 202);
    padding: 0 12px;
    font-size: 12px;
    font-weight: 800;
    font-family: 'Nunito Sans', sans-serif;
    letter-spacing: 0.5px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    height: 40px;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.tab:hover {
    color: rgb(200, 195, 230);
}

.tab-badge {
    color: rgb(165, 159, 202);
    font-size: 11px;
    margin-left: 4px;
    font-weight: 800;
}

.tab.active {
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
}

.tab.active .tab-badge {
    color: var(--accent);
}

.tab-right-controls {
    margin-left: auto;
    display: flex;
    align-items: center;
    padding-right: 12px;
    gap: 8px;
    height: 40px;
}

.icon-btn {
    background: none;
    border: none;
    color: rgb(165, 159, 202);
    font-size: 14px;
    cursor: pointer;
    font-weight: 800;
}

.lang-btn {
    background: var(--bg-card);
    border: 1px solid rgba(165, 159, 202, 0.2);
    border-radius: 6px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    padding: 6px 10px;
    height: 32px;
}

.tab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Chat */
.chat-messages {
    flex: 1;
    padding: 10px 13px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-msg {
    font-size: 0.86rem;
    display: flex;
    gap: 6px;
    line-height: 1.35;
    align-items: baseline;
    min-height: 19px;
}

.chat-time {
    color: var(--text-muted);
    min-width: 38px;
    opacity: 0.85;
}

.chat-user {
    font-weight: 700;
    color: var(--accent-yellow);
    white-space: nowrap;
}

.chat-text {
    color: #f0edff;
    overflow-wrap: anywhere;
}

.chat-input-area {
    padding: 10px;
    border-top: 1px solid var(--border-color);
    display: flex;
    background-color: var(--bg-input-2);
}

.chat-input-area input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-main);
    padding: 10px;
    outline: none;
}

.btn-chat-login {
    background: none;
    border: none;
    color: var(--accent-yellow);
    font-weight: 700;
    padding: 0 15px;
    cursor: pointer;
}

/* Players Table */
.players-table {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.players-sidebar {
    width: 422px;
    min-width: 422px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    min-height: 0;
}

.players-sidebar .players-table {
    width: 100%;
}

.table-header {
    display: flex;
    padding: 9px 10px;
    color: #dad6ff;
    font-weight: 700;
    font-size: 0.82rem;
}

.col-user { flex: 2.1; min-width: 0; }
.col-at { flex: 0.85; text-align: center; }
.col-bet { flex: 1; text-align: right; }
.col-profit { flex: 1.05; text-align: right; }

.players-list {
    flex: 1;
    overflow-y: auto;
}

.player-row {
    display: flex;
    padding: 6px 10px;
    font-size: 0.82rem;
    font-weight: 600;
}

.live-player-row {
    align-items: center;
    min-height: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.025);
}

.live-player-row:hover {
    background: rgba(255, 255, 255, 0.025);
}

.live-player-row.betting {
    color: var(--accent-yellow);
}

.live-player-row.cashed-out .live-player-name,
.live-player-row.cashed-out .live-player-at,
.live-player-row.cashed-out .live-player-profit.positive {
    color: var(--accent-green);
}

.live-player-row.cashed-out .live-player-bet {
    color: #d9d5ff;
}

.live-player-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 12px;
}

.live-player-at,
.live-player-bet,
.live-player-profit {
    font-family: 'Courier New', monospace;
    font-weight: 800;
}

.live-player-at {
    color: inherit;
}

.live-player-profit {
    color: var(--text-muted);
}

.history-row {
    min-height: 34px;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.history-row:hover {
    background: rgba(255, 255, 255, 0.025);
}

.history-table .table-header {
    display: flex;
    padding: 9px 10px;
}

.hist-col-bust { flex: 1.2; text-align: center; font-weight: 800; }
.hist-col-at { flex: 0.8; text-align: center; color: var(--text-muted); }
.hist-col-bet { flex: 0.8; text-align: center; color: var(--text-muted); }
.hist-col-profit { flex: 1; text-align: center; color: var(--text-muted); }
.hist-col-hash { flex: 1.8; text-align: right; padding-right: 10px; color: var(--text-muted); overflow: hidden; }

.hash-text {
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    max-width: 140px;
}

.channel-list {
    padding: 14px;
}

.channel-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #d9d5ff;
    padding: 11px 12px;
    border-radius: 5px;
    font-weight: 800;
}

.channel-row.active,
.channel-row:hover {
    background: #252342;
    color: var(--accent-yellow);
}

.table-footer {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 10px;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-main);
    border-top: 1px solid var(--border-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--bg-panel);
    padding: 30px;
    border-radius: 8px;
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

@media (max-width: 1180px) {
    .players-sidebar {
        display: none;
    }
}

@media (max-width: 980px) {
    .game-section {
        display: flex;
        flex-direction: column;
    }

    .controls-container {
        min-height: 104px;
    }

    .betting-controls {
        flex-direction: row;
    }

    .btn-bet-massive {
        width: 150px;
        min-width: 150px;
        height: 90px;
    }
}

@media (max-width: 780px) {
    .app-container {
        padding: 8px;
    }

    .top-nav {
        padding-left: 12px;
    }

    .logo-text {
        font-size: 24px;
    }

    .main-content-wrapper {
        max-width: 100%;
    }

    .graph-container {
        height: 300px;
    }

    .game-section {
        display: flex;
        flex-direction: column;
    }

    .betting-controls {
        flex-direction: column;
    }

    .btn-bet-massive {
        width: 100%;
        min-width: 0;
        height: 56px;
    }

    .history-item {
        min-width: 58px;
    }

    .tab {
        padding: 0 12px;
    }
}

.modal-input {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 10px;
    border-radius: 4px;
    outline: none;
}

.modal-buttons {
    display: flex;
    gap: 10px;
}

.modal-buttons button {
    flex: 1;
}
