:root, [data-theme="light"] {
    --bg: #f7f6f2;
    --surface: #fbfbf9;
    --surface2: #f1eee9;
    --text: #28251d;
    --muted: #6f6b63;
    --primary: #2d5a3f;
    --border: #d6d1c8;
    --success: #2e7d32;
    --error: #b42318;
    --radius: 16px;
    --radius2: 8px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .08);
    --link: #3a7a57;
    --linkHovered: #4a9a6f;
}

[data-theme="dark"] {
    --bg: #171614;
    --surface: #1d1c1a;
    --surface2: #262421;
    --text: #ece7de;
    --muted: #a9a298;
    --primary: #4a8c6a;
    --border: #3a3733;
    --success: #6eb875;
    --error: #f97066;
    --shadow: 0 12px 34px rgba(0, 0, 0, .34);
    --link: #5aa87a;
    --linkHovered: #7ac894;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Satoshi', sans-serif;
    background: var(--bg);
    color: var(--text);
}

button, select {
    font: inherit;
}

.wrap {
    max-width: 75%;
    margin: 0 auto;
    padding: 24px;
}

.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 5%;
    margin-bottom: 24px;
}

.topicOverview{
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.logo {
    font-size: 30px;
    font-weight: 700;
}

.middle{
    margin-bottom: 24px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero, .card, .stats, .topics {
    padding: 22px;
}

.controls {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    width: 100%;
    margin-top: 10px;
}

.controls > * {
    min-width: 0;
}

#themaSelect {
    flex: 2;
}

#modusSelect,
#reihenfolgeSelect {
    flex: 1;
}

#startBtn {
    flex: 0 0 auto;
}

.grid {
    display: grid;
    grid-template-columns:2fr 1fr;
    gap: 20px;
}

.question {
    font-size: 24px;
    line-height: 1.35;
    margin: 14px 0 18px;
}

#optionen{
    font-size: 20px;
}

.option {
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    margin: 10px 0;
    border-radius: var(--radius2);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: .18s;
}

.option:hover {
    border-color: var(--primary);
}

.option.selected {
    outline: 3px solid var(--primary);
    background: var(--surface2);
}

.option.correct {
    background: rgba(46, 125, 50, .14);
    border-color: var(--success);
}

.option.wrong {
    background: rgba(180, 35, 24, .14);
    border-color: var(--error);
}

.kpi {
    font-size: 15px;
    background: var(--surface2);
    border-radius: var(--radius2);
    padding: 12px 14px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

.row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.space{
    justify-content: space-between;
}

.btn {
    font-size: 18px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius2);
    padding: 12px 16px;
    cursor: pointer;
    text-align: center;
}

.btn.alt {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border);
}

.green{
    background: var(--success)
}

.red{
    background: var(--error);
}

.heading{
    font-size: 18px;
}

.muted {
    font-size: 18px;
    color: var(--muted);
}

.progress {
    height: 10px;
    background: var(--surface2);
    border-radius: 999px;
    overflow: hidden;
    margin: 12px 0 4px;
    border: 1px solid var(--border);
}

.bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
}

.small {
    font-size: 14px;
}

.hidden {
    display: none;
}

select {
    padding: 12px;
    border-radius: var(--radius2);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
}

.badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--surface2);
    border: 1px solid var(--border);
    font-size: 13px;
    margin-bottom: 10px;
}

#themaBadge2 {
    display: none;
}

.content{
    font-size: 15px;
}

.link {
    color: var(--text);
    text-decoration-line: none;
}

.link2{
    color: var(--link);
    text-decoration-line: underline;
}

.link:hover {
    text-decoration-line: underline;
}

.link2:hover{
    color: var(--linkHovered);
}

@media (max-width: 900px) {

    .wrap{
        max-width: 99%;
    }

    .btn{
        font-size: 15px;
    }
    .question {
        font-size: 18px;
    }

    #optionen{
        font-size: 14px;
    }

    .logo {
        font-size: 20px;
    }
    .muted, .heading {
        font-size: 15px;
    }

    .grid, .controls {
        grid-template-columns:1fr;
    }

    .top {
        flex-direction: column;
        align-items: flex-start;
    }

    .small, .kpi {
        font-size: 12px;
    }
}

@media (max-width: 650px) {
    .controls{
        flex-direction: column;
    }
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#questionCard {
    border: 2px solid var(--border);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#questionCard.card-correct {
    border-color: var(--success, #2e7d32);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--success, #2e7d32) 18%, transparent);
}

#questionCard.card-wrong {
    border-color: var(--error, #c62828);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--error, #c62828) 18%, transparent);
}

.optionen-wrap {
    position: relative;
}

.optionen-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 20, 20, 0.72);
    backdrop-filter: blur(10px);
    border-radius: 14px;
}

.optionen-overlay.hidden {
    display: none;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tooltip-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.info-details {
    position: relative;
    display: inline-block;
}

.info-summary {
    list-style: none;
    width: 24px;
    height: 24px;
    border: 1px solid var(--border);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    background: var(--surface, #fff);
    color: var(--text, #111);
    cursor: pointer;
    user-select: none;
}

.info-summary::-webkit-details-marker {
    display: none;
}

.tooltip-box {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: min(280px, 75vw);
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface, #fff);
    color: var(--text, #111);
    font-size: 0.9rem;
    line-height: 1.4;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
    z-index: 20;
}

.info-details:not([open]) .tooltip-box {
    display: none;
}

@media (hover: hover) {
    .info-summary:hover {
        background: var(--surface2, #f3f3f3);
    }
}