*, *::before, *::after {
    box-sizing: border-box;
}

/* Visuell unsichtbar, aber von Screenreadern vorgelesen - NICHT
   display:none/visibility:hidden verwenden, das wuerde auch Screenreader
   ausschliessen. Fuer <label>s zu Formularfeldern, die nur einen
   Placeholder haben (siehe index.html). */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:root {
    /* Bottom-UI-Geometrie: einzige Quelle fuer #action-bar UND die runden
       Buttons (#leaderboard-btn/#menu-btn/#locate-btn) - verhindert, dass
       beide Bereiche unabhaengig auseinanderlaufen und sich ueberlappen
       (frueherer Bugfix: der runde-Button-Abstand war fest auf die Hoehe
       eines einzelnen Buttons geschaetzt, #action-bar besteht aber aus ZWEI
       gestapelten Buttons - siehe --action-bar-height unten). */
    --claim-btn-min-height: 52px;               /* siehe min-height an #claim-btn/#visit-btn */
    --action-bar-btn-gap: 10px;                  /* siehe gap an #action-bar */
    --action-bar-bottom: 20px;                   /* Basisabstand #action-bar <-> Bildschirmrand */
    --action-bar-height: calc(2 * var(--claim-btn-min-height) + var(--action-bar-btn-gap));
    --action-bar-clearance: 16px;                /* Mindestabstand runde Buttons <-> #action-bar */
    --round-btn-size: 48px;
    --round-btn-gap: 10px;                       /* vertikaler Abstand der runden Buttons im Stapel */
    /* Basis-bottom der untersten runden Button-Reihe (leaderboard/locate) -
       liegt dadurch automatisch oberhalb von #action-bar inkl. Puffer. */
    --round-btn-base-bottom: calc(var(--action-bar-bottom) + var(--action-bar-height) + var(--action-bar-clearance));
}

/* Schmale/kurze Viewports (z.B. iPhone SE 375x667, kleine Android-Geraete):
   Standardpuffer reicht dort nicht immer (weniger Reserve nach oben,
   Systemleisten nehmen mehr relativen Platz weg) - Clearance vergroessern.
   Wirkt automatisch auf #action-bar-Abstand UND runde Buttons, da beide
   von --action-bar-clearance abgeleitet sind. */
@media (max-width: 400px), (max-height: 700px) {
    :root {
        --action-bar-clearance: 24px;
    }
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

#map {
    height: 100%;
    width: 100%;
    z-index: 1;
}

/* Top HUD */
#hud {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 8px 10px;
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    text-align: center;
    width: calc(100% - 24px);
    max-width: 440px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    gap: 2px;
}

.hud-item {
    text-align: center;
    flex: 1;
}

.hud-title {
    margin: 0;
    font-size: 8px;
    color: #8e8e93;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.hud-value {
    margin: 2px 0 0 0;
    font-size: 11px;
    font-weight: 700;
    color: #1c1c1e;
    white-space: nowrap;
}

.hud-value-sub {
    margin: 1px 0 0 0;
    font-size: 8px;
    font-weight: 600;
    color: #8e8e93;
    white-space: nowrap;
}

/* Bottom UI: Claim Button */
#action-bar {
    position: absolute;
    bottom: calc(var(--action-bar-bottom) + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: calc(100% - 32px);
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: var(--action-bar-btn-gap);
}

#claim-btn, #visit-btn {
    width: 100%;
    padding: 16px;
    min-height: var(--claim-btn-min-height);
    font-size: 15px;
    font-weight: 700;
    color: white;
    border: none;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.18);
    cursor: pointer;
    transition: transform 0.1s ease, background 0.2s ease;
}

#claim-btn {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

#visit-btn {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

#claim-btn:active:not(:disabled), #visit-btn:active:not(:disabled) {
    transform: scale(0.96);
}

#claim-btn:disabled, #visit-btn:disabled {
    background: #bdc3c7;
    box-shadow: none;
    cursor: not-allowed;
}

/* Modal / Dialog Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

.modal-card {
    background: white;
    padding: 24px 20px;
    border-radius: 22px;
    width: 100%;
    max-width: 320px;
    box-shadow: 0 12px 35px rgba(0,0,0,0.25);
    text-align: center;
}

.modal-card h3 {
    margin-top: 0;
    color: #2c3e50;
}

.modal-card p {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 18px;
}

.modal-card input {
    width: 100%;
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid #e5e5ea;
    background: #f2f2f7;
    border-radius: 12px;
    box-sizing: border-box;
    font-size: 15px;
    outline: none;
}

.modal-card button {
    width: 100%;
    padding: 14px;
    margin-top: 6px;
    border: none;
    border-radius: 12px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
}

.modal-card button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary { background: #3498db; color: white; }
.btn-secondary { background: #e5e5ea; color: #1c1c1e; }
.btn-danger { background: #e74c3c; color: white; }
.btn-close { background: transparent; color: #8e8e93; margin-top: 8px; }

/* Dezente Text-Links im Einstellungen-Modal (Nutzungsbedingungen-,
   Datenschutz- + Impressum-Seite, js/menu.js) - bewusst kleiner/
   unauffaelliger als die Standard-Modal-Buttons, analog zu den Rechts-Links
   auf dem Startbildschirm. */
#settings-impressum-link,
#settings-datenschutz-link,
#settings-agb-link {
    font-size: 12px;
    color: #8e8e93;
    text-decoration: underline;
    cursor: pointer;
    margin: 0 0 14px;
}
#settings-datenschutz-link,
#settings-agb-link { margin-bottom: 6px; }

/* Trennt die Rechts-Links vom Gefahrenbereich (Konto loeschen) im
   Einstellungen-Modal. */
.settings-divider {
    margin: 16px 0 10px;
    border: none;
    border-top: 1px solid #e5e5ea;
}

/* Dezente Kontur um zusammenhaengende Spieler-Gebiete (siehe map.js,
   borderColorFor()) - laeuft ueber einen eigenen SVG-Renderer, da die Karte
   sonst preferCanvas:true nutzt (Canvas-Layer haben keine DOM-Knoten, CSS
   koennte dort nicht greifen). Bewusst schwacher Schatten (statt dickem
   Rahmen) - Option A aus dem A/B-Vergleich, hebt zusammenhaengende Gebiete
   nur leicht ab, ohne wie ein Rahmen zu wirken. */
.territory-outline {
    filter: drop-shadow(0px 0px 2px rgba(0,0,0,0.35));
}

/* Glow-Rand der Zelle, auf der der Spieler gerade physisch steht
   (state.userCellPolygon, js/gps.js) - laeuft aus demselben Grund wie
   .territory-outline ueber einen eigenen SVG-Renderer (eigenes Pane
   "currentCellPane", siehe map.js) statt Canvas. Zwei gestapelte
   drop-shadows (eng + weich) statt hartem schwarzem Rand: dezenter, aber
   klar erkennbarer Leucht-Effekt statt scharfer Kontur. */
.current-cell-glow {
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.648))
            drop-shadow(0 0 7px rgba(150, 240, 255, 0.432));
}

/* Runde Aktions-Buttons auf der Karte: Rangliste (links), Menue (mittig,
   ueber dem Besichtigen-Button), Standort (rechts) - identischer Kreis-
   Look, individuelle Position pro Button. */
#leaderboard-btn, #menu-btn, #locate-btn {
    position: absolute;
    z-index: 1000;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform 0.1s ease;
}
#leaderboard-btn {
    left: 16px;
    bottom: calc(var(--round-btn-base-bottom) + env(safe-area-inset-bottom, 0px));
}
/* Mittig ueber #action-bar verankert (die selbst zentriert ist) - landet
   dadurch automatisch direkt ueber dem "Besichtigen"-Button. Gleiche Reihe
   wie leaderboard/locate, kein eigener Stapel mehr. */
#menu-btn {
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--round-btn-base-bottom) + env(safe-area-inset-bottom, 0px));
    font-weight: 800;
    color: #2c3e50;
}
#locate-btn {
    right: 16px;
    bottom: calc(var(--round-btn-base-bottom) + env(safe-area-inset-bottom, 0px));
}
#leaderboard-btn:active, #locate-btn:active { transform: scale(0.94); }
/* Basis-Transform (Zentrierung) muss bei :active erhalten bleiben, sonst
   springt der Button beim Klick aus der Mitte. */
#menu-btn:active { transform: translateX(-50%) scale(0.94); }
#lang-list button { width: 100%; margin-bottom: 8px; }

/* Menue-Popup: kompaktes, an #menu-btn verankertes Popup (kein volles
   modal-overlay wie .modal-card) fuer Profil/Level/Sprache/Einstellungen.
   #menu-btn sitzt jetzt in Reihe 1 (mittig), Popup daher eine Reihe
   darueber (Reihe 2) und ebenfalls horizontal zentriert. */
#menu-popup {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--round-btn-base-bottom) + var(--round-btn-size) + var(--round-btn-gap) + env(safe-area-inset-bottom, 0px));
    z-index: 1001;
    display: none;
    flex-direction: column;
    min-width: 180px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 6px;
}
#menu-popup button {
    background: transparent;
    border: none;
    text-align: left;
    padding: 11px 12px;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    border-radius: 10px;
    white-space: nowrap;
}
#menu-popup button:active { background: rgba(0,0,0,0.08); }
.menu-popup-divider { height: 1px; background: rgba(0,0,0,0.1); margin: 4px 6px; }

/* Levelsystem: Vorteile-Liste im Level-Modal + Level-Uebersicht-Modal */
#level-modal-benefits-title {
    font-size: 12px;
    font-weight: 700;
    color: #2c3e50;
    text-align: left;
    margin: 4px 0 6px 0;
}
#level-modal-benefits {
    text-align: left;
    font-size: 13px;
    color: #27ae60;
    margin-bottom: 14px;
}
#level-modal-benefits div { margin-bottom: 3px; }

#level-overview-card {
    max-width: 360px;
    text-align: left;
    max-height: 88vh;
    overflow-y: auto;
}
#level-overview-list { margin: 4px 0 14px 0; }
.level-row {
    padding: 10px 6px;
    border-bottom: 1px solid #f0f0f3;
}
.level-row.level-row-current {
    background: #eafaf1;
    border-radius: 10px;
    border-bottom: 1px solid transparent;
}
.level-row-head {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    color: #1c1c1e;
    font-size: 14px;
}
.level-row-cost { color: #e67e22; }
.level-row-req { font-size: 12px; color: #7f8c8d; margin-top: 2px; }
.level-row-benefit { font-size: 12px; color: #27ae60; margin-top: 2px; }

/* Levelsystem: Name in Gold ab Level 5 */
.name-gold {
    color: #b8860b !important;
    font-weight: 800;
}

/* Levelsystem: Kreis-Badge mit Levelzahl hinter dem Namen in den Ranglisten */
.lb-level-badge {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e5e5ea;
    color: #48484a;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lb-level-badge-gold {
    background: #b8860b;
    color: #fff;
}

/* ===================== CHAT (js/chat.js) ===================== */
/* Gleiche Kartenbreite wie die Rangliste. Die Karte selbst scrollt NICHT
   (kein overflow-y wie bei #leaderboard-card): das Eingabefeld und der
   Schliessen-Button sollen immer sichtbar bleiben, gescrollt wird nur die
   Nachrichtenliste darin. */
#chat-card {
    max-width: 360px;
    text-align: left;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}
#chat-card h3 { text-align: center; }

/* Hinweis, dass der Channel oeffentlich ist - dezent, aber dauerhaft
   sichtbar (siehe datenschutz.html). */
#chat-notice {
    text-align: center;
    font-size: 11px;
    line-height: 1.35;
    color: #8e8e93;
    margin: -4px 0 10px 0;
}

#chat-list {
    flex: 1;
    min-height: 120px;
    max-height: 50vh;
    overflow-y: auto;
    /* Verhindert, dass ein einzelnes langes Wort ohne Leerzeichen die
       Kartenbreite sprengt - Chat-Text ist beliebiger Nutzer-Input. */
    overflow-wrap: anywhere;
    margin-bottom: 10px;
}

.chat-empty {
    color: #8e8e93;
    font-size: 13px;
    text-align: center;
    padding: 20px 0;
}

.chat-row {
    padding: 8px 6px;
    border-bottom: 1px solid #f0f0f3;
    font-size: 14px;
}
.chat-row.chat-me {
    background: #eafaf1;
    border-radius: 10px;
    border-bottom: 1px solid transparent;
}
.chat-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}
.chat-name {
    font-weight: 700;
    font-size: 13px;
    color: #1c1c1e;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 45%;
}
.chat-time {
    margin-left: auto;
    font-size: 11px;
    color: #8e8e93;
    flex-shrink: 0;
}
.chat-text {
    color: #2c3e50;
    line-height: 1.35;
}

/* Eingabezeile: Feld + Button nebeneinander. Ueberschreibt bewusst die
   generischen .modal-card input/button-Regeln (width: 100%), die sonst beide
   untereinander stellen wuerden. */
#chat-form {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
#chat-form input {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}
#chat-form button {
    width: auto;
    flex-shrink: 0;
    margin-top: 0;
    padding: 14px 16px;
}

#chat-error {
    color: #e74c3c;
    font-size: 12px;
    margin-bottom: 8px;
    text-align: center;
}

#leaderboard-card {
    max-width: 360px;
    text-align: left;
    max-height: 88vh;
    overflow-y: auto;
}
#leaderboard-card h3:not(:first-child) {
    margin-top: 4px;
    border-top: 1px solid #f0f0f3;
    padding-top: 14px;
}
/* Hinweis auf den Aktualisierungs-Takt der Ranglisten (stuendlich, siehe
   leaderboardsRebuild). Bewusst dezent: erklaerender Nebensatz, kein
   Warnhinweis. */
#leaderboard-update-hint {
    text-align: center;
    font-size: 11px;
    line-height: 1.35;
    color: #8e8e93;
    margin: -4px 0 12px 0;
}
/* Warnzustand: die Rangliste ist deutlich aelter als der stuendliche Takt,
   der Rebuild-Job haengt also vermutlich (siehe STALE_AFTER_MS in
   js/leaderboard.js). Bewusst Orange statt Rot und ohne Kasten - es ist ein
   Hinweis, kein Fehler, und die angezeigten Daten stimmen ja, sie sind nur alt. */
#leaderboard-update-hint.lb-hint-stale {
    color: #e67e22;
    font-weight: 600;
}
#leaderboard-list, #leaderboard-visited-list {
    max-height: 26vh;
    overflow-y: auto;
    margin: 4px 0 14px 0;
}
.lb-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 6px;
    border-bottom: 1px solid #f0f0f3;
    font-size: 14px;
}
.lb-row.lb-me {
    background: #eafaf1;
    border-radius: 10px;
    border-bottom: 1px solid transparent;
    font-weight: 700;
}
.lb-rank {
    width: 30px;
    text-align: center;
    font-weight: 700;
    color: #6c6c70;
    flex-shrink: 0;
}
.lb-name-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.lb-name {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #1c1c1e;
}
.lb-count {
    font-weight: 700;
    color: #27ae60;
    flex-shrink: 0;
}
.lb-sep {
    text-align: center;
    color: #c7c7cc;
    padding: 4px 0;
}

/* Startseite / Landing-Overlay */
/* Hintergrund: diagonale Kueste (Meer/Land), feines Laengen-/Breitengrad-Raster
   und ein angedeuteter Stadtblock von oben (graue Gebaeude, Strassenraster,
   ein kleiner Platz) - alles als ein SVG-Data-URI, damit kein zusaetzlicher
   Asset-Request noetig ist. */
#start-screen {
    position: fixed;
    inset: 0;
    z-index: 1500;
    background-image:
        repeating-linear-gradient(90deg, rgba(255,255,255,0.09) 0px, rgba(255,255,255,0.09) 1px, transparent 1px, transparent 20px),
        repeating-linear-gradient(0deg, rgba(255,255,255,0.09) 0px, rgba(255,255,255,0.09) 1px, transparent 1px, transparent 20px),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 400' preserveAspectRatio='none'%3E%3Crect width='240' height='400' fill='%232980b9'/%3E%3Cpolygon points='240,0 240,400 0,400 0,140' fill='%2327ae60'/%3E%3Cg stroke='rgba(255,255,255,0.75)' stroke-width='3'%3E%3Cline x1='30' y1='210' x2='230' y2='210'/%3E%3Cline x1='30' y1='260' x2='230' y2='260'/%3E%3Cline x1='30' y1='310' x2='230' y2='310'/%3E%3Cline x1='30' y1='360' x2='230' y2='360'/%3E%3Cline x1='30' y1='210' x2='30' y2='360'/%3E%3Cline x1='80' y1='210' x2='80' y2='360'/%3E%3Cline x1='130' y1='210' x2='130' y2='360'/%3E%3Cline x1='180' y1='210' x2='180' y2='360'/%3E%3Cline x1='230' y1='210' x2='230' y2='360'/%3E%3C/g%3E%3Cg fill='%238e8e93' stroke='%236c6c70' stroke-width='1'%3E%3Crect x='36' y='216' width='38' height='38'/%3E%3Crect x='86' y='216' width='17' height='38'/%3E%3Crect x='107' y='216' width='17' height='38'/%3E%3Crect x='136' y='218' width='38' height='30'/%3E%3Crect x='186' y='220' width='38' height='34'/%3E%3Crect x='36' y='266' width='38' height='38'/%3E%3Crect x='136' y='266' width='30' height='38'/%3E%3Crect x='186' y='266' width='38' height='38'/%3E%3Crect x='36' y='316' width='38' height='38'/%3E%3Crect x='86' y='316' width='38' height='30'/%3E%3Crect x='136' y='316' width='17' height='38'/%3E%3Crect x='157' y='316' width='17' height='38'/%3E%3Crect x='186' y='316' width='38' height='38'/%3E%3C/g%3E%3Ccircle cx='105' cy='285' r='14' fill='%231e8449'/%3E%3C/svg%3E");
    background-repeat: repeat, repeat, no-repeat;
    background-size: 20px 20px, 20px 20px, 100% 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: calc(40px + env(safe-area-inset-top, 0px)) 24px calc(28px + env(safe-area-inset-bottom, 0px));
    text-align: center;
    color: white;
}

/* Umschliesst Header+Menue und scrollt NUR diesen Bereich, wenn der
   Platz nicht reicht (kurzer Viewport, lange Sprachtexte) -
   #start-play-wrap steht bewusst ausserhalb, siehe dort. */
#start-scroll-area {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

#start-scroll-area::-webkit-scrollbar {
    display: none;
}

#start-logo {
    width: 68px;
    height: 68px;
    margin: 0 0 8px 0;
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.35));
}

#start-header h1 {
    font-size: 30px;
    margin: 0 0 8px 0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

#start-header p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 4px 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

#start-status {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75) !important;
    min-height: 16px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

#start-online-status {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75) !important;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

#start-welcome-back {
    font-size: 13px;
    font-weight: 600;
    color: #f9d976 !important;
    margin: 8px 0 0 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

#start-menu {
    width: 100%;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#start-menu button {
    width: 100%;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    color: white;
    background: rgba(255, 255, 255, 0.26);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    transition: transform 0.1s ease, background 0.2s ease;
}

#start-menu button:active {
    transform: scale(0.96);
}

#btn-start-login.logged-in {
    background: rgba(255, 255, 255, 0.4);
}

#start-play-wrap {
    width: 100%;
    max-width: 340px;
    flex-shrink: 0;
}

#btn-start-play {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 18px;
    font-size: 18px;
    font-weight: 800;
    color: #1e8449;
    background: white;
    box-shadow: 0 8px 25px rgba(0,0,0,0.25);
    cursor: pointer;
    transition: transform 0.1s ease;
}

#btn-start-play:active {
    transform: scale(0.97);
}

/* Schmale/kurze Viewports: muss NACH den obigen unconditional #start-*
   Regeln stehen, sonst gewinnt bei gleicher Spezifitaet die spaetere
   unconditional Regel unabhaengig davon, ob die Media Query zutrifft
   (CSS-Kaskade ignoriert @media fuer die Reihenfolge zwischen Blocks). */
@media (max-width: 400px), (max-height: 700px) {
    #start-screen {
        gap: 16px;
        padding: calc(10px + env(safe-area-inset-top, 0px)) 20px calc(16px + env(safe-area-inset-bottom, 0px));
    }

    #start-logo {
        width: 47px;
        height: 47px;
    }

    #start-header h1 {
        font-size: 22px;
    }

    #start-scroll-area {
        gap: 16px;
    }

    #start-menu {
        gap: 8px;
    }

    #start-menu button {
        padding: 10px;
        font-size: 13px;
    }

    #btn-start-play {
        padding: 14px;
        font-size: 16px;
    }
}

/* Rechts-Links (Nutzungsbedingungen + Datenschutz + Impressum): dezent unten
   rechts auf dem Startbildschirm, spiegelbildlich zu #app-version-label
   unten links - anders als dort aber klickbar. Gemeinsamer Container, damit
   die Position unabhaengig von der sprachabhaengigen Textbreite stimmt. */
#start-legal-links {
    position: absolute;
    right: 14px;
    bottom: calc(4px + env(safe-area-inset-bottom, 0px));
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 55vw;
}
/* reCAPTCHA-Badge (Firebase App Check) ausblenden: es haengt fix unten rechts
   und ueberlappt auf schmalen Viewports die #action-bar, also genau die
   Besichtigen-/Kaufen-Buttons - Fehltaps waeren vorprogrammiert. Google
   erlaubt das Ausblenden ausdruecklich, verlangt dafuer aber den Hinweistext
   in #start-recaptcha-note. Beides gehoert zusammen: wer das eine entfernt,
   muss auch das andere anfassen. visibility statt display, weil reCAPTCHA
   den Container selbst positioniert. */
.grecaptcha-badge {
    visibility: hidden;
}

/* Der zugehoerige Pflichthinweis: dezente Zeile direkt ueber dem
   Spielen-Button, im normalen Fluss von #start-play-wrap. Nicht bei den
   Rechts-Links unten rechts - der Block dort ist absolut positioniert und
   waechst nach oben, der Hinweis lag damit ueber dem Button. */
#start-recaptcha-note {
    margin: 0 0 8px 0;
    padding: 0 4px;
    font-size: 9px;
    line-height: 1.35;
    text-align: center;
    color: rgba(255, 255, 255, 0.45);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
#start-recaptcha-note a {
    color: inherit;
    text-decoration: underline;
}

#btn-start-impressum,
#btn-start-datenschutz,
#btn-start-agb {
    border: none;
    background: none;
    padding: 2px 6px;
    font-size: 10px;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: underline;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

/* Versionsanzeige: permanent unten links, ueber Start-Screen (z-index 1500)
   aber unter Modals (z-index 2000). Dezent, halbtransparent, klick-durch. */
#app-version-label {
    position: fixed;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    left: 10px;
    z-index: 1600;
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    letter-spacing: 0.3px;
}
