/* CityLife RP — Haupt-Stylesheet */
:root {
  --bg:        #0a0f1a;
  --bg2:       #111827;
  --bg3:       #1e293b;
  --border:    rgba(255,255,255,0.08);
  --text:      #e2e8f0;
  --muted:     #64748b;
  --primary:   #6366f1;
  --success:   #10b981;
  --danger:    #ef4444;
  --warning:   #f59e0b;
  --info:      #3b82f6;
  --twitch:    #9146ff;
  --discord:   #5865f2;
  --radius:    10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: 'Segoe UI', system-ui, sans-serif; min-height: 100vh; }
/* Game-Seite braucht exakte Höhe */
body.game-body { height: 100vh; max-height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
input, select, textarea { background: var(--bg3); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 8px 12px; width: 100%; font-size: 14px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 4px; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 6px; border: none; cursor: pointer; font-size: 14px; font-weight: 500; transition: all 0.2s; }
.btn-primary   { background: var(--primary); color: #fff; }
.btn-success   { background: var(--success); color: #fff; }
.btn-danger    { background: var(--danger);  color: #fff; }
.btn-warning   { background: var(--warning); color: #000; }
.btn-info      { background: var(--info);    color: #fff; }
.btn-outline   { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-large     { padding: 12px 24px; font-size: 16px; }
.btn-sm        { padding: 4px 10px; font-size: 12px; }
.btn-xs        { padding: 3px 8px; font-size: 12px; }
.btn:hover     { opacity: 0.85; transform: translateY(-1px); }
.btn-twitch    { background: var(--twitch); color: #fff; display: inline-flex; align-items: center; gap: 10px; padding: 14px 28px; border-radius: 8px; font-size: 16px; font-weight: 600; text-decoration: none; transition: all 0.2s; }
.btn-twitch:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-discord   { background: var(--discord); color: #fff; display: inline-block; padding: 10px 20px; border-radius: 8px; font-weight: 600; }
.btn-discord-full { background: var(--discord); color: #fff; display: block; padding: 10px; border-radius: 6px; text-align: center; font-weight: 600; margin-top: 8px; }
.btn-discord-small { background: var(--discord) !important; color: #fff !important; }

/* ALERTS */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-weight: 500; }
.alert-danger  { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.alert-success { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); color: #6ee7b7; }
.muted { color: var(--muted); font-size: 13px; }
.hint  { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* ============================================
   LOGIN
============================================ */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: radial-gradient(ellipse at center, #0d1b2a 0%, #0a0f1a 70%); }
.login-box { text-align: center; max-width: 420px; padding: 48px; background: var(--bg2); border: 1px solid var(--border); border-radius: 16px; }
.login-logo { font-size: 64px; margin-bottom: 16px; }
.login-box h1 { font-size: 32px; font-weight: 800; margin-bottom: 8px; }
.login-sub { color: var(--muted); margin-bottom: 32px; }
.login-hint { color: var(--muted); font-size: 12px; margin-top: 16px; }

/* ============================================
   EINREISE
============================================ */
.immigration-page { min-height: 100vh; padding: 40px 16px; background: radial-gradient(ellipse at top, #0d1b2a, #0a0f1a); }
.immi-container { max-width: 700px; margin: 0 auto; }
.immi-header { text-align: center; margin-bottom: 32px; }
.immi-flag { font-size: 56px; margin-bottom: 12px; }
.immi-header h1 { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.immi-form, .settings-form { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 32px; }
.form-section { margin-bottom: 24px; }
.form-section h3 { font-size: 15px; font-weight: 600; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 16px; }
.immi-status { text-align: center; padding: 40px; border-radius: 12px; }
.immi-status.status-pending  { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3); }
.immi-status.status-rejected { background: rgba(239,68,68,0.1);  border: 1px solid rgba(239,68,68,0.3); }
.status-icon { font-size: 48px; margin-bottom: 16px; }
.char-count { color: var(--muted); font-size: 11px; }

/* ============================================
   GAME LAYOUT
============================================ */
.game-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; height: 48px;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  flex-shrink: 0; z-index: 100;
}
.nav-logo  { font-weight: 800; font-size: 16px; }
.nav-online { font-size: 12px; color: var(--success); margin-left: 12px; }
.nav-char  { font-weight: 600; }
.nav-gang  { font-weight: 700; margin-left: 6px; }
.nav-faction { margin-left: 4px; }
.nav-notif { cursor: pointer; font-size: 14px; color: var(--warning); margin-right: 12px; }
.nav-admin { background: var(--warning); color: #000; padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; margin-right: 8px; }
.nav-logout { color: var(--muted); font-size: 13px; }

.game-layout { display: flex; flex: 1; overflow: hidden; min-height: 0; }

.panel { width: 260px; background: var(--bg2); border-right: 1px solid var(--border); overflow-y: auto; flex-shrink: 0; padding: 16px; }
.panel-right { border-right: none; border-left: 1px solid var(--border); }

.char-card { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.char-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.char-info strong { display: block; font-size: 14px; }
.char-info small { color: var(--muted); font-size: 11px; }

.stat-bars { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.stat-bar { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.bar { flex: 1; height: 8px; background: var(--bg3); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s; }
.bar-health { background: var(--danger); }
.bar-energy { background: var(--warning); }

.money-display { background: var(--bg3); border-radius: 8px; padding: 10px; margin-bottom: 12px; }
.money-item { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.money-item strong { color: #fbbf24; }

.attr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 12px; }
.attr { background: var(--bg3); padding: 6px 10px; border-radius: 6px; font-size: 12px; text-align: center; }
.char-status { font-size: 12px; color: var(--muted); line-height: 1.8; margin-bottom: 12px; }
.panel-nav { display: flex; flex-direction: column; gap: 4px; }
.panel-btn { background: var(--bg3); border: 1px solid var(--border); color: var(--text); padding: 8px 12px; border-radius: 6px; font-size: 13px; cursor: pointer; text-align: left; text-decoration: none; display: block; transition: background 0.2s; }
.panel-btn:hover { background: var(--bg); }

/* MAP (Regeln weiter unten im File) */
.district-label span { color: rgba(255,255,255,0.25); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.loc-marker { cursor: pointer; }
.loc-icon { font-size: 20px; text-align: center; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8)); }
.loc-name { font-size: 10px; color: #fff; text-align: center; text-shadow: 0 1px 3px rgba(0,0,0,1); white-space: nowrap; margin-top: 2px; }
.loc-public .loc-icon { }
.loc-farm .loc-icon { filter: drop-shadow(0 0 6px rgba(16,185,129,0.8)); }
.loc-faction .loc-icon { filter: drop-shadow(0 0 6px rgba(59,130,246,0.8)); }
.loc-illegal .loc-icon { filter: drop-shadow(0 0 6px rgba(239,68,68,0.8)); }
.loc-gang .loc-icon { filter: drop-shadow(0 0 6px rgba(245,158,11,0.8)); }
.player-dot { font-size: 20px; animation: pulse 2s infinite; }
.player-pulse { width: 30px; height: 30px; border: 2px solid var(--primary); border-radius: 50%; position: absolute; top: -5px; left: -5px; animation: ring 2s infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@keyframes ring { 0% { transform: scale(0.8); opacity: 1; } 100% { transform: scale(1.8); opacity: 0; } }
.leaflet-container { background: #0a1628 !important; }

/* LOCATION OVERLAY */
.location-overlay { position: absolute; inset: 0; z-index: 200; background: rgba(0,0,0,0.8); display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.location-overlay.hidden { display: none; }
.overlay-inner { background: var(--bg2); border: 1px solid var(--border); border-radius: 16px; max-width: 600px; width: 90%; overflow: hidden; position: relative; }
.overlay-close { position: absolute; top: 12px; right: 12px; background: var(--bg3); border: none; color: var(--text); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 16px; z-index: 1; }
.overlay-img { width: 100%; max-height: 300px; object-fit: cover; }
.overlay-video { width: 100%; max-height: 300px; object-fit: cover; }
.overlay-icon-big { font-size: 80px; text-align: center; padding: 40px; background: var(--bg3); }
#overlay-info { padding: 16px 20px; }
.overlay-label { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.overlay-desc { color: var(--muted); font-size: 14px; }
#overlay-actions { padding: 0 20px 20px; display: flex; gap: 8px; flex-wrap: wrap; }

/* SIDE PANELS */
.side-panel { position: fixed; top: 48px; right: 260px; width: 320px; height: calc(100vh - 48px); background: var(--bg2); border-left: 1px solid var(--border); z-index: 150; overflow-y: auto; box-shadow: -4px 0 20px rgba(0,0,0,0.4); }
.side-panel.hidden { display: none; }
.side-panel-header { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg2); }
.side-panel-header button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 18px; }
.side-panel-body { padding: 16px; }
.inv-item { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--bg3); border-radius: 8px; margin-bottom: 6px; }
.inv-item.illegal { border: 1px solid rgba(239,68,68,0.3); }
.inv-icon { font-size: 24px; }
.inv-name { flex: 1; font-weight: 500; }
.inv-qty { color: var(--muted); font-size: 13px; }
.badge-illegal { font-size: 11px; color: var(--danger); }

/* CITY INFO PANEL */
.city-info-panel h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.city-info-panel h4 { font-size: 13px; font-weight: 600; color: var(--muted); }
.info-row { font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.notif-item { padding: 8px; border-radius: 6px; font-size: 12px; margin-bottom: 4px; display: flex; justify-content: space-between; }
.notif-info    { background: rgba(59,130,246,0.15); }
.notif-success { background: rgba(16,185,129,0.15); }
.notif-warning { background: rgba(245,158,11,0.15); }
.notif-danger  { background: rgba(239,68,68,0.15); }

/* TOASTS */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--bg2); border: 1px solid var(--border); color: var(--text); padding: 12px 24px; border-radius: 8px; z-index: 9999; opacity: 0; transition: all 0.3s; pointer-events: none; font-size: 14px; white-space: nowrap; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-success { border-color: var(--success); }
.toast-danger  { border-color: var(--danger); }

/* ============================================
   ANDERE SPIELER AUF DER KARTE
============================================ */
.other-player-marker { cursor: pointer; }
.other-player-dot { font-size: 18px; text-align: center; filter: drop-shadow(0 2px 6px rgba(99,102,241,0.8)); transition: transform .2s; }
.other-player-marker:hover .other-player-dot { transform: scale(1.2); }
.other-player-name { font-size: 10px; color: #a5b4fc; text-align: center; text-shadow: 0 1px 3px rgba(0,0,0,1); white-space: nowrap; margin-top: 2px; }

/* ============================================
   CHAT LINK IN NAV
============================================ */
.nav-chat { background: rgba(99,102,241,0.2); color: var(--primary); padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; margin-right: 8px; }

/* ============================================
   FILTER BUTTON (allgemein)
============================================ */
.filter-btn { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg3); color: var(--muted); font-size: 13px; cursor: pointer; text-decoration: none; display: inline-block; transition: all .2s; }
.filter-btn.active, .filter-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }


/* ============================================
   MAP
============================================ */
@keyframes playerRing {
  0%   { transform: translate(-50%,-50%) scale(0.8); opacity: 1; }
  100% { transform: translate(-50%,-50%) scale(2.2); opacity: 0; }
}

/* Map-Container */
.game-map-area {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #0a0f18;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#game-map {
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 0;
  overflow: auto;
  position: relative;
  cursor: default;
}

#game-map::-webkit-scrollbar        { width: 6px; height: 6px; }
#game-map::-webkit-scrollbar-track  { background: transparent; }
#game-map::-webkit-scrollbar-thumb  { background: #1e293b; border-radius: 3px; }

#map-inner {
  position: relative;
  display: inline-block;
  min-width: 100%;
  min-height: 100%;
}

#map-bg-img {
  display: block;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
}

#pin-layer {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

.loc-pin,
.player-pin,
.other-player-pin { pointer-events: all; }

/* ── Toast ─────────────────────────────────── */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #1e293b; color: #e2e8f0; padding: 10px 20px; border-radius: 20px;
  font-size: 13px; font-weight: 500; z-index: 9999; opacity: 0;
  transition: all .3s; white-space: nowrap; pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-success { background: #064e3b; color: #6ee7b7; }
.toast-danger  { background: #450a0a; color: #fca5a5; }
.toast-info    { background: #1e3a5f; color: #93c5fd; }

/* ══════════════════════════════════════════════
   REISE-OVERLAY
══════════════════════════════════════════════ */
.travel-overlay {
  position: absolute; inset: 0; z-index: 500;
  background: linear-gradient(160deg, #0f0c29, #302b63, #24243e);
  display: flex; align-items: center; justify-content: center;
}
.travel-overlay.hidden { display: none; }

.travel-inner {
  text-align: center; color: #fff; padding: 24px; max-width: 400px;
}

/* Auto-Animation */
.travel-animation {
  position: relative; height: 80px; overflow: hidden; margin-bottom: 24px;
}
.travel-car {
  font-size: 36px;
  position: absolute; top: 20px;
  animation: travel-drive 2s linear infinite;
}
@keyframes travel-drive {
  0%   { left: -10%; }
  100% { left: 110%; }
}
.travel-road {
  position: absolute; bottom: 10px; left: 0; right: 0;
  height: 4px; background: rgba(255,255,255,.1);
  display: flex; gap: 20px; align-items: center; padding: 0 20px;
}
.travel-line {
  flex: 1; height: 2px; background: rgba(255,255,255,.3);
  animation: travel-lines 0.8s linear infinite;
}
@keyframes travel-lines {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* Info */
.travel-status { font-size: 13px; color: rgba(255,255,255,.6); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 6px; }
.travel-destination { font-size: 28px; font-weight: 800; margin-bottom: 12px; }
.travel-countdown { font-size: 48px; font-weight: 200; font-family: monospace; letter-spacing: -2px; margin-bottom: 16px; }

.travel-bar-wrap {
  background: rgba(255,255,255,.1); border-radius: 4px;
  height: 6px; overflow: hidden; margin-bottom: 16px;
}
.travel-bar {
  height: 100%; background: linear-gradient(90deg, #6366f1, #a855f7);
  border-radius: 4px; width: 0%;
  transition: width 1s linear;
}

.travel-sub { font-size: 12px; color: rgba(255,255,255,.4); margin-bottom: 20px; }

.travel-phone-btn {
  background: rgba(255,255,255,.1); color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 12px; padding: 12px 24px;
  font-size: 15px; cursor: pointer;
  transition: background .2s;
}
.travel-phone-btn:hover { background: rgba(255,255,255,.2); }

/* Während Reise: alles außer Handy blockieren */
body.is-traveling .game-layout          { pointer-events: none; opacity: .4; filter: blur(1px); }
body.is-traveling .game-map-area        { pointer-events: none; }
body.is-traveling #travel-overlay       { pointer-events: all; opacity: 1; filter: none; }
body.is-traveling .travel-phone-btn     { pointer-events: all; }
body.is-traveling #phone-modal          { pointer-events: all; opacity: 1; filter: none; }
/* Navbar bleibt lesbar aber deaktiviert */
body.is-traveling nav                   { pointer-events: none; opacity: .5; }
/* Außer dem Handy-Button */
body.is-traveling nav .ph-nav-btn       { pointer-events: all; opacity: 1; }
