/* ==========================================================================
   Gebetszeiten.io — Modernes Design-System
   Kein Framework, reines CSS. Dark/Light Theme über [data-theme].
   ========================================================================== */

/* ---------- Design Tokens ---------- */

:root {
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --radius-s: 10px;
    --radius-m: 16px;
    --radius-l: 22px;

    --container: 1100px;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, .18), 0 8px 24px rgba(0, 0, 0, .12);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, .22), 0 18px 48px rgba(0, 0, 0, .22);

    --ease: cubic-bezier(.22, 1, .36, 1);
}

:root,
[data-theme="dark"] {
    color-scheme: dark;

    --bg: #071410;
    --bg-2: #0a1c16;
    --surface: rgba(255, 255, 255, .045);
    --surface-2: rgba(255, 255, 255, .08);
    --surface-solid: #0e211a;
    --border: rgba(255, 255, 255, .09);
    --border-strong: rgba(255, 255, 255, .16);

    --text: #e9f4ee;
    --text-muted: #9fb8ac;
    --text-faint: #82a093;

    --primary: #2dd4a0;
    --primary-strong: #10b981;
    --primary-soft: rgba(45, 212, 160, .12);
    --primary-glow: rgba(45, 212, 160, .35);

    --gold: #e9bb5c;
    --gold-soft: rgba(233, 187, 92, .14);

    --danger: #f87171;

    --header-bg: rgba(7, 20, 16, .72);
    --pattern-opacity: .05;
    --orb-opacity: .5;
}

[data-theme="light"] {
    color-scheme: light;

    --bg: #f3f7f5;
    --bg-2: #e9f1ed;
    --surface: rgba(255, 255, 255, .78);
    --surface-2: rgba(255, 255, 255, .95);
    --surface-solid: #ffffff;
    --border: rgba(15, 60, 42, .10);
    --border-strong: rgba(15, 60, 42, .2);

    --text: #12241c;
    --text-muted: #476055;
    --text-faint: #566d62;

    --primary: #087a56;
    --primary-strong: #066547;
    --primary-soft: rgba(8, 122, 86, .10);
    --primary-glow: rgba(8, 122, 86, .25);

    --gold: #8a660f;
    --gold-soft: rgba(138, 102, 15, .12);

    --danger: #dc2626;

    --header-bg: rgba(243, 247, 245, .8);
    --pattern-opacity: .045;
    --orb-opacity: .35;

    --shadow-1: 0 1px 2px rgba(18, 36, 28, .06), 0 8px 24px rgba(18, 36, 28, .08);
    --shadow-2: 0 2px 6px rgba(18, 36, 28, .08), 0 18px 48px rgba(18, 36, 28, .12);
}

/* ---------- Basis ---------- */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Sanfte Seitenübergänge (moderne Browser, degradiert stumm) */
@view-transition {
    navigation: auto;
}

/* Islamisches Sternmuster als dezente Hintergrund-Textur */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    opacity: var(--pattern-opacity);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%232dd4a0' stroke-width='1'%3E%3Cpath d='M48 8 58 38 88 48 58 58 48 88 38 58 8 48 38 38Z'/%3E%3Ccircle cx='48' cy='48' r='12'/%3E%3Cpath d='M0 0h8v8M88 0h8v8M0 88h8v8M88 88h8v8'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 96px 96px;
}

/* Aurora-Glow im Hintergrund */
body::after {
    content: "";
    position: fixed;
    z-index: -3;
    inset: -20% -10%;
    pointer-events: none;
    opacity: var(--orb-opacity);
    background:
        radial-gradient(38% 30% at 12% 8%, var(--primary-glow), transparent 70%),
        radial-gradient(30% 26% at 88% 14%, var(--gold-soft), transparent 70%),
        radial-gradient(40% 34% at 55% 100%, var(--primary-soft), transparent 70%);
    animation: aurora 26s ease-in-out infinite alternate;
}

@keyframes aurora {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(2%, 3%, 0) scale(1.06); }
    100% { transform: translate3d(-2%, -2%, 0) scale(1.02); }
}

h1, h2, h3, h4 {
    line-height: 1.25;
    margin: 0 0 .5em;
    font-weight: 750;
    letter-spacing: -.015em;
    text-wrap: balance;
}

h1 { font-size: clamp(1.7rem, 1.2rem + 2.6vw, 2.7rem); }
h2 { font-size: clamp(1.25rem, 1.05rem + 1.1vw, 1.7rem); }
h3 { font-size: 1.12rem; }

p { margin: 0 0 1em; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: color .2s var(--ease);
}

a:hover { color: var(--primary-strong); }

img, svg { vertical-align: middle; }

[hidden] { display: none !important; }

time, .tabular {
    font-variant-numeric: tabular-nums;
}

::selection {
    background: var(--primary);
    color: #04211a;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: clamp(14px, 3vw, 24px);
}

main {
    flex: 1;
    width: 100%;
    padding-bottom: clamp(2.5rem, 6vw, 5rem);
}

.section {
    margin-top: clamp(2rem, 5vw, 3.5rem);
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-head h2 {
    margin: 0;
}

.section-kicker {
    display: inline-block;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: .35rem;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -100px;
    z-index: 100;
    background: var(--primary);
    color: #04211a;
    padding: .55rem 1rem;
    border-radius: var(--radius-s);
    font-weight: 700;
    transition: top .2s var(--ease);
}

.skip-link:focus {
    top: 1rem;
    color: #04211a;
}

/* ---------- Header / Navigation ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--header-bg);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    backdrop-filter: blur(14px) saturate(1.4);
    border-bottom: 1px solid var(--border);
}

.nav {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: clamp(.6rem, 2vw, 1.4rem);
    padding-block: .6rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    color: var(--text);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -.01em;
    white-space: nowrap;
}

.brand:hover { color: var(--text); }

.brand-logo {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-strong), #0c7a5b);
    box-shadow: 0 4px 14px var(--primary-glow);
}

.brand-logo svg { width: 20px; height: 20px; }

.brand .tld { color: var(--primary); }

@media (max-width: 640px) {
    .brand-name { display: none; }
}

/* Suche */
.nav-search {
    position: relative;
    max-width: 480px;
    justify-self: center;
    width: 100%;
}

.nav-search .search-icon {
    position: absolute;
    left: .8rem;
    top: 50%;
    translate: 0 -50%;
    width: 16px;
    height: 16px;
    color: var(--text-faint);
    pointer-events: none;
}

#search {
    width: 100%;
    padding: .6rem 1rem .6rem 2.3rem;
    font: inherit;
    font-size: .95rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    outline: none;
    transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}

#search::placeholder { color: var(--text-faint); }

#search:focus {
    border-color: var(--primary);
    background: var(--surface-2);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 340px;
    overflow-y: auto;
    background: var(--surface-solid);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-2);
    z-index: 60;
    animation: dropIn .18s var(--ease);
}

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}

.search-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .8rem;
    padding: .65rem .95rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    transition: background .15s var(--ease);
}

.search-item:last-child { border-bottom: 0; }

.search-item:hover,
.search-item.is-active {
    background: var(--primary-soft);
    color: var(--text);
}

.search-item .country {
    font-size: .78rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-empty {
    padding: .8rem 1rem;
    color: var(--text-muted);
    font-size: .9rem;
}

/* Aktionen rechts */
.nav-actions {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.icon-btn {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: background .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease);
}

.icon-btn:hover {
    background: var(--surface-2);
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.icon-btn:active { transform: translateY(0); }

.icon-btn svg { width: 18px; height: 18px; }

[data-theme="dark"] .theme-icon-sun { display: block; }
[data-theme="dark"] .theme-icon-moon { display: none; }
[data-theme="light"] .theme-icon-sun { display: none; }
[data-theme="light"] .theme-icon-moon { display: block; }

/* Menü */
.menu-toggle {
    position: relative;
}

.menu-toggle span {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform .25s var(--ease);
    transform: translate(-50%, calc(-50% - 3px));
}

.menu-toggle span + span {
    transform: translate(-50%, calc(-50% + 3px));
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translate(-50%, -50%) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { transform: translate(-50%, -50%) rotate(-45deg); }

.site-menu {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .3s var(--ease);
}

.site-menu.is-open { grid-template-rows: 1fr; }

.site-menu > ul {
    overflow: hidden;
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .25rem .35rem;
    /* Eingeklappte Links aus der Tab-Reihenfolge nehmen */
    visibility: hidden;
    transition: visibility .3s;
}

.site-menu.is-open > ul {
    visibility: visible;
}

.site-menu.is-open > ul {
    padding: .35rem 0 .8rem;
}

.site-menu a {
    display: inline-block;
    padding: .5rem .9rem;
    border-radius: 999px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: .92rem;
    transition: background .2s var(--ease), color .2s var(--ease);
}

.site-menu a:hover,
.site-menu a[aria-current="page"] {
    background: var(--primary-soft);
    color: var(--primary);
}

/* ---------- Buttons, Chips, Badges ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .65rem 1.25rem;
    font: inherit;
    font-weight: 700;
    font-size: .95rem;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
}

.btn svg { width: 17px; height: 17px; }

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #04211a;
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-primary:hover {
    color: #04211a;
    box-shadow: 0 10px 28px var(--primary-glow);
}

.btn-ghost {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.btn-ghost:hover {
    background: var(--surface-2);
    border-color: var(--border-strong);
    color: var(--text);
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .42rem .95rem;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: background .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease), color .2s var(--ease);
}

.chip:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.badge {
    display: inline-block;
    padding: .18rem .6rem;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    border-radius: 999px;
    background: var(--primary);
    color: #04211a;
}

.badge-gold {
    background: var(--gold);
    color: #241a04;
}

/* ---------- Karten ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-l);
    padding: clamp(1rem, 2.5vw, 1.6rem);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-1);
}

/* ---------- Hero ---------- */

.hero {
    padding-top: clamp(2.2rem, 6vw, 4.5rem);
    text-align: center;
}

.hero .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .35rem .95rem;
    font-size: .82rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid var(--primary);
    border-radius: 999px;
    margin-bottom: 1.1rem;
}

.hero h1 {
    margin-bottom: .4em;
}

.hero h1 .accent {
    background: linear-gradient(120deg, var(--primary), var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero .lead {
    max-width: 640px;
    margin: 0 auto 1.4rem;
    color: var(--text-muted);
    font-size: clamp(1rem, .95rem + .4vw, 1.15rem);
}

.hero-datetime {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .6rem 1rem;
    margin-top: 1.4rem;
    color: var(--text-muted);
    font-size: .95rem;
}

.hero-datetime .live-clock {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--text);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .7rem;
    margin-top: 1.5rem;
}

/* ---------- Länder- / Städtelisten ---------- */

.country-tabs {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.city-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: .5rem;
}

.city-link {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem .85rem;
    border-radius: var(--radius-s);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 600;
    font-size: .92rem;
    transition: background .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease), color .2s var(--ease);
}

.city-link:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.city-link svg {
    width: 13px;
    height: 13px;
    color: var(--text-faint);
    flex-shrink: 0;
}

.city-link:hover svg { color: var(--primary); }

/* Accordion (Bundesländer, FAQ) */
details.accordion {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    margin-bottom: .6rem;
    overflow: hidden;
    transition: border-color .2s var(--ease);
}

details.accordion[open] { border-color: var(--border-strong); }

details.accordion summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 1.1rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

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

details.accordion summary::after {
    content: "";
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform .25s var(--ease);
    flex-shrink: 0;
}

details.accordion[open] summary::after {
    transform: rotate(225deg);
}

details.accordion .accordion-body {
    padding: 0 1.1rem 1rem;
    color: var(--text-muted);
}

/* ---------- Gebetszeiten-Seite ---------- */

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
    padding-top: 1rem;
    font-size: .85rem;
    color: var(--text-faint);
}

.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs .sep { opacity: .5; }

.city-hero {
    text-align: center;
    padding-top: clamp(1.2rem, 3vw, 2rem);
}

.city-hero .sub {
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .35rem .9rem;
}

/* Countdown */
.countdown-card {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: clamp(1rem, 4vw, 2.5rem);
    margin-top: 1.6rem;
    position: relative;
    overflow: hidden;
}

.countdown-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(60% 120% at 0% 50%, var(--primary-soft), transparent 70%);
    pointer-events: none;
}

@media (max-width: 620px) {
    .countdown-card {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }
}

.ring-wrap {
    position: relative;
    width: clamp(170px, 40vw, 210px);
    aspect-ratio: 1;
}

.ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring circle {
    fill: none;
    stroke-width: 7;
    stroke-linecap: round;
}

.ring-track { stroke: var(--surface-2); }

.ring-progress {
    stroke: url(#ringGradient);
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 1s linear;
    filter: drop-shadow(0 0 6px var(--primary-glow));
}

.ring-center {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    text-align: center;
    gap: .1rem;
}

.ring-center .label {
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.ring-center .name {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
}

.ring-center .count {
    font-size: 1.45rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.ring-center .at {
    font-size: .85rem;
    color: var(--text-muted);
}

.countdown-side {
    position: relative;
    display: grid;
    gap: .3rem;
}

.countdown-side .live-clock {
    font-size: clamp(2rem, 6vw, 2.8rem);
    font-weight: 850;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.countdown-side .dates {
    color: var(--text-muted);
    font-size: .95rem;
}

.countdown-side .hint {
    margin-top: .5rem;
    font-size: .85rem;
    color: var(--text-faint);
}

/* Gebetszeiten-Grid */
.prayer-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: .7rem;
    margin-top: 1.2rem;
}

@media (max-width: 900px) {
    .prayer-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
    .prayer-grid { grid-template-columns: repeat(2, 1fr); }
}

.prayer-card {
    position: relative;
    display: grid;
    justify-items: center;
    gap: .3rem;
    padding: 1.1rem .5rem .95rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    text-align: center;
    transition: transform .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}

.prayer-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
}

.prayer-card .p-icon {
    width: 26px;
    height: 26px;
    color: var(--gold);
}

.prayer-card .p-name {
    font-weight: 700;
    font-size: .92rem;
}

.prayer-card .p-time {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
}

.prayer-card .p-badge {
    position: absolute;
    top: -9px;
    left: 50%;
    translate: -50% 0;
    white-space: nowrap;
}

.prayer-card.is-current {
    background: linear-gradient(160deg, var(--primary-soft), var(--surface));
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary), 0 8px 30px var(--primary-glow);
    animation: currentPulse 2.6s ease-in-out infinite;
}

.prayer-card.is-current .p-time { color: var(--primary); }

.prayer-card.is-next {
    border-color: var(--gold);
}

@keyframes currentPulse {
    0%, 100% { box-shadow: 0 0 0 1px var(--primary), 0 8px 26px var(--primary-glow); }
    50% { box-shadow: 0 0 0 1px var(--primary), 0 8px 40px var(--primary-glow); }
}

/* Zusatzzeiten + Qibla */
.extras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: .7rem;
    margin-top: .7rem;
}

.extra-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .95rem 1.15rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
}

.extra-card .k {
    font-size: .9rem;
    font-weight: 650;
    color: var(--text-muted);
}

.extra-card .v {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.extra-card .v .gold { color: var(--gold); }

/* Qibla-Kompass */
.qibla-flex {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    flex-wrap: wrap;
}

.compass {
    position: relative;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background:
        radial-gradient(circle at 50% 50%, var(--surface-2), transparent 70%);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.compass .dir {
    position: absolute;
    font-size: .68rem;
    font-weight: 700;
    color: var(--text-faint);
}

.compass .dir-n { top: 7px; }
.compass .dir-s { bottom: 7px; }
.compass .dir-w { left: 9px; }
.compass .dir-e { right: 9px; }

.compass-needle {
    width: 100%;
    height: 100%;
    transition: transform 1s var(--ease);
}

.qibla-info .deg {
    font-size: 1.7rem;
    font-weight: 850;
    color: var(--gold);
}

.qibla-info .desc {
    color: var(--text-muted);
    font-size: .92rem;
    max-width: 420px;
}

/* Aktionen / Methode */
.actions-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .7rem;
    margin-top: 1.4rem;
}

.method-select {
    position: relative;
}

.method-select select {
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    font-weight: 650;
    font-size: .93rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: .62rem 2.4rem .62rem 1.1rem;
    cursor: pointer;
    transition: border-color .2s var(--ease);
}

.method-select select:hover { border-color: var(--border-strong); }

.method-select::after {
    content: "";
    position: absolute;
    right: 1rem;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}

/* Monatstabelle */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-m);
    border: 1px solid var(--border);
    background: var(--surface);
}

table.timetable {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
    min-width: 560px;
}

table.timetable caption {
    padding: .9rem 1rem .4rem;
    font-weight: 800;
    font-size: 1.05rem;
    text-align: left;
    color: var(--text);
}

table.timetable th {
    position: sticky;
    top: 0;
    text-align: center;
    padding: .55rem .6rem;
    font-size: .78rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-strong);
    background: var(--surface-solid);
}

table.timetable td {
    text-align: center;
    padding: .45rem .6rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

table.timetable td:first-child {
    font-weight: 650;
    color: var(--text-muted);
}

table.timetable tr:last-child td { border-bottom: 0; }

table.timetable tbody tr:hover { background: var(--surface-2); }

table.timetable tr.today {
    background: var(--primary-soft);
}

table.timetable tr.today td {
    color: var(--primary);
    font-weight: 750;
}

/* ---------- Koran ---------- */

.filter-input {
    width: 100%;
    max-width: 420px;
    padding: .65rem 1.1rem;
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    outline: none;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.filter-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.sura-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: .6rem;
    margin-top: 1.2rem;
}

.sura-card {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .8rem .95rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    color: var(--text);
    transition: transform .18s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}

.sura-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--text);
}

.sura-num {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    font-weight: 800;
    font-size: .85rem;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid var(--primary);
    border-radius: 11px;
    rotate: 45deg;
}

.sura-num span { rotate: -45deg; }

.sura-card .names { display: grid; line-height: 1.35; min-width: 0; }

.sura-card .de {
    font-weight: 700;
    font-size: .95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sura-card .ar {
    font-size: .82rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Suren-Leseansicht */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--primary), var(--gold));
    z-index: 60;
}

.verses {
    max-width: 760px;
    margin-inline: auto;
    margin-top: 1.6rem;
    display: grid;
    gap: .8rem;
}

.verse {
    position: relative;
    padding: 1.05rem 1.2rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    font-size: var(--verse-size, 1.02rem);
    line-height: 1.75;
}

.verse .vnum {
    display: inline-block;
    margin-top: .55rem;
    font-size: .78rem;
    font-weight: 700;
    color: var(--gold);
}

.verse-tools {
    display: flex;
    justify-content: center;
    gap: .5rem;
    margin-top: 1.4rem;
}

.pager {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    max-width: 760px;
    margin: 2rem auto 0;
}

.pager a {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .7rem 1.1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    color: var(--text);
    font-weight: 650;
    font-size: .9rem;
    max-width: 100%;
    transition: border-color .2s var(--ease), background .2s var(--ease), transform .15s var(--ease);
}

.pager a:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
    transform: translateY(-2px);
}

.pager a svg { width: 15px; height: 15px; flex-shrink: 0; }

.pager .prev { justify-self: start; }
.pager .next { justify-self: end; }

.pager .current {
    font-weight: 800;
    color: var(--text-muted);
}

.pager a .label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 560px) {
    .pager a .label { display: none; }
}

/* ---------- Feature-Kacheln (Startseite) ---------- */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: .8rem;
}

.feature-card {
    display: grid;
    gap: .5rem;
    padding: 1.3rem 1.2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-l);
    transition: transform .2s var(--ease), border-color .2s var(--ease);
}

.feature-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
}

.feature-card .f-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
}

.feature-card .f-icon svg { width: 21px; height: 21px; }

.feature-card h3 { margin: 0; font-size: 1rem; }

.feature-card p {
    margin: 0;
    font-size: .88rem;
    color: var(--text-muted);
}

/* ---------- Prosa-Seiten (Über uns, Datenschutz, …) ---------- */

.prose {
    max-width: 760px;
    margin-inline: auto;
}

.prose h1 { margin-top: 1.2em; }

.prose h2 {
    margin-top: 1.6em;
    padding-bottom: .3em;
    border-bottom: 1px solid var(--border);
}

.prose h3 { margin-top: 1.4em; }
.prose h4 { margin-top: 1.2em; font-size: 1rem; }

.prose p, .prose li { color: var(--text-muted); }

.prose a { text-decoration: underline; text-underline-offset: 3px; }

/* 404 */
.error-hero {
    text-align: center;
    padding-top: clamp(3rem, 10vw, 6rem);
}

.error-hero .code {
    font-size: clamp(4.5rem, 16vw, 8rem);
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(120deg, var(--primary), var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- Footer ---------- */

.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    background: var(--bg-2);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 2rem;
    padding-block: clamp(1.8rem, 5vw, 3rem) 1.5rem;
}

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

@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; gap: 1.4rem; }
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: .6rem;
}

.footer-about {
    font-size: .88rem;
    color: var(--text-muted);
    max-width: 320px;
}

.footer-col h4 {
    font-size: .8rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: .7rem;
}

.footer-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .35rem;
}

.footer-col a {
    color: var(--text-muted);
    font-size: .92rem;
}

.footer-col a:hover { color: var(--primary); }

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    padding-block: 1.1rem;
    border-top: 1px solid var(--border);
    font-size: .82rem;
    color: var(--text-faint);
}

/* ---------- Toast ---------- */

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    translate: -50% 0;
    z-index: 90;
    padding: .7rem 1.2rem;
    background: var(--surface-solid);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    box-shadow: var(--shadow-2);
    font-size: .92rem;
    font-weight: 600;
    opacity: 0;
    translate: -50% 12px;
    transition: opacity .3s var(--ease), translate .3s var(--ease);
    pointer-events: none;
    max-width: min(92vw, 480px);
    text-align: center;
}

.toast.is-visible {
    opacity: 1;
    translate: -50% 0;
}

/* ---------- Scroll-Reveal-Animationen ---------- */

.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .7s var(--ease), transform .7s var(--ease);
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

.reveal-stagger > * {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .55s var(--ease), transform .55s var(--ease);
}

.reveal-stagger.is-visible > * {
    opacity: 1;
    transform: none;
}

.reveal-stagger.is-visible > :nth-child(1) { transition-delay: .03s; }
.reveal-stagger.is-visible > :nth-child(2) { transition-delay: .07s; }
.reveal-stagger.is-visible > :nth-child(3) { transition-delay: .11s; }
.reveal-stagger.is-visible > :nth-child(4) { transition-delay: .15s; }
.reveal-stagger.is-visible > :nth-child(5) { transition-delay: .19s; }
.reveal-stagger.is-visible > :nth-child(6) { transition-delay: .23s; }
.reveal-stagger.is-visible > :nth-child(7) { transition-delay: .27s; }
.reveal-stagger.is-visible > :nth-child(8) { transition-delay: .31s; }
.reveal-stagger.is-visible > :nth-child(9) { transition-delay: .35s; }
.reveal-stagger.is-visible > :nth-child(n+10) { transition-delay: .39s; }

/* Ohne JS (oder bei reduzierter Bewegung) alles sichtbar */
.no-js .reveal,
.no-js .reveal-stagger > * {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    @view-transition {
        navigation: none;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }

    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) {
        animation: none !important;
    }

    .reveal,
    .reveal-stagger > * {
        opacity: 1;
        transform: none;
    }
}

/* ---------- Utilities ---------- */

.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
