*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0a1a0f;
    color: #f0fdf4;
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    padding-bottom: 72px;
    -webkit-tap-highlight-color: transparent;
}

/* ── Header ─────────────────────────────────── */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    background: #0f1f15;
    border-bottom: 1px solid #1e3526;
    position: sticky;
    top: 0;
    z-index: 20;
}

.logo {
    height: 30px;
    width: auto;
}

#header-coords {
    font-size: 0.68rem;
    color: #4ade80;
    font-family: monospace;
    opacity: 0.8;
}

/* ── Loading Overlay ─────────────────────────── */
#loading {
    position: fixed;
    inset: 0;
    background: rgba(10, 26, 15, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    color: #f0fdf4;
    z-index: 100;
}

#loading::after {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid #1e3526;
    border-top-color: #d97706;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Error Banner ────────────────────────────── */
#error-msg {
    display: none;
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid #dc2626;
    color: #fca5a5;
    font-size: 0.82rem;
    padding: 0.6rem 1rem;
    margin: 0.5rem 0.75rem;
    border-radius: 8px;
}

/* ── Views ───────────────────────────────────── */
.view { display: block; }

/* ── Setup View ──────────────────────────────── */
.setup-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 130px);
    padding: 2rem;
    text-align: center;
    gap: 1.25rem;
}

.setup-icon { font-size: 5rem; }

.setup-card h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: #d97706;
}

.setup-card p {
    color: #86efac;
    font-size: 1rem;
    max-width: 280px;
    line-height: 1.5;
}

/* ── Risk Banner ─────────────────────────────── */
.risk-banner {
    padding: 1.75rem 1rem 1.5rem;
    text-align: center;
    background: #16a34a;
    transition: background-color 0.5s ease;
}

.risk-score-big {
    font-size: 4.5rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    letter-spacing: -0.02em;
}

.risk-label {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin-top: 0.2rem;
}

.risk-sublabel {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ── Risk Meter ──────────────────────────────── */
.risk-meter-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    background: #0f1f15;
    border-bottom: 1px solid #1e3526;
}

.risk-meter {
    flex: 1;
    background: linear-gradient(to right,
        #16a34a 0%, #16a34a 25%,
        #eab308 25%, #eab308 50%,
        #ea580c 50%, #ea580c 75%,
        #dc2626 75%, #dc2626 100%
    );
    height: 12px;
    border-radius: 6px;
    position: relative;
}

.risk-meter-needle {
    position: absolute;
    top: -4px;
    width: 4px;
    height: 20px;
    background: #fff;
    border-radius: 2px;
    transform: translateX(-50%);
    box-shadow: 0 0 4px rgba(0,0,0,0.5);
    transition: left 0.5s ease;
}

/* ── Prognose ────────────────────────────────── */
.prognose-card {
    background: #0f1f15;
    border: 1px solid #1e3526;
    border-radius: 12px;
    padding: 1rem;
    margin: 0.75rem;
}

.card-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #86efac;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

.prognose-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.prognose-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 0.25rem;
    border-radius: 8px;
    background: #162a1e;
    border: 1px solid #1e3526;
}

.prognose-item.active {
    border-color: #d97706;
    background: #1a3020;
}

.prognose-time {
    font-size: 0.75rem;
    color: #86efac;
    margin-bottom: 0.25rem;
}

.prognose-score {
    font-size: 1.5rem;
    font-weight: 800;
    color: #f0fdf4;
}

.prognose-label {
    font-size: 0.7rem;
    color: #4ade80;
    margin-top: 0.1rem;
}

.prognose-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 0.4rem;
}

/* ── Erklärung ───────────────────────────────── */
.erklaerung-card {
    background: #0f1f15;
    border: 1px solid #2d5a3d;
    border-left: 4px solid #d97706;
    border-radius: 12px;
    padding: 1rem;
    margin: 0.75rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.erklaerung-icon { font-size: 1.5rem; }

.erklaerung-text {
    color: #f0fdf4;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

#risk-meter-val {
    font-size: 0.8rem;
    font-weight: 700;
    color: #86efac;
    min-width: 26px;
    text-align: right;
    font-family: monospace;
}

/* ── Cards ───────────────────────────────────── */
.card {
    background: #0f1f15;
    border: 1px solid #1e3526;
    border-radius: 12px;
    padding: 1rem;
    margin: 0.75rem;
}

.card h3 {
    font-size: 0.72rem;
    font-weight: 700;
    color: #86efac;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

/* ── Factor Rows ─────────────────────────────── */
.factor-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #1e3526;
    font-size: 0.88rem;
}

.factor-row:last-child { border-bottom: none; }

.factor-row span:first-child { color: #86efac; }

.factor-row span:last-child {
    color: #f0fdf4;
    font-weight: 600;
    font-family: monospace;
    font-size: 0.85rem;
}

/* ── Solunar Rows ────────────────────────────── */
.solunar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0;
    font-size: 0.88rem;
    color: #86efac;
    border-bottom: 1px solid #1e3526;
}

.solunar-row:last-child { border-bottom: none; }

.solunar-row.hauptzeit {
    color: #d97706;
    font-weight: 600;
}

.solunar-row span:last-child {
    font-family: monospace;
    font-size: 0.82rem;
}

/* ── Buttons ─────────────────────────────────── */
.btn-primary {
    background: #d97706;
    color: #000;
    border: none;
    border-radius: 8px;
    padding: 1rem 2rem;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: opacity 0.15s;
}

.btn-primary:active { opacity: 0.8; }

.btn-refresh {
    display: block;
    background: transparent;
    border: 1px solid #2d5a3d;
    color: #86efac;
    width: calc(100% - 1.5rem);
    margin: 0.25rem 0.75rem 1rem;
    padding: 0.7rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: background-color 0.15s;
}

.btn-refresh:active { background: #1e3526; }

/* ── Bottom Navigation ───────────────────────── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #0f1f15;
    border-top: 1px solid #1e3526;
    display: flex;
    justify-content: space-around;
    z-index: 50;
}

.bottom-nav button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.7rem 0;
    background: none;
    border: none;
    color: #4ade80;
    font-size: 1.35rem;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: color 0.2s;
}

.bottom-nav button span {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bottom-nav button.active { color: #d97706; }

/* ── Settings ────────────────────────────────── */
.card label {
    display: block;
    color: #86efac;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.card select {
    width: 100%;
    background: #0a1a0f;
    color: #f0fdf4;
    border: 1px solid #1e3526;
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    appearance: none;
    cursor: pointer;
}

/* ── Footer Credit ───────────────────────────── */
.lumaris-credit {
    text-align: center;
    padding: 1rem;
    font-size: 0.78rem;
    color: #4ade80;
    opacity: 0.7;
}

.lumaris-credit a {
    color: #d97706;
    text-decoration: none;
}

/* ── Wild melden ─────────────────────────────── */
.btn-wild-melden {
    width: calc(100% - 1.5rem);
    margin: 0 0.75rem 0.75rem;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.85rem;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
    50%       { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ──────────────────────────────── */
@media (min-width: 480px) {
    .risk-score-big { font-size: 5rem; }

    .card { margin: 0.75rem 1rem; }
}
