/* ============================================
   IRLove – czysty CSS, design od zera
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@500;600;700&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&display=swap');

/* ---- Zmienne (domyślny motyw) ---- */
:root {
  --bg: #0f0f12;
  --bg-soft: #1a1a1f;
  --bg-card: #222228;
  --accent: #e07a5f;
  --accent-soft: rgba(224, 122, 95, 0.2);
  --accent-hover: #e89a82;
  --accent-glow: rgba(224, 122, 95, 0.3);
  --text: #f5f4f2;
  --text-muted: #9a9692;
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(224, 122, 95, 0.6);
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-logo: 'Caveat', cursive;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --bg-gradient: radial-gradient(ellipse 110% 80% at 50% -15%, rgba(224, 122, 95, 0.1) 0%, transparent 55%);
}

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

html {
  height: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-gradient);
  -webkit-font-smoothing: antialiased;
}

.app {
  min-height: 100vh;
  min-height: 100dvh;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* ---- Ekrany ---- */
.screen {
  display: none;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

.screen.active {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.hidden {
  display: none !important;
}

/* ---- Ekran start ---- */
.screen--start.active {
  align-items: center;
  padding-bottom: 2rem;
}

.logo-header {
  flex-shrink: 0;
  padding: max(1rem, env(safe-area-inset-top)) 1rem 0.35rem;
  text-align: center;
}

.logo {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.06em;
  font-family: var(--font-sans);
  font-size: clamp(1.75rem, 8vw, 2.5rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--text);
  transform: scaleY(0.9);
  transform-origin: center;
}

.logo-a {
  letter-spacing: 0.12em;
}

.logo-heart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1em;
  line-height: 1;
  color: var(--accent);
  padding: 0 0.02em;
}

.logo-b {
  letter-spacing: 0.04em;
}

.start-content {
  width: 100%;
  max-width: 400px;
  flex-shrink: 0;
  padding: 0 1rem 1.5rem;
}

.profile-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem 1.2rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.form-label {
  display: block;
  margin: 0.7rem 0 0.3rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.form-label:first-child {
  margin-top: 0;
}

.gender-avatar-mood-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  margin-top: 0.2rem;
}

.gender-block,
.avatar-block,
.mood-block {
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.gender-block .form-label,
.avatar-block .form-label,
.mood-block .form-label {
  margin-top: 0.7rem;
  margin-bottom: 0.35rem;
  display: block;
  text-align: center;
}

.gender-block .form-label:first-child,
.avatar-block .form-label:first-child,
.mood-block .form-label:first-child {
  margin-top: 0;
}

.gender-buttons {
  display: flex;
  gap: 0.25rem;
  margin-top: 0;
  flex-wrap: nowrap;
  align-items: stretch;
  min-height: 48px;
}

.gender-block .btn-gender {
  flex: 1;
  min-width: 0;
  padding: 0.35rem 0.25rem;
  font-size: 0.75rem;
  min-height: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}

.btn-gender {
  padding: 0.35rem 0.5rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.btn-gender:hover {
  border-color: var(--accent);
  color: var(--text);
}

.btn-gender.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.avatar-current-row,
.mood-current-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.15rem;
  margin-top: 0;
}

.avatar-current,
.mood-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  font-size: 2.25rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

button.avatar-current,
button.mood-current {
  cursor: pointer;
  padding: 0;
  font: inherit;
  color: inherit;
  transition: border-color 0.2s, background 0.2s;
}

button.avatar-current:hover,
button.mood-current:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.1);
}

.mood-current.placeholder {
  color: var(--text-muted);
  font-size: 1.15rem;
}

/* Pełny panel wyboru (avatar, humor) – rozwijany po kliknięciu */
.toolbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 15, 18, 0.97);
  backdrop-filter: blur(8px);
  overflow-y: auto;
}

.toolbox-overlay.hidden {
  display: none !important;
}

.toolbox-overlay:not(.hidden) {
  display: flex !important;
}

.toolbox-overlay-inner {
  width: 100%;
  max-width: 360px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.toolbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  padding: 1rem 0;
  overflow-y: auto;
}

.toolbox-grid .toolbox-btn {
  width: 58px;
  height: 58px;
  padding: 0;
  font-size: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.1s;
}

.toolbox-grid .toolbox-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.08);
}

.toolbox-grid .toolbox-btn.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.toolbox-close {
  padding: 0.75rem 1.25rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s;
}

.toolbox-close:hover {
  border-color: var(--accent);
}

.form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-input--avatar {
  font-size: 1.25rem;
}

.form-input--textarea {
  min-height: 44px;
  max-height: 80px;
  resize: none;
}


.tag-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.btn-tag {
  padding: 0.55rem 1rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.btn-tag:hover {
  border-color: var(--accent);
  color: var(--text);
}

.btn-tag.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.75rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--text);
}

.btn-interests {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  min-height: 3rem;
}

.btn-interests:hover {
  border-color: var(--accent);
  color: var(--text);
}

.btn-interests .interests-selected {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
  justify-content: center;
}

.btn-interests .interests-selected .interest-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
}

.interests-toolbox {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
  padding: 0.35rem 0;
  max-height: 7rem;
  overflow-y: auto;
}

.interests-toolbox.hidden {
  display: none !important;
}

.btn-outline {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-primary {
  width: 100%;
  padding: 0.75rem 1.25rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #0f0f12;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 4px 20px var(--accent-glow);
  transition: filter 0.2s, box-shadow 0.2s, transform 0.1s;
}

.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 24px var(--accent-glow);
}

.btn-primary:active {
  transform: scale(0.99);
}

.lang-switcher {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 1rem;
}

.btn-lang {
  padding: 0.4rem 1rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

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

.btn-lang.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---- Ekran mapy ---- */
.screen--map {
  position: relative;
  padding: 0;
}

.screen--map.active {
  display: flex;
}

.map-container {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.map-container.map-soft-cute .leaflet-tile-pane {
  filter: brightness(0.97) contrast(1.02) saturate(1.05);
}

.map-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 1.5rem 1.5rem 0;
  background: linear-gradient(to bottom, rgba(15, 15, 18, 0.92), transparent);
  pointer-events: none;
}

.map-overlay > * {
  pointer-events: auto;
}

.map-status-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.status-bar {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
}

.map-status-row {
  margin-top: 0.75rem;
  width: 100%;
  max-width: 320px;
  display: flex;
  justify-content: center;
}

.map-status-input {
  width: 100%;
  padding: 0.65rem 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.map-status-input::placeholder {
  color: var(--text-muted);
}

.map-status-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.powerup-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
  max-width: 360px;
}

.powerup-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
}

.powerup-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.1);
}

.powerup-btn:active {
  transform: scale(0.95);
}

.powerup-btn.powerup-cooldown,
.powerup-btn:disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}

/* Cząsteczki – fontanna serc, konfetti, gwiazdki, kwiatki */
.powerup-particles {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  pointer-events: none;
  width: 1px;
  height: 1px;
  overflow: visible;
}

.powerup-particle {
  position: absolute;
  left: 0;
  bottom: 0;
  font-size: 1.1rem;
  opacity: 0;
  animation: particle-fountain 2.4s ease-out forwards;
  animation-delay: var(--delay, 0s);
}

.powerup-particles-anger .powerup-particle,
.powerup-particles-sad .powerup-particle,
.powerup-particles-surprise .powerup-particle,
.powerup-particles-laugh .powerup-particle { animation-name: particle-fountain; }

@keyframes particle-fountain {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.5);
  }
  15% {
    opacity: 1;
    transform: translate(var(--x, 0), -15px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--x, 0) * 1.8), -85px) scale(0.8);
  }
}

@keyframes particle-confetti {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.3) rotate(0deg);
  }
  20% {
    opacity: 1;
    transform: translate(var(--x, 0), -20px) scale(1) rotate(180deg);
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--x, 0) * 2.5), -90px) scale(0.6) rotate(720deg);
  }
}

@keyframes particle-stars {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0);
  }
  10% {
    opacity: 1;
    transform: translate(var(--x, 0), -10px) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--x, 0) * 1.5), -80px) scale(0.4);
  }
}

@keyframes particle-blossom {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.5);
  }
  20% {
    opacity: 0.9;
    transform: translate(var(--x, 0), -25px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--x, 0) * 1.4), -75px) scale(0.7);
  }
}

.map-nearby-hint {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.btn-fab {
  position: absolute;
  bottom: 2rem;
  right: 1.5rem;
  width: 56px;
  height: 56px;
  padding: 0;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--accent);
  color: #0f0f12;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px var(--accent-glow);
  transition: transform 0.2s;
}

.btn-fab:hover {
  transform: scale(1.06);
}

.btn-fab:active {
  transform: scale(0.98);
}

.btn-back {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  padding: 0.65rem 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  z-index: 20;
  transition: background 0.2s;
}

.btn-back:hover {
  background: var(--bg-card);
}

/* ---- Markery mapy (Leaflet, JS) ---- */
.user-marker.irlove-user,
.other-user-marker.irlove-other {
  background: none !important;
  border: none !important;
}

.user-marker-wrap,
.other-marker-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.leaflet-marker-icon.user-marker {
  overflow: visible !important;
}

.user-marker-wrap {
  overflow: visible;
}

/* Power-upy – animacje zwracania uwagi na swoim markerze */
.user-marker-wrap.powerup-wave {
  animation: powerup-bounce 0.5s ease 2;
}

.user-marker-wrap.powerup-sparkle {
  animation: powerup-glow 0.6s ease 2;
}

.user-marker-wrap.powerup-pulse {
  animation: powerup-pulse 0.4s ease 3;
}

.user-marker-wrap.powerup-heart {
  animation: powerup-bounce 0.5s ease 2;
}

.user-marker-wrap.powerup-party {
  animation: powerup-party 0.5s ease 2;
}

.user-marker-wrap.powerup-hearts,
.user-marker-wrap.powerup-anger,
.user-marker-wrap.powerup-sad,
.user-marker-wrap.powerup-surprise,
.user-marker-wrap.powerup-laugh {
  animation: powerup-soft-pulse 0.6s ease 2;
}

.user-marker-wrap.powerup-fire {
  animation: powerup-fire 0.5s ease-in-out 3;
}

@keyframes powerup-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

@keyframes powerup-glow {
  0%, 100% { filter: drop-shadow(0 0 4px transparent); }
  50% { filter: drop-shadow(0 0 20px var(--accent)) drop-shadow(0 0 30px rgba(224, 122, 95, 0.5)); }
}

@keyframes powerup-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.95; }
}

@keyframes powerup-party {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.15) rotate(-8deg); }
  75% { transform: scale(1.15) rotate(8deg); }
}

@keyframes powerup-soft-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

@keyframes powerup-fire {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.2); filter: brightness(1.4) drop-shadow(0 0 15px #ff6b35); }
}

@keyframes powerup-lightning {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(2.5) contrast(1.2); }
}

@keyframes powerup-rainbow {
  0% { filter: hue-rotate(0deg) scale(1); }
  25% { filter: hue-rotate(90deg) scale(1.1); }
  50% { filter: hue-rotate(180deg) scale(1.15); }
  75% { filter: hue-rotate(270deg) scale(1.1); }
  100% { filter: hue-rotate(360deg) scale(1); }
}

@keyframes powerup-dance {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.1) rotate(-12deg); }
  75% { transform: scale(1.1) rotate(12deg); }
}

@keyframes powerup-rock {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.2) rotate(5deg); }
}

@keyframes powerup-boom {
  0% { transform: scale(1); filter: brightness(1); }
  40% { transform: scale(1.35); filter: brightness(1.8); }
  100% { transform: scale(1.1); filter: brightness(1); }
}

/* Chmurka komiksowa nad markerem (status) – skaluje się do treści */
.user-marker-bubble {
  position: relative;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  justify-content: center;
  gap: 6px 8px;
  padding: 5px 10px 8px;
  border-radius: 14px 14px 14px 4px;
  background: #fff;
  color: #1a1a1a;
  border: 2px solid #333;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.2);
  width: max-content;
  max-width: 220px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: max-width 0.2s ease;
}

.user-marker-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translateX(-50%);
  border: 10px solid transparent;
  border-top-color: #333;
  border-bottom: none;
  width: 0;
  height: 0;
}

.user-marker-bubble::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: #fff;
  border-bottom: none;
  width: 0;
  height: 0;
  z-index: 1;
}

.user-marker-wrap:hover .user-marker-bubble {
  width: max-content;
  max-width: 280px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.user-marker-bubble .user-marker-status-text {
  font-size: 0.7rem;
  color: #1a1a1a;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 10ch;
  font-family: var(--font-sans);
  word-break: break-word;
  overflow-wrap: break-word;
}

.user-marker-bubble .user-marker-tag-icon {
  order: -1;
}

.user-marker-wrap:hover .user-marker-bubble .user-marker-status-text {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  flex-basis: 100%;
  max-width: none;
}

.user-marker-bubble .user-marker-tag-icon,
.user-marker-tag-icon {
  font-size: 12px;
  line-height: 1;
  opacity: 0.95;
  flex-shrink: 0;
}

.user-marker-wrap:hover .user-marker-bubble .user-marker-tag-icon {
  order: 0;
  flex-basis: 100%;
  margin-top: 2px;
  max-width: 100%;
  white-space: normal;
}

.user-marker-avatar,
.other-marker-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border: 3px solid rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
}

.other-marker-avatar {
  width: 42px;
  height: 42px;
  font-size: 1.25rem;
  background: var(--bg-card);
  border: 2px solid var(--accent);
  cursor: pointer;
  transition: transform 0.2s;
}

.other-marker-avatar:hover {
  transform: scale(1.1);
}

/* ---- Tooltip mapy (Leaflet) ---- */
.leaflet-tooltip.marker-tooltip {
  padding: 0;
  font-size: 0;
  border: none;
  background: transparent;
  max-width: 420px;
  white-space: normal;
}

.leaflet-tooltip.marker-tooltip .marker-tooltip-inner {
  padding: 12px 16px;
  min-width: 280px;
  max-width: 420px;
  font-size: 0.8125rem;
  line-height: 1.45;
  border-radius: var(--radius-lg);
  background: rgba(15, 15, 18, 0.96);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  color: var(--text);
}

.leaflet-tooltip.marker-tooltip .marker-tooltip-line {
  margin-bottom: 4px;
}

.leaflet-tooltip.marker-tooltip .marker-tooltip-line:last-child {
  margin-bottom: 0;
}

.leaflet-tooltip.marker-tooltip .marker-tooltip-name {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9375rem;
}

.leaflet-tooltip.marker-tooltip .marker-tooltip-mood {
  font-size: 1rem;
  margin-left: 0.2em;
}

.leaflet-tooltip.marker-tooltip .marker-tooltip-meta {
  color: rgba(245, 244, 242, 0.85);
  font-weight: 500;
  font-size: 0.8125rem;
}

.leaflet-tooltip.marker-tooltip .marker-tooltip-status {
  color: rgba(245, 244, 242, 0.9);
  font-size: 0.8125rem;
  font-style: italic;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.leaflet-tooltip.marker-tooltip .marker-tooltip-tags {
  color: rgba(245, 244, 242, 0.75);
  font-size: 0.8rem;
}

.leaflet-tooltip.marker-tooltip .marker-tooltip-bio {
  color: rgba(245, 244, 242, 0.88);
  font-size: 0.8125rem;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  font-style: italic;
}

.leaflet-tooltip.marker-tooltip .marker-tooltip-interests {
  margin-top: 6px;
  font-size: 1rem;
  letter-spacing: 2px;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .leaflet-tooltip.marker-tooltip {
    max-width: calc(100vw - 24px);
  }
  .leaflet-tooltip.marker-tooltip .marker-tooltip-inner {
    min-width: 0;
    max-width: calc(100vw - 32px);
    padding: 10px 12px;
    font-size: 0.8rem;
  }
  .leaflet-tooltip.marker-tooltip .marker-tooltip-name {
    font-size: 0.9rem;
  }

  /* Zainteresowania – wszystkie 10 w jednej linii na telefonie */
  .btn-interests {
    padding: 0.6rem 0.5rem;
    gap: 0.2rem;
  }
  .btn-interests .interests-selected {
    gap: 0.15rem;
    flex-wrap: nowrap;
    justify-content: center;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .btn-interests .interests-selected .interest-chip {
    font-size: 1.2rem;
    flex-shrink: 0;
  }
}

/* ---- Chat overlay ---- */
.chat-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: flex-end;
  justify-content: center;
  background: rgba(15, 15, 18, 0.75);
  backdrop-filter: blur(8px);
}

.chat-overlay:not(.hidden) {
  display: flex !important;
}

.chat-panel {
  width: 100%;
  max-width: 28rem;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom: none;
  box-shadow: var(--shadow-lg);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.chat-header span {
  font-weight: 600;
  font-size: 1.0625rem;
  color: var(--text);
}

.btn-close {
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  min-height: 120px;
  max-height: 320px;
}

.chat-msg {
  margin-bottom: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  max-width: 85%;
  word-break: break-word;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.chat-msg-me {
  margin-left: auto;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #0f0f12;
  border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg);
}

.chat-msg-them {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 4px;
}

.chat-input-row {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
}

.chat-input {
  flex: 1;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input::placeholder {
  color: var(--text-muted);
}

.chat-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn-send {
  padding: 0.75rem 1.25rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f0f12;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: filter 0.2s;
}

.btn-send:hover {
  filter: brightness(1.08);
}

.btn-send:active {
  transform: scale(0.98);
}

/* ---- Toolboxy (avatar, zainteresowania – JS) ---- */
.interest-btn {
  width: 54px;
  height: 54px;
  padding: 0;
  font-size: 1.6rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.interest-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.05);
}

.interest-btn.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ---- Toast ---- */
.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: toastIn 0.3s ease;
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(30, 20, 20, 0.95);
}

.toast-out {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(-6px); }
}

/* ---- Małe ekrany ---- */
@media (max-height: 640px) {
  .logo-header {
    padding: 0.75rem 1rem 0.25rem;
  }

  .logo {
    font-size: 2.25rem;
  }

  .profile-form {
    padding: 0.75rem 1rem 1rem;
    margin-bottom: 0.75rem;
  }

  .form-label {
    margin-top: 0.6rem;
    margin-bottom: 0.2rem;
    font-size: 0.65rem;
  }

  .avatar-toolbox,
  .interests-toolbox {
    max-height: 5rem;
    margin-top: 0.4rem;
  }

  .interest-btn {
    width: 46px;
    height: 46px;
    font-size: 1.35rem;
  }

  .btn-tag {
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
  }

  .btn-primary {
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
  }

  .btn-lang {
    padding: 0.4rem 0.875rem;
    font-size: 0.8125rem;
  }
}
