:root {
    --bg-color: #F7F7F9;
    --card-bg: #FFFFFF;
    --text-main: #222222;
    --text-muted: #717171;
    --accent-primary: #FF385C;
    /* Airbnb-like energetic pink/red */
    --accent-secondary: #000000;
    --accent-blue: #0A84FF;
    --accent-green: #34C759;
    --accent-yellow: #FFCC00;
    --border-color: #EBEBEB;
    --shadow-soft: 0 8px 28px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 12px 36px rgba(0, 0, 0, 0.12);
    --system-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    --header-bg: rgba(247, 247, 249, 0.85);
    --card-bg-translucent: rgba(255, 255, 255, 0.85);
    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 12px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #121212;
        --card-bg: #1C1C1E;
        --text-main: #F5F5F7;
        --text-muted: #8E8E93;
        --accent-primary: #FF4F70;
        --accent-secondary: #FFFFFF;
        --border-color: #2C2C2E;
        --shadow-soft: 0 8px 28px rgba(0, 0, 0, 0.5);
        --shadow-hover: 0 12px 36px rgba(0, 0, 0, 0.7);
        --header-bg: rgba(18, 18, 18, 0.85);
        --card-bg-translucent: rgba(28, 28, 30, 0.85);
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--system-font);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 60px;
    font-size: 16px;
}

a {
    text-decoration: none;
    color: var(--accent-primary);
}

h1,
h2,
h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    background-color: var(--header-bg);
    padding: 24px 20px 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid var(--border-color);
}

.header h1 {
    font-size: 34px;
    margin: 0;
    color: var(--accent-secondary);
}

.add-button {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-secondary);
    background-color: var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-xl);
    transition: transform 0.2s, background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.add-button:active {
    transform: scale(0.95);
    background-color: var(--text-muted);
}

/* Search & Filter Container */
.filter-bar {
    padding: 16px 20px 8px;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-input-wrapper input {
    width: 100%;
    padding: 16px 20px 16px 48px;
    font-size: 18px;
    border: none;
    border-radius: var(--radius-xl);
    background-color: var(--card-bg);
    color: var(--text-main);
    box-shadow: var(--shadow-soft);
    outline: none;
    transition: box-shadow 0.2s;
}

.search-input-wrapper input:focus {
    box-shadow: var(--shadow-hover);
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: var(--text-main);
}

.chips-container {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.chips-container::-webkit-scrollbar {
    display: none;
}

.chip {
    padding: 10px 18px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

a.chip {
    color: var(--text-main);
    text-decoration: none;
    white-space: nowrap;
}
.season-chips {
    margin-bottom: 8px;
}
.chip.active {
    background-color: var(--accent-secondary);
    color: var(--bg-color);
    border-color: var(--accent-secondary);
}

.chip.dropdown-trigger::after {
    content: " ▾";
    font-size: 12px;
}

.chip.dropdown-trigger.expanded::after {
    content: " ▴";
}

/* Map Container */
#map-view {
    width: 100%;
    /* Berechne Höhe = Screen minus Header minus Filter Bar minus margin */
    height: calc(100vh - 120px);
    position: relative;
    z-index: 1;
}

#map {
    width: 100%;
    height: 100%;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.05);
}

.map-popup h3 {
    margin-bottom: 4px;
}
.map-popup h3 {
    margin-bottom: 4px;
    color: var(--text-main);
}
.map-popup p {
    margin-top: 0;
    color: var(--text-muted);
}

/* Leaflet Overrides for Apple Aesthetic */
.leaflet-popup-content-wrapper {
    border-radius: 16px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12) !important;
    background-color: var(--card-bg) !important;
    color: var(--text-main) !important;
}
@supports (-webkit-backdrop-filter: none) or (backdrop-filter: none) {
    .leaflet-popup-content-wrapper {
        background-color: var(--card-bg-translucent) !important;
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
    }
}
.leaflet-popup-tip {
    background-color: var(--card-bg) !important;
}
@supports (-webkit-backdrop-filter: none) or (backdrop-filter: none) {
    .leaflet-popup-tip {
        background-color: var(--card-bg-translucent) !important;
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
    }
}
.leaflet-container {
    font-family: inherit;
}
.leaflet-popup-content {
    margin: 16px 16px 14px 16px !important;
    color: var(--text-main) !important;
}
.leaflet-popup-close-button {
    color: var(--text-muted) !important;
    padding: 8px 8px 0 0 !important;
    width: 24px !important;
    height: 24px !important;
    font-size: 18px !important;
    transition: color 0.2s !important;
}
.leaflet-popup-close-button:hover {
    color: var(--text-main) !important;
    background: transparent !important;
}

/* Custom Leaflet Pins */
.custom-icon-wrapper {
    background: transparent;
    border: none;
}
.custom-map-marker {
    background-color: var(--card-bg);
    border: 2px solid var(--text-main);
    color: var(--text-main);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    position: relative;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-map-marker::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--text-main);
}

/* Rank Highlights */
.custom-map-marker.rank-1 {
    background: linear-gradient(135deg, #FFDF40, #F4A21A);
    border-color: #F4A21A;
    color: #fff;
    width: 36px;
    height: 36px;
    margin-left: -3px; /* Center larger icon visually */
    margin-top: -3px;
    font-size: 16px;
    z-index: 1000 !important;
}
.custom-map-marker.rank-1::after { border-top-color: #F4A21A; }

.custom-map-marker.rank-2 {
    background: linear-gradient(135deg, #E2E2E2, #9E9E9E);
    border-color: #9E9E9E;
    color: #fff;
    width: 32px;
    height: 32px;
    z-index: 900 !important;
}
.custom-map-marker.rank-2::after { border-top-color: #9E9E9E; }

.custom-map-marker.rank-3 {
    background: linear-gradient(135deg, #F0A868, #B05D2D);
    border-color: #B05D2D;
    color: #fff;
    width: 32px;
    height: 32px;
    z-index: 800 !important;
}
.custom-map-marker.rank-3::after { border-top-color: #B05D2D; }

/* List Layout & Grouping */
.list-container {
    padding: 8px 20px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.rank-group {
    margin-bottom: 32px;
}

.rank-group.hidden {
    display: none !important;
}

.group-heading {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-bottom: 8px;
    padding-left: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.price-options {
    display: none;
    gap: 8px;
    animation: fadeIn 0.2s;
}

.price-options.visible {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-header {
    background: var(--card-bg);
    padding: 24px;
    border-radius: var(--radius-xl);
    text-align: center;
    margin-bottom: 24px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.list-item {
    display: flex;
    align-items: center;
    background-color: var(--card-bg);
    padding: 16px;
    border-radius: var(--radius-xl);
    margin-bottom: 16px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: var(--text-main);
    position: relative;
}

.list-item:active {
    transform: scale(0.97);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.list-item.hidden {
    display: none !important;
}

.list-item .rank-badge {
    background-color: var(--accent-secondary);
    color: var(--bg-color);
    font-weight: 800;
    font-size: 18px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    flex-shrink: 0;
}

.list-item .thumbnail {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    background-size: cover;
    background-position: center;
    margin-right: 16px;
    background-color: var(--bg-color);
    flex-shrink: 0;
}

.list-item .placeholder-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.list-item .info {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.list-item .info h3 {
    font-size: 20px;
    margin: 0;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.closed-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: var(--text-muted);
    color: white;
    font-size: 9px;
    padding: 3px 6px;
    border-radius: 6px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    z-index: 2;
}

.list-item .info.info-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 4px;
}

.meta-badge {
    display: inline-block;
    margin-top: 5px;
    font-size: 13px;
    color: var(--text-muted);
    background-color: var(--bg-color);
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* Details Page */
.detail-container {
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 40px;
}

/* Back Button on Detail Page */
.back-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 20;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    text-decoration: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, background-color 0.2s;
}

.back-btn:active {
    transform: scale(0.92);
    background-color: rgba(255, 255, 255, 1);
}

@media (prefers-color-scheme: dark) {
    .back-btn {
        background-color: rgba(30, 30, 30, 0.85);
        color: var(--text-main);
    }
}

.hero-container {
    position: relative;
    width: 100%;
    height: 350px;
    overflow: hidden;
    background-color: var(--bg-color);
}

.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    will-change: transform, opacity;
    z-index: 1;
}

@media (min-width: 800px) {
    .detail-container {
        padding-top: 24px;
    }
    .hero-container {
        border-radius: 24px;
        overflow: hidden;
        margin: 0 auto;
        max-width: 800px;
        box-shadow: var(--shadow-soft);
    }
}

.placeholder-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 100px;
    background-color: var(--card-bg);
}

.content {
    padding: 24px;
    margin-top: -50px;
    position: relative;
    z-index: 10;
    /* Transparent statt solid, damit das Hero Image beim Drüberscrollen sichtbar bleibt */
    background-color: transparent;
}

/* Leaflet User Location Blue Dot */
.user-location-marker {
    position: relative;
}
.blue-dot {
    width: 16px;
    height: 16px;
    background-color: #007AFF;
    border: 3px solid white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
    z-index: 2;
}
.pulse {
    width: 32px;
    height: 32px;
    background-color: rgba(0, 122, 255, 0.3);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 2s infinite ease-out;
    z-index: 1;
}
@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

/* Opening Hours on Detail Page */
.hours-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 6px 0;
    align-items: center;
    border-bottom: 1px solid rgba(142, 142, 147, 0.1);
}
.hours-row:last-child {
    border-bottom: none;
}
.hours-row.today-open {
    font-weight: 700;
    color: #10b981;
}
.hours-row.today-closing {
    font-weight: 700;
    color: #f59e0b;
}
.hours-row.today-opening {
    font-weight: 700;
    color: #f59e0b;
}
.hours-row.today-closed {
    font-weight: 700;
    color: #ef4444;
}
.hours-day {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}
.hours-row.today-open .hours-day,
.hours-row.today-open .hours-time {
    color: #10b981;
    font-weight: 700;
}
.hours-row.today-closing .hours-day,
.hours-row.today-closing .hours-time {
    color: #f59e0b;
    font-weight: 700;
}
.hours-row.today-opening .hours-day,
.hours-row.today-opening .hours-time {
    color: #f59e0b;
    font-weight: 700;
}
.hours-row.today-closed .hours-day,
.hours-row.today-closed .hours-time {
    color: #ef4444;
    font-weight: 700;
}
.hours-time {
    font-size: 14px;
    text-align: right;
    font-weight: 600;
}

.content-header {
    background: var(--card-bg);
    padding: 24px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    margin-bottom: 24px;
    text-align: center;
}

.content-header h1 {
    font-size: 36px;
    margin-bottom: 8px;
}

.content-header .badge {
    display: inline-block;
    background-color: var(--accent-primary);
    color: white;
    padding: 6px 14px;
    border-radius: var(--radius-lg);
    font-weight: 700;
    font-size: 16px;
    margin-top: 8px;
    box-shadow: var(--shadow-soft);
}

.content-header .badge-gold {
    background: linear-gradient(135deg, #FFD700, #F7A800);
    color: #6B4E00;
}

.content-header .badge-silver {
    background: linear-gradient(135deg, #E0E0E0, #9E9E9E);
    color: #424242;
}

.content-header .badge-bronze {
    background: linear-gradient(135deg, #CD7F32, #8D5524);
    color: #FFF;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.card h3 {
    font-size: 22px;
    margin-bottom: 20px;
    color: var(--text-main);
}

.row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 17px;
}

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

.row span {
    color: var(--text-muted);
    font-weight: 500;
    width: 40%;
}

.row strong {
    color: var(--text-main);
    font-weight: 600;
    text-align: right;
    width: 60%;
}

/* Progress Bar Ratings */
.rating-item {
    margin-bottom: 16px;
}

.rating-item:last-child {
    margin-bottom: 0;
}

.rating-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 600;
}

.rating-header .val {
    color: var(--text-muted);
}

.progress-bar-bg {
    width: 100%;
    height: 12px;
    background-color: var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease-out;
}

/* Colors dynamically added inline via PHP based on score */

/* Forms */
.form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
}

form .card .row {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px;
    padding: 16px 0;
}

form .row.checkbox-row {
    flex-direction: row;
    align-items: center !important;
    justify-content: space-between;
}

form .row label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

form .row.checkbox-row label {
    text-transform: none;
    font-size: 17px;
    color: var(--text-main);
}

form .row input[type="text"],
form .row input[type="number"],
form .row input[type="password"],
form .row input[type="url"],
form .row input[type="file"],
form .row textarea {
    width: 100%;
    background-color: var(--bg-color);
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    text-align: left;
    font-size: 17px;
    color: var(--text-main);
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

form .row input:focus,
form .row textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(255, 56, 92, 0.1);
}

/* Rating Radio Buttons */
form .card .row.form-rating-row {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 2px;
    padding: 6px 0;
    border-bottom: none;
}

form .card .row.form-rating-row:last-child {
    padding-bottom: 0;
}

/* Zwei Reihen (0-5 / 6-10), damit alle Werte ohne seitliches Wischen sichtbar sind */
.rating-group {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px 0;
    /* Angepasstes Padding für Schatten nach unten */
    padding: 10px 0 16px;
    width: 100%;
}

.rating-btn {
    display: flex;
    justify-content: center;
    margin: 0 !important;
}

.rating-btn input[type="radio"] {
    display: none;
}

.rating-btn span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: var(--bg-color);
    border: 1.5px solid var(--border-color);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.rating-btn input[type="radio"]:checked+span {
    background-color: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    /* Kein Scale mehr, um das Wackeln des Layouts zu verhindern, nur noch Shadow */
    box-shadow: 0 4px 12px rgba(255, 56, 92, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

/* Toggle Checkbox */
form .row input[type="checkbox"] {
    appearance: none;
    width: 54px;
    height: 32px;
    background-color: var(--border-color);
    border-radius: 16px;
    position: relative;
    outline: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

form .row input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 28px;
    height: 28px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

form .row input[type="checkbox"]:checked {
    background-color: var(--accent-secondary);
}

form .row input[type="checkbox"]:checked::after {
    transform: translateX(22px);
}

/* Buttons */
.buttons-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 32px;
}

.btn {
    display: block;
    width: 100%;
    padding: 18px;
    border-radius: var(--radius-lg);
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    color: white;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background-color: var(--accent-primary);
    box-shadow: 0 4px 14px rgba(255, 56, 92, 0.3);
}

.btn-secondary {
    background-color: var(--border-color);
    color: var(--text-main);
}

.btn-destructive {
    background-color: var(--bg-color);
    color: var(--accent-primary);
    border: 2px solid var(--accent-primary);
}

/* Success Page */
.success-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    text-align: center;
    padding: 24px;
}

.success-page .emoji {
    font-size: 120px;
    margin-bottom: 24px;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-page h1 {
    font-size: 42px;
    margin-bottom: 16px;
    color: var(--text-main);
}

.success-page p {
    font-size: 20px;
    color: var(--text-muted);
    margin-bottom: 48px;
}

.error {
    color: var(--accent-primary);
    text-align: center;
    margin-bottom: 24px;
    font-weight: 600;
}

/* Live Voting Modal */
.vote-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 24px;
}

.vote-modal-overlay.active {
    display: flex;
}

.vote-modal-content {
    background: var(--card-bg);
    width: 100%;
    max-width: 450px;
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.2);
    text-align: center;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.vote-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--border-color);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vote-qr-container img {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    margin: 16px auto;
    display: block;
    box-shadow: var(--shadow-soft);
}

.vote-users-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 16px 0;
}

.vote-user-badge {
    background: var(--border-color);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}
.vote-user-badge.voted {
    background: var(--accent-green);
    color: white;
}

/* --- Live Voting Grid & Input Styles --- */
.vote-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.vote-grid-btn {
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.vote-grid-btn:hover {
    border-color: var(--border-color-hover);
}

.vote-grid-btn:active {
    transform: scale(0.95);
    background-color: var(--border-color);
}

.vote-grid-btn.abstain {
    grid-column: span 3;
    background-color: transparent;
    border: 2px dashed var(--border-color);
    color: var(--text-muted);
    font-size: 16px;
    padding: 16px 0;
    box-shadow: none;
}
.vote-grid-btn.abstain:active {
    background-color: rgba(0,0,0,0.05);
}

.huge-icon {
    font-size: 64px;
    margin-bottom: 16px;
    display: inline-block;
}

.huge-input {
    width: 100%;
    background-color: var(--card-bg) !important;
    padding: 18px 24px !important;
    border-radius: var(--radius-xl) !important;
    border: 2px solid var(--border-color) !important;
    text-align: center;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s !important;
    outline: none;
    margin-bottom: 20px !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02), var(--shadow-soft) !important;
    -webkit-appearance: none;
    appearance: none;
}

.huge-input:focus {
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 4px rgba(255, 56, 92, 0.15) !important;
}

.btn-huge {
    width: 100%;
    padding: 18px !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    border-radius: var(--radius-xl) !important;
}

/* User Vote List for Intermediate Screen */
.result-vote-list {
    text-align: left;
    margin-top: 16px;
    background: var(--bg-body);
    border-radius: var(--radius-lg);
    padding: 16px;
    max-height: 200px;
    overflow-y: auto;
}

.result-vote-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 16px;
}
.result-vote-item:last-child {
    border-bottom: none;
}
.result-vote-item strong {
    color: var(--text-main);
}

/* Lightbox Overlay */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lightbox-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lightbox-overlay.active .lightbox-img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.lightbox-close:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.lightbox-close:active {
    transform: scale(0.9);
}
/* Erklärung unter einer Bewertungskategorie (z. B. Lautstärke) */
.rating-hint {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.35;
}

/* Tabelle "Wer hat wie abgestimmt?" auf der Detailseite */
.vote-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: center;
}
.vote-table th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 6px 4px;
    border-bottom: 1px solid var(--border-color);
}
.vote-table td {
    padding: 8px 4px;
    border-bottom: 1px solid var(--border-color);
}
.vote-table tr:last-child td {
    border-bottom: none;
}
.vote-table th:first-child,
.vote-table .vote-name {
    text-align: left;
    font-weight: 600;
}
.muted {
    color: var(--text-muted);
}

/* Banner "Als App installieren" */
.install-banner {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 40px 12px 12px;
    background: var(--card-bg, #fff);
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    transform: translateY(140%);
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.1);
    max-width: 480px;
    margin: 0 auto;
}
.install-banner.visible {
    transform: translateY(0);
}
.install-banner[hidden] {
    display: none;
}
.install-banner-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    flex-shrink: 0;
}
.install-banner-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
    line-height: 1.35;
    color: var(--text-muted);
}
.install-banner-text strong {
    font-size: 15px;
    color: var(--text-main);
}
.install-banner-btn {
    width: auto !important;
    padding: 10px 14px !important;
    font-size: 14px !important;
    margin: 0 !important;
    flex-shrink: 0;
}
.install-banner-close {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    font-size: 16px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

/* Lokal erzeugter QR-Code (weißer Rand, damit er auch im Dark Mode scanbar ist) */
.vote-qr {
    display: flex;
    justify-content: center;
}
.vote-qr img,
.vote-qr canvas {
    background: #fff;
    padding: 10px;
    box-sizing: content-box;
}
.vote-qr-container .vote-qr img {
    margin: 8px auto;
}

/* Abstimmung "Wohin als Nächstes?" */
.choice-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.choice-option {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    padding: 16px 18px;
    text-align: left;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    font-family: inherit;
    font-size: 17px;
    color: var(--text-main);
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
}
.choice-option span {
    font-size: 13px;
    color: var(--text-muted);
}
.choice-option:active,
.choice-option.selected {
    transform: scale(0.98);
    border-color: var(--accent-primary);
}

/* Auswahl der Bars für "Wohin als Nächstes?" */
.choice-candidates {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 45vh;
    overflow-y: auto;
    text-align: left;
}
.choice-candidate {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
}
.choice-candidate input {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    accent-color: var(--accent-primary);
}
.choice-candidate span {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.choice-candidate small {
    font-size: 12px;
    color: var(--text-muted);
}
.choice-candidate small.open {
    color: #10b981;
}

/* Statistik */
.stat-tiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}
.stat-tile {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: var(--shadow-soft);
}
.stat-tile span {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
}
.stat-tile strong {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-main);
}
.stat-tile small {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}
.stat-bar {
    margin: 12px 0;
}
.stat-bar-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--text-main);
}
.stat-bar-head a {
    color: var(--text-main);
    text-decoration: none;
}
.stat-bar-head strong {
    white-space: nowrap;
}
.stat-bar-track {
    height: 8px;
    border-radius: 4px;
    background: var(--border-color);
    overflow: hidden;
}
.stat-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--accent-primary);
}
.install-banner-btn[hidden] {
    display: none !important;
}

/* Geburtstag (Tag + Monat) beim Beitreten */
.birthday-selects {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 8px;
}
.birthday-selects select {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border-radius: 14px;
    border: 1.5px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-main);
    font-family: inherit;
}
.person-hint {
    display: none;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-muted);
    background: rgba(10, 132, 255, 0.08);
    border-radius: 12px;
    padding: 10px 12px;
    margin: 8px 0;
    text-align: left;
}
.person-hint .chip {
    margin: 6px 4px 2px 0;
    display: inline-block;
}
.field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin: 12px 0 6px;
    text-align: left;
}

/* Abzeichen */
.badge-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}
.badge-item {
    display: flex;
    align-items: center;
    gap: 12px;
}
.badge-item div {
    display: flex;
    flex-direction: column;
}
.badge-item small {
    font-size: 13px;
    color: var(--text-muted);
}
.badge-emoji {
    font-size: 28px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border-radius: 12px;
    flex-shrink: 0;
}
.badge-inline {
    font-size: 14px;
    margin-left: 4px;
}

/* Glücksrad */
.wheel-fab {
    position: fixed;
    right: 16px;
    bottom: calc(20px + env(safe-area-inset-bottom));
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--accent-primary);
    color: #fff;
    font-size: 28px;
    box-shadow: 0 6px 20px rgba(255, 56, 92, 0.4);
    cursor: pointer;
    z-index: 900;
}
.wheel-window {
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 14px 12px;
    background: var(--bg-color);
    height: 87px; /* 2 Zeilen à 27,5px + Innenabstand + Rahmen – springt nicht bei langen Namen */
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}
.wheel-name {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-main);
    /* höchstens zwei Zeilen; die feste Höhe hat der Kasten (.wheel-window) */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}
.wheel-name.winner {
    color: var(--accent-primary);
    animation: wheel-pop 0.4s ease;
}
@keyframes wheel-pop {
    0% { transform: scale(0.8); }
    60% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

/* Admin: Anwesenheit nachtragen */
.att-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 12px 16px 40px;
}
.att-add-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.att-add-form input[type="text"] {
    padding: 12px;
    font-size: 16px;
    border-radius: 14px;
    border: 1.5px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-main);
    font-family: inherit;
}
.att-add-form .btn {
    margin: 0;
}
.att-toolbar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 4px 0 12px;
}
.att-card {
    display: grid;
    grid-template-columns: 96px 1fr;
    grid-template-areas: "img head" "people people";
    gap: 12px 14px;
    align-items: start;
}
.att-image { grid-area: img; }
.att-body { grid-area: head; }
.att-people { grid-area: people; }
.att-image img,
.att-noimage {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 12px;
    cursor: zoom-in;
    display: block;
    background: var(--bg-color);
}
.att-noimage {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    cursor: default;
}
.att-body h3 {
    margin: 0 0 2px;
    font-size: 17px;
}
.att-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 12px 0 6px;
}
.att-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.att-chip {
    border: 1.5px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-main);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    min-height: 36px;
}
.att-chip small {
    color: var(--text-muted);
    font-size: 11px;
}
.att-chip.present {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
    font-weight: 600;
}
.att-chip.locked {
    background: rgba(255, 56, 92, 0.12);
    color: var(--accent-primary);
    cursor: default;
    display: inline-flex;
    align-items: center;
}
.att-chip:disabled {
    opacity: 0.5;
}
.att-more {
    background: none;
    border: none;
    color: var(--accent-blue);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    padding: 6px 4px;
}
@media (min-width: 600px) {
    .att-card {
        grid-template-columns: 200px 1fr;
        grid-template-areas: "img head" "img people";
    }
    .att-image img,
    .att-noimage {
        width: 200px;
        height: 200px;
    }
    .att-add-form {
        grid-template-columns: 1fr 1.5fr auto;
    }
}

/* Timeline & Community */
.feed-container {
    max-width: 640px;
    margin: 0 auto;
    padding: 12px 16px 48px;
}
.feed-goal p {
    margin-top: 8px;
    font-size: 15px;
}
.feed-goal-head {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 8px;
}
.feed-event-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    border: 2px solid var(--accent-primary);
}
.feed-event-card h3 {
    margin: 0 0 2px;
}
.feed-event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--accent-primary);
    color: #fff;
    border-radius: 12px;
    padding: 8px 10px;
    min-width: 58px;
}
.feed-event-date span {
    font-size: 12px;
    text-transform: uppercase;
}
.feed-event-date strong {
    font-size: 18px;
}
.feed-rsvp {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.feed-rsvp button {
    border: 1.5px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-main);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}
.feed-rsvp button.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
    font-weight: 600;
}
.feed-admin summary {
    cursor: pointer;
    font-weight: 600;
}
.feed-event-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}
.feed-event-form input,
.feed-composer textarea {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border-radius: 12px;
    border: 1.5px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-main);
    font-family: inherit;
    box-sizing: border-box;
}
.feed-composer textarea {
    resize: vertical;
    min-height: 60px;
}
.feed-composer-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}
.feed-composer-foot .btn {
    width: auto;
    margin: 0;
    padding: 10px 18px;
}
.feed-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
    padding-bottom: 20px;
}
.feed-item[hidden] {
    display: none;
}
/* senkrechte Zeitleiste: eine durchgehende Linie hinter allen Einträgen */
#feed-list {
    position: relative;
}
#feed-list::before {
    content: '';
    position: absolute;
    left: 19px;
    top: 20px;
    bottom: 20px;
    width: 2px;
    background: var(--border-color);
}
.feed-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--card-bg);
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    z-index: 1;
}
.feed-content {
    flex: 1;
    min-width: 0;
    background: var(--card-bg);
    border-radius: 16px;
    padding: 12px 14px;
    box-shadow: var(--shadow-soft);
}
.feed-type-milestone .feed-content {
    background: linear-gradient(135deg, rgba(255, 56, 92, 0.10), rgba(255, 204, 0, 0.12));
}
.feed-type-milestone .feed-icon {
    background: var(--accent-yellow);
}
.feed-content h3 {
    margin: 0 0 4px;
    font-size: 16px;
}
.feed-content p {
    font-size: 14px;
    line-height: 1.45;
}
.feed-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.feed-text {
    white-space: normal;
    word-break: break-word;
}
.feed-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    color: var(--text-main);
    text-decoration: none;
}
.feed-bar img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
}
.feed-points {
    font-weight: 800;
    color: var(--accent-primary);
    font-size: 16px;
}
.feed-mini-ratings {
    display: grid;
    gap: 4px;
    margin: 10px 0 4px;
}
.feed-mini-ratings > div {
    display: grid;
    grid-template-columns: 72px 1fr 18px;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}
.feed-mini-ratings b {
    color: var(--text-main);
    text-align: right;
}
.feed-mini-ratings .stat-bar-track {
    height: 6px;
}
.feed-people {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}
.feed-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 10px;
}
.feed-react {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    border: 1px solid var(--border-color);
    background: transparent;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-main);
    cursor: pointer;
    min-height: 32px;
}
.feed-react span {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}
.feed-comments {
    margin-top: 10px;
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
}
.feed-comments[hidden] {
    display: none;
}
.feed-comment {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 10px;
    word-break: break-word;
}
.feed-comment-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0 0 3px 4px;
}
.feed-comment-author {
    font-weight: 700;
    font-size: 13px;
    color: var(--accent-primary);
}
.feed-comment-time {
    font-size: 11px;
    color: var(--text-muted);
}
.feed-comment-head .feed-delete {
    margin-left: auto;
}
.feed-comment-text {
    background: var(--bg-color);
    border-radius: 4px 14px 14px 14px;
    padding: 8px 12px;
    display: inline-block;
    max-width: 100%;
    box-sizing: border-box;
}
.feed-comment-form {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}
.feed-comment-form input {
    flex: 1;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1.5px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-main);
    font-size: 16px;
    font-family: inherit;
    min-width: 0;
}
.feed-comment-form button {
    border: none;
    background: var(--accent-primary);
    color: #fff;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
}
.feed-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}
.menu-new-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-primary);
    margin-left: 6px;
    vertical-align: middle;
}
.menu-new-dot[hidden] {
    display: none;
}

/* Gemeinsame Kopfzeile: Logo, Login, Menü */
.app-header {
    align-items: center;
}
.app-logo {
    color: inherit;
    text-decoration: none;
}
.app-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.app-login-btn {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: var(--radius-xl);
    border: 1.5px solid var(--border-color);
    background: var(--card-bg);
    white-space: nowrap;
}

/* Umschalter Timeline | Rangliste */
.view-switch {
    display: flex;
    gap: 4px;
    margin: 12px 16px 0;
    padding: 4px;
    background: var(--border-color);
    border-radius: 14px;
    max-width: 608px;
}
@media (min-width: 640px) {
    .view-switch {
        margin: 12px auto 0;
    }
}
.view-switch a {
    flex: 1;
    text-align: center;
    padding: 9px 8px;
    border-radius: 11px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}
.view-switch a.active {
    background: var(--card-bg);
    color: var(--text-main);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

/* Schwebender Button "Neuigkeit schreiben" */
.feed-fab {
    position: fixed;
    right: 16px;
    bottom: calc(20px + env(safe-area-inset-bottom));
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    background: var(--accent-primary);
    color: #fff;
    font-size: 26px;
    box-shadow: 0 6px 20px rgba(255, 56, 92, 0.4);
    cursor: pointer;
    z-index: 900;
    transition: bottom 0.3s, transform 0.15s;
}
.feed-fab:active {
    transform: scale(0.92);
}
body:has(.install-banner.visible) .feed-fab {
    bottom: calc(120px + env(safe-area-inset-bottom));
}

/* Glücksrad: Rad + Zeiger */
.wheel-stage {
    position: relative;
    width: min(280px, 72vw);
    margin: 4px auto 14px;
}
.wheel-stage svg {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.18));
}
.wheel-label {
    fill: #fff;
    font-weight: 700;
    font-family: inherit;
    paint-order: stroke;
    stroke: rgba(0, 0, 0, 0.25);
    stroke-width: 1.2px;
}
.wheel-pointer {
    position: absolute;
    top: -6px;
    left: 50%;
    width: 0;
    height: 0;
    border-left: 13px solid transparent;
    border-right: 13px solid transparent;
    border-top: 24px solid var(--text-main);
    transform: translateX(-50%);
    transform-origin: 50% 0;
    z-index: 2;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}
.wheel-pointer.tick {
    animation: wheel-tick 0.12s ease-out;
}
@keyframes wheel-tick {
    0% { transform: translateX(-50%) rotate(0deg); }
    40% { transform: translateX(-50%) rotate(-14deg); }
    100% { transform: translateX(-50%) rotate(0deg); }
}

/* Ansicht-Dropdown neben der Suche: Liste | Karte | Statistik */
.view-dropdown {
    position: relative;
    flex-shrink: 0;
    align-self: flex-start;
}
.view-dropdown-btn {
    height: 54px;
    width: 54px;
    justify-content: center;
    padding: 0;
    border-radius: var(--radius-xl);
    border: none;
    background-color: var(--card-bg);
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 20px;
    font-family: inherit;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
}
.view-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 1000;
    min-width: 180px;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.18);
    padding: 6px;
    display: flex;
    flex-direction: column;
}
.view-dropdown-menu[hidden] {
    display: none;
}
.view-dropdown-menu button,
.view-dropdown-menu a {
    text-align: left;
    padding: 12px 14px;
    border: none;
    border-radius: 12px;
    background: none;
    color: var(--text-main);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
}
.view-dropdown-menu .active {
    background: rgba(255, 56, 92, 0.1);
    color: var(--accent-primary);
}

/* Menü-Button in jeder Kopfzeile oben rechts */
.header-corner {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
}
.app-menu-btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 20px;
    position: relative;
}
.app-menu-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    margin: 0;
}
/* Detailseite: Teilen + Menü oben rechts auf dem Foto */
.hero-actions {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 20;
    display: flex;
    gap: 8px;
}
.hero-actions .back-btn {
    position: relative;
    top: auto;
    left: auto;
}
.app-menu-hero {
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-family: inherit;
}

/* Menü als kompakte Liste */
.app-menu {
    width: 90%;
    max-width: 400px;
    text-align: left;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
    max-height: 85vh;
    overflow-y: auto;
}
.app-menu-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}
.app-menu-head h3 {
    margin: 0;
    font-size: 20px;
}
.app-menu-head .muted {
    font-size: 12px;
}
.app-menu-section {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 12px 0 4px 4px;
}
.app-menu-list {
    display: flex;
    flex-direction: column;
}
.app-menu-list a,
.app-menu-list button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    border-radius: 12px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    width: 100%;
}
.app-menu-list [hidden] {
    display: none;
}
.app-menu-list a > span:first-child,
.app-menu-list button > span:first-child {
    width: 28px;
    text-align: center;
    font-size: 18px;
}
.app-menu-list a.active {
    background: rgba(255, 56, 92, 0.1);
    color: var(--accent-primary);
}
.app-menu-secondary {
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
    padding-top: 8px;
}
.app-menu-secondary a,
.app-menu-secondary button {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted);
}
.wtv-add-chip {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    font-weight: 600;
}

/* Fotos im Feed */
.feed-photo {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: 12px;
    margin-top: 8px;
    cursor: zoom-in;
    background: var(--bg-color);
}
.composer-preview {
    position: relative;
    margin-top: 8px;
}
.composer-preview[hidden] {
    display: none;
}
.composer-preview img {
    display: block;
    max-width: 100%;
    max-height: 220px;
    border-radius: 12px;
}
.composer-preview button {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    cursor: pointer;
}
.composer-photo-btn {
    border: 1.5px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-main);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
}

/* Hinweis für Besucher: Benachrichtigung bei neuen Bars */
.push-optin {
    margin: 0 16px 8px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 56, 92, 0.08);
    color: var(--accent-primary);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
}
.push-optin[hidden] {
    display: none;
}

/* Admin-Aktionen im Feed (z. B. "+ Neuer Termin") */
.feed-admin-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}
.feed-action-btn {
    border: 1.5px solid var(--accent-primary);
    background: rgba(255, 56, 92, 0.08);
    color: var(--accent-primary);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

/* Großansicht: Wischen nach unten schließt (siehe partials/head.php); Seite dahinter scrollt nicht mit */
.lightbox-overlay.active:has(.lightbox-img) {
    touch-action: pinch-zoom;
}
.feed-event-form textarea,
.feed-event-form select {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border-radius: 12px;
    border: 1.5px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-main);
    font-family: inherit;
    box-sizing: border-box;
}

/* Serie (Bars in Folge) auf "Meine Bar-Tour" */
.streak-card {
    background: linear-gradient(135deg, rgba(255, 56, 92, 0.12), rgba(255, 184, 0, 0.14));
}
.streak-main {
    display: flex;
    align-items: center;
    gap: 14px;
}
.streak-flame {
    font-size: 40px;
    line-height: 1;
}
.streak-main strong {
    display: block;
    font-size: 22px;
    font-weight: 800;
}
.streak-main small {
    color: var(--text-muted);
    font-size: 13px;
}

/* Ergebnis nach der Live-Abstimmung (Moderator + Handys) */
.poll-result {
    margin: 8px 0 20px;
}
.poll-result-total {
    font-size: 64px;
    font-weight: 800;
    color: var(--accent-primary);
    line-height: 1.1;
}
.poll-result-total span {
    font-size: 26px;
    color: var(--text-muted);
}
.poll-result-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 16px 0;
}
.poll-result-meta div {
    background: var(--bg-color);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
}
.poll-result-meta strong {
    font-size: 20px;
}
.poll-result-meta small {
    color: var(--text-muted);
    font-size: 13px;
}
.poll-section {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 18px 0 8px;
}
.poll-achievements {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}
.poll-achievement {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--bg-color);
    font-size: 15px;
}
.poll-achievement > span {
    font-size: 22px;
}
.poll-achievement.group,
.poll-achievement.mine {
    background: linear-gradient(135deg, rgba(255, 56, 92, 0.12), rgba(255, 184, 0, 0.14));
    font-weight: 600;
}
.poll-streak {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 56, 92, 0.12), rgba(255, 184, 0, 0.14));
}
.poll-streak-flame {
    font-size: 40px;
}
.poll-streak strong {
    display: block;
    font-size: 22px;
}
.poll-streak small {
    color: var(--text-muted);
}

/* Hinweis "neue Einträge" nach automatischem Nachladen */
.feed-toast {
    position: fixed;
    top: 90px;
    left: 50%;
    transform: translate(-50%, -20px);
    opacity: 0;
    pointer-events: none;
    z-index: 950;
    border: none;
    border-radius: 999px;
    padding: 9px 16px;
    background: var(--accent-primary);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    font-family: inherit;
    box-shadow: 0 6px 18px rgba(255, 56, 92, 0.35);
    transition: opacity 0.25s, transform 0.25s;
    cursor: pointer;
}
.feed-toast.visible {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
}

/* Reaktionen: nur gegebene + "Reagieren"-Button mit Emoji-Auswahl */
.feed-add-actions {
    display: inline-flex;
    gap: 10px;
    margin-left: auto;
}
/* Herz (Reaktion hinzufügen) und Sprechblase (Kommentar hinzufügen): graue Fläche + kleines Plus */
.feed-add-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    /* Nur Rahmen, kein Hintergrund – im Dark Mode automatisch hell */
    border: 1.5px solid var(--text-muted);
    background: transparent;
    border-radius: 999px;
    padding: 4px 11px;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    min-height: 32px;
    transition: transform 0.15s;
}
.feed-add-btn:active {
    transform: scale(0.9);
}
.feed-add-btn::after {
    content: '';
    position: absolute;
    top: -6px;
    right: -6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    /* Kreis in der Rahmenfarbe, Plus invertiert – aus zwei Balken gezeichnet, damit es exakt mittig sitzt */
    background:
        linear-gradient(var(--card-bg), var(--card-bg)) center / 8px 2px no-repeat,
        linear-gradient(var(--card-bg), var(--card-bg)) center / 2px 8px no-repeat,
        var(--text-muted);
}
/* Eigene Reaktion: gewähltes Emoji im Rahmen, Haken statt Plus (Akzentfarbe) */
.feed-add-btn.reacted {
    border-color: var(--accent-primary);
}
.feed-add-btn.reacted::after {
    background: var(--accent-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.3l2.3 2.3 4.7-4.9' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
}
.feed-react.pop {
    animation: react-pop 0.3s ease;
}
@keyframes react-pop {
    0% { transform: scale(0.7); }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); }
}
.reaction-picker {
    position: absolute;
    z-index: 1500;
    display: flex;
    gap: 2px;
    padding: 6px 8px;
    background: var(--card-bg);
    border-radius: 999px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
}
.reaction-picker[hidden] {
    display: none;
}
.reaction-picker button {
    border: none;
    background: none;
    font-size: 26px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s, background-color 0.15s;
}
.reaction-picker button:active,
.reaction-picker button:hover {
    transform: scale(1.25);
    background: var(--bg-color);
}
/* Vorhandene Reaktionen als klare Kästchen (auch auf den farbigen Meilenstein-Karten gut sichtbar) */
.feed-react:not(.feed-add-btn) {
    background: var(--card-bg);
}
/* Wer hat reagiert? (Popup beim Antippen einer Reaktion) */
.reaction-who {
    position: absolute;
    z-index: 1500;
    max-width: min(320px, calc(100vw - 16px));
    padding: 8px 12px;
    background: var(--card-bg);
    color: var(--text-main);
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    line-height: 1.35;
}
.reaction-who[hidden] {
    display: none;
}
.reaction-who-row {
    display: flex;
    gap: 8px;
    align-items: baseline;
    padding: 4px 0;
}
.reaction-who-row + .reaction-who-row {
    border-top: 1px solid var(--border-color);
}
.reaction-who-emoji {
    font-size: 18px;
    flex-shrink: 0;
}
/* Eigene Reaktion in der Emoji-Auswahl markieren (eine Reaktion pro Person) */
.reaction-picker button.selected {
    background: rgba(255, 56, 92, 0.15);
    box-shadow: inset 0 0 0 2px var(--accent-primary);
}

/* Kommentar-Like: kleines Herz neben der Sprechblase */
.feed-comment-body {
    display: flex;
    align-items: center;
    gap: 6px;
}
.comment-like {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    border: none;
    background: none;
    padding: 2px 4px;
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
}
.comment-like b {
    font-size: 12px;
    font-weight: normal;
}
.comment-like span {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}
.comment-like.mine span {
    color: var(--accent-primary);
}
.comment-like.pop b {
    display: inline-block;
    animation: react-pop 0.3s ease;
}
/* Eintrag, zu dem eine Benachrichtigung geführt hat, kurz hervorheben */
.feed-highlight .feed-content {
    animation: feed-highlight 2.2s ease;
}
@keyframes feed-highlight {
    0%, 40% { box-shadow: 0 0 0 3px var(--accent-primary); }
    100% { box-shadow: var(--shadow-soft); }
}

/* Doppeltippen auf Kommentar = Like */
.feed-comment-text {
    position: relative;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
.like-burst {
    position: absolute;
    left: 50%;
    top: 50%;
    font-size: 30px;
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
    animation: like-burst 0.8s ease forwards;
}
@keyframes like-burst {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    35% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
    60% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -90%) scale(1); opacity: 0; }
}

/* Ziehen zum Aktualisieren (nur in der installierten App) */
/* Installierte App: kein Nachfedern am Seitenrand – sonst bewegen sich feste Elemente (Stift-Button)
   beim Ziehen mit; Aktualisieren übernimmt die eigene Anzeige (.ptr-indicator) */
html.standalone,
html.standalone body {
    overscroll-behavior: none;
}
@media (display-mode: standalone) {
    html,
    body {
        overscroll-behavior: none;
    }
}
.ptr-indicator {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 10px);
    left: 50%;
    transform: translate(-50%, 0);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-bg);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    color: var(--text-muted);
    font-size: 20px;
    font-weight: 700;
}
.ptr-indicator span {
    display: inline-block;
    transition: transform 0.15s;
}
.ptr-indicator.ready {
    color: var(--accent-primary);
}
.ptr-indicator.loading span {
    width: 18px;
    height: 18px;
    border: 2.5px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    font-size: 0;
    animation: ptr-spin 0.7s linear infinite;
}
@keyframes ptr-spin {
    to { transform: rotate(360deg); }
}

/* @Erwähnungen in Kommentaren */
.mention {
    color: var(--accent-primary);
    font-weight: 700;
}
.mention-suggest {
    position: absolute;
    z-index: 1600;
    display: flex;
    flex-direction: column;
    padding: 4px;
    background: var(--card-bg);
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}
.mention-suggest[hidden] {
    display: none;
}
.mention-suggest button {
    border: none;
    background: none;
    text-align: left;
    padding: 10px 12px;
    border-radius: 10px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
}
.mention-suggest button:first-child {
    background: var(--bg-color);
}

/* Saison-Rückblick im Feed */
.recap-feed-card {
    margin-top: 6px;
    padding: 18px 16px;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(140deg, #ff385c 0%, #7b2ff7 100%);
}
.recap-feed-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.9;
}
.recap-feed-card h3 {
    color: #fff;
    font-size: 22px;
    margin: 4px 0;
}
.recap-feed-card p {
    margin: 0;
    opacity: 0.92;
    font-size: 14px;
}
.recap-feed-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.recap-feed-actions a,
.recap-feed-actions button {
    padding: 8px 14px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.recap-feed-actions .recap-feed-play {
    background: #fff;
    color: #be123c;
}

/* Hinweis zu @Erwähnungen: nur sichtbar, solange man im Kommentarfeld ist */
.comment-hint {
    display: none;
    margin: 6px 4px 0;
    font-size: 12px;
    color: var(--text-muted);
}
.feed-comment-form:focus-within + .comment-hint {
    display: block;
}

/* Bar anlegen: neue Person bei "Wer war noch dabei?" */
.att-chip[hidden] {
    display: none;
}
.att-new-person {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}
.att-new-person input[type="text"] {
    flex: 1 1 140px;
    margin: 0;
}
.att-new-person .birthday-selects {
    flex: 1 1 160px;
    margin: 0;
}
.att-new-person .btn {
    flex: 0 0 auto;
    width: auto;
    margin: 0;
    padding: 10px 14px;
}

/* ===== Live-Abstimmung: wer hat abgestimmt, wer fehlt noch ===== */
.voter-status {
    margin: 4px 0 20px;
}
.voter-status.compact {
    margin-top: 8px;
}
.voter-status.compact .voter-group small,
.voter-status.compact .voter-track {
    display: none;
}
.voter-progress {
    margin: 0 0 8px;
    font-size: 15px;
    color: var(--text-muted);
}
.voter-progress b {
    color: var(--text-main);
    font-size: 18px;
}
.voter-track {
    height: 8px;
    max-width: 260px;
    margin: 0 auto 14px;
    border-radius: 999px;
    background: var(--border-color);
    overflow: hidden;
}
.voter-track i {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--accent-green);
    transition: width 0.6s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.voter-group {
    margin-bottom: 10px;
}
.voter-group small {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.voter-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}
.voter-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
}
.voter-pill.done {
    background: var(--accent-green);
    color: #fff;
}
.voter-pill.open {
    background: transparent;
    border: 1.5px dashed var(--text-muted);
    color: var(--text-muted);
}
/* "tippt …"-Pünktchen bei denen, die noch fehlen */
.voter-pill.open i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    animation: voter-dots 1.2s ease-in-out infinite;
}
.voter-pill.open i:first-of-type { margin-left: 3px; }
.voter-pill.open i:nth-of-type(2) { animation-delay: 0.2s; }
.voter-pill.open i:nth-of-type(3) { animation-delay: 0.4s; }
@keyframes voter-dots {
    0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}
/* Gerade abgestimmt: ploppt auf und leuchtet kurz */
.voter-pill.pop {
    animation: voter-pop 0.7s cubic-bezier(0.3, 1.6, 0.5, 1);
}
@keyframes voter-pop {
    0% { transform: scale(0.2); opacity: 0; box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.7); }
    60% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); box-shadow: 0 0 0 14px rgba(52, 199, 89, 0); }
}

/* ===== Punkte auswürfeln ===== */
.result-score {
    font-size: 80px;
    font-weight: 800;
    color: var(--accent-primary);
    margin: 20px 0;
    font-variant-numeric: tabular-nums;
}
.rolling {
    opacity: 0.55;
    filter: blur(0.6px);
}
.landed {
    animation: score-land 0.6s cubic-bezier(0.3, 1.7, 0.5, 1);
}
@keyframes score-land {
    0% { transform: scale(1.7); }
    100% { transform: scale(1); }
}
.reveal-item {
    opacity: 0;
    animation: reveal-item 0.45s ease forwards;
    animation-delay: calc(1.6s + var(--i, 0) * 0.12s);
}
@keyframes reveal-item {
    from { opacity: 0; transform: translateX(-16px); }
    to { opacity: 1; transform: none; }
}

/* Gesamtergebnis: erst "Wird ausgewertet …", dann Zahl, dann Platz & Erfolge */
.poll-evaluating {
    display: none;
    margin: 0 0 4px;
    font-weight: 700;
    color: var(--text-muted);
    animation: evaluating-pulse 1s ease-in-out infinite;
}
.poll-result.evaluating .poll-evaluating {
    display: block;
}
@keyframes evaluating-pulse {
    50% { opacity: 0.4; }
}
.poll-result-total {
    position: relative;
    font-variant-numeric: tabular-nums;
}
.poll-result-total b {
    display: inline-block;
    font-weight: 800;
}
.poll-result .poll-result-meta,
.poll-result .poll-achievements {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.poll-result.revealed .poll-result-meta {
    opacity: 1;
    transform: none;
    transition-delay: 0.3s;
}
.poll-result.revealed .poll-achievements {
    opacity: 1;
    transform: none;
    transition-delay: 0.7s;
}
.poll-confetti {
    position: absolute;
    left: 50%;
    top: 50%;
    pointer-events: none;
}
.poll-confetti span {
    position: absolute;
    font-size: 20px;
    animation: confetti-fly 1.4s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}
@keyframes confetti-fly {
    0% { transform: rotate(var(--a)) translateY(0) scale(0.4); opacity: 1; }
    100% { transform: rotate(var(--a)) translateY(calc(var(--d) * -1.6)) scale(1); opacity: 0; }
}
.att-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-color);
    color: var(--text-main);
    font: inherit;
    font-size: 16px;
    -webkit-appearance: none;
    appearance: none;
}
.att-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}
/* Persönliches beim Moderator erst nach dem Auswerten zeigen */
.poll-result ~ div {
    transition: opacity 0.5s ease 0.9s;
}
.poll-result:not(.revealed) ~ div {
    opacity: 0;
}

/* Termine: Bar-Abstimmung & Kalender */
.hours-open { color: #10b981 !important; }
.hours-closes_early, .hours-opens_later { color: #f59e0b !important; }
.hours-closed { color: #ef4444 !important; }
.hours-unknown { color: var(--text-muted) !important; }
.event-candidates {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 38vh;
    overflow-y: auto;
}
.event-candidates .choice-candidate { padding: 8px 10px; }
.event-vote {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}
.event-vote-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 8px;
}
.event-vote-head .muted { font-size: 12px; }
.event-vote-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.event-vote.closed .event-vote-options { margin-top: 10px; opacity: 0.6; }
.event-vote-row {
    display: flex;
    gap: 6px;
}
.event-vote-option {
    position: relative;
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1px 8px;
    text-align: left;
    padding: 9px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    overflow: hidden;
    isolation: isolate;
    transition: border-color 0.2s, transform 0.15s;
}
/* Balken hinter dem Text: Anteil an der führenden Bar */
.event-vote-option::before {
    content: "";
    position: absolute;
    inset: 0;
    width: var(--share, 0%);
    background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
    z-index: -1;
    transition: width 0.5s ease;
}
.event-vote-option:active:not(:disabled) { transform: scale(0.98); }
.event-vote-option.mine {
    border-color: var(--accent-primary);
    font-weight: 600;
}
.event-vote-option.leading .event-vote-count::after { content: " 👑"; }
.event-vote-option.pending { opacity: 0.6; }
.event-vote-option:disabled { cursor: default; }
.event-vote-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-vote-count { font-weight: 700; }
.event-vote-option small {
    grid-column: 1 / -1;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
}
.event-vote-pick {
    border: 1.5px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 12px;
    padding: 0 10px;
    cursor: pointer;
    font-size: 16px;
}
.event-vote-winner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 12px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent-primary) 16%, transparent), color-mix(in srgb, var(--accent-yellow) 22%, transparent));
}
.event-vote-winner span { font-size: 13px; color: var(--text-muted); }
.event-vote-winner strong { font-size: 20px; line-height: 1.2; }
.event-vote-winner small { font-size: 12px; }
.event-vote-winner a { font-size: 13px; font-weight: 600; margin-top: 4px; color: var(--accent-primary); text-decoration: none; }
.event-vote-admin {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-top: 8px;
    font-size: 12px;
}
.event-vote-admin button {
    border: none;
    background: var(--accent-primary);
    color: #fff;
    border-radius: 999px;
    padding: 7px 12px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.event-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin-top: 12px;
}
.event-actions .feed-delete { margin: 0; }
.event-cal-btn {
    display: inline-block;
    border: 1.5px solid var(--border-color);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
}
.event-cal-menu {
    display: flex;
    flex-direction: column;
    width: 100%;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}
.event-cal-menu a {
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text-main);
    text-decoration: none;
}
.event-cal-menu a + a { border-top: 1px solid var(--border-color); }
.feed-event-card { flex-wrap: wrap; }
.feed-event-card > .event-vote,
.feed-event-card > .event-actions { flex-basis: 100%; }
.feed-event-card > .event-vote { margin-top: 0; }
.event-candidates .choice-candidate input[type=checkbox] {
    width: 20px;
    padding: 0;
}
.event-vote-map {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

/* Admin: Nutzer & Geräte */
.user-card { padding: 14px 16px; margin-bottom: 10px; }
.user-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.user-card-head strong { font-size: 16px; margin-right: 2px; }
.user-last { margin-left: auto; font-size: 12px; }
.user-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--bg-color);
    color: var(--text-muted);
}
.user-badge.role-2 { background: color-mix(in srgb, var(--accent-primary) 14%, transparent); color: var(--accent-primary); }
.user-badge.is-app { background: color-mix(in srgb, #10b981 16%, transparent); color: #059669; }
.user-badge.is-push { background: color-mix(in srgb, var(--accent-blue) 14%, transparent); color: var(--accent-blue); }
.user-devices {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    font-size: 12px;
    color: var(--text-muted);
}
.user-devices li + li { margin-top: 2px; }
.user-never { display: flex; flex-wrap: wrap; gap: 6px; }
.user-never span {
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1.5px solid var(--border-color);
}
.user-never small { color: var(--text-muted); font-weight: 600; }

/* Dunkler Modus: ☰ ohne Kasten, dafür größer */
@media (prefers-color-scheme: dark) {
    .app-menu-btn,
    .app-menu-btn:active {
        background: none;
        padding: 2px 4px;
        font-size: 30px;
        line-height: 1;
        color: var(--text-main);
    }
    .app-menu-btn .app-menu-dot {
        top: 0;
        right: -2px;
    }
}

/* Admin: Umschalter Admin-/Teilnehmer-Ansicht im Menü */
.view-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    margin: 4px 0 8px;
    border-radius: 999px;
    background: var(--bg-color);
    font-size: 13px;
}
.view-toggle > span {
    padding: 0 8px 0 10px;
    color: var(--text-muted);
    font-weight: 600;
}
.view-toggle a {
    flex: 1;
    text-align: center;
    padding: 8px 6px;
    border-radius: 999px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
}
.view-toggle a.active {
    background: var(--accent-primary);
    color: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
.view-toggle-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin: -2px 4px 8px;
}
.app-menu-view-badge {
    position: absolute;
    bottom: -4px;
    left: -6px;
    font-size: 12px;
    line-height: 1;
}
