/* Demotrading Minigame — Spiel-Styles (baut auf design-system.css / landing.css auf) */

.dt-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- Startbildschirm ---------- */
.dt-start {
    max-width: 900px;
    margin: 0 auto;
    padding: 7rem 1.25rem 4rem;
    text-align: center;
}

.dt-level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.4rem;
    margin-top: 2.5rem;
    text-align: left;
}

.dt-level-card {
    border-radius: 16px;
    padding: 1.7rem 1.5rem;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .1);
    display: flex;
    flex-direction: column;
    gap: .8rem;
}

.dt-level-card.playable {
    border-color: rgba(102, 126, 234, .55);
    background: linear-gradient(180deg, rgba(102, 126, 234, .12), rgba(255, 255, 255, .03));
}

.dt-level-card.locked {
    opacity: .65;
}

.dt-level-num {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255, 255, 255, .45);
}

.dt-level-card h3 {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.dt-level-card p {
    color: rgba(255, 255, 255, .6);
    font-size: .9rem;
    line-height: 1.55;
    margin: 0;
    flex: 1;
}

.dt-locked-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    align-self: flex-start;
    font-size: .78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .55);
    background: rgba(255, 255, 255, .07);
    padding: .35rem .7rem;
    border-radius: 20px;
}

.dt-done-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    align-self: flex-start;
    font-size: .78rem;
    font-weight: 600;
    color: #22c55e;
    background: rgba(34, 197, 94, .12);
    padding: .35rem .7rem;
    border-radius: 20px;
}

/* ---------- Spielansicht ---------- */
.dt-game {
    display: none;
    flex: 1;
    flex-direction: column;
    padding: 5.2rem 1rem 1rem;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
}

.dt-game.active {
    display: flex;
}

.dt-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: .8rem;
}

.dt-topbar .dt-symbol {
    display: flex;
    align-items: center;
    gap: .55rem;
    color: #fff;
    font-weight: 700;
}

.dt-symbol .live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    animation: dtPulse 1.6s infinite;
}

@keyframes dtPulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .55); }
    70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.dt-price {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: #fff;
    font-size: 1.05rem;
}

.dt-progress {
    flex: 1;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .08);
    overflow: hidden;
}

.dt-progress>div {
    height: 100%;
    width: 0;
    border-radius: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width .5s ease;
}

.dt-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

.dt-chart-wrap {
    position: relative;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .09);
    background: rgba(15, 18, 34, .75);
    overflow: hidden;
    min-height: 420px;
}

#dtChart {
    position: absolute;
    inset: 0;
}

/* ---------- Konto-Panel ---------- */
.dt-panel {
    display: flex;
    flex-direction: column;
    gap: .9rem;
}

.dt-card {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .09);
    background: rgba(15, 18, 34, .75);
    padding: 1rem 1.1rem;
}

.dt-card h4 {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255, 255, 255, .4);
    margin: 0 0 .55rem;
    font-weight: 600;
}

.dt-balance {
    font-size: 1.55rem;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.dt-position-line {
    color: rgba(255, 255, 255, .8);
    font-size: .9rem;
}

.dt-pnl {
    font-size: 1.3rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, .5);
    margin-top: .25rem;
}

.dt-pnl.pos { color: #22c55e; }
.dt-pnl.neg { color: #ef4444; }

.dt-dir {
    font-weight: 800;
    font-size: .78rem;
    padding: .12rem .45rem;
    border-radius: 6px;
}

.dt-dir-long { color: #22c55e; background: rgba(34, 197, 94, .14); }
.dt-dir-short { color: #ef4444; background: rgba(239, 68, 68, .14); }

.dt-hint {
    font-size: .76rem;
    color: rgba(255, 255, 255, .4);
    margin-top: .5rem;
}

/* ---------- Trade-Buttons ---------- */
.dt-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
}

.dt-btn {
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: .95rem;
    padding: .85rem 1rem;
    cursor: pointer;
    color: #fff;
    transition: transform .15s ease, opacity .15s ease, box-shadow .15s ease;
    font-family: inherit;
}

.dt-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.dt-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.dt-btn-long { background: linear-gradient(135deg, #16a34a, #22c55e); }
.dt-btn-short { background: linear-gradient(135deg, #dc2626, #ef4444); }

.dt-btn-close {
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .18);
}

.dt-btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 6px 20px rgba(102, 126, 234, .35);
}

.dt-btn-wa {
    background: linear-gradient(135deg, #25d366, #128c7e);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
}

.dt-btn-wa:hover {
    color: #fff;
}

/* ---------- Indikatoren-Panel ---------- */
.dt-ind-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    cursor: pointer;
    margin: 0;
    width: 100%;
}

.dt-ind-name {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: rgba(255, 255, 255, .85);
    font-size: .92rem;
    font-weight: 600;
}

.dt-ind-name i {
    color: #667eea;
}

.dt-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.dt-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.dt-slider {
    position: absolute;
    inset: 0;
    border-radius: 24px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .18);
    transition: background .2s ease;
}

.dt-slider::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform .2s ease;
}

.dt-switch input:checked+.dt-slider {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: transparent;
}

.dt-switch input:checked+.dt-slider::before {
    transform: translateX(20px);
}

/* ---------- Historie ---------- */
.dt-history {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 170px;
    overflow-y: auto;
}

.dt-history li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .45rem 0;
    font-size: .82rem;
    color: rgba(255, 255, 255, .7);
    border-bottom: 1px solid rgba(255, 255, 255, .05);
    font-variant-numeric: tabular-nums;
}

.dt-history li:last-child { border-bottom: none; }
.dt-history .pos { color: #22c55e; font-weight: 700; }
.dt-history .neg { color: #ef4444; font-weight: 700; }

.dt-history-empty {
    font-size: .82rem;
    color: rgba(255, 255, 255, .35);
}

/* ---------- Tutorial-Overlays ---------- */
.dt-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 7, 15, .62);
    backdrop-filter: blur(2px);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}

.dt-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.dt-modal {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -48%) scale(.97);
    width: min(480px, calc(100vw - 32px));
    background: rgba(24, 28, 48, .97);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 16px;
    padding: 1.6rem 1.5rem;
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
}

.dt-modal.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.dt-modal h3 {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0 0 .8rem;
}

.dt-modal-body {
    color: rgba(255, 255, 255, .75);
    font-size: .93rem;
    line-height: 1.65;
    margin-bottom: 1.2rem;
}

.dt-modal .dt-btn { width: 100%; }

.dt-coach {
    position: fixed;
    background: rgba(24, 28, 48, .97);
    border: 1px solid rgba(102, 126, 234, .5);
    border-radius: 14px;
    padding: 1.1rem 1.2rem;
    z-index: 10002;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
}

.dt-coach.visible {
    opacity: 1;
    pointer-events: auto;
}

.dt-coach .dt-modal-body {
    margin-bottom: .9rem;
    font-size: .88rem;
}

.dt-spotlight {
    position: relative;
    z-index: 10001;
    border-radius: 12px;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, .8), 0 0 30px rgba(102, 126, 234, .45);
}

/* ---------- Quiz ---------- */
.dt-quiz-options {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    margin-bottom: 1rem;
}

.dt-quiz-option {
    text-align: left;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .85);
    border-radius: 10px;
    padding: .8rem 1rem;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
    font-family: inherit;
}

.dt-quiz-option:hover { border-color: rgba(102, 126, 234, .6); }
.dt-quiz-option.correct { border-color: #22c55e; background: rgba(34, 197, 94, .12); }
.dt-quiz-option.incorrect { border-color: #ef4444; background: rgba(239, 68, 68, .1); animation: dtShake .3s ease; }

@keyframes dtShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.dt-quiz-feedback .ok,
.dt-quiz-feedback .nope {
    font-size: .87rem;
    line-height: 1.55;
    border-radius: 10px;
    padding: .7rem .9rem;
    margin-bottom: .8rem;
}

.dt-quiz-feedback .ok { color: #d7f5e2; background: rgba(34, 197, 94, .12); }
.dt-quiz-feedback .nope { color: #fbdcdc; background: rgba(239, 68, 68, .1); }

/* ---------- End-Screen ---------- */
.dt-end {
    position: fixed;
    inset: 0;
    z-index: 10005;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(5, 7, 15, .8);
    backdrop-filter: blur(4px);
    padding: 1rem;
}

.dt-end.visible { display: flex; }

.dt-end-card {
    width: min(560px, 100%);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    background: rgba(24, 28, 48, .98);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 18px;
    padding: 2rem 1.8rem;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
}

.dt-end-card h2 {
    color: #fff;
    font-weight: 800;
    font-size: 1.5rem;
    margin-bottom: .6rem;
}

.dt-end-card p {
    color: rgba(255, 255, 255, .7);
    font-size: .94rem;
    line-height: 1.65;
}

.dt-end-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .8rem;
    margin: 1.4rem 0;
}

.dt-end-stat {
    border-radius: 12px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .09);
    padding: .9rem .5rem;
}

.dt-end-stat .n {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.dt-end-stat .n.pos { color: #22c55e; }
.dt-end-stat .n.neg { color: #ef4444; }

.dt-end-stat .d {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: rgba(255, 255, 255, .45);
}

.dt-end-actions {
    display: flex;
    flex-direction: column;
    gap: .7rem;
    margin-top: 1.4rem;
}

.dt-end-actions a {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
}

.dt-end-teaser {
    margin-top: 1.2rem;
    font-size: .82rem;
    color: rgba(255, 255, 255, .45);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .dt-layout {
        grid-template-columns: 1fr;
    }

    .dt-chart-wrap {
        min-height: 46vh;
    }

    .dt-history {
        max-height: 110px;
    }

    .dt-end-stats {
        grid-template-columns: 1fr 1fr;
    }
}
