body {
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: #eef2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    position: relative;
}

input {
    width: 90%;
    padding: 12px 16px;
    margin-bottom: 14px;
    font-size: 16px;
    border-radius: 12px;
    border: 1px solid #dfe3e8;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

input.correct {
    border-color: #2ecc71;
    background: #eafaf1;
    box-shadow: none;
}

input.wrong {
    border-color: #e74c3c;
    background: #fdecea;
    box-shadow: none;
}


/* Container für Titel + App */
.wrapper {
    position: relative;
    z-index: 1;
    text-align: center;
}

/* Titelbereich */
.title {
    margin: 0 auto 20px;
    width: 560px;
    max-width: 100%;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    padding: 22px 26px;
}

.title h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, #3498db, #9b59b6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.title p {
    margin: 8px auto 0;
    font-size: 15px;
    color: #666;
    max-width: 520px;
}

/* App */
.app {
    position: relative;
    background: white;
    padding: 40px 45px 48px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.14);
    width: 560px;
    max-width: 100%;
    overflow: hidden;
}

.app::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #9b59b6);
}

.settings-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f6f8;
    border: 1px solid #e2e6ea;
    border-radius: 50%;
    color: #576574;
    cursor: pointer;
    transition: transform 0.25s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.settings-btn:hover {
    background: #eef0f3;
    color: #2c3e50;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: rotate(45deg);
}

.settings-btn svg {
    width: 20px;
    height: 20px;
}

.flag {
    width: 380px;
    max-width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid #e2e6ea;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    margin: 10px 0 22px;
}

.country-name {
    margin: 10px 0 20px;
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    min-height: 28px;
}

.stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 18px;
}

#score,
#timer,
#highscore {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    margin: 0;
}

#score {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.12), rgba(155, 89, 182, 0.12));
    color: #2c3e50;
    font-weight: 700;
    border: 1px solid rgba(52, 152, 219, 0.25);
}

#timer {
    background: #eef6fc;
    color: #2c80b4;
    font-weight: 700;
    border: 1px solid rgba(52, 152, 219, 0.25);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

#timer.low {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.18), rgba(231, 76, 60, 0.08));
    color: #c0392b;
    border-color: rgba(231, 76, 60, 0.4);
    animation: timer-pulse 1s ease-in-out infinite;
}

@keyframes timer-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.06);
    }
}

#highscore {
    background: #f8f9fb;
    color: #8a94a0;
    font-weight: 600;
    border: 1px solid #e2e6ea;
}

button {
    padding: 12px 22px;
    margin: 6px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

.next {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.35);
}

.next:hover {
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.45);
}

.choices-btn {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    box-shadow: 0 6px 16px rgba(155, 89, 182, 0.35);
}

.choices-btn:hover {
    box-shadow: 0 8px 20px rgba(155, 89, 182, 0.45);
}

/* Vorschläge */
#choices {
    margin-top: 10px;
}

.choice-btn {
    display: block;
    width: 100%;
    margin: 6px 0;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #e2e6ea;
    background: #f8f9fb;
    color: #3a4550;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.choice-btn:hover {
    border-color: #bbb;
    background: #f0f2f5;
    transform: translateY(-1px);
}

.choice-btn.correct {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    border-color: transparent;
}

.choice-btn.wrong {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border-color: transparent;
}

.choice-btn:disabled {
    cursor: default;
    transform: none;
}

/* Einstellungen */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 24, 32, 0.45);
    backdrop-filter: blur(2px);
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background: white;
    border-radius: 16px;
    text-align: left;
    width: 340px;
    max-width: 90%;
    font-size: 16px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.28);
    overflow: hidden;
    animation: modal-in 0.18s ease;
}

#settings .modal-content {
    width: 660px;
    max-width: 100%;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #3498db, #9b59b6);
    color: white;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.modal-close {
    background: rgba(255, 255, 255, 0.18);
    border: none;
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    transition: background 0.15s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.32);
}

.modal-body {
    padding: 18px 20px 20px;
}

#settings .modal-header {
    padding: 22px 28px;
}

#settings .modal-header h3 {
    font-size: 22px;
}

#settings .modal-body {
    padding: 26px 28px 28px;
}

.modal-body h4 {
    margin: 0 0 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #97a2ad;
    font-weight: 700;
}

#settings .modal-body h4 {
    font-size: 14px;
}

.modal-body h4:not(:first-child) {
    margin-top: 20px;
}

.modal-content label {
    display: block;
    margin: 0;
}

/* Segmented Control für die Schwierigkeit */
.difficulty-options {
    display: flex;
    gap: 8px;
}

.difficulty-options label {
    flex: 1;
}

.difficulty-options input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: -1px;
}

.difficulty-options label > span {
    display: block;
    text-align: center;
    padding: 8px 6px;
    border-radius: 20px;
    border: 1px solid #e2e6ea;
    background: #f8f9fb;
    color: #555;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

#settings .difficulty-options label > span {
    padding: 12px 10px;
    font-size: 16px;
}

#settings .difficulty-desc {
    font-size: 14px;
}

.difficulty-options label > span:hover {
    border-color: #bbb;
}

.difficulty-options input:checked + span {
    background: linear-gradient(135deg, #3498db, #9b59b6);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(155, 89, 182, 0.35);
}

.difficulty-options input:focus-visible + span {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.difficulty-desc {
    margin: 10px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: #8a94a0;
}

/* Kontinente als Chips */
.continent-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.continent-options input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: -1px;
}

.continent-options label > span {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #e2e6ea;
    background: #f8f9fb;
    color: #555;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}

#settings .continent-options label > span {
    padding: 12px 14px;
    font-size: 16px;
}

.continent-options label > span:hover {
    border-color: #bbb;
}

.continent-options input:checked + span {
    background: #eafaf1;
    border-color: #2ecc71;
    color: #1e824c;
    font-weight: 600;
}

.continent-options input:focus-visible + span {
    outline: 2px solid #2ecc71;
    outline-offset: 2px;
}

.apply-btn {
    display: block;
    width: 100%;
    margin: 20px 0 0;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    font-weight: 600;
    border-radius: 10px;
}

#settings .apply-btn {
    padding: 16px 22px;
    font-size: 17px;
    margin-top: 26px;
}

/* Rundenende */
.modal-header-center {
    justify-content: center;
}

.game-over-body {
    text-align: center;
}

.game-over-score {
    margin: 4px 0;
    font-size: 26px;
    font-weight: 800;
    color: #2c3e50;
}

.game-over-highscore {
    margin: 0 0 6px;
    font-size: 14px;
    color: #8a94a0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    padding: 6px 14px;
    border-radius: 20px;
    background: #f4f6f8;
    color: #3498db;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s ease;
}

.back-link:hover {
    background: #eaf4fb;
}
