:root {
    /* Primäre Farbpalette - Tiefe und Raffinesse */
    --bg-primary: #0c111d;
    --bg-secondary: #141b2b;
    --accent-primary: #2b6ef0;
    --accent-secondary: #4f8cff;
    --accent-glow: rgba(43, 110, 240, 0.25);
    
    /* Oberflächen */
    --surface-glass: rgba(20, 27, 43, 0.85);
    --surface-elevated: #1e2740;
    --surface-inset: #0a0f1a;
    
    /* Textabstufungen */
    --text-primary: #ffffff;
    --text-secondary: #d7dce4;
    --text-tertiary: #6b7b95;
    --text-inverse: #0c111d;
    
    /* Borders & Effects */
    --border-light: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.4);
    --shadow-accent: 0 8px 20px rgba(43, 110, 240, 0.2);
    
    /* Typografie */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Roboto Mono', monospace;
    
    /* Übergänge */
    --transition-fast: 150ms cubic-bezier(0.2, 0, 0, 1);
    --transition-base: 250ms cubic-bezier(0.2, 0, 0, 1);
    --transition-smooth: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Basis Reset & Globale Stile --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    height: -webkit-fill-available;
}

body {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    background: var(--bg-primary);
    background-image: 
        radial-gradient(circle at 100% 0%, rgba(43, 110, 240, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 0% 100%, rgba(43, 110, 240, 0.05) 0%, transparent 50%);
    font-family: var(--font-sans);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    padding-bottom: env(safe-area-inset-bottom);
}

/* --- Container mit eleganterer Glas-Oberfläche --- */
.container {
    width: 92%;
    max-width: 480px;
    padding: 48px 24px;
    margin: 20px auto 0;
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-medium);
    border-radius: 32px;
    box-shadow: var(--shadow-lg);
    position: relative;
    transition: var(--transition-base);
}

.container::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 32px;
    padding: 1px;
    background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* --- Typografie mit mehr Charakter --- */
h1 {
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 24px;
    position: relative;
    display: inline-block;
    padding: 0 16px;
}

h1::before,
h1::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 20px;
    height: 1px;
    background: var(--border-medium);
}

h1::before {
    left: -10px;
}

h1::after {
    right: -10px;
}

#coords {
    font-size: 40px;
    font-weight: 700;
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
    color: transparent;
    background: linear-gradient(135deg, #fff 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    line-height: 1.1;
    margin: 0 0 4px;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 20px var(--accent-glow);
}

#accuracy {
    margin-top: 10px;
}

#status {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    padding: 6px 12px;
    background: rgba(255,255,255,0.02);
    border-radius: 5px;
    display: inline-block;
    margin-top: 5px;
}

#copyToggle {
    width: 80%;
    padding: 7px;
    padding-left: 10px;
    border-radius: 5px;
    background: #38bdf8;
    color: #00082b;
    font-weight: bold;
    height: 40px;
    margin-top: 10px;
    margin-bottom: -10px;
}

/* --- Canvas mit elegantem Rand --- */
#altitudeCanvas {
    margin-top: 22px;
    width: 94%;
    height: 200px !important;
    border-radius: 10px;
    background: var(--surface-inset);
    border: 1px solid var(--border-light);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.4);
    transition: var(--transition-base);
}

#altitudeCanvas:hover {
    border-color: var(--border-medium);
}

.website_links {
    margin: 0 auto 30px auto;
    margin-top: 10px;
    width: 90%;
    display: flex;
    justify-content: center;
    gap: 5px; /* Optional: Abstand zwischen den Boxen */
}

/* Wir stylen die Links, da sie die direkten Kinder sind */
.website_links a {
    text-decoration: none; /* Entfernt Unterstreichung vom Link */
    width: 120px;
}

.website_links a div {
    font-weight: bold;
    color: white;
    border: 1px solid var(--border-medium);
    display: flex;         /* Damit wir Text/Bild darin zentrieren können */
    flex-direction: column; /* Bild über Text */
    align-items: center;    /* Horizontal zentrieren */
    padding: 10px;
    background-color: var(--surface-elevated);
    border-radius: 3px;
}

.website_links a div img {
    border-radius: 2px;
    width: 48px;
    height: 48px;
}

#compassText {
    margin: 0;
    display: flex;
    align-items: center;
    font-family: sans-serif;
    font-weight: bold;
}

#compassText {
    margin: 0;
    display: flex;
    align-items: center;
    font-family: sans-serif;
    font-weight: bold;
}

#compassIcon {
    width: 15%;
    height: 15%;
    min-height: 35px;
    min-width: 35px;
    transition: var(--transition-base);
    border-radius: 50%;
}

#nextFactBtn {
    width: 60%;
    padding: 5px;
    border: none;
    border-radius: 5px;
    background: #38bdf8;
    color: #020617;
    font-weight: bold;
    text-size-adjust: 120%;
    margin-left: 20%;
    margin-top: -10px;
    margin-bottom: 10px;
    display: none;
    height: 40px;
}

#fun_facts {
    display: none;
    margin-top: -5px;
}

.infoContainer .fun_fact_class {
    margin-top: 10px !important;
}


#facts-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
    margin-bottom: 20px;
}

/* --- Info Container mit mehr Struktur --- */
/* --- Info Container mit mehr Struktur --- */
#infoContainer {
    width: 92%;
    max-width: 650px;
    margin: 15px auto 40px;
    padding: 25px;
    background: var(--surface-elevated);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
    line-height: 1.7;
}

#infoContainer h2 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

#infoContainer ul {
    margin-left: 25px;
}

#infoContainer p {
    margin-bottom: 16px;
}

/* Vertikale Linien zwischen den Spalten */
.infoTable th:not(:last-child), 
.infoTable td:not(:last-child) {
    border-right: 1px solid var(--border-light);
}

.infoTable th {
    background: rgba(255,255,255,0.02);
    color: var(--text-secondary);
    padding: 16px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
}

.infoTable td {
    padding: 16px 12px;
    /* Horizontale Linien */
    border-top: 1px solid var(--border-light);
    color: var(--text-primary);
    font-size: 0.9375rem;
}


/* --- Utilities mit mehr Finesse --- */
.hidden {
    display: none !important;
}

.status-warning {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
    padding: 8px 20px;
    border-radius: 5px;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-block;
    border: 1px solid rgba(245, 158, 11, 0.2);
}


@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-2px); }
    80% { transform: translateX(2px); }
}

/* --- Mobile-First Optimierungen --- */
@media (max-width: 480px) {
    .container {
        width: 94%;
        padding: 40px 20px;
        margin-top: 16px;
    }
    
    #altitude {
        font-size: 4.5rem;
    }
    
    .settingsBox {
        padding: 32px 24px;
    }
    
    .infoContainer {
        width: 94%;
        padding: 28px 20px;
    }
    
    button, 
    #settingsBtn {
        min-height: 48px;
    }
}

/* --- Safe Area für moderne Smartphones --- */
@supports (padding: max(0px)) {
    .container,
    .infoContainer {
        padding-left: max(24px, env(safe-area-inset-left));
        padding-right: max(24px, env(safe-area-inset-right));
    }
}

/* --- Dark Mode Optimierung (falls System Dark Mode) --- */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0a0e17;
        --surface-glass: rgba(20, 27, 43, 0.9);
    }
}

/* --- Performance-Optimierungen --- */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* --- Druckoptimierung (Bonus) --- */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .container,
    .infoContainer {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    #settingsBtn {
        display: none;
    }
}

footer {
    margin-bottom: 30px;
    margin-top: 5px !important;
}

span {
    margin-left: 5px;
}

.link {
    color: #2952d8;
    text-decoration: underline;
    margin-bottom: 10px;
}

#städtelink {
    margin-bottom: 20px;
}

#link {
    color: #2952d8;
    text-decoration: underline;
    margin-bottom: 5px;
}

#firsth2 {
    margin-top: -10px
}

.navLinks {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.navLinks a {
    color: var(--text-primary);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 14px;
    background: var(--surface-elevated);
    border: 1px solid var(--border-medium);
    transition: var(--transition-base);
    width: 30%;
}

.navLinks p {
    font-size: 14px;
}