/* ── Google Fonts (Outfit pro text, Cinzel pro fantasy RPG nadpisy) ───────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;800;900&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ── Reset & proměnné ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #0a0a10; /* Hluboký noční tmavý prostor */
  --bg-gradient:  radial-gradient(circle at center, #1b1b32 0%, #06060a 100%);
  --bg2:          rgba(19, 19, 35, 0.6); /* Průhlednost pro glassmorphism */
  --bg3:          #161626;
  --accent:       #a78bfa; /* Ametysová fialová */
  --accent-glow:  rgba(167, 139, 250, 0.4);
  --accent-grad:  linear-gradient(135deg, #a78bfa 0%, #f472b6 100%); /* Fialovo-růžový herní gradient */
  --accent2:      #fbbf24; /* Jantarově zlatá */
  --text:         #f3f4f6; /* Skoro bílá */
  --text-dim:     #9ca3af; /* Tlumená šedá */
  --border:       rgba(255, 255, 255, 0.07);
  --border-focus: rgba(167, 139, 250, 0.5);
  --radius:       14px;
  --nav-h:        66px;   /* výška spodní navigace na mobilu */
  --header-h:     58px;
  --shadow:       0 8px 32px 0 rgba(0, 0, 0, 0.6);
  --input-bg:     rgba(10, 10, 15, 0.6);
  --input-bg-focus: rgba(10, 10, 15, 0.85);
  --header-bg:    rgba(22, 22, 38, 0.75);
  --nav-bg:       rgba(22, 22, 38, 0.85);
  --dropdown-bg:  rgba(22, 22, 38, 0.95);
  --transition:   all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  height: 100%;
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  background: var(--bg);
  background-attachment: fixed;
  color: var(--text);
  overscroll-behavior: none;
  letter-spacing: -0.01em;
}

/* ── Vlastní Scrollbary ───────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  transition: var(--transition);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ── Utility ────────────────────────────────────────────────────────────────── */
.hidden   { display: none !important; }
.error    { color: #f87171; font-size: .875rem; margin-top: .5rem; font-weight: 500; }
.hint     { color: var(--text-dim); font-size: .8rem; margin: .25rem 0 .5rem; line-height: 1.4; }

/* ── Screeny ────────────────────────────────────────────────────────────────── */
.screen          { display: none; height: 100dvh; }
.screen.active   { display: flex; flex-direction: column; }

/* ── Přihlášení ─────────────────────────────────────────────────────────────── */
#screen-login {
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg-gradient);
}

.login-wrap {
  width: 100%;
  max-width: 440px;
  background: var(--bg2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
}

.logo {
  font-family: 'Cinzel', serif;
  font-weight: 800;
  font-size: 2.1rem;
  text-align: center;
  margin-bottom: 2rem;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(167, 139, 250, 0.2));
  letter-spacing: 0.02em;
}
.logo-small {
  font-size: 1.4rem;
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  gap: 0.5rem;
}
.tab {
  flex: 1;
  padding: .75rem;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: .95rem;
  font-weight: 500;
  font-family: 'Outfit', sans-serif;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--transition);
}
.tab:hover {
  color: var(--text);
}
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-shadow: 0 0 10px rgba(167, 139, 250, 0.3);
}

.tab-panel        { display: none; }
.tab-panel.active { display: flex; flex-direction: column; gap: 1rem; }

/* Formuláře */
label {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-dim);
}
input[type="text"],
input[type="number"],
input[type="password"],
textarea,
select {
  padding: .75rem 1rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  font-family: 'Outfit', sans-serif;
  width: 100%;
  transition: var(--transition);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  background: var(--input-bg-focus);
}

/* Tlačítka */
.btn-primary {
  margin-top: .75rem;
  padding: .8rem;
  background: var(--accent-grad);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(167, 139, 250, 0.2);
  transition: var(--transition);
}
.btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(167, 139, 250, 0.4);
}
.btn-primary:active {
  transform: translateY(1px);
}
.btn-primary:disabled {
  opacity: .4;
  transform: none;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-secondary {
  padding: .6rem 1.1rem;
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: var(--transition);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.3rem;
  cursor: pointer;
  padding: .3rem .5rem;
  border-radius: 6px;
  transition: var(--transition);
}
.btn-icon:hover {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.03);
}

#btn-logout, #btn-logout-rooms {
  color: #ef4444;
  opacity: 0.8;
}
#btn-logout:hover, #btn-logout-rooms:hover {
  color: #ef4444;
  opacity: 1;
  background: rgba(239, 68, 68, 0.1);
}

.btn-danger {
  padding: .45rem 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  border-radius: 8px;
  font-size: .85rem;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: var(--transition);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.6);
  color: #fca5a5;
}

/* ── Hlavní app layout ──────────────────────────────────────────────────────── */
#screen-app {
  display: none;
  flex-direction: column;
  height: 100dvh;
}
#screen-app.active { display: flex; }

#app-header {
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  flex-shrink: 0;
  gap: .5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  z-index: 10;
}
.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: .75rem;
}
#room-label {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent);
  text-shadow: 0 0 12px rgba(167, 139, 250, 0.25);
}
#user-label {
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-dim);
}

/* Spodní navigace — mobil */
#app-nav {
  order: 3;
  display: flex;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 10;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: .65rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  cursor: pointer;
  padding: .4rem .1rem;
  transition: var(--transition);
  border-top: 3px solid transparent;
  position: relative;
  top: -1px;  /* překrýt border-top */
}
.nav-btn span {
  font-size: .65rem;
  transition: var(--transition);
}
.nav-btn:hover {
  color: var(--text);
  transform: translateY(-1px);
}
.nav-btn.active {
  color: #f472b6; /* Růžová ze zakončení gradientu */
  border-top-color: var(--accent);
}
.nav-btn.active span {
  font-weight: 600;
}

/* Navigační badge notifikace (pulzující tečka) */
.nav-btn.has-badge::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 18px;
  width: 8px;
  height: 8px;
  background-color: #ef4444; /* Živá červená */
  border-radius: 50%;
  box-shadow: 0 0 6px #ef4444;
  animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Hlavní obsah */
#app-main {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: var(--bg-gradient);
}

.panel {
  display: none;
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 1.25rem;
  -webkit-overflow-scrolling: touch;
}
.panel.active {
  display: block;
  animation: panelIn 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

/* ── Panel nadpisy ──────────────────────────────────────────────────────────── */
.panel-title {
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text);
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Karty ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.card:hover {
  border-color: rgba(167, 139, 250, 0.15);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  transform: translateY(-1px);
}

/* ── Toast notifikace ───────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: calc(var(--nav-h) + 1rem);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: .5rem;
  z-index: 999;
  pointer-events: none;
  width: min(90vw, 380px);
}
.toast {
  background: rgba(22, 22, 38, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  padding: .8rem 1.2rem;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 500;
  border-left: 4px solid var(--accent2);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  animation: toastIn .3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
}
.toast.error {
  border-left-color: #ef4444;
}
.toast.warning {
  border-left-color: #f59e0b;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Desktop layout (≥768px) ────────────────────────────────────────────────── */
@media (min-width: 768px) {
  #screen-app.active {
    flex-direction: row;
    flex-wrap: wrap;
  }
  #app-header {
    width: 100%;
    order: 0;
  }
  #app-nav {
    order: 1;
    flex-direction: column;
    width: 90px;
    height: calc(100dvh - var(--header-h));
    border-top: none;
    border-right: 1px solid var(--border);
    padding: 1rem 0;
    justify-content: flex-start;
    gap: 0.5rem;
  }
  .nav-btn {
    border-top: none;
    border-right: 3px solid transparent;
    top: 0;
    height: auto;
    width: 100%;
    padding: 1.1rem .2rem;
    font-size: .7rem;
    flex: initial;
  }
  .nav-btn span {
    font-size: .7rem;
  }
  .nav-btn:hover {
    transform: translateX(3px);
  }
  .nav-btn.active {
    border-right-color: var(--accent);
    color: var(--accent);
  }
  #app-main {
    order: 2;
    flex: 1;
    height: calc(100dvh - var(--header-h));
  }
  #toast-container {
    bottom: 2rem;
    right: 2rem;
    left: auto;
    transform: none;
  }
  .panel { padding: 2rem 2.5rem; }
}

/* ── Výběr místností a postavy ──────────────────────────────────────────────── */
.app-header-simple {
  height: var(--header-h);
  background: rgba(22, 22, 38, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  z-index: 10;
}

.rooms-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 620px;
  margin: 0 auto;
  width: 100%;
}

.rooms-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.room-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  transition: var(--transition);
}
.room-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(167, 139, 250, 0.25);
}

.room-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.room-item-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.room-item-name {
  font-weight: 600;
  font-size: 1.1rem;
}

.room-item-code {
  font-family: monospace;
  font-size: 0.75rem;
  background: rgba(167, 139, 250, 0.12);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
}

.room-item-role {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 12px;
}

.room-item-body {
  border-top: 1px dashed var(--border);
  padding-top: 0.75rem;
  margin-top: 0.25rem;
}

.char-list-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.char-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.char-badge:hover {
  border-color: var(--accent);
  background: var(--input-bg-focus);
  transform: translateY(-1px);
}

/* Status dot (pulzující tečka pro stav postavy) */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
}
.status-dot.alive {
  background-color: #10b981; /* Zelená */
  box-shadow: 0 0 8px #10b981;
  animation: pulseGreen 2s infinite;
}
.status-dot.exhausted {
  background-color: #f59e0b; /* Žlutá / Amber */
  box-shadow: 0 0 8px #f59e0b;
  animation: pulseYellow 2s infinite;
}
.status-dot.dead {
  background-color: #ef4444; /* Červená */
  box-shadow: 0 0 8px #ef4444;
  animation: pulseRed 2s infinite;
}

@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
@keyframes pulseYellow {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}
@keyframes pulseRed {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Modální okna (GM a tvorba postav) */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}
.modal.hidden {
  display: none !important;
}

.modal-content {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow);
  animation: scaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.modal-header .panel-title {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.modal-body {
  padding: 1.25rem;
  max-height: 70vh;
  overflow-y: auto;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scaleIn {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* GM tab-content */
.gm-tab-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}
.gm-tab-content.hidden {
  display: none !important;
}

/* ── Vzhled karet místností v lobby ────────────────────────────────────────── */
.room-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: var(--transition);
}
.room-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(167, 139, 250, 0.25);
}
.room-card.clickable {
  cursor: pointer;
}
.room-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.room-card-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}
.room-name {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
}
.room-name:hover {
  color: var(--accent);
}
.room-role {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 8px;
  border-radius: 12px;
}
.room-role.gm {
  background: rgba(167, 139, 250, 0.15);
  color: var(--accent);
}
.room-card-divider {
  width: 1px;
  height: 1.5rem;
  background: var(--border);
  margin: 0 0.5rem;
  align-self: center;
}

/* Resource Squares Grid Visuals */
.resource-cells-grid {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.resource-cell {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-radius: 4px;
  position: relative;
  background: rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
  transition: background-color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

/* Double-crossed (X) cell - Scar */
.resource-cell.cell-scar::before,
.resource-cell.cell-scar::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 9px;
  width: 2px;
  height: 18px;
  background: #ef4444; /* red for scars */
}
.resource-cell.cell-scar::before {
  transform: rotate(45deg);
}
.resource-cell.cell-scar::after {
  transform: rotate(-45deg);
}

/* Single-crossed (/) cell - Fatigue */
.resource-cell.cell-fatigue::before {
  content: '';
  position: absolute;
  top: 1px;
  left: 9px;
  width: 2px;
  height: 18px;
  background: var(--text-dim);
  transform: rotate(45deg);
}

.resource-cell.cell-empty:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--text-dim);
}

.resource-cell.cell-fatigue:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
}

/* Scar group wrapper with dashed blue line */
.scar-group-wrapper {
  border: 2px dashed #3b82f6; /* blue dashed line */
  border-radius: 6px;
  padding: 3px;
  display: inline-flex;
  gap: 4px;
  background: rgba(59, 130, 246, 0.05);
  transition: background-color 0.2s, border-color 0.2s;
  align-items: center;
}

.scar-group-wrapper:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: #ef4444 !important;
}

.scar-group-wrapper:hover .resource-cell.cell-scar::before,
.scar-group-wrapper:hover .resource-cell.cell-scar::after {
  background: #ef4444 !important;
}

/* Limit changes inline buttons style */
.btn-limit-change {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-limit-change:hover {
  background: var(--accent-grad);
  color: #fff;
  border-color: transparent;
}

/* Nav Dropdown styling */
.nav-dropdown {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
}

@media (min-width: 768px) {
  .nav-dropdown {
    width: 100%;
    flex: initial;
  }
}

.nav-dropdown-content {
  position: absolute;
  background: var(--dropdown-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  z-index: 100;
  display: flex;
  flex-direction: column;
  min-width: 130px;
}

/* Mobile: layout at the bottom, dropdown opens upwards */
@media (max-width: 767px) {
  .nav-dropdown-content {
    bottom: calc(100% + 5px);
    right: 0;
  }
  .nav-dropdown-content .nav-btn {
    padding: 0.75rem 1rem;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    border-top: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
    justify-content: flex-start;
  }
  .nav-dropdown-content .nav-btn span {
    font-size: 0.8rem;
  }
}

/* Desktop: layout on the left, dropdown opens to the right */
@media (min-width: 768px) {
  .nav-dropdown-content {
    left: calc(100% + 5px);
    top: 0;
  }
  .nav-dropdown-content .nav-btn {
    padding: 0.75rem 1rem;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
    text-align: left;
    justify-content: flex-start;
  }
  .nav-dropdown-content .nav-btn span {
    font-size: 0.8rem;
  }
}

.nav-dropdown-content .nav-btn:last-child {
  border-bottom: none;
}

.nav-dropdown-content.hidden {
  display: none;
}

/* ── Vizuální motivy (Themes) ────────────────────────────────────────────── */

/* Světlý motiv */
html.theme-light {
  --bg:           #f8fafc;
  --bg-gradient:  radial-gradient(circle at center, #f1f5f9 0%, #e2e8f0 100%);
  --bg2:          rgba(255, 255, 255, 0.75);
  --bg3:          #ffffff;
  --accent:       #6366f1;
  --accent-glow:  rgba(99, 102, 241, 0.2);
  --accent-grad:  linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --accent2:      #d97706;
  --text:         #0f172a;
  --text-dim:     #475569;
  --border:       rgba(15, 23, 42, 0.08);
  --border-focus: rgba(99, 102, 241, 0.4);
  --shadow:       0 8px 32px 0 rgba(15, 23, 42, 0.08);
  --input-bg:     rgba(241, 245, 249, 0.8);
  --input-bg-focus: #f1f5f9;
  --header-bg:    rgba(255, 255, 255, 0.75);
  --nav-bg:       rgba(241, 245, 249, 0.85);
  --dropdown-bg:  rgba(255, 255, 255, 0.95);
}

/* Barevný tmavý motiv (Smaragdový les) */
html.theme-colorful-dark {
  --bg:           #022c22;
  --bg-gradient:  radial-gradient(circle at center, #064e3b 0%, #02140f 100%);
  --bg2:          rgba(6, 78, 59, 0.55);
  --bg3:          #022c22;
  --accent:       #10b981;
  --accent-glow:  rgba(16, 185, 129, 0.35);
  --accent-grad:  linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
  --accent2:      #fbbf24;
  --text:         #f0fdf4;
  --text-dim:     #a7f3d0;
  --border:       rgba(255, 255, 255, 0.08);
  --border-focus: rgba(16, 185, 129, 0.4);
  --shadow:       0 8px 32px 0 rgba(0, 0, 0, 0.6);
  --input-bg:     rgba(2, 44, 34, 0.6);
  --input-bg-focus: rgba(2, 44, 34, 0.85);
  --header-bg:    rgba(2, 44, 34, 0.75);
  --nav-bg:       rgba(2, 44, 34, 0.85);
  --dropdown-bg:  rgba(2, 44, 34, 0.95);
}

/* Barevný světlý motiv (Pergamen) */
html.theme-colorful-light {
  --bg:           #fef3c7;
  --bg-gradient:  radial-gradient(circle at center, #fde68a 0%, #fcd34d 100%);
  --bg2:          rgba(255, 255, 255, 0.85);
  --bg3:          #fffbeb;
  --accent:       #ea580c;
  --accent-glow:  rgba(234, 88, 12, 0.2);
  --accent-grad:  linear-gradient(135deg, #ea580c 0%, #d97706 100%);
  --accent2:      #b45309;
  --text:         #451a03;
  --text-dim:     #78350f;
  --border:       rgba(69, 26, 3, 0.1);
  --border-focus: rgba(234, 88, 12, 0.4);
  --shadow:       0 8px 32px 0 rgba(69, 26, 3, 0.12);
  --input-bg:     rgba(254, 243, 199, 0.65);
  --input-bg-focus: #fffefb;
  --header-bg:    rgba(254, 243, 199, 0.75);
  --nav-bg:       rgba(253, 230, 138, 0.85);
  --dropdown-bg:  rgba(255, 251, 235, 0.95);
}

/* Motiv Honzíkova (Pistáciový) */
html.theme-honzikova {
  --bg:           #d8ecc8;
  --bg-gradient:  radial-gradient(circle at center, #e2f0d9 0%, #c6e0b4 100%);
  --bg2:          rgba(255, 255, 255, 0.6);
  --bg3:          #eef6e8;
  --accent:       #3f6212;
  --accent-glow:  rgba(63, 98, 18, 0.25);
  --accent-grad:  linear-gradient(135deg, #65a30d 0%, #22c55e 100%);
  --accent2:      #b45309;
  --text:         #1a2e05;
  --text-dim:     #3f6212;
  --border:       rgba(26, 46, 5, 0.15);
  --border-focus: rgba(63, 98, 18, 0.5);
  --shadow:       0 8px 32px 0 rgba(26, 46, 5, 0.1);
  --input-bg:     rgba(216, 236, 200, 0.65);
  --input-bg-focus: #f4faf0;
  --header-bg:    rgba(238, 246, 232, 0.75);
  --nav-bg:       rgba(226, 240, 217, 0.85);
  --dropdown-bg:  rgba(255, 255, 255, 0.95);
}

/* Barevný červený motiv (Temná svatyně) */
html.theme-colorful-red {
  --bg:           #1a0505;
  --bg-gradient:  radial-gradient(circle at center, #450a0a 0%, #0f0202 100%);
  --bg2:          rgba(69, 10, 10, 0.45);
  --bg3:          #1a0505;
  --accent:       #dc2626;
  --accent-glow:  rgba(220, 38, 38, 0.35);
  --accent-grad:  linear-gradient(135deg, #dc2626 0%, #f43f5e 100%);
  --accent2:      #fbbf24;
  --text:         #fef2f2;
  --text-dim:     #fecaca;
  --border:       rgba(255, 255, 255, 0.08);
  --border-focus: rgba(220, 38, 38, 0.4);
  --shadow:       0 8px 32px 0 rgba(0, 0, 0, 0.6);
  --input-bg:     rgba(26, 5, 5, 0.6);
  --input-bg-focus: rgba(26, 5, 5, 0.85);
  --header-bg:    rgba(26, 5, 5, 0.75);
  --nav-bg:       rgba(26, 5, 5, 0.85);
  --dropdown-bg:  rgba(26, 5, 5, 0.95);
}

/* ── Přepínač motivů (Theme Picker) ───────────────────────────────────────── */
.theme-picker-container {
  margin-top: 1.75rem;
  text-align: center;
  border-top: 1px dashed var(--border);
  padding-top: 1.25rem;
}

.theme-picker-title {
  font-size: 0.85rem;
  color: var(--text-dim);
  display: block;
  margin-bottom: 0.75rem;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.theme-picker-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
}

.theme-select-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.theme-select-btn:hover {
  transform: scale(1.15) !important;
}

.theme-btn-dark {
  background: radial-gradient(circle, #1b1b32 0%, #06060a 100%) !important;
}

.theme-btn-light {
  background: radial-gradient(circle, #f1f5f9 0%, #e2e8f0 100%) !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.1) !important;
}

.theme-btn-colorful-dark {
  background: radial-gradient(circle, #064e3b 0%, #02140f 100%) !important;
}

.theme-btn-colorful-light {
  background: radial-gradient(circle, #fde68a 0%, #fcd34d 100%) !important;
  border: 1px solid rgba(69, 26, 3, 0.12) !important;
  box-shadow: 0 4px 10px rgba(69, 26, 3, 0.08) !important;
}

.theme-btn-honzikova {
  background: radial-gradient(circle, #e2f0d9 0%, #c6e0b4 100%) !important;
  border: 1px solid rgba(26, 46, 5, 0.15) !important;
  box-shadow: 0 4px 10px rgba(26, 46, 5, 0.1) !important;
}

.theme-btn-colorful-red {
  background: radial-gradient(circle, #450a0a 0%, #0f0202 100%) !important;
}

/* ── Integrovaný Status Bar v záhlaví (App HUD) ───────────────────────────── */
.header-status-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex: 1;
  padding: 0 1rem;
}
.status-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
}
.status-label {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}
.status-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
/* Barevné rozlišení tlačítek */
.status-item[data-resource="telo"] .status-btn {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.25);
}
.status-item[data-resource="telo"] .status-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
}
.status-item[data-resource="duse"] .status-btn {
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.25);
}
.status-item[data-resource="duse"] .status-btn:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: #3b82f6;
}
.status-item[data-resource="vliv"] .status-btn {
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.25);
}
.status-item[data-resource="vliv"] .status-btn:hover {
  background: rgba(168, 85, 247, 0.15);
  border-color: #a855f7;
}
.status-item[data-resource="ohrozeni"] .status-btn {
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.25);
}
.status-item[data-resource="ohrozeni"] .status-btn:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: #eab308;
}

.status-value {
  font-family: monospace;
  font-weight: 700;
  color: var(--text);
  font-size: 0.85rem;
}
.status-value.status-warning { color: #f59e0b; }
.status-value.status-critical { color: #ef4444; }

/* Responzivní přizpůsobení */
@media (max-width: 900px) {
  .status-label { display: none !important; }
}
@media (max-width: 768px) {
  .status-money { display: none !important; }
}
@media (max-width: 600px) {
  .status-ohrozeni { display: none !important; }
}
@media (max-width: 480px) {
  .header-status-bar { display: none !important; }
}



