:root {
    --gold: #ffcf40;
    --gold-dark: #b8860b;
    --blue-deep: #020a2b;
    --blue-mid: #0b1f5c;
    --blue-light: #1b3a8a;
    --green: #17c964;
    --red: #e6394c;
    --text: #f2f5ff;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", Verdana, Arial, sans-serif;
    background: radial-gradient(ellipse at center, var(--blue-mid) 0%, var(--blue-deep) 65%, #000 100%);
    color: var(--text);
    overflow-x: hidden;
}

.bg-glow {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 50% 20%, rgba(255, 207, 64, 0.08), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.wwm-header {
    text-align: center;
    padding: 28px 16px 8px;
    position: relative;
    z-index: 1;
}

.wwm-header h1 {
    margin: 0;
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text);
    text-shadow: 0 0 12px rgba(255, 207, 64, 0.35);
}

.wwm-header h1 span {
    color: var(--gold);
}

.screen {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px;
}

.hidden { display: none !important; }

.panel {
    background: linear-gradient(160deg, rgba(11, 31, 92, 0.85), rgba(2, 10, 43, 0.9));
    border: 1px solid rgba(255, 207, 64, 0.35);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.45);
}

.intro { font-size: 1.1rem; margin-bottom: 24px; color: #cdd6ff; }

.btn {
    display: inline-block;
    padding: 14px 28px;
    margin: 8px;
    border-radius: 30px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
    background: linear-gradient(160deg, var(--gold), var(--gold-dark));
    color: #1a1200;
    box-shadow: 0 4px 14px rgba(255, 207, 64, 0.35);
}

.btn-secondary {
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--gold);
}

.btn-outline {
    background: transparent;
    color: #ffb3b3;
    border: 1px solid #e6394c;
    border-radius: 30px;
    padding: 10px 18px;
    cursor: pointer;
    font-weight: 600;
}
.btn-outline:hover { background: rgba(230, 57, 76, 0.15); }

/* ===== Joker-Leiste ===== */
.joker-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.joker-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, var(--blue-light), var(--blue-deep));
    border: 2px solid var(--gold);
    color: var(--gold);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(255, 207, 64, 0.25);
    transition: transform 0.15s ease, opacity 0.15s ease;
}
.joker-btn:hover:not(:disabled) { transform: scale(1.08); }
.joker-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    filter: grayscale(1);
}

/* ===== Spiel-Layout ===== */
.game-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 24px;
}

@media (max-width: 800px) {
    .game-layout { grid-template-columns: 1fr; }
}

.question-area { position: relative; }

.frage-box {
    background: linear-gradient(160deg, var(--blue-light), var(--blue-mid));
    border: 1px solid rgba(255, 207, 64, 0.5);
    border-radius: 14px;
    padding: 22px 26px;
    margin-bottom: 18px;
    min-height: 90px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.level-badge {
    display: inline-block;
    background: var(--gold);
    color: #1a1200;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 10px;
}

#frage-text {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

.antworten-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 560px) {
    .antworten-grid { grid-template-columns: 1fr; }
}

.antwort-tile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(100deg, var(--blue-mid) 0%, var(--blue-light) 100%);
    border: 1px solid rgba(255, 207, 64, 0.4);
    clip-path: polygon(3% 0, 100% 0, 97% 100%, 0 100%);
    color: var(--text);
    padding: 16px 20px;
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.antwort-tile:hover:not(:disabled) {
    background: linear-gradient(100deg, var(--blue-light) 0%, #2a4bb0 100%);
    transform: translateX(3px);
}

.antwort-tile:disabled { cursor: default; }

.antwort-tile.ausgeblendet {
    opacity: 0;
    pointer-events: none;
}

.antwort-tile.gewaehlt { background: linear-gradient(100deg, #665200, #b8860b); }
.antwort-tile.richtig { background: linear-gradient(100deg, #0d7a3d, var(--green)) !important; border-color: var(--green); }
.antwort-tile.falsch { background: linear-gradient(100deg, #7a0d1d, var(--red)) !important; border-color: var(--red); }

.ant-label {
    background: rgba(255, 207, 64, 0.15);
    border: 1px solid var(--gold);
    color: var(--gold);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    min-width: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

/* ===== Publikumsjoker Overlay ===== */
.publikum-overlay {
    position: absolute;
    inset: 0;
    background: rgba(2, 10, 43, 0.92);
    border-radius: 14px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.publikum-bars {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    height: 160px;
    width: 100%;
    max-width: 420px;
}

.publikum-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}

.publikum-bar {
    width: 100%;
    background: linear-gradient(180deg, var(--gold), var(--gold-dark));
    border-radius: 6px 6px 0 0;
    transition: height 0.6s ease;
}

.publikum-pct { margin-top: 6px; font-weight: 700; color: var(--gold); }
.publikum-label { margin-top: 4px; font-size: 0.85rem; color: #cdd6ff; }

/* ===== Geldleiter ===== */
.geldleiter {
    background: linear-gradient(160deg, rgba(11, 31, 92, 0.6), rgba(2, 10, 43, 0.8));
    border: 1px solid rgba(255, 207, 64, 0.25);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.leiter-stufe {
    display: flex;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #b9c3ee;
}

.leiter-stufe.sicherheit { color: var(--gold); font-weight: 700; }
.leiter-stufe.aktuell {
    background: linear-gradient(90deg, var(--gold-dark), var(--gold));
    color: #1a1200;
    font-weight: 700;
    box-shadow: 0 0 10px rgba(255, 207, 64, 0.4);
}
.leiter-stufe.erreicht:not(.aktuell) { color: #fff; }

/* ===== Endbildschirm ===== */
.end-amount {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--gold);
    margin: 18px 0;
    text-shadow: 0 0 14px rgba(255, 207, 64, 0.4);
}

#save-form {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 16px 0;
}

#input-name {
    padding: 12px 16px;
    border-radius: 30px;
    border: 1px solid var(--gold);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 1rem;
    min-width: 220px;
}

/* ===== Bestenliste ===== */
.scoreboard {
    margin-top: 20px;
    text-align: left;
}

.scoreboard table {
    width: 100%;
    border-collapse: collapse;
}

.scoreboard th, .scoreboard td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 207, 64, 0.15);
    font-size: 0.95rem;
}

.scoreboard th {
    color: var(--gold);
    text-align: left;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.scoreboard tr:nth-child(1) td { color: var(--gold); font-weight: 700; }
