:root {
    --primary: #FFA200;
    --primary-dark: #cc8200;
    --bg-dark: #121212;
    --bg-surface: #1E1E1E;
    --bg-glass: rgba(30, 30, 30, 0.90);
    --text-main: #ffffff;
    --text-muted: #888888;
    --col-self: #007AFF;
    --col-hider: #4CD964;
    --col-seeker: #FF3B30;
    --col-caught: #888888;
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* LOGOS */
.app-logo-large {
    width: 150px;
    height: 150px;
    object-fit: contain;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px rgba(255, 162, 0, 0.3));
    border-radius: 30px;
}

.app-logo-medium {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin-bottom: 15px;
    border-radius: 20px;
}

.app-logo-small {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 15px;
    border-radius: 12px;
}

/* UTILS */
.hidden {
    display: none !important;
}

.flex-center {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.w-100 {
    width: 100%;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.flex-1 {
    flex: 1;
}

/* BUTTONS */
.btn {
    border: none;
    padding: 16px 24px;
    border-radius: var(--radius);
    font-weight: 800;
    font-size: 1rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 15px rgba(255, 162, 0, 0.4);
}

.btn-secondary {
    background: #444;
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid #444;
    color: #fff;
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-block {
    width: 100%;
}

.btn-danger {
    background: rgba(255, 59, 48, 0.15);
    color: #FF3B30;
    border: 1px solid #FF3B30;
}

.btn-success {
    background: #34C759;
    color: #fff;
    box-shadow: 0 0 15px rgba(52, 199, 89, 0.4);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    padding: 8px 16px;
    font-size: 0.8rem;
}

.btn-text {
    background: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 20px;
    text-decoration: underline;
}

/* INPUTS */
input[type="text"] {
    background: var(--bg-surface);
    border: 2px solid #333;
    color: white;
    padding: 15px;
    border-radius: var(--radius);
    width: 100%;
    font-size: 1.1rem;
    text-align: center;
    outline: none;
    transition: 0.3s;
}

input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(255, 162, 0, 0.2);
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    margin: 10px 0;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background: #333;
    border-radius: 3px;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: -7px;
    box-shadow: 0 0 10px var(--primary);
    border: 2px solid #fff;
}

/* SCREENS */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
}

.bg-pattern {
    background-image: radial-gradient(circle at 50% 50%, #2a2a2a 1px, transparent 1px);
    background-size: 20px 20px;
}

.hero-content {
    text-align: center;
    padding: 20px;
    width: 100%;
    max-width: 400px;
}

.brand-title {
    font-family: 'Russo One', sans-serif;
    font-size: 3.5rem;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(255, 162, 0, 0.3);
}

.brand-title.small {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.text-primary {
    color: var(--primary);
}

.brand-subtitle {
    letter-spacing: 3px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: -10px;
}

/* POCKET OVERLAY */
#pocket-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #444;
    touch-action: none;
}

.pocket-content {
    text-align: center;
    animation: pulse 3s infinite;
}

.icon-lock-large {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #333;
}

.pocket-hint {
    margin-top: 20px;
    font-size: 0.8rem;
    color: #222;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* MENUS */
.login-container,
.menu-container {
    width: 90%;
    max-width: 350px;
    text-align: center;
    z-index: 10;
}

.input-group {
    text-align: left;
    margin-bottom: 20px;
}

.menu-bg-decoration {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 30%, rgba(255, 162, 0, 0.1), transparent 60%);
    pointer-events: none;
}

.menu-card {
    background: var(--bg-surface);
    padding: 25px;
    border-radius: var(--radius);
    border: 1px solid #333;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.big-btn {
    padding: 25px;
    font-size: 1.2rem;
    width: 100%;
}

.join-wrapper {
    display: flex;
    gap: 10px;
}

.welcome-text {
    margin-bottom: 20px;
    font-family: 'Russo One';
    letter-spacing: 1px;
    color: #ddd;
}

.divider-text {
    margin: 5px 0;
    color: #555;
    font-size: 0.8rem;
    font-weight: bold;
}

.info-card {
    background: #252525;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: left;
    border: 1px solid #444;
}

.info-card h3 {
    color: var(--primary);
    margin-bottom: 5px;
    font-size: 1rem;
    font-weight: bold;
}

.info-card p {
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.4;
}

.install-card {
    background: #252525;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: left;
    border: 1px solid #444;
}

.os-guide {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.os-col {
    flex: 1;
    background: #333;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.8rem;
}

.os-col strong {
    color: var(--primary);
    display: block;
    margin-bottom: 5px;
}

/* LOBBY UI */
.app-bar {
    background: var(--bg-surface);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    z-index: 10;
    flex-shrink: 0;
}

.lobby-code-box .label {
    font-size: 0.7rem;
    color: #666;
    display: block;
}

.lobby-code-box .code {
    font-family: 'Russo One';
    font-size: 1.5rem;
    color: var(--primary);
    letter-spacing: 2px;
}

.player-counter {
    font-weight: bold;
    background: #333;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.scroll-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.scroll-content {
    height: 100%;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 160px;
}

.settings-panel {
    background: var(--bg-surface);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid #333;
    margin-top: 30px;
}

.settings-title {
    margin-bottom: 20px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #666;
    font-size: 0.9rem;
}

.disabled-area {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(0.8);
}

.control-card {
    background: #252525;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.control-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: bold;
    color: #aaa;
    margin-bottom: 5px;
}

.control-header .val {
    color: var(--primary);
}

.control-group {
    margin-bottom: 25px;
}

.control-group label {
    font-size: 0.75rem;
    color: #888;
    font-weight: bold;
    display: block;
    margin-bottom: 8px;
}

select {
    width: 100%;
    background: #252525;
    color: white;
    border: 1px solid #444;
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
    -webkit-appearance: none;
}

.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.player-card {
    background: var(--bg-surface);
    padding: 15px 5px;
    border-radius: var(--radius);
    text-align: center;
    border: 2px solid transparent;
    position: relative;
    cursor: pointer;
    transition: 0.2s;
}

.player-card:active {
    transform: scale(0.95);
}

.player-card.manual-seeker {
    border-color: var(--col-seeker);
    background: rgba(255, 59, 48, 0.1);
}

.player-card.manual-seeker::after {
    content: '🕵️';
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 22px;
    height: 22px;
    background: var(--bg-surface);
    border-radius: 50%;
    font-size: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid var(--col-seeker);
}

.player-avatar {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.player-name {
    font-size: 0.8rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 2px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #444;
    border-radius: 50%;
    position: absolute;
    top: 8px;
    right: 8px;
}

.status-dot.status-online {
    background: var(--col-hider);
    box-shadow: 0 0 5px var(--col-hider);
}

.info-symbol {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid var(--primary);
    color: var(--primary);
    font-weight: 900;
    font-size: 0.65rem;
    font-family: 'Inter', sans-serif;
}

.lobby-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--bg-surface);
    padding: 20px;
    border-top: 1px solid #333;
    z-index: 20;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

.footer-row {
    display: flex;
    gap: 15px;
    width: 100%;
    margin-top: 10px;
    align-items: center;
}

.icon-btn {
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.waiting-pulse {
    text-align: center;
    color: var(--primary);
    font-weight: bold;
    animation: pulse 1.5s infinite;
    letter-spacing: 2px;
}

/* --- CONNECTION BANNER --- */
.connection-banner {
    background: #FF3B30;
    color: white;
    font-family: 'Russo One', sans-serif;
    font-size: 0.9rem;
    text-align: center;
    padding: 10px;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99999;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    animation: pulse 2s infinite;
}

/* --- GAME HUD --- */
#game-map {
    flex: 1;
    width: 100%;
}

.full-map {
    width: 100%;
    height: 100%;
}

/* FIX: Verhindert, dass helle Linien (Kachelabstände) beim Zoomen sichtbar werden */
.leaflet-container {
    background-color: var(--bg-dark) !important;
}

.leaflet-layer,
.leaflet-control-zoom-in,
.leaflet-control-zoom-out,
.leaflet-control-attribution {
    filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
}

.map-overlay-header {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

.map-overlay-header * {
    pointer-events: auto;
}

.glass-badge {
    background: var(--bg-glass);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.editor-panel {
    padding: 30px 20px;
    background: var(--bg-surface);
    border-radius: 20px 20px 0 0;
    border-top: 1px solid var(--primary);
}

.hud-top {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 1000;
}

.hud-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.hud-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.hud-pill {
    background: var(--bg-glass);
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: bold;
    backdrop-filter: blur(8px);
    margin-bottom: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    height: 40px;
}

.hud-pill.timer-pill {
    font-size: 1.1rem;
    font-family: 'Russo One';
    border-color: var(--primary);
    color: white;
}

.hud-pill.role {
    border-color: var(--primary);
}

.hud-pill.warning {
    border-color: var(--col-seeker);
    color: var(--col-seeker);
    animation: pulse 1s infinite;
}

.thin-font {
    font-weight: normal;
    font-size: 0.8rem;
}

.btn-menu-game {
    background: rgba(30, 30, 30, 0.9);
    border: 1px solid #444;
    color: white;
    padding: 0 15px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    height: 40px;
    width: auto;
    white-space: nowrap;
}

.hud-bottom {
    position: absolute;
    bottom: 30px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    z-index: 1000;
    gap: 15px;
}

.btn-fab-small {
    pointer-events: auto;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #444;
    border: 1px solid #666;
    color: white;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: 0.2s;
}

.action-bar {
    pointer-events: auto;
    width: auto;
    padding: 15px 30px;
    border-radius: 30px;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    font-size: 1rem;
}

/* ============================
   DYNAMIC ISLAND  (v3 – Complete Redesign)
   ============================ */

.dynamic-island {
    position: absolute;
    top: env(safe-area-inset-top, 12px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 9000;
    width: calc(100% - 24px);
    max-width: 420px;
    margin-top: 12px;
    border-radius: 36px;
    cursor: pointer;
    /* drop-in animation */
    animation: island-drop-in 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

/* ── Shell (glass pill) ── */
.island-shell {
    background: #000000;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow:
        0 2px 0 rgba(255,255,255,0.03) inset,
        0 16px 40px rgba(0,0,0,0.85);
    overflow: hidden;
    transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

/* Role-tinted glow */
.dynamic-island.role-seeker .island-shell {
    border-color: rgba(255, 59, 48, 0.4);
    box-shadow:
        0 2px 0 rgba(255,255,255,0.06) inset,
        0 12px 40px rgba(0,0,0,0.7),
        0 0 28px rgba(255, 59, 48, 0.28);
}
.dynamic-island.role-hider .island-shell {
    border-color: rgba(76, 217, 100, 0.28);
    box-shadow:
        0 2px 0 rgba(255,255,255,0.06) inset,
        0 12px 40px rgba(0,0,0,0.7),
        0 0 22px rgba(76, 217, 100, 0.18);
}
.dynamic-island.role-caught .island-shell {
    border-color: rgba(140, 140, 140, 0.2);
}

/* ── Always-visible bar ── */
.island-bar {
    position: relative;
    display: flex;
    align-items: center;
    height: 56px;
    padding: 0 18px;
    gap: 12px;
}

/* Sub-bar for zone timer */
.island-sub-bar {
    display: flex;
    justify-content: center;
    padding: 2px 18px 12px;
    transition: opacity 0.3s;
}
.island-sub-bar.hidden {
    display: none;
}

/* Timer */
.island-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Russo One', sans-serif;
    font-size: 1.1rem;
    color: #fff;
    white-space: nowrap;
    width: 78px;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
    transition: color 0.3s;
    letter-spacing: 0.5px;
}
.island-timer .timer-icon {
    font-size: 0.9rem;
    opacity: 0.65;
}
.island-timer.urgent {
    color: #FF3B30;
    animation: island-blink 0.9s step-start infinite;
}
@keyframes island-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}

/* Ping arc widget */
.island-ping-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.ping-arc-svg {
    width: 28px;
    height: 28px;
    transform: rotate(-90deg);
    flex-shrink: 0;
}
.ping-arc-bg {
    fill: none;
    stroke: rgba(255,255,255,0.08);
    stroke-width: 3;
}
.ping-arc-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

/* Ping arc widget – container approach */
.island-ping-wrap {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}
.ping-arc-container {
    position: relative;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ping-arc-svg {
    position: absolute;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.ping-arc-bg {
    fill: none;
    stroke: rgba(255,255,255,0.09);
    stroke-width: 3.5;
}
.ping-arc-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 3.5;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.22s linear;
}
.ping-center-time {
    position: relative;
    font-size: 0.6rem;
    font-weight: 800;
    color: rgba(255,255,255,0.85);
    white-space: nowrap;
    z-index: 1;
    letter-spacing: 0.3px;
}
.ping-wrap-label {
    font-size: 0.5rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.3);
    text-transform: uppercase;
}

/* Zone badge */
.island-zone-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 10px;
    padding: 7px 12px;
    font-size: 0.73rem;
    font-weight: 700;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.5);
    transition: background 0.4s, border-color 0.4s, color 0.4s;
}
.island-zone-badge.warning {
    background: rgba(255,59,48,0.12);
    border-color: rgba(255,59,48,0.35);
    color: #FF3B30;
    animation: zone-warn-pulse 1.4s ease-in-out infinite;
}
.zone-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
    animation: zone-dot-blink 2s ease-in-out infinite;
}
.island-zone-badge.warning .zone-badge-dot { animation: zone-dot-blink 0.9s ease-in-out infinite; }

/* Role badge */
.island-role-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    transition: all 0.35s ease;
    white-space: nowrap;
    flex-shrink: 0;
}
.island-role-badge.seeker {
    color: #FF3B30;
}
.island-role-badge.hider {
    color: #4CD964;
}
.island-role-badge.caught {
    color: #888;
}

/* Chevron */
.island-chevron {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.28;
    flex-shrink: 0;
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s;
    color: #fff;
}
.island-chevron svg { width: 14px; height: 14px; }
.dynamic-island.expanded .island-chevron {
    transform: rotate(180deg);
    opacity: 0.55;
}

/* ── Drawer (expanded panel) ── */
.island-drawer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.42s cubic-bezier(0.32, 0.72, 0, 1),
                opacity 0.28s ease;
    opacity: 0;
}
.dynamic-island.expanded .island-drawer {
    max-height: 200px;
    opacity: 1;
}

.island-drawer-inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 8px 18px 24px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* Player chips row */
.island-chips-row {
    display: flex;
    gap: 12px;
    align-items: center;
}
.island-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
}
.island-chip.seeker-chip { color: #FF5C53; border-color: rgba(255,59,48,0.25); background: rgba(255,59,48,0.12); }
.island-chip.hider-chip  { color: #4CD964; border-color: rgba(76,217,100,0.25); background: rgba(76,217,100,0.1); }
.island-chip .chip-val   { font-size: 1rem; }

/* Zone badge */
.island-zone-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 10px;
    padding: 7px 12px;
    font-size: 0.73rem;
    font-weight: 700;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.5);
    transition: background 0.4s, border-color 0.4s, color 0.4s;
}
.island-zone-badge.warning {
    background: rgba(255,59,48,0.12);
    border-color: rgba(255,59,48,0.35);
    color: #FF3B30;
    animation: zone-warn-pulse 1.4s ease-in-out infinite;
}
.zone-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
    animation: zone-dot-blink 2s ease-in-out infinite;
}
.island-zone-badge.warning .zone-badge-dot { animation: zone-dot-blink 0.9s ease-in-out infinite; }

@keyframes zone-warn-pulse {
    0%,100% { background: rgba(255,59,48,0.10); }
    50%      { background: rgba(255,59,48,0.22); }
}
@keyframes zone-dot-blink {
    0%,100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.3; transform: scale(0.6); }
}

/* Leave button */
.island-leave-btn {
    width: 100%;
    padding: 9px;
    border-radius: 12px;
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.3);
    color: #FF3B30;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.island-leave-btn:active {
    transform: scale(0.97);
    background: rgba(255, 59, 48, 0.25);
}

/* Drop-in animation */
@keyframes island-drop-in {
    from {
        transform: translateX(-50%) translateY(-80px) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0) scale(1);
        opacity: 1;
    }
}


/* MISC */
.blind-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
}

.icon-lock {
    font-size: 4rem;
    margin-bottom: 20px;
}

.giant-timer {
    font-size: 5rem;
    font-family: 'Russo One';
    color: var(--primary);
    margin-top: 10px;
}

.game-over-header {
    text-align: center;
    margin-bottom: 20px;
}

.stats-card {
    background: var(--bg-surface);
    width: 90%;
    max-width: 400px;
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid #333;
    margin: 20px 0;
}

.stats-list {
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.game-over-actions {
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.divider {
    height: 1px;
    background: #333;
    margin: 15px 0;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    z-index: 15000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-card {
    background: #252525;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    width: 85%;
    max-width: 320px;
    border: 1px solid #444;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

.btn-ghost {
    background: transparent;
    color: #aaa;
}

#toast-container {
    position: fixed;
    top: 110px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(30, 30, 30, 0.95);
    color: white;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease-out;
    backdrop-filter: blur(5px);
}

.toast.alert {
    border-color: var(--col-seeker);
}

/* QR CODE FIX: Dark Mode überschreiben */
#qrcode-container {
    background-color: #ffffff !important;
    padding: 15px;
    border-radius: 8px;
    display: inline-block;
    color-scheme: light !important;
    -webkit-filter: invert(0) !important;
    filter: invert(0) !important;
}

#qrcode-container img,
#qrcode-container canvas {
    margin: 0;
    background-color: #ffffff !important;
    -webkit-filter: invert(0) !important;
    filter: invert(0) !important;
}

.qr-scanner-box {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--primary);
}

.custom-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 40px !important;
    height: 40px !important;
}

.marker-pin {
    width: 20px;
    height: 20px;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    transition: background 0.3s;
}

.marker-pin.ghost {
    opacity: 0.5 !important;
    filter: none !important;
}

/* --- NEUES SONAR/RADAR PING DESIGN --- */
.marker-ping-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
}

.marker-ping-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: currentColor;
    box-shadow: 0 0 10px currentColor;
    z-index: 2;
}

.marker-ping-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px solid currentColor;
    animation: sonar-ripple 2s linear infinite;
    z-index: 1;
}

.marker-ping-ripple:nth-child(2) {
    animation-delay: 1s;
}

@keyframes sonar-ripple {
    0% {
        width: 14px;
        height: 14px;
        opacity: 1;
    }

    100% {
        width: 60px;
        height: 60px;
        opacity: 0;
    }
}

.marker-caught {
    width: 20px;
    height: 20px;
    background: rgba(100, 100, 100, 0.5);
    border: 2px solid #888;
    border-radius: 50%;
}

.editor-pin {
    width: 20px;
    height: 20px;
    background: #FFA200;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 0 15px #FFA200;
}

.marker-label {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    white-space: nowrap;
    pointer-events: none;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slide-up {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.fade-in {
    animation: fade-in 0.5s ease-out;
}

.slide-up {
    animation: slide-up 0.4s ease-out;
}

.bounce-in {
    animation: slide-up 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pulse-anim {
    animation: pulse 2s infinite;
}

.pulse-slow {
    animation: pulse 3s infinite;
}

.pulse-ripple {
    animation: pulse-ripple 2s infinite;
}

@keyframes pulse-ripple {
    0% {
        transform: scale(0.5);
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7);
        opacity: 1;
    }

    70% {
        transform: scale(1.5);
        box-shadow: 0 0 0 20px rgba(255, 59, 48, 0);
        opacity: 0;
    }

    100% {
        transform: scale(0.5);
        opacity: 0;
    }
}

/* --- BLICKRICHTUNG (BEAM) --- */
.marker-beam {
    position: absolute;
    bottom: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle at 50% 100%, rgba(0, 122, 255, 0.4) 0%, rgba(0, 122, 255, 0) 70%);
    transform-origin: 50% 100%;
    transform: translate(-50%, 0) rotate(0deg);
    pointer-events: none;
    z-index: -1;
    clip-path: polygon(0% 0%, 100% 0%, 50% 100%);
    transition: transform 0.1s linear;
}

.custom-marker {
    overflow: visible !important;
}

/* INPUTS */
input[type="text"],
input[type="number"] {
    background: var(--bg-surface);
    border: 2px solid #333;
    color: white;
    padding: 15px;
    border-radius: var(--radius);
    width: 100%;
    font-size: 1.1rem;
    text-align: center;
    outline: none;
    transition: 0.3s;
}

input[type="text"]:focus,
input[type="number"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(255, 162, 0, 0.2);
}

/* Entfernt die kleinen Scroll-Pfeile bei Nummerneingaben */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    margin: 10px 0;
}