/* ==========================================================================
   SŁAWA: 536 – ŚWIT POPIOŁÓW | HUD & Interfejs Gry (Strategia + RPG)
   ========================================================================== */

#game-hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 30;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#game-hud.hidden {
  display: none;
}

/* Elementy interaktywne w HUD */
.hud-interactive {
  pointer-events: auto;
}

/* ==========================================================================
   Pasek Górny (Top Bar) - Surowce, Rok 536, Pora Roku, Kalendarz Słowiański
   ========================================================================== */

#hud-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px;
  background: linear-gradient(180deg, rgba(16, 10, 7, 0.95) 0%, rgba(26, 16, 11, 0.8) 100%);
  border-bottom: 2px solid var(--gold-dark);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
  font-size: 0.95rem;
}

.topbar-left, .topbar-center, .topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Kalendarz i Czas */
.time-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(45, 28, 18, 0.7);
  padding: 4px 10px;
  border-radius: 3px;
  border: 1px solid var(--gold-dark);
}

.time-year {
  color: var(--gold-bright);
  font-weight: 700;
}

.time-season {
  color: var(--text-main);
}

.time-icon {
  font-size: 1.1rem;
}

/* Pasek Surowców */
.resources-list {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.res-item {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(0, 0, 0, 0.4);
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid rgba(140, 88, 26, 0.4);
  font-size: 0.9rem;
}

.res-icon {
  font-size: 1rem;
}

.res-val {
  font-weight: bold;
  color: var(--gold-bright);
}

/* Przyciski w pasku górnym */
.hud-btn-icon {
  background: rgba(45, 28, 18, 0.8);
  border: 1px solid var(--gold-dark);
  color: var(--gold-bright);
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-slavic);
  font-size: 0.85rem;
  transition: all 0.2s;
}

.hud-btn-icon:hover {
  background: var(--gold-dark);
  color: #fff;
  border-color: var(--gold-bright);
}

/* ==========================================================================
   Panel Dziennika Zadań (Quest Tracker)
   ========================================================================== */

#quest-tracker {
  position: absolute;
  top: 50px;
  right: 12px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  z-index: 35;
}

.quest-tracker-collapsed {
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}

.quest-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(22, 14, 10, 0.9);
  border: 1.5px solid var(--gold-dark);
  border-radius: 20px;
  padding: 4px 10px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.6);
  font-size: 0.8rem;
  color: var(--gold-bright);
}

.quest-pill:hover {
  border-color: var(--gold-bright);
  background: rgba(45, 28, 18, 0.95);
}

.quest-pill-title {
  font-weight: bold;
}

.quest-pill-toggle {
  font-size: 0.7rem;
  color: var(--gold-primary);
}

.quest-tracker-expanded {
  width: 280px;
  max-width: 90vw;
  background: rgba(22, 14, 10, 0.92);
  border: 2px solid var(--gold-dark);
  border-radius: 6px;
  padding: 10px 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.8);
}

.quest-tracker-header {
  font-size: 0.88rem;
  color: var(--gold-bright);
  border-bottom: 1px solid rgba(212, 155, 66, 0.3);
  padding-bottom: 4px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quest-toggle-btn {
  font-size: 0.72rem;
  color: var(--gold-primary);
}

.quest-title-current {
  font-weight: 700;
  color: #fff;
  font-size: 0.86rem;
  margin-bottom: 4px;
}

.quest-obj-item {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.3;
  margin: 3px 0;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.quest-obj-item.completed {
  color: #86efac;
  text-decoration: line-through;
}

/* ==========================================================================
   Karta Bohatera (Bottom-Left)
   ========================================================================== */

#hero-card {
  position: absolute;
  bottom: 14px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-panel);
  border: 2px solid var(--gold-primary);
  padding: 8px 12px;
  border-radius: 4px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.8);
}

.hero-avatar-box {
  width: 48px;
  height: 48px;
  border: 2px solid var(--gold-dark);
  background: #140b07;
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hero-avatar-img {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.hero-level-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  background: var(--gold-dark);
  color: #fff;
  font-size: 0.65rem;
  padding: 1px 3px;
  font-weight: bold;
}

.hero-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hero-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold-bright);
}

.bar-container {
  width: 110px;
  height: 8px;
  background: #20130c;
  border: 1px solid #4a2d19;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  transition: width 0.2s ease;
}

.bar-hp {
  background: linear-gradient(90deg, #b91c1c 0%, #ef4444 100%);
}

.bar-faith {
  background: linear-gradient(90deg, #0284c7 0%, #38bdf8 100%);
}

/* ==========================================================================
   Dolny Pasek Akcji i Budowania (Bottom Center)
   ========================================================================== */

#action-bar {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  background: var(--bg-panel);
  border: 2px solid var(--gold-dark);
  padding: 6px 10px;
  border-radius: 4px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.85);
}

.action-btn {
  width: 50px;
  height: 50px;
  background: linear-gradient(180deg, #3d2315 0%, #1f120a 100%);
  border: 1px solid var(--gold-dark);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.action-btn:hover {
  border-color: var(--gold-bright);
  background: linear-gradient(180deg, #57331f 0%, #2f1b0f 100%);
  transform: translateY(-2px);
  box-shadow: 0 0 8px rgba(212, 155, 66, 0.4);
}

.action-btn:active, .action-btn.active {
  background: linear-gradient(180deg, #7c3b17 0%, #461f0a 100%);
  border-color: #ffe17d;
  box-shadow: 0 0 10px rgba(255, 225, 125, 0.6);
}

.action-btn-icon {
  font-size: 1.3rem;
}

.action-btn-label {
  font-size: 0.62rem;
  letter-spacing: 0.5px;
  color: var(--gold-primary);
}

.action-btn-cost {
  position: absolute;
  top: -10px;
  background: #140b07;
  border: 1px solid var(--gold-dark);
  padding: 1px 4px;
  font-size: 0.6rem;
  color: #fff;
  border-radius: 2px;
  white-space: nowrap;
  display: none;
}

.action-btn:hover .action-btn-cost {
  display: block;
}

/* ==========================================================================
   Minimapa & Kontrola Gry (Bottom Right)
   ========================================================================== */

#minimap-card {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: var(--bg-panel);
  border: 2px solid var(--gold-dark);
  border-radius: 4px;
  padding: 4px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

#minimap-canvas {
  width: 120px;
  height: 120px;
  background-color: #120c08;
  border: 1px solid #3d2416;
  image-rendering: pixelated;
}

.speed-controls {
  display: flex;
  gap: 4px;
  width: 100%;
  justify-content: center;
}

.speed-btn {
  background: #25160d;
  border: 1px solid var(--gold-dark);
  color: var(--gold-bright);
  font-size: 0.75rem;
  padding: 2px 6px;
  cursor: pointer;
  border-radius: 2px;
}

.speed-btn.active {
  background: var(--gold-dark);
  color: #fff;
}

/* ==========================================================================
   Czat Wieloosobowy w Stylu Minecrafta (In-Game Multiplayer Chat)
   ========================================================================== */

#hud-minecraft-chat {
  position: absolute;
  bottom: 95px;
  left: 14px;
  width: 330px;
  max-width: calc(100vw - 28px);
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#hud-chat-history {
  max-height: 150px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 4px;
  background: rgba(14, 8, 5, 0.55);
  backdrop-filter: blur(3px);
  border: 1px solid rgba(140, 88, 26, 0.35);
  scrollbar-width: thin;
  pointer-events: auto;
}

.chat-msg-line {
  font-size: 0.82rem;
  line-height: 1.35;
  text-shadow: 1px 1px 2px #000;
  word-break: break-word;
  animation: fadeIn 0.2s ease;
}

.chat-msg-author {
  font-weight: bold;
  color: var(--gold-bright);
}

.chat-msg-system {
  color: #fbbf24;
  font-style: italic;
}

#hud-chat-input-bar {
  display: flex;
  gap: 4px;
  background: rgba(18, 10, 6, 0.94);
  border: 1.5px solid var(--gold-dark);
  border-radius: 4px;
  padding: 4px 6px;
  pointer-events: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}

#hud-chat-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-slavic);
  font-size: 0.85rem;
  outline: none;
}

#hud-chat-send-btn {
  background: var(--gold-dark);
  border: none;
  color: #fff;
  font-size: 0.8rem;
  padding: 2px 10px;
  border-radius: 3px;
  cursor: pointer;
}

#hud-chat-send-btn:hover {
  background: var(--gold-primary);
}

/* Przycisk Czat na Smartfony (Mobile Quick Chat Button) */
#mobile-chat-toggle-btn {
  position: absolute;
  top: 52px;
  left: 14px;
  background: rgba(26, 16, 11, 0.88);
  border: 1.5px solid var(--gold-dark);
  color: var(--gold-bright);
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.6);
  pointer-events: auto;
}

/* Szybkie Okrzyki Słowiańskie (Mobile Quick Callouts Dock) */
#mobile-quick-callouts {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 4px 0;
  pointer-events: auto;
  scrollbar-width: none;
}

.quick-callout-btn {
  white-space: nowrap;
  background: rgba(28, 16, 10, 0.88);
  border: 1px solid var(--gold-dark);
  color: #fde047;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.quick-callout-btn:active {
  background: var(--gold-dark);
  color: #fff;
}
