    :root {
      --ui-bg: rgba(10,10,14,0.75);
      --ui-border: rgba(255,255,255,0.15);
      --ui-text: #eaeaea;
      --accent: #42d392;
      --danger: #ff6b6b;
    }
    html, body {
      margin: 0; padding: 0;
      background: #0c0e12; color: var(--ui-text);
      height: 100%;
      font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
      overflow: hidden; /* pełny ekran canvas */
    }
    #gameCanvas {
      width: 100vw; height: 100vh; display: block; background: #0b0e14;
    }


/* HUD w kolumnie po lewej */
    .hud-vertical {
      position: fixed;
      top: 10px; left: 10px;
      display: flex;
      flex-direction: column;     /* kolumna */
      gap: 8px;                   /* odstęp między wierszami */
      padding: 10px 14px;
      background: rgba(10,10,14,0.65);
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: 12px;
      backdrop-filter: blur(4px);
      user-select: none;
      z-index: 900;
      max-width: 220px;           /* żeby się nie rozciągał za bardzo */
    }

    .hud-row {
      display: flex;
      align-items: center;
      gap: 8px;
      justify-content: flex-start;
    }

    .hud-label {
      font-size: 12px;
      opacity: 0.8;
    }

    /* Pasek stresu jak wcześniej */
    .stress-wrap {
      position: relative;
      flex: 1;
      min-width: 100px;
      height: 16px;
      background: rgba(255,255,255,0.06);
      border: 1px solid rgba(255,255,255,0.14);
      border-radius: 10px;
      overflow: hidden;
    }
    .stress-bar {
      height: 100%; width: 0%;
      background: linear-gradient(90deg, #42d392, #ffd166, #ff6b6b);
      transition: width 160ms ease;
    }
    .stress-value {
      position: absolute; inset: 0;
      display: grid; place-items: center;
      font-size: 11px; color: #eaeaea;
      text-shadow: 0 1px 2px rgba(0,0,0,0.6);
      pointer-events: none;
    }

		#locationsBar{
		  display: grid;
		  grid-auto-flow: column;              /* wypełnia kolumnami */
		  grid-template-rows: repeat(2, auto); /* dokładnie 2 rzędy */
		  gap: 6px 8px;
		  overflow-x: auto;                    /* scroll w poziomie przy nadmiarze */
		  padding: 6px 2px;
		}
		#locationsBar .loc-btn{
		  white-space: nowrap;                 /* guziki w jednej linii */
		}
    
    .locations-bar{
      position: fixed; top: 10px; left: 50%; transform: translateX(-50%);
      display: flex; gap: 8px; padding: 6px 8px;
      background: rgba(10,10,14,0.65);
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: 12px;
      backdrop-filter: blur(4px);
      z-index: 950; /* nad HUD (900), pod menu/inventory (2000+) */
    }
    .loc-btn{
      background: rgba(255,255,255,0.06);
      color: #eaeaea; border: 1px solid rgba(255,255,255,0.15);
      border-radius: 10px; padding: 6px 10px; cursor: pointer;
    }
    .loc-btn.active{ border-color: #42d392; box-shadow: 0 0 0 1px #42d392 inset; }




    /* Okno dialogów z animacją wysuwania od dołu */
/* Panel – nadal wsuwa się od dołu */
#dialogPanel{
  position: fixed; left: 0; right: 0; bottom: 0;
  transform: translateY(100%);
  transition: transform 260ms ease;
  z-index: 1000;
  background: radial-gradient(ellipse at center, rgba(6,8,12,0.20), rgba(6,8,12,0.20)); /* tutaj przeżroczystośc panelu ostatnia liczba */
  padding: 12px 0 16px 0;
}
#dialogPanel.open{ transform: translateY(0); }

/* Wrapper o szerokości karty – do pozycjonowania avatara */
#dialogPanel .dialog-wrap{
  position: relative;
  width: min(940px, 92vw);
  margin: 0 auto;
  height: auto;
}

/* Karta – ma być WYŻEJ niż avatar, żeby go lekko przykryć */
#dialogPanel .dialog-card{
  position: relative;
  z-index: 2; /* przykrywa avatar */
  background: linear-gradient(180deg, rgba(15,18,24,0.44), rgba(15,18,24,0.48)); /* Przeźroczystość karty dialogowej */
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px 14px 0 0;
  padding: 14px 16px 18px 16px;
  box-shadow: 0 -10px 24px rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
}

/* Pływający avatar NPC – wystaje na lewo i pod kartą */
.avatar-float {
  opacity: 0;                     /* domyślnie niewidoczny */
  transition: opacity 260ms ease; /* płynne pojawianie/zanikanie */
  position: absolute;
  z-index: 1;
  width: 300px; height: 300px;
  left: -150px; bottom: 18px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  filter: drop-shadow(0 8px 14px rgba(0,0,0,0.5));
}

#dialogPanel.open .avatar-float {
  opacity: 1;   /* pojawia się tylko, gdy panel otwarty */
}


/* Avatar gracza (jak wcześniej) */
.avatar-md{
  width: 64px; height: 64px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
}

/* Drobna responsywność */
@media (max-width: 576px){
  #dialogPanel .dialog-wrap{ width: 96vw; }
  #dialogPanel .dialog-card{ border-radius: 12px 12px 0 0; }
  .avatar-float{
    width: 100px; height: 100px;
    left: -36px;
    bottom: 14px;
  }
}

/* Przycisk "Exit" */
.menu-toggle{
  position: fixed; top: 10px; right: 10px; z-index: 901;
  background: rgba(255,255,255,0.08);
  color: #eaeaea; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px; padding: 6px 10px; cursor: pointer;
  backdrop-filter: blur(4px);
}

/* Overlay menu */
.menu-overlay{
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(0,0,0,0.5);
  display: none; /* ukryte domyślnie */
  align-items: flex-end; justify-content: center; /* panel z dołu (jak dialog) */
}
.menu-overlay.open{ display: flex; }

.menu-card{
  width: min(560px, 92vw);
  background: linear-gradient(180deg, rgba(15,18,24,0.92), rgba(15,18,24,0.98));
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px 16px 0 0;
  padding: 14px 16px 16px;
  box-shadow: 0 -10px 28px rgba(0,0,0,0.5);
  transform: translateY(8px); opacity: 0;
  transition: transform .22s ease, opacity .22s ease;
}
.menu-overlay.open .menu-card{ transform: translateY(0); opacity: 1; }

.menu-header{
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.btn-ghost{
  background: transparent; color: #eaeaea; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px; padding: 4px 8px; cursor: pointer;
}

.menu-view{ display: grid; gap: 8px; }
.menu-btn{
  text-align: left; width: 100%;
  background: rgba(255,255,255,0.06);
  color: #eaeaea; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px; padding: 10px 12px; cursor: pointer;
}
.menu-btn:hover{ border-color: #42d392; }

.d-none{ display: none !important; }

/* Sloty */
.slots-header{ display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.slots-grid{
  display: grid; gap: 8px; grid-template-columns: 1fr;
  max-height: 50vh; overflow: auto; padding-right: 4px;
}
.slot{
  display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px; padding: 8px 10px;
}
.slot-title{ font-weight: 600; }
.slot-meta{ font-size: 12px; opacity: 0.85; }
.slot-actions{ display: flex; gap: 6px; }
.slot .btn{
  background: transparent; color: #eaeaea; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px; padding: 4px 8px; cursor: pointer;
}
.slot .btn:hover{ border-color: #42d392; }
.slots-hint{ font-size: 12px; opacity: 0.8; margin-top: 6px; }




    /* Tooltip (komunikaty) */
    #toast {
      position: fixed; bottom: 74px; left: 50%; transform: translateX(-50%) translateY(20px);
      opacity: 0; transition: opacity .2s ease, transform .2s ease;
      background: var(--ui-bg); border: 1px solid var(--ui-border);
      padding: 8px 10px; border-radius: 10px; backdrop-filter: blur(4px);
      pointer-events: none;
    }
    #toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
