/* ========================================================================= */
/* PODSTAWOWE STYLE I RESET                                                  */
/* ========================================================================= */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #000;
  color: #e0d0b0;
}

@import url('https://fonts.googleapis.com/css2?family=Eagle+Lake&family=MedievalSharp&display=swap');

/* ================================================ */
/* === GLOBALNY, KLIMATYCZNY STYL PRZYCISKÓW ==== */
/* ================================================ */

/* Ten styl nada "duszę" wszystkim przyciskom w grze (poza tymi, które mają własne, specyficzne style) */
#equipment-panel button,
#inventory button,
#shop button,
#tavern button,
#fight-dialog button,
#level-up-dialog button,
.dialog button {
  background-color: #8b4513;
  /* Główny, brązowy kolor */
  border: 1px solid #a0522d;
  /* Subtelna ramka w jaśniejszym odcieniu */
  color: #ffffff;
  /* Biały tekst */
  padding: 8px 16px;
  /* Wewnętrzne odstępy (marginesy) */
  margin: 5px;
  /* Zewnętrzny odstęp od innych elementów */
  border-radius: 8px;
  /* Zaokrąglone rogi */
  cursor: pointer;
  /* Kursor łapki */
  font-family: Georgia, serif;
  /* Spójna czcionka */
  font-size: 14px;
  /* Rozmiar czcionki */
  font-weight: bold;
  /* Pogrubienie dla czytelności */
  text-shadow: 1px 1px 2px #000;
  /* Delikatny cień pod tekstem */
  transition: background-color 0.2s, transform 0.1s;
  /* Płynne przejścia */
}

#equipment-panel button:hover,
#inventory button:hover,
#shop button:hover,
#tavern button:hover,
#fight-dialog button:hover,
#level-up-dialog button:hover,
.dialog button:hover {
  background-color: #a0522d;
  /* Jaśniejszy brąz po najechaniu */
}

#equipment-panel button:active,
#inventory button:active,
#shop button:active,
#tavern button:active,
#fight-dialog button:active,
#level-up-dialog button:active,
.dialog button:active {
  transform: translateY(1px);
  /* Efekt "wciśnięcia" przycisku */
}

/* ========================================================================= */
/* NOWY KREATOR POSTACI PREMIUM                                              */
/* ========================================================================= */

/* ========================================================================= */
/* NOWY KREATOR POSTACI PREMIUM - 3 KOLUMNY                                  */
/* ========================================================================= */

.character-creator {
  position: fixed;
  inset: 0;
  display: block;
  background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.65)), url('../../assets/images/tlo3.png') no-repeat center center;
  background-size: cover;
  z-index: 99999;
  overflow: hidden;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  box-shadow: inset 0 0 100px #000;
}

.character-creator::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: none;
  /* Opcjonalnie jeśli masz teksturę - brakujący plik usunięty */
  opacity: 0.05;
  pointer-events: none;
}

/* --- IKONA BOHATERA: Absolutnie w lewym górnym rogu --- */
.hero-icon-corner {
  position: absolute;
  top: 30px;
  left: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  z-index: 10;
}

/* --- GŁÓWNY PANEL: Pełny ekran z paddingiem od lewej --- */
.creator-main-panel {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 60px 20px 230px;
  box-sizing: border-box;
  overflow-y: auto;
}

/* .hero-icon-container usunięty — zastąpiony przez .hero-icon-corner */

.hero-icon-square {
  width: 150px;
  height: 150px;
  background: rgba(139, 69, 19, 0.1);
  border: 3px solid #8b4513;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  box-shadow: 0 0 25px rgba(139, 69, 19, 0.3);
  position: relative;
}

.hero-icon-square img {
  width: 90%;
  height: 90%;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.8));
  opacity: 0;
  transition: opacity 0.5s ease-in-out, transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform: scale(0.8);
}

.hero-icon-square img.visible {
  opacity: 1;
  transform: scale(1);
}

.hero-name-badge {
  background: #3b2f1a;
  border: 1px solid #ffd700;
  padding: 8px 25px;
  border-radius: 20px;
  color: #ffd700;
  font-family: 'MedievalSharp', serif;
  font-size: 18px;
  text-shadow: 1px 1px 2px #000;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.creator-steps-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.step-node {
  width: 130px;
  padding: 8px;
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #4a3d2a;
  border-radius: 4px;
  color: #b8a082;
  font-family: 'MedievalSharp', serif;
  font-size: 12px;
  transition: all 0.3s;
}

.step-node.active {
  background: rgba(139, 69, 19, 0.3);
  border-color: #ffd700;
  color: #fff;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

.step-line {
  width: 2px;
  height: 30px;
  background: #4a3d2a;
}

/* .creator-main-col usunięty — zastąpiony przez .creator-main-panel zdefiniowany wyżej */

.creator-title {
  font-family: 'Eagle Lake', cursive;
  font-size: 38px;
  color: #ffd700;
  text-align: center;
  margin-bottom: 25px;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.7), 2px 2px 5px #000;
  letter-spacing: 4px;
  animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
  from {
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5), 2px 2px 5px #000;
  }

  to {
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.9), 2px 2px 5px #000;
  }
}

.creator-content {
  max-width: 950px;
  width: 100%;
  margin: 0 auto;
}

/* LAYOUT KROKU 1: dwie kolumny obok siebie */
.step1-layout {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 30px;
  align-items: start;
}

.step1-left {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.step1-bottom {
  margin-top: auto;
  padding-top: 20px;
}

.step1-right .creator-section {
  margin-bottom: 0;
}

.creator-step {
  display: none;
  animation: fadeIn 0.5s ease-out;
}

.creator-step.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-label {
  display: block;
  font-family: 'MedievalSharp', serif;
  color: #ffd700;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 14px;
  margin-bottom: 15px;
}

/* --- KOLUMNA PRAWA - USUNIĘTA --- */

/* --- ELEMENTY WSPÓLNE --- */
.creator-section {
  margin-bottom: 40px;
  background: rgba(255, 255, 255, 0.02);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid rgba(139, 69, 19, 0.2);
}

.input-group-premium {
  display: flex;
  gap: 12px;
}

.input-group-premium input {
  flex: 1;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid #8b4513;
  padding: 15px;
  color: #fff;
  border-radius: 6px;
  font-size: 18px;
  transition: all 0.3s;
}

.input-group-premium input:focus {
  border-color: #ffd700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
  outline: none;
}

.icon-btn {
  background: #3b2f1a;
  border: 1px solid #8b4513;
  color: #fff;
  width: 50px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 20px;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: #5d2e0a;
  border-color: #ffd700;
}

.race-grid-premium {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.race-card {
  background: rgba(255, 255, 255, 0.03);
  border: 4px solid #4a3d2a;
  padding: 1px;
  border-radius: 1px;
  cursor: pointer;
  transition: all 0.3s;
}

.race-card:hover {
  background: rgba(139, 69, 19, 0.15);
  border-color: #8b4513;
  transform: translateY(-3px);
}

.race-card.selected {
  background: rgba(139, 69, 19, 0.4);
  border-color: #ffd700;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.15);
}

.race-name {
  font-family: 'Eagle Lake', cursive;
  font-size: 18px;
  color: #ffd700;
  margin-bottom: 8px;
}

.race-description {
  font-size: 13px;
  color: #b8a082;
  margin-bottom: 10px;
}

.race-bonuses {
  font-size: 12px;
  color: #ffd700;
  font-style: italic;
}

.stats-grid-premium {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.stat-block-premium {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid #8b4513;
  padding: 8px 6px;
  text-align: center;
  border-radius: 6px;
  transition: transform 0.2s;
}

.stat-block-premium:hover {
  transform: scale(1.05);
  border-color: #ffd700;
}

.stat-val-premium {
  font-size: 20px;
  color: #fff;
  font-weight: bold;
  margin: 3px 0;
}

.creator-footer {
  margin-top: 15px;
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.gold-btn {
  background: linear-gradient(135deg, #8b4513 0%, #5d2e0a 100%);
  border: 1px solid #ffd700;
  color: #fff;
  padding: 12px 20px;
  font-family: 'MedievalSharp', serif;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 2px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

/* Tytuł kroku (h2 wewnątrz step) */
.step-title {
  font-family: 'Eagle Lake', cursive;
  font-size: 20px;
  color: #ffd700;
  margin: 0 0 15px 0;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.gold-btn:hover:not(:disabled) {
  filter: brightness(1.2);
  box-shadow: 0 0 20px rgba(139, 69, 19, 0.5);
}

.gold-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(1);
}

.gold-btn.primary {
  background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
  border-color: #4caf50;
}

.silver-btn {
  background: #333;
  border: 1px solid #888;
  color: #fff;
  padding: 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'MedievalSharp', serif;
}

.text-btn {
  background: none;
  border: none;
  color: #b8a082;
  cursor: pointer;
  text-align: center;
}

.text-btn:hover {
  color: #ffd700;
}

.reroll-counter {
  font-family: 'MedievalSharp', serif;
  color: #ffd700;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 15px;
  border-radius: 20px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  margin: 0 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.reroll-counter strong {
  font-size: 18px;
  color: #fff;
  text-shadow: 0 0 5px #ffd700;
}

/* ================= KONIEC NOWYCH STYLÓW KREATORA ================= */

/* GŁÓWNA GRA - ukryta na początku */
.game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: #1a1a0e;
  overflow: hidden;
  display: none;
}

.map-container {
  width: 1600px;
  height: 1000px;
  position: relative;
  cursor: grab;
  transform-origin: center center;
  overflow: hidden;
}

/* Kinematograficzna winieta na całą mapę */
.map-container::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, transparent 40%, rgba(0, 0, 0, 0.4) 100%);
  pointer-events: none;
  z-index: 50;
  /* Nad mapą, pod HUDem */
}

.map-container:active {
  cursor: grabbing;
}

.world-map {
  width: 1600px;
  height: 1000px;
  background: url('../../assets/images/Nawohen.jpg') no-repeat top left;
  background-size: 100% 100%;
  transform-origin: top left;
  position: relative;
}

/* Tekstura starego papieru nałożona na świat */
.world-map::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('https://www.transparenttextures.com/patterns/papyros.png');
  opacity: 0.15;
  pointer-events: none;
  z-index: 5;
}

/* Style dla map miast */
.city-map {
  width: 1600px;
  height: 1000px;
  position: relative;
  background-size: 100% 100%;
  display: none;
}

.city-map.active {
  display: block;
}

#hero-token {
  position: absolute;
  width: 30px;
  height: 30px;
  z-index: 20;
  pointer-events: none;
  left: 785px;
  top: 485px;
  transition: transform 0.3s ease-in-out;
}

/* ================================================ */
/* === NOWY, PROFESJONALNY LAYOUT HUD (GRID) ==== */
/* ================================================ */

/* ========================================================================= */
/* INTERFEJS HUD (Górny pasek parametrów)                                    */
/* ========================================================================= */
/* --- Główny kontener HUD --- */
.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(44, 24, 16, 0.6);
  padding: 8px 15px;
  border-bottom: 2px solid #8b4513;
  z-index: 1000;
  font-size: 14px;
  color: #d4c4a0;
  /* MAKSYMALNIE WYŚRODKOWANE */
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(300px, 2fr) auto minmax(150px, 1fr);
  gap: 20px;
  align-items: center;
  justify-items: center;
}

/* --- Style ogólne dla elementów HUD --- */
.bar {
  width: 150px;
  height: 15px;
  background: #333;
  border: 2px solid #8b4513;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff4444, #ff0000);
  width: 100%;
}

.exp-fill {
  height: 100%;
  background: linear-gradient(90deg, #4444ff, #0066ff);
  width: 0%;
}

.bar-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  color: #fff;
  font-weight: bold;
  font-size: 12px;
  text-align: center;
  line-height: 15px;
  text-shadow: 1px 1px 2px #000;
}



.stat {
  background: linear-gradient(135deg, #3b2a14, #a67c00);
  /* ciemne złoto z brązem */
  color: #8b0000;
  /* krwisty czerwony tekst */
  padding: 6px 10px;
  border-radius: 8px;
  border: 2px solid #964B00;
  /* brązowa ramka */
  text-align: center;
  font-family: 'MedievalSharp', 'Georgia', serif;
  /* klimatyczna czcionka */
  font-size: 15px;
  font-weight: bold;
  text-shadow: 1px 1px 2px #000;

  /* Wypukłość + cień */
  box-shadow:
    inset -2px -2px 3px rgba(255, 255, 255, 0.2),
    inset 2px 2px 3px rgba(0, 0, 0, 0.4),
    3px 3px 6px rgba(0, 0, 0, 0.6);
}



.hud button {
  background: #8b4513;
  border: 1px solid #a0522d;
  padding: 5px 12px;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Georgia', serif;
  font-size: 14px;
}

.hud button:hover {
  background: #a0522d;
}

/* --- Blok 1: Paski życia/doświadczenia i czas --- */
.hud-vitals {
  display: flex;
  align-items: center;
  gap: 15px;
}

.hud-bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Style dla kontenera opisu i paska */
.bar-container {
  display: flex;
  /* Ustawia opis i pasek w jednej linii */
  align-items: center;
  /* Wyrównuje je idealnie w pionie */
  gap: 8px;
  /* Dodaje odstęp między opisem a paskiem */
}

/* Styl samego opisu "HP:", "EXP:" */
.bar-label {
  font-weight: bold;
  /* Pogrubia czcionkę */
  min-width: 35px;
  /* Ustawia stałą szerokość, aby paski były równo */
  text-align: right;
  /* Wyrównuje tekst do prawej dla estetyki */
  color: #ffd700;
  /* Daje mu ładny, złoty kolor pasujący do reszty */
}

.hud-time-display {
  background: #3b2f1a;
  border: 1px solid #8b4513;
  border-radius: 6px;
  padding: 6px 12px;
  text-align: center;
  align-self: stretch;
  /* Rozciąga tło na całą wysokość bloku */
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.time-period {
  font-size: 12px;
  color: #b8a082;
}

/* --- Blok 2: Poziom i złoto --- */
.hud-resources {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #3b2f1a;
  padding: 8px 12px;
  border: 1px solid #8b4513;
  border-radius: 6px;
}

.resource-item {
  font-weight: bold;
  white-space: nowrap;
}

/* --- Blok 3: Statystyki --- */
.hud-stats {
  display: grid;
  grid-template-columns: repeat(5, auto);
  gap: 8px;
  padding: 5px;
  background: rgba(0, 0, 0, 0.0);
  border-radius: 6px;
  justify-content: center;
  /* Wyśrodkowanie statystyk, jeśli jest ich mniej niż 6/12 */
  min-width: 320px;
}

/* --- Blok 4: Główne przyciski --- */
.hud-main-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#quest-panel-btn {
  /* Specjalne style dla przycisku questów */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* --- Blok 5: Ustawienia dźwięku --- */
.hud-settings {
  display: grid;
  grid-template-columns: auto auto;
  /* 2 kolumny */
  grid-template-rows: auto auto;
  /* 2 rzędy */
  gap: 5px;
  align-items: center;
  justify-items: center;
}

/* Przycisk muzyki - pierwszy rząd, pierwsza kolumna */
#toggle-music-btn {
  grid-column: 1;
  grid-row: 1;
  font-size: 12px;
  padding: 4px 8px;
  min-width: 60px;
}

/* Potencjometr - pierwszy rząd, druga kolumna */
#volume-slider {
  grid-column: 2;
  grid-row: 1;
  width: 80px;
}

/* Kontener dla przycisków zapisu - drugi rząd, obie kolumny */
.hud-save-load {
  grid-column: 1 / 3;
  /* Rozciąga się na obie kolumny */
  grid-row: 2;
  display: flex;
  gap: 5px;
}

.hud-save-load button {
  font-size: 11px;
  padding: 4px 8px;
  min-width: 60px;
  background: #6b4423;
  border: 1px solid #8b4513;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
}

.hud-save-load button:hover {
  background: #8b4513;
}

#volume-slider {
  width: 100px;
  margin-right: 5px;
}

/* ================= KONIEC NOWYCH STYLÓW HUD ================= */


.equipment-item {
  background: #3b2f1a;
  border: 2px solid #6b5639;
  border-radius: 8px;
  padding: 10px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  cursor: grab;
  color: #fff;
  font-weight: bold;
}

.equipment-item.equipped {
  border-color: #ffd700;
  box-shadow: 0 0 10px rgba(255, 214, 0, 0.2);
}

.equipment-item:active {
  cursor: grabbing;
}

.backpack-item {
  background: #4a3d2a;
  border: 1px solid #8b4513;
  border-radius: 4px;
  padding: 8px;
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  cursor: grab;
  transition: background 0.2s;
}

.item-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.item-sell-btn {
  background: #5a1b1b !important;
  color: #ff9999 !important;
  border: 1px solid #7a2b2b !important;
  padding: 4px 8px !important;
  font-size: 11px !important;
  border-radius: 4px !important;
  cursor: pointer;
}

.item-sell-btn:hover {
  background: #7a2b2b !important;
  color: #fff !important;
}

.backpack-item:hover {
  background: #5a4d3a;
}

/* Drag & Drop Feedback */
[draggable="true"] {
  user-select: none;
}

.dragging {
  opacity: 0.5;
  transform: scale(0.95);
}

.drop-target {
  background: rgba(255, 215, 0, 0.1) !important;
  border: 2px dashed #ffd700 !important;
}

#shop.drop-target {
  background: rgba(0, 255, 0, 0.1) !important;
  border: 3px dashed #00ff00 !important;
}

#backpack-items.drop-target {
  background: rgba(139, 69, 19, 0.3) !important;
  border: 2px dashed #a0522d !important;
}

/* === LOKACJE I ZASOBY === */
.location {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  z-index: 5;
}

/* --- PODPISY MIAST (Etykiety) --- */
.location[data-name]::after {
  content: attr(data-name);
  position: absolute;
  bottom: -22px;
  /* Pozycja pod okręgiem lokacji */
  left: 50%;
  transform: translateX(-50%);
  font-family: 'MedievalSharp', Georgia, serif;
  font-size: 14px;
  white-space: nowrap;
  text-shadow: 1px 1px 2px #000, -1px -1px 2px #000, 1px -1px 2px #000, -1px 1px 2px #000;
  /* Mocny obrys dla czytelności */
  pointer-events: none;
  /* Żeby nie blokowało klikania na mapę */
  z-index: 10;
  opacity: 0;
  animation: fadeInLabel 2s ease-in-out forwards;
}

@keyframes fadeInLabel {
  0% {
    opacity: 0;
    transform: translate(-50%, -10px);
  }

  100% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Kolory podpisów dla poszczególnych typów lokacji */
.city[data-name]::after {
  color: #ffd700;
}

/* Złoty dla miast */
.forest[data-name]::after {
  color: #90ee90;
}

/* Jasnozielony dla lasów */
.orc-camp[data-name]::after {
  color: #ff6b6b;
}

/* Czerwony dla obozu orków */
.ruin[data-name]::after {
  color: #d3d3d3;
}

/* Jasnoszary dla ruin */
.river[data-name]::after {
  color: #87ceeb;
}

/* Jasnoniebieski dla rzeki */

.city {
  background: rgba(139, 69, 19, 0.5);
  cursor: pointer;
}

.forest {
  background: rgba(34, 139, 34, 0.6);
  cursor: pointer;
}

.orc-camp {
  background: rgba(139, 0, 0, 0.3);
  cursor: pointer;
}

.ruin {
  background: rgba(100, 100, 100, 0.6);
  cursor: pointer;
  border: 1px solid #444;
}



.resource-node {
  width: 5px;
  height: 5px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
  transition: transform 0.2s, filter 0.2s;
  z-index: 20;
  border-radius: 50%;
}

.resource-node:hover {
  transform: scale(2.5);
  filter: brightness(1.5) drop-shadow(0 0 6px #ffd700);
}

/* --- STYLE DLA RODZAJÓW ATAKU --- */
.attack-variant-btn {
  font-size: 13px !important;
  padding: 10px 8px !important;
  margin: 0 !important;
  flex: 1;
  transition: all 0.3s ease !important;
  min-height: 44px;
  border-radius: 8px !important;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 6px rgba(0, 0, 0, 0.25);
}

.fight-actions-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px !important;
  width: 100% !important;
}

#fight-dialog {
  width: min(560px, 92vw);
}

.fight-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  align-items: stretch;
}

.fight-actions-grid .attack-variant-btn {
  width: 100%;
  min-width: 0;
}

#flee-btn,
#close-fight-btn {
  width: 100%;
  margin: 0 !important;
  min-height: 44px;
}

#attack-fast-btn {
  background: linear-gradient(135deg, #2a5d3f, #1b4332) !important;
  border-color: #40916c !important;
}

#attack-fast-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #40916c, #2d6a4f) !important;
  box-shadow: 0 0 10px rgba(64, 145, 108, 0.5);
}

#attack-strong-btn {
  background: linear-gradient(135deg, #7a1b1b, #5a1b1b) !important;
  border-color: #a32a2a !important;
}

#attack-strong-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #a32a2a, #7a1b1b) !important;
  box-shadow: 0 0 10px rgba(163, 42, 42, 0.5);
}

#attack-btn {
  background: linear-gradient(135deg, #8b4513, #5d2e0a) !important;
}

.attack-variant-btn:disabled {
  filter: grayscale(0.8);
  opacity: 0.5;
  cursor: not-allowed;
}

.wood-node {
  background-color: #5a3e1b;
  background-image: none;
  border: 1px solid #c8a060;
  box-shadow: 0 0 4px rgba(200, 160, 96, 0.6);
}

/* ======================== */

.bridge {
  position: absolute;
  width: 30px;
  height: 40px;
  background: #8b7355;
  border: 5px solid #5a3d1e;
  left: 330px;
  top: 350px;
  z-index: 6;
}

.dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, rgba(44, 24, 16, 0.98), rgba(60, 35, 25, 0.98));
  border: 4px solid #8b4513;
  border-image: linear-gradient(to bottom, #8b4513, #a0522d, #8b4513) 1;
  padding: 25px;
  width: 380px;
  color: #d4c4a0;
  display: none;
  z-index: 2000;
  text-align: center;
  border-radius: 4px;
  /* Medieval sharpness */
  opacity: 0;
  transition: opacity 0.4s ease-out;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.9), inset 0 0 100px rgba(0, 0, 0, 0.4);
}

#dialog-title {
  color: #ffd700;
  font-family: 'MedievalSharp', Georgia, serif;
  font-size: 22px;
  margin-top: 0;
  border-bottom: 2px solid #8b4513;
  padding-bottom: 10px;
  text-shadow: 1px 1px 2px #000;
}

#dialog-text {
  font-style: italic;
  font-size: 16px;
  line-height: 1.5;
  margin: 20px 0;
}

.dialog-fadein {
  opacity: 1 !important;
  transition: opacity 0.8s;
}

.dialog-fadeout {
  opacity: 0 !important;
  pointer-events: none;
  transition: opacity 0.8s;
}

/* --- TOAST NOTIFICATIONS --- */
#toast-container {
  position: fixed;
  top: 60px;
  /* Poniżej HUD-u */
  left: 50%;
  transform: translateX(-50%);
  z-index: 5000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: rgba(44, 24, 16, 0.9);
  border: 2px solid #ffd700;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: Georgia, serif;
  font-size: 14px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  pointer-events: auto;
  max-width: 300px;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.fade-panel {
  opacity: 0;
  transition: opacity 0.8s;
  display: none;
}

.fadein {
  opacity: 1 !important;
  transition: opacity 0.8s;
  display: block !important;
}

.fadeout {
  opacity: 0 !important;
  pointer-events: none;
  transition: opacity 0.8s;
}

.dialog button,
.shop-item button {
  background: #8b4513;
  border: none;
  padding: 8px 15px;
  margin: 5px;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  border-radius: 8px;
}

.dialog button:hover,
.shop-item button:hover {
  background: #a0522d;
}

/* Sklep: przycisk kupna bardziej epicki */
.shop-item button {
  background: linear-gradient(135deg, #3f2916 0%, #8b4513 55%, #b86a2b 100%);
  border: 1px solid #d6a66a;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.45), inset 0 0 8px rgba(255, 226, 179, 0.18);
  font-weight: 700;
  letter-spacing: 0.3px;
}

.shop-item button:hover {
  background: linear-gradient(135deg, #5d3516 0%, #a85d20 55%, #d48435 100%);
  box-shadow: 0 0 16px rgba(255, 187, 92, 0.35), inset 0 0 12px rgba(255, 236, 195, 0.25);
}

/* ========================================================================= */
/* OKNA DIALOGOWE I MODALE (Walka, Sklep, Tawerna)                           */
/* ========================================================================= */
#shop,
#fight-dialog,
#level-up-dialog,
#tavern {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(44, 24, 16, 0.95);
  border: 3px solid #8b4513;
  padding: 20px;
  color: #d4c4a0;
  border-radius: 12px;
  display: none;
  z-index: 3000;
  width: 360px;
  max-height: 85vh;
  overflow-y: auto;
  transition: left 0.5s ease, transform 0.5s ease;
}

/* Tryb aktywnego sklepu - przesunięcie na lewo */
body.shop-active #shop {
  left: calc(50% - 10px);
  transform: translate(-100%, -50%);
  /* Prawa krawędź 10px od środka */
}

body.shop-active #character-window {
  left: calc(50% + 10px);
  transform: translate(0, -50%);
  /* Lewa krawędź 10px od środka */
  display: flex !important;
  opacity: 1 !important;
}

/* --- OKNO POSTACI (Side-by-Side) --- */
#character-window {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(44, 24, 16, 0.98);
  border: 4px solid #8b4513;
  padding: 30px;
  border-radius: 15px;
  z-index: 5000;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
  display: none;
  /* kontrolowane przez fadeInPanel */
  flex-direction: row;
  gap: 20px;
  align-items: flex-start;
  justify-content: center;
}

#equipment-panel,
#inventory {
  background: rgba(0, 0, 0, 0.2);
  padding: 15px;
  border-radius: 10px;
  border: 1px solid #6b5639;
  min-width: 300px;
}

#equipment-panel h2,
#inventory h2 {
  margin-top: 0;
  color: #ffd700;
  text-align: center;
  font-size: 20px;
}

#shop-items {
  max-height: 400px;
  overflow-y: auto;
  margin: 10px 0;
  padding-right: 4px;
}

#fight-log {
  text-align: left;
  font-size: 14px;
  background: #3b2f1a;
  border: 1px solid #8b4513;
  padding: 8px;
  max-height: 120px;
  overflow-y: auto;
  margin: 10px 0;
}

.shop-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border: 1px solid rgba(139, 69, 19, 0.6);
  border-radius: 8px;
  margin-bottom: 8px;
  background: linear-gradient(120deg, rgba(52, 30, 18, 0.75), rgba(34, 19, 10, 0.9));
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.shop-item:hover {
  transform: translateY(-1px);
  border-color: #2ecc71;
  box-shadow: 0 0 16px rgba(46, 204, 113, 0.22), inset 0 0 12px rgba(0, 0, 0, 0.35);
}

.shop-item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.shop-item-name {
  color: #f6deb7;
  letter-spacing: 0.25px;
}

.shop-item-price {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  width: fit-content;
  color: #b9ffd6;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(94, 255, 158, 0.55);
  background: radial-gradient(circle at 30% 30%, rgba(30, 114, 68, 0.85), rgba(14, 74, 43, 0.95));
  box-shadow: 0 0 10px rgba(46, 204, 113, 0.35), inset 0 0 6px rgba(190, 255, 219, 0.22);
}

.shop-item-price .price-value {
  color: #d5ffe8;
  font-size: 1.05em;
  text-shadow: 0 0 8px rgba(109, 255, 179, 0.55);
}

.shop-item-price .price-currency {
  color: #95f7c1;
  font-size: 0.86em;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

#level-up-dialog .stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0;
}

#level-up-dialog .stat-name {
  flex: 1;
  text-align: left;
  font-weight: bold;
  font-size: 16px;
}

#level-up-dialog .stat-value {
  flex: 0 0 50px;
  text-align: center;
  font-size: 16px;
  user-select: none;
}

#level-up-dialog button.stat-inc {
  flex: 0 0 30px;
  font-weight: bold;
  font-size: 20px;
  line-height: 20px;
  cursor: pointer;
}

#level-up-dialog .points-left {
  margin: 15px 0;
  font-weight: bold;
  font-size: 18px;
}

#character-window {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(44, 24, 16, 0.98);
  border: 4px solid #8b4513;
  padding: 30px;
  color: #d4c4a0;
  border-radius: 15px;
  z-index: 4000;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
  max-height: 90vh;
  overflow-y: auto;
  transition: left 0.5s ease, transform 0.5s ease;
}

#character-window .close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  background: #8b4513;
  border: 1px solid #a0522d;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 20px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 1px 1px 2px #000;
  transition: background-color 0.2s, transform 0.1s;
  z-index: 5010;
}

#character-window .close-btn:hover {
  background-color: #a0522d;
  transform: scale(1.1);
}

#character-window .close-btn:active {
  transform: translateY(1px) scale(1.1);
}

#equipment-panel,
#inventory {
  background: rgba(0, 0, 0, 0.2);
  border: 2px solid #6b5639;
  padding: 15px;
  border-radius: 10px;
  min-width: 320px;
}

#equipment-panel h2,
#inventory h2 {
  text-align: center;
  margin-top: 0;
  color: #ffd700;
  text-shadow: 1px 1px 2px #000;
}

.equipment-slot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  margin: 8px 0;
  background: rgba(59, 47, 26, 0.6);
  border: 1px solid #8b4513;
  border-radius: 8px;
}

/* --- KARCZMA --- */
#tavern {
  width: 400px;
  background: url('https://www.transparenttextures.com/patterns/leather.png'), rgba(44, 24, 16, 0.98);
  box-shadow: 0 0 40px rgba(0, 0, 0, 1), inset 0 0 60px rgba(139, 69, 19, 0.3);
}

#tavern-services button {
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #4a2c1a 0%, #2c1810 100%);
  border: 1px solid #8b4513;
  padding: 12px 15px;
  font-size: 15px;
  transition: all 0.3s;
}

#tavern-services button:hover {
  background: linear-gradient(135deg, #5d3a1a 0%, #3b2210 100%);
  border-color: #ffd700;
  transform: translateX(5px);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

.quest-status {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid #8b4513;
  padding: 12px;
  margin: 10px 0;
  border-radius: 6px;
  font-size: 14px;
}

.quest-completed {
  background: rgba(34, 139, 34, 0.2);
  border: 1px solid #4a7c59;
}

/* --- KONTROLKI MAPY --- */
.map-controls {
  position: absolute;
  top: 90px;
  right: 20px;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.map-controls button {
  background: rgba(44, 24, 16, 0.9);
  border: 2px solid #8b4513;
  color: #d4c4a0;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  min-width: 120px;
}

.map-controls button:hover {
  background: rgba(160, 82, 45, 0.9);
}

.zoom-info {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 1001;
  background: rgba(44, 24, 16, 0.8);
  border: 1px solid #8b4513;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  color: #d4c4a0;
}

/* Style dla przedmiotów w plecaku */
.backpack-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px;
  margin: 2px 0;
  background: #4a3d2a;
  border: 1px solid #6b5639;
  border-radius: 4px;
}

.backpack-item:hover {
  background: #5a4d3a;
}

.item-equip-btn {
  background: #4a7c59;
  border: none;
  color: white;
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
}

.item-equip-btn:hover {
  background: #5a8c69;
}

.item-use-btn {
  background: #7c4a59;
  border: none;
  color: white;
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
}

.item-use-btn:hover {
  background: #8c5a69;
}

/* --- POZYCJA MYSZY I BOHATERA --- */
#hero-pos {
  position: fixed;
  left: 20px;
  bottom: 60px;
  z-index: 5000;
  background: rgba(44, 24, 16, 0.8);
  border: 1px solid #ffd700;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  color: #ffd700;
  pointer-events: none;
  user-select: none;
}

#mouse-pos {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 5000;
  background: rgba(44, 24, 16, 0.8);
  border: 1px solid #8b4513;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  color: #d4c4a0;
  pointer-events: none;
  user-select: none;
}

/* --- PANEL QUESTÓW --- */
.quest-indicator {
  display: inline-block;
  width: 11px;
  height: 11px;
  background: #ffb700;
  border-radius: 50%;
  border: 2px solid #fffbe0;
  box-shadow: 0 0 2px #fff, 0 0 5px #ffb700;
  vertical-align: middle;
  animation: quest-pulse 1.2s infinite alternate;
}

@keyframes quest-pulse {
  0% {
    box-shadow: 0 0 2px #fff, 0 0 5px #ffb700;
  }

  100% {
    box-shadow: 0 0 8px #fff, 0 0 18px #ffb700;
  }
}

/* ================================================ */
/* === DZIENNIK PRZYGÓD (QUEST BOOK) - PERGAMIN === */
/* ================================================ */
#quest-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #f4e4bc;
  background-image:
    radial-gradient(circle at 2% 2%, rgba(0, 0, 0, 0.05) 0%, transparent 10%),
    radial-gradient(circle at 98% 98%, rgba(0, 0, 0, 0.05) 0%, transparent 10%),
    url('https://www.transparenttextures.com/patterns/papyros.png');
  border: 4px solid #8b4513;
  border-radius: 8px;
  color: #2c1810;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), inset 0 0 100px rgba(139, 69, 19, 0.2);
  width: 450px;
  max-height: 85vh;
  padding: 30px;
  z-index: 5000;
  display: none;
  font-family: 'Georgia', serif;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #8b4513 rgba(0, 0, 0, 0.2);
}

#quest-modal::-webkit-scrollbar {
  width: 8px;
}

#quest-modal::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

#quest-modal::-webkit-scrollbar-thumb {
  background-color: #8b4513;
  border-radius: 4px;
}

#quest-modal h3 {
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 14px;
  margin-top: 20px;
  text-shadow: 1px 1px 2px black;
}

#quest-modal h2 {
  font-family: 'MedievalSharp', serif;
  text-align: center;
  color: #5d3a1a;
  border-bottom: 2px solid #8b4513;
  padding-bottom: 10px;
  margin-top: 0;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 24px;
}

#quest-modal .quest-entry {
  background: rgba(139, 69, 19, 0.05);
  border-bottom: 1px dashed #8b4513;
  padding: 15px 10px;
  margin-bottom: 15px;
  transition: all 0.3s;
  border-radius: 0;
}

#quest-modal .quest-entry.completed {
  background: rgba(34, 139, 34, 0.1);
  border-bottom: 1px solid #228b22;
  opacity: 0.8;
  color: #1b5e20;
  text-decoration: none;
}

#quest-modal .quest-entry .quest-title {
  font-weight: bold;
  font-size: 18px;
  color: #3b2f1a;
  display: flex;
  align-items: center;
  gap: 10px;
}

#quest-modal .quest-entry .quest-status {
  font-size: 14px;
  margin-top: 8px;
  color: #3b2f1a;
  font-style: italic;
  background: transparent;
  /* Usunięcie ciemnego tła z ogólnej klasy .quest-status */
  border: none;
  padding: 0;
}

#quest-modal .quest-entry .quest-status.completed {
  color: #1b5e20;
  font-weight: bold;
}

#quest-modal .quest-empty {
  color: #8b4513;
  text-align: center;
  margin: 15px 0 5px 0;
  font-style: italic;
}

#quest-modal .close-quest-modal-btn {
  display: block;
  margin: 20px auto 0;
  background: #5d3a1a !important;
  color: #f4e4bc !important;
  border: 2px solid #3b2f1a !important;
  border-radius: 4px !important;
  font-weight: bold;
  padding: 10px 30px !important;
  cursor: pointer;
}

#quest-modal .close-quest-modal-btn:hover {
  background: #3b2f1a !important;
  transform: scale(1.05);
}

/* Paski postępu w Dzienniku */
.quest-progress-container {
  width: 100%;
  height: 12px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid rgba(139, 69, 19, 0.3);
}

.quest-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #5d3a1a, #8b4513);
  /* Ciemniejszy gradient postępu */
  width: 0%;
  transition: width 0.5s ease-out;
}

.quest-progress-text {
  font-size: 11px;
  text-align: right;
  margin-top: 4px;
  font-weight: bold;
  color: #8b4513;
}

/* Nowe lokacje i animacje */
.location.new-poi {
  border: 2px solid #ffd700;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.location.bandit-camp {
  background: rgba(139, 0, 0, 0.4);
}

.location.river-bend {
  background: rgba(0, 0, 139, 0.4);
}

.location.hidden-grove {
  background: rgba(0, 100, 0, 0.4);
}

@keyframes pulse-quest {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
  }

  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(255, 215, 0, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
  }
}

.quest-indicator.active-pulse,
.quest-ready-pulse {
  animation: quest-map-blink 1s infinite alternate;
}

@keyframes quest-map-blink {
  from {
    transform: scale(1);
    filter: brightness(1);
  }

  to {
    transform: scale(1.4);
    filter: brightness(1.8);
  }
}

.quest-indicator.active-pulse {
  display: block;
  width: 10px;
  height: 10px;
  background: #ffd700;
  border-radius: 50%;
  position: absolute;
  top: -5px;
  right: -5px;
  border: 2px solid #2c1810;
  animation: pulse-quest 2s infinite;
}

/* --- NOWY SYSTEM MENU MIASTA --- */
.city-menu {
  position: absolute;
  top: 90px;
  left: 20px;
  z-index: 1001;
  background: rgba(44, 24, 16, 0.95);
  border: 3px solid #8b4513;
  border-radius: 12px;
  min-width: 220px;
  display: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.city-menu.show {
  display: block;
}

.city-menu-header {
  background: #8b4513;
  color: #fff;
  padding: 12px 15px;
  border-radius: 9px 9px 0 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: bold;
  transition: background 0.2s;
}

.city-menu-header:hover {
  background: #a0522d;
}

.city-menu-content {
  padding: 10px;
  display: none;
}

.city-menu-content.show {
  display: block;
}

.city-menu-content button {
  display: block;
  width: 100%;
  margin: 5px 0;
  background: #6b5639;
  border: none;
  color: #fff;
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  transition: background 0.2s;
}

.city-menu-content button:hover {
  background: #7b6649;
}

.city-menu-toggle {
  position: absolute;
  top: 90px;
  left: 260px;
  z-index: 1002;
  background: rgba(44, 24, 16, 0.9);
  border: 2px solid #8b4513;
  color: #d4c4a0;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: none;
}

.city-menu-toggle:hover {
  background: rgba(160, 82, 45, 0.9);
}

/* Przycisk powrotu do mapy świata */
.return-to-world-btn {
  position: absolute;
  top: 90px;
  left: 20px;
  z-index: 1001;
  background: rgba(44, 24, 16, 0.9);
  border: 2px solid #8b4513;
  color: #d4c4a0;
  padding: 10px 15px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
}

.return-to-world-btn:hover {
  background: rgba(160, 82, 45, 0.9);
}

/* --- SYSTEM CZASU --- */
.time-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  transition: all 2s ease-in-out;
}

.time-dawn {
  background: linear-gradient(45deg, rgba(255, 182, 108, 0.15), rgba(255, 218, 185, 0.1));
}

.time-day {
  background: transparent;
}

.time-dusk {
  background: linear-gradient(45deg, rgba(255, 94, 77, 0.2), rgba(255, 154, 0, 0.15));
}

.time-night {
  background: linear-gradient(45deg, rgba(25, 25, 112, 0.4), rgba(0, 0, 139, 0.3));
}

/* Dodany styl do obracania postaci */
.flipped {
  transform: scaleX(-1);
}

@keyframes turnFlash {
  0% {
    filter: brightness(1);
  }

  50% {
    filter: brightness(2.5) drop-shadow(0 0 5px white);
  }

  100% {
    filter: brightness(1);
  }
}

.is-turning {
  animation: turnFlash 0.3s ease-out;
}

#dice-animation-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
  padding: 8px;
  border-radius: 5px;
  border: 1px solid #5a4b3a;
  background-color: rgba(0, 0, 0, 0.2);
  transition: opacity 0.3s ease;
}

#dice-animation-container.hidden {
  display: none;
  /* Ukrywa element, gdy nie jest używany */
}

#dice-label {
  font-size: 14px;
  font-weight: bold;
  color: #d8c0a2;
  margin-bottom: 5px;
}

#dice-target {
  font-size: 12px;
  color: #aaa;
  margin-top: 5px;
}

#dice {
  font-family: 'Times New Roman', serif;
  font-size: 38px;
  font-weight: bold;
  color: #fff;
  width: 70px;
  height: 70px;
  border: 3px solid #b8a082;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #3c3228, #1a1612);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
  transition: all 0.1s ease;
}

/* Animacja trzęsącej się kości */
@keyframes dice-roll-animation {
  0% {
    transform: scale(1) rotate(0deg);
  }

  25% {
    transform: scale(1.1) rotate(15deg);
    color: #fff;
  }

  50% {
    transform: scale(0.9) rotate(-15deg);
    color: #ddd;
  }

  75% {
    transform: scale(1.1) rotate(10deg);
    color: #fff;
  }

  100% {
    transform: scale(1) rotate(0deg);
  }
}

#dice.rolling {
  animation: dice-roll-animation 0.15s infinite;
}

/* ======== WKLEJ NA KOŃCU PLIKU CSS ======== */


#flee-btn {
  background-color: #753b27;
  /* Ciemniejszy, mniej ważny kolor */
  border: 2px solid #5a2e1f;
}

#flee-btn:hover {
  background-color: #8f4a32;
}

#flee-btn:disabled {
  background-color: #4a3a2a;
  cursor: not-allowed;
}

/* Style dla formularza w kreatorze postaci */
.creator-form-group {
  margin-bottom: 25px;
  text-align: left;
}

.creator-form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #d4c4a0;
}

.input-with-button {
  display: flex;
  gap: 10px;
}

#char-name-input {
  flex-grow: 1;
  /* Input zajmuje całą dostępną przestrzeń */
  padding: 10px;
  background-color: #1e150d;
  border: 2px solid #5a3e2b;
  border-radius: 5px;
  color: #e0e0e0;
  font-size: 16px;
}

#char-name-input::placeholder {
  color: #776a54;
}

.creator-btn.small-btn {
  flex-shrink: 0;
  /* Przycisk nie będzie się kurczył */
  padding: 0 20px;
}

/* Dostosowanie nagłówka pod polem imienia */
#step-race h3 {
  text-align: left;
  margin-top: 20px;
  margin-bottom: 10px;
  color: #d4c4a0;
  padding-left: 5px;
  /* Delikatne wcięcie dla spójności */
}

/* Zmieniamy tytuł główny w kroku 1 */
#step-race h2 {
  text-align: center;
  /* Wycentrujmy główny tytuł */
}

/* Styl dla imienia postaci w HUD - dodany na końcu */
#character-name-display {
  font-weight: bold;
  /* Pogrubienie */
  color: #FFD700;
  /* Krwisty kolor */
  text-shadow: 1px 1px 2px #000;
  /* Cień dla czytelności */
  font-size: 16px;
  /* Opcjonalnie: nieco większa czcionka */
}

.ukryty-parametr {
  display: none !important;
  /* !important daje pewność, że styl zostanie nadpisany */
}

/* --- System Kolizji (styl do debugowania) --- */
.collision-box {
  position: absolute;
  /* Ten styl jest tylko po to, żebyśmy widzieli granice. Można go później usunąć. */
  background-color: rgba(255, 0, 0, 0.2);
  border: 1px dashed white;
  z-index: 100;
  /* Upewnij się, że są nad mapą, ale pod bohaterem */
}

#exit-zone {
  position: absolute;
  background-color: rgba(0, 255, 0, 0.4);
  /* Półprzezroczysty zielony */
  border: 1px dashed white;
  z-index: 100;
  /* Tak jak collision-box, żeby był na wierzchu */
}

/* === CENTRALNIE NA DOLE === */
#exit-city-btn {
  position: absolute;
  bottom: 20px;
  /* 20px od dolnej krawędzi */
  left: 50%;
  /* Przesuń o 50% szerokości ekranu w lewo */
  transform: translateX(-50%);
  /* Skoryguj pozycję o połowę szerokości samego przycisku */
  z-index: 1002;
}

/* Możesz użyć istniejącej klasy dla spójnego wyglądu, 
   jeśli ją masz, albo stworzyć nową. Załóżmy klasę 'game-button' */
.game-button {
  background-color: #5a2d0c;
  color: #e4d3b6;
  border: 2px solid #3e1e07;
  padding: 8px 16px;
  font-family: 'MedievalSharp', cursive;
  /* Zachowajmy czcionkę gry */
  font-size: 16px;
  cursor: pointer;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
  transition: background-color 0.2s;
}

.game-button:hover {
  background-color: #793f16;
}

/* Strefy przejść między mapami */

.transition-zone {
  position: absolute;
  width: 64px;
  height: 64px;
  background-image: url('../../assets/images/brama_miasta.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 15;
  pointer-events: none;
  opacity: 0.8;
}


.transition-zone.hidden {
  display: none;
}

.transition-indicator {
  position: absolute;
  background: rgba(0, 255, 0, 0.8);
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: bold;
  z-index: 2000;
  display: none;
}

/* === DODAJ TUTAJ === */
#world-map-sw,
#world-map-se {
  background-color: #654321 !important;
  /* Brązowe tło zamiast obrazu */
}


#world-map-ne {
  background-image: url('../../assets/images/Las.jpg');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
}





.hero-in-city {
  filter: drop-shadow(0 0 8px gold);
  animation: glowCity 1.5s infinite alternate;
}

@keyframes glowCity {
  from {
    filter: drop-shadow(0 0 4px gold);
  }

  to {
    filter: drop-shadow(0 0 12px yellow);
  }
}


#dice-animation-container {
  min-width: 240px;
  min-height: 160px;
  font-size: 18px;
}

#dice {
  font-size: 60px;
  width: 100px;
  height: 100px;
}

#enemy-hp-bar-container {
  width: 100%;
  margin-bottom: 10px;
  display: none;
  position: relative;
}

#enemy-hp-label {
  font-size: 15px;
  color: #ffd700;
  text-align: center;
  margin-bottom: 2px;
  font-weight: bold;
  letter-spacing: 1px;
  text-shadow: 1px 1px 2px #000;
}

#enemy-hp-bar {
  background: linear-gradient(90deg, #ff4444, #ff0000);
  height: 100%;
  border-radius: 6px;
  transition: width 0.3s;
}

#enemy-hp-bar-text {
  position: absolute;
  width: 100%;
  left: 0;
  top: 0;
  text-align: center;
  color: #fff;
  font-size: 13px;
  line-height: 16px;
  font-weight: bold;
  text-shadow: 1px 1px 2px #000;
  pointer-events: none;
}

#enemy-hp-bar-container>div:nth-child(2) {
  background: #333;
  border: 1px solid #a0522d;
  border-radius: 6px;
  height: 16px;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.hero-at-night {
  filter: drop-shadow(0 0 16px #ffe066) brightness(1.3);
  animation: nightGlow 1.2s infinite alternate;
}

@keyframes nightGlow {
  from {
    filter: drop-shadow(0 0 8px #ffe066) brightness(1.2);
  }

  to {
    filter: drop-shadow(0 0 24px #fffbe0) brightness(1.5);
  }
}


.hp-fill.regenerating {
  animation: pulseHP 1s infinite alternate;
}


@keyframes pulseHP {
  0% {
    filter: brightness(1) drop-shadow(0 0 4px limegreen);
    transform: scale(1);
  }

  50% {
    filter: brightness(2.2) drop-shadow(0 0 14px limegreen);
    transform: scale(1.15);
  }

  100% {
    filter: brightness(1) drop-shadow(0 0 6px limegreen);
    transform: scale(1);
  }
}

#hero-token.halfling {
  width: 28px;
  height: 15px;
  object-fit: contain;
}

/* ========================================================================= */
/* ANIMACJA PODRÓŻY TRATWĄ                                                   */
/* ========================================================================= */
.raft-travel-container {
  position: absolute;
  width: 60px;
  height: 60px;
  background-image: url('../../assets/images/tratwa.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 25;
  transition: all 4s cubic-bezier(0.45, 0.05, 0.55, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
}

.raft-travel-container img {
  width: 25px;
  height: 25px;
  object-fit: contain;
  margin-top: -10px;
  /* Pozycjonowanie bohatera na tratwie */
  animation: raft-bobbing 1s infinite alternate ease-in-out;
}

@keyframes raft-bobbing {
  from {
    transform: translateY(0) rotate(-1deg);
  }

  to {
    transform: translateY(-4px) rotate(1deg);
  }
}

.raft-water-ripple {
  position: absolute;
  width: 40px;
  height: 10px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  bottom: -5px;
  filter: blur(4px);
  animation: ripple-fade 1s infinite;
}

@keyframes ripple-fade {
  from {
    transform: scale(1);
    opacity: 0.6;
  }

  to {
    transform: scale(2);
    opacity: 0;
  }
}

/* ========================================================================= */
/* GAME MODAL - ładne okienko zamiast alert()                                */
/* ========================================================================= */

#game-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(3px);
}

#game-modal-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

#game-modal-box {
  background: linear-gradient(160deg, #2a1a0e 0%, #1a0d05 100%);
  border: 2px solid #8b4513;
  border-radius: 12px;
  padding: 30px 36px;
  min-width: 320px;
  max-width: 480px;
  text-align: center;
  font-family: 'MedievalSharp', Georgia, serif;
  color: #d4c4a0;
  box-shadow:
    0 0 0 1px #5d2e0a,
    0 0 40px rgba(139, 69, 19, 0.5),
    0 20px 60px rgba(0, 0, 0, 0.8);
  transform: scale(0.85) translateY(-20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

#game-modal-overlay.visible #game-modal-box {
  transform: scale(1) translateY(0);
}

#game-modal-icon {
  font-size: 42px;
  display: block;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.5));
}

#game-modal-title {
  font-family: 'Eagle Lake', 'MedievalSharp', cursive;
  font-size: 20px;
  color: #ffd700;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
  margin-bottom: 12px;
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(139, 69, 19, 0.5);
  padding-bottom: 10px;
}

#game-modal-message {
  font-size: 15px;
  line-height: 1.6;
  color: #c8b896;
  margin-bottom: 22px;
}

#game-modal-btn {
  background: linear-gradient(135deg, #8b4513 0%, #5d2e0a 100%);
  border: 1px solid #ffd700;
  color: #fff;
  padding: 10px 32px;
  font-family: 'MedievalSharp', Georgia, serif;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 2px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-shadow: 1px 1px 2px #000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

#game-modal-btn:hover {
  filter: brightness(1.25);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.5);
  transform: translateY(-1px);
}

#game-modal-btn:active {
  transform: translateY(1px);
}

/* Dekoracyjny pasek na górze okienka */
#game-modal-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #ffd700 30%, #ffd700 70%, transparent);
  border-radius: 12px 12px 0 0;
  opacity: 0.7;
}

/* ========================================================================= */
/* TOAST NOTIFICATIONS                                                        */
/* ========================================================================= */

#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 99980;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(30, 18, 8, 0.95);
  border: 1px solid #8b4513;
  border-left: 4px solid #8b4513;
  color: #d4c4a0;
  padding: 10px 16px;
  border-radius: 6px;
  font-family: Georgia, serif;
  font-size: 14px;
  max-width: 320px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast.success {
  border-left-color: #4caf50;
}

.toast.error {
  border-left-color: #e53935;
}

.toast.info {
  border-left-color: #ffd700;
}

.race-card img {
  width: 100%;
  max-height: 100px;
  object-fit: contain;
  display: block;
  margin-bottom: 10px;
}

.race-card {
  padding: 10px 12px;
  min-height: 140px;
}

.race-card img {
  max-height: 60px;
  margin-bottom: 6px;
}

.race-description {
  line-height: 1.2;
}

/* --- ANIMACJE LIVING MAP --- */

@keyframes locationBreathe {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.08);
  }
}

.location.city,
.location.forest,
.location.river,
.location.ruin,
.location.orc-camp {
  transition: transform 0.3s ease;
}

.location.city,
.location.orc-camp {
  animation: locationBreathe 3s infinite alternate ease-in-out;
}

/* Styl dla cząsteczek (świetliki / liście) */
.particle {
  position: absolute;
  pointer-events: none;
  z-index: 25;
  border-radius: 50%;
  filter: blur(1px);
}

.particle.firefly {
  background-color: #fff700;
  box-shadow: 0 0 8px #fff700, 0 0 15px rgba(255, 247, 0, 0.5);
}

.particle.leaf {
  background-color: #8b4513;
  opacity: 0.4;
  border-radius: 2px 10px;
  /* Kształt liścia */
}

.cloud {
  position: absolute;
  pointer-events: none;
  z-index: 45;
  background-size: contain;
  background-repeat: no-repeat;
  mix-blend-mode: screen;
  filter: blur(10px);
  opacity: 0.5;
  transition: filter 2s, opacity 2s; /* Płynne przejście przy zmianie pory */
}

.cloud.golden {
  background-image: url('../../assets/images/cloud_golden.png');
}

.cloud.stormy {
  background-image: url('../../assets/images/cloud_stormy.png');
}

.cloud.night {
  filter: blur(15px) brightness(0.3) saturate(0.5); /* Ciemniejsze i mniej nasycone w nocy */
  opacity: 0.35;
}

  border-radius: 50%;
}

/* Styl dla oznaczenia przedmiotów questowych w plecaku */
.quest-item-badge {
  background: rgba(80, 80, 80, 0.4);
  color: #bbb;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #555;
  font-style: italic;
  pointer-events: none;
  display: inline-block;
  margin-top: 2px;
}