/* ── TOPQ Roguelite-Modus Styles ─────────────────────────────────────────── */

/* ── Basis-Overlay ──────────────────────────────────────────────────────── */
.rl-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    padding: 16px;
}

.rl-overlay.is-hidden {
    display: none;
}

.rl-panel {
    background: var(--color-surface, #1e1e2e);
    border: 2px solid var(--color-accent, #7c3aed);
    border-radius: 16px;
    padding: 32px 28px;
    max-width: 480px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 8px 40px rgba(124, 58, 237, 0.35);
    color: var(--color-text, #e2e8f0);
    text-align: center;
}

.rl-panel h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--color-accent, #7c3aed);
}

.rl-panel p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--color-text-muted, #94a3b8);
    line-height: 1.5;
}

.rl-panel-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── Modus-Wahl ─────────────────────────────────────────────────────────── */
#rl-mode-choice-overlay .rl-panel-buttons button {
    padding: 14px 20px;
    font-size: 1.05rem;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.15s, border-color 0.15s;
}

#rl-choose-normal {
    background: var(--color-secondary, #334155);
    color: var(--color-text, #e2e8f0);
    border-color: var(--color-border, #475569);
}

#rl-choose-normal:hover {
    border-color: var(--color-text-muted, #94a3b8);
    transform: scale(1.02);
}

#rl-choose-roguelite {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    border-color: #a855f7;
}

#rl-choose-roguelite:hover {
    transform: scale(1.04);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
}

/* ── Schwierigkeit ──────────────────────────────────────────────────────── */
.rl-diff-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.rl-diff-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 8px;
    border-radius: 12px;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 0.9rem;
    transition: transform 0.15s, border-color 0.15s;
    background: var(--color-secondary, #334155);
    color: var(--color-text, #e2e8f0);
}

.rl-diff-btn .rl-diff-icon {
    font-size: 2rem;
}

.rl-diff-btn:hover {
    transform: scale(1.05);
}

#rl-diff-easy:hover   { border-color: #22c55e; }
#rl-diff-normal:hover { border-color: #f59e0b; }
#rl-diff-hard:hover   { border-color: #ef4444; }

.rl-diff-desc {
    font-size: 0.78rem;
    color: var(--color-text-muted, #94a3b8);
    margin-top: 2px;
}

/* ── Shop ───────────────────────────────────────────────────────────────── */
#rl-shop-overlay .rl-panel {
    max-width: 600px;
}

#rl-shop-offers {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    max-height: 55vh;
    overflow-y: auto;
    padding-right: 4px;
}

.rl-shop-offer {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--color-bg, #0f172a);
    border: 1px solid var(--color-border, #334155);
    border-radius: 10px;
    padding: 12px 14px;
}

.rl-shop-offer-icon {
    font-size: 1.8rem;
    min-width: 38px;
    text-align: center;
}

.rl-shop-offer-body {
    flex: 1;
}

.rl-shop-offer-body strong {
    display: block;
    margin-bottom: 3px;
}

.rl-shop-offer-body p {
    margin: 0 0 4px;
    font-size: 0.82rem;
}

.rl-shop-price {
    font-size: 0.8rem;
    color: #fbbf24;
    font-weight: 600;
}

.rl-buy-btn {
    white-space: nowrap;
    padding: 8px 14px;
    font-size: 0.88rem;
}

/* Joker-Slots */
#rl-joker-slots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
}

.rl-joker-slot {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    border: 2px dashed var(--color-border, #334155);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--color-text-muted, #94a3b8);
}

.rl-joker-slot.is-filled {
    border-style: solid;
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.1);
    color: var(--color-text, #e2e8f0);
}

.rl-joker-icon { font-size: 1.8rem; }
.rl-joker-label { font-size: 0.72rem; text-align: center; }
.rl-joker-empty { font-size: 0.75rem; opacity: 0.5; }

/* Upgrade-Liste */
#rl-upgrade-list {
    text-align: left;
    max-height: 120px;
    overflow-y: auto;
    font-size: 0.82rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rl-upgrade-entry {
    background: var(--color-bg, #0f172a);
    padding: 5px 10px;
    border-radius: 6px;
    border-left: 3px solid #7c3aed;
}

/* ── Checkpoint / Run-Ende Panels ───────────────────────────────────────── */
#rl-checkpoint-text,
#rl-checkpoint-failed-text {
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ── Karten-Picker ──────────────────────────────────────────────────────── */
#rl-joker-swap-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 50vh;
    overflow-y: auto;
    text-align: left;
}

#rl-card-picker-overlay .rl-panel {
    max-width: 760px;
}

.rl-card-picker-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: -4px;
}

.rl-card-picker-toolbar label {
    font-size: 0.8rem;
    color: #94a3b8;
}

.rl-card-picker-sort-select {
    background: rgba(15, 23, 42, 0.8);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 8px;
    padding: 6px 9px;
    font-size: 0.8rem;
}

#rl-card-picker-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-height: 58vh;
    overflow-y: auto;
    text-align: left;
}

.rl-card-pick-btn {
    text-align: left;
    padding: 10px 14px;
    font-size: 0.9rem;
    border-radius: 8px;
}

.rl-card-pick-tile {
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.65);
    color: #e2e8f0;
    padding: 8px;
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px;
    cursor: pointer;
    text-align: left;
    transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.rl-card-pick-tile:hover {
    transform: translateY(-1px);
    border-color: rgba(168, 85, 247, 0.75);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.rl-card-pick-image-wrap {
    border-radius: 8px;
    overflow: hidden;
    height: 74px;
    background: rgba(15, 23, 42, 0.9);
}

.rl-card-pick-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rl-card-pick-image-placeholder {
    display: grid;
    place-items: center;
    color: #94a3b8;
    font-size: 0.72rem;
}

.rl-card-pick-content {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.rl-card-pick-name {
    font-size: 0.84rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rl-card-pick-meta {
    font-size: 0.72rem;
    color: #93c5fd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rl-card-pick-upgrade {
    font-size: 0.7rem;
    color: #fbbf24;
}

.rl-card-pick-stats {
    margin-top: 2px;
    display: grid;
    gap: 2px;
}

.rl-card-pick-stat-row {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    font-size: 0.68rem;
    color: #cbd5e1;
}

.rl-card-pick-stat-row strong {
    color: #f8fafc;
    font-weight: 700;
    text-align: right;
}

@media (max-width: 760px) {
    #rl-card-picker-list {
        grid-template-columns: 1fr;
    }

    .rl-card-picker-toolbar {
        justify-content: stretch;
    }

    .rl-card-picker-sort-select {
        flex: 1;
    }
}

/* ── HUD (während des Spiels) ───────────────────────────────────────────── */
#rl-hud {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 20, 0.88);
    border-bottom: 2px solid #7c3aed;
    border-radius: 0 0 14px 14px;
    padding: 6px 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    z-index: 900;
    font-size: 0.85rem;
    color: #e2e8f0;
    backdrop-filter: blur(6px);
    white-space: nowrap;
}

#rl-hud.is-hidden {
    display: none;
}

.rl-hud-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.rl-hud-label {
    color: #94a3b8;
    font-size: 0.78rem;
}

.rl-hud-value {
    font-weight: 700;
    color: #f8fafc;
}

#rl-hud-coins { color: #fbbf24; }
#rl-hud-checkpoints { color: #22c55e; }

/* Upgrade-Badge auf Karte */
.rl-upgrade-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.72rem;
    line-height: 1.2;
    font-weight: 700;
    background: rgba(0,0,0,0.6);
    border-radius: 6px;
    padding: 3px 6px;
    pointer-events: none;
    z-index: 10;
    color: #f8fafc;
    border: 1px solid rgba(248, 250, 252, 0.18);
}

.rl-upgrade-badge-boost {
    background: rgba(37, 99, 235, 0.78);
    border-color: rgba(191, 219, 254, 0.55);
}

.rl-upgrade-badge-magnet {
    background: rgba(13, 148, 136, 0.8);
    border-color: rgba(153, 246, 228, 0.5);
}

.rl-upgrade-badge-shield {
    background: rgba(180, 83, 9, 0.82);
    border-color: rgba(253, 224, 71, 0.55);
}

.rl-upgrade-badge-shield-used {
    background: rgba(71, 85, 105, 0.82);
    border-color: rgba(203, 213, 225, 0.45);
}

.rl-upgrade-badge-generic {
    background: rgba(51, 65, 85, 0.8);
    border-color: rgba(226, 232, 240, 0.32);
}

/* ── Schriftzug "Roguelite" im Modus-Modal ──────────────────────────────── */
.rl-mode-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 4px;
}

.rl-next-shop-info {
    width: 100%;
    max-width: 132px;
    padding: 0.35rem 0.5rem;
    border-radius: 10px;
    text-align: center;
    font-size: 0.72rem;
    line-height: 1.25;
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.28);
}

/* ── Gespeichert-Meldung ────────────────────────────────────────────────── */
#rl-shop-save-msg {
    font-size: 0.82rem;
    color: #22c55e;
    min-height: 18px;
}

/* ── Scrollbar für Shop ─────────────────────────────────────────────────── */
#rl-shop-offers::-webkit-scrollbar,
#rl-upgrade-list::-webkit-scrollbar,
#rl-card-picker-list::-webkit-scrollbar {
    width: 6px;
}
#rl-shop-offers::-webkit-scrollbar-thumb,
#rl-upgrade-list::-webkit-scrollbar-thumb,
#rl-card-picker-list::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}
