/* ========== BASE ========== */
body {
  margin: 0;
  padding: 20px;
  font-family: 'Merienda', cursive;
  color: #eee;
  background-image: url('https://wallpapers.com/images/hd/dark-souls-3-darkmoon-above-irithyll-city-4ci96nra6e1a11gz.webp');
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2;
  pointer-events: none;
}

#smoke-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  opacity: 0.5;
  pointer-events: none;
  mix-blend-mode: screen;
}

body > *:not(#smoke-overlay) {
  position: relative;
  z-index: 10;
}

/* ========== TYPOGRAPHY ========== */
h1, h2, h3 {
  font-family: 'Merienda', cursive;
  letter-spacing: 2px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
  text-align: center;
  width: 100%;
}

h1 {
  font-size: 2.8em;
  border-bottom: 3px solid #ff4500;
  display: block;
  padding-bottom: 5px;
  margin: 10px 0 20px 0;
}

h2 {
  color: #ff4500;
  margin: 40px 0 20px 0;
}

h3 {
  color: #ffa500;
  margin: 30px 0 15px 0;
}

/* ========== PROGRESS BAR ========== */
#progressContainer {
  width: 100%;
  background: #222;
  border: 2px solid #444;
  border-radius: 15px;
  box-shadow: inset 0 2px 5px #000;
  margin-bottom: 15px;
}
#progressBar {
  height: 30px;
  width: 0%;
  background: linear-gradient(90deg, #b33, #ff4500);
  border-radius: 15px;
  box-shadow: 0 0 10px #ff4500;
  text-align: center;
  line-height: 30px;
  color: #fff;
  font-weight: bold;
  transition: width 0.5s ease;
}
#progressText {
  margin-bottom: 10px;
  font-size: 1.2em;
  text-align: center;
}

/* ========== VIEWER COUNT (fixed oben links) ========== */
#viewerCount {
  position: fixed;
  top: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #ff4500;
  border-radius: 30px;
  padding: 8px 16px;
  font-size: 1.1em;
  color: #ffaa33;
  box-shadow: 0 0 15px rgba(255, 69, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 999999;
  white-space: nowrap;
  margin: 0;
  display: inline-block;
  text-align: center;
}

/* ========== LEGEND (fixed unten rechts) ========== */
#legend {
  position: fixed;
  bottom: 20px;
  right: 20px;
  max-width: 280px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid #b8860b;
  border-radius: 10px;
  padding: 15px 20px;
  backdrop-filter: blur(4px);
  box-shadow: 0 0 20px rgba(0,0,0,0.8);
  z-index: 999999;
  margin: 0;
  text-align: left;
}
#legend h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #ffaa33;
  font-family: 'Cinzel', serif;
  font-size: 1.5em;
  text-align: left;
}
.legend-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.3);
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid #444;
  color: #eee;
  font-size: 0.9em;
}
.legend-icon {
  font-size: 1.2em;
  color: #ffaa33;
}
.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: inline-block;
}
.legend-badge {
  background: rgba(0,0,0,0.7);
  border: 1px solid #ff4500;
  border-radius: 12px;
  padding: 2px 8px;
  font-family: 'Cinzel', serif;
  font-weight: bold;
  color: white;
}

/* ========== FLOATING DEATH COUNTER (top right) ========== */
#floating-death-counter {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #ff4500;
  border-radius: 30px;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: bold;
  color: #ff4500;
  box-shadow: 0 0 15px rgba(255, 69, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000000; /* etwas höher */
  white-space: nowrap;
}

#deathCountDisplay {
  font-size: 1.2em;
  font-family: 'Cinzel', serif;
  color: white;
}

.death-btn {
  background: #ff4500;
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  padding: 0;
  line-height: 1;
  margin: 0;
}
.death-btn:hover {
  background: #ff6347;
  transform: scale(1.1);
}
.death-btn:active {
  transform: scale(0.95);
}

/* ========== READ-ONLY MODE (Admin) ========== */
.read-only #addDeathBtn,
.read-only #resetBtn,
.read-only .edit-vod-btn,
.read-only .edit-yt-btn {
  display: none !important;
}
.read-only .boss-death-display {
  pointer-events: none !important;
}

/* ========== RESET BUTTON ========== */
#resetBtn {
  padding: 8px 15px;
  background: #ff4500;
  color: white;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
  margin: 20px auto;
  display: block;
}
#resetBtn:hover {
  background: #ff6347;
}

/* ========== INTRO ========== */
.intro {
  padding: 40px 30px;
  margin: 50px 0;
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.7);
  color: #fff;
  text-shadow: 1px 1px 3px black;
  background: rgba(0, 0, 0, 0.7);
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  font-size: 1.2em;
  line-height: 1.7;
}

.intro h2 {
  font-size: 2.2em;
  margin-bottom: 30px;
  color: #ffaa33;
  text-shadow: 0 0 10px #ff4500;
}

.intro-quote {
  font-style: italic;
  font-size: 1.4em;
  color: #ffaa33;
  margin: 20px 0 30px 0;
}

.intro-final {
  margin-top: 40px;
  font-size: 1.3em;
}

/* ========== RULES ========== */
.rules {
  background: rgba(0,0,0,0.4);
  border: 2px solid #b8860b;
  border-radius: 20px;
  padding: 40px 30px;
  margin: 60px auto;
  max-width: 900px;
  box-shadow: 0 0 30px rgba(255, 69, 0, 0.3), inset 0 0 20px rgba(0,0,0,0.8);
  position: relative;
  text-align: center;
  backdrop-filter: blur(3px);
}

.rules::before,
.rules::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #ff4500, #b8860b, #ff4500, transparent);
  border-radius: 50%;
}

.rules::before { top: -5px; }
.rules::after { bottom: -5px; }

.rules h2 {
  font-family: 'Cinzel', serif;
  font-size: 2.4em;
  color: #ffaa33;
  text-shadow: 0 0 10px #ff4500, 2px 2px 4px black;
  margin-top: 0;
  margin-bottom: 30px;
  letter-spacing: 4px;
  border: none;
  display: inline-block;
  padding: 0 20px;
  background: rgba(0,0,0,0);
  border-radius: 40px;
  line-height: 1.4;
}

.rules ul {
  list-style: none;
  padding: 0;
  margin: 20px 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.rules li {
  font-family: 'Merienda', cursive;
  font-size: 1.1em;
  line-height: 1.5;
  color: #f0e6d2;
  background: rgba(0, 0, 0, 0.5);
  padding: 15px 20px;
  border-radius: 15px;
  border-left: 4px solid #ff4500;
  box-shadow: 0 5px 10px rgba(0,0,0,0.5);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rules li:hover {
  transform: translateX(5px);
  box-shadow: 0 8px 15px rgba(255, 69, 0, 0.4);
  border-left-color: #ffaa33;
}

.rule-title {
  font-family: 'Cinzel', serif;
  font-size: 1.3em;
  font-weight: bold;
  color: #ffaa33;
  text-shadow: 0 0 5px #ff4500;
  letter-spacing: 1px;
}

.rule-text {
  font-size: 1em;
  color: #ddd;
}

/* ========== SPONSOR ========== */
.sponsor {
  text-align: center;
  color: #ddd;
  font-size: 1em;
  margin: 30px auto 20px auto;
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #b8860b;
  border-radius: 40px;
  max-width: 500px;
  backdrop-filter: blur(2px);
  box-shadow: 0 0 15px rgba(255, 69, 0, 0.2);
  font-family: 'Merienda', cursive;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.sponsor:hover {
  border-color: #ff4500;
  box-shadow: 0 0 20px rgba(255, 69, 0, 0.5);
  background: rgba(0, 0, 0, 0.6);
  transform: scale(1.02);
}

.sponsor strong {
  color: #ffaa33;
  font-weight: bold;
  text-shadow: 0 0 5px #ff4500;
}

/* ========== BOSS GRIDS ========== */
.bossGrid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 20px;
}

.card {
  background: rgba(20, 20, 20, 0.9);
  border: 1px solid #444;
  border-radius: 10px;
  padding: 10px 0 0 0;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 8px rgba(0,0,0,0.6);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 160px;
  box-sizing: border-box;
  min-height: 280px;
}
.card.alive {
  border-color: #ff4500;
  box-shadow: 0 0 10px rgba(255,69,0,0.3);
}
.card.defeated {
  opacity: 0.9;
  border-color: #666;
}
.card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 10px 20px rgba(0,0,0,0.8);
}

.card-content {
  width: 100%;
  padding: 0 10px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.card-content img {
  width: 120px;
  height: 120px;
  border-radius: 10px;
  object-fit: cover;
  margin-bottom: 0;
}

.card-content h3 {
  margin: 0;
  font-size: 0.9em;
  font-family: 'Roboto', sans-serif;
  word-break: break-word;
  text-align: center;
  width: 100%;
  line-height: 1.3em;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card.defeated .card-content img,
.card.defeated .card-content h3 {
  filter: grayscale(100%) brightness(70%);
}

.boss-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  border: 2px solid #ff4500;
  border-radius: 8px;
  padding: 5px 8px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.5);
  margin-top: auto;
}

.card.defeated .boss-footer {
  border-color: #888;
}

.boss-footer .youtube-icon {
  font-size: 1.5em;
  color: #ff0000;
  text-decoration: none;
  transition: transform 0.2s, color 0.2s;
  display: inline-block;
}
.boss-footer .youtube-icon:hover {
  color: #ff4d4d;
  transform: scale(1.2);
}
.boss-footer .youtube-icon {
  display: none;
}
.card.defeated .boss-footer .youtube-icon.show {
  display: inline-block;
}

.boss-death-display {
  font-family: 'Cinzel', serif;
  font-size: 1.1em;
  font-weight: bold;
  color: white;
  background: rgba(0, 0, 0, 0.7);
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid #ff4500;
  cursor: default;
  text-align: center;
  flex: 1;
  margin: 0 5px;
}

.read-only .boss-death-display {
  cursor: default;
}

.boss-death-display.editable {
  cursor: pointer;
}
.boss-death-display.editable:hover {
  background: #ff4500;
  color: black;
}

.boss-footer .twitch-icon {
  font-size: 1.5em;
  color: #6441a5;
  text-decoration: none;
  transition: transform 0.2s, color 0.2s;
  display: inline-block;
}
.boss-footer .twitch-icon:hover {
  color: #9147ff;
  transform: scale(1.2);
}
.boss-footer .twitch-icon {
  display: none;
}
.card.defeated .boss-footer .twitch-icon.show {
  display: inline-block;
}

.edit-buttons {
  position: absolute;
  top: 5px;
  right: 5px;
  display: flex;
  gap: 5px;
  z-index: 20;
}

.edit-vod-btn,
.edit-yt-btn {
  background: rgba(0, 0, 0, 0.7);
  color: #ffaa33;
  border: 1px solid #ff4500;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 0.8em;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
}
.read-only .edit-vod-btn,
.read-only .edit-yt-btn {
  display: none !important;
}
.edit-vod-btn:hover,
.edit-yt-btn:hover {
  background: #ff4500;
  color: white;
  transform: scale(1.1);
}

/* ========== ADMIN LOGIN BUTTONS & FORM ========== */
#adminControls {
  text-align: center;
  margin: 10px auto;
}

.admin-btn {
  background: #333;
  color: #ffaa33;
  border: 1px solid #ff4500;
  border-radius: 20px;
  padding: 5px 15px;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.2s;
  margin: 0 5px;
}
.admin-btn:hover {
  background: #ff4500;
  color: white;
  transform: scale(1.05);
}

#adminLogoutBtn {
  display: none;
}

#loginForm {
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid #ff4500;
  border-radius: 10px;
  padding: 20px;
  max-width: 300px;
  margin: 10px auto;
  text-align: center;
  box-shadow: 0 0 20px rgba(255,69,0,0.5);
}
#loginForm h3 {
  color: #ffaa33;
  margin-top: 0;
}
#loginForm input {
  width: 90%;
  padding: 8px;
  margin: 5px;
  border-radius: 5px;
  border: 1px solid #ff4500;
  background: #222;
  color: white;
}
#loginForm button {
  background: #ff4500;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  margin: 5px;
}
#loginForm button:hover {
  background: #ff6347;
}
#loginError {
  color: red;
  font-size: 0.9em;
  display: none;
}

/* ========== FADE-IN ========== */
.fade-target {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.fade-target.fade-in {
  opacity: 1;
  transform: translateY(0);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 800px) {
  .card { width: 140px; min-height: 260px; }
  .card-content img { width: 100px; height: 100px; }
}
@media (max-width: 600px) {
  h1 { font-size: 2em; }
  .intro { padding: 30px 20px; }
  .card { width: 120px; min-height: 240px; }
  .card-content img { width: 80px; height: 80px; }
  #floating-death-counter { padding: 5px 10px; font-size: 0.9em; }
  .death-btn { width: 25px; height: 25px; font-size: 1em; }
}
/* ===== FIXED POSITIONEN – MIT !important ===== */
#viewerCount {
  position: fixed !important;
  top: 20px !important;
  left: 20px !important;
  right: auto !important;
  bottom: auto !important;
  z-index: 1000000 !important;
}

#floating-death-counter {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  left: auto !important;
  bottom: auto !important;
  z-index: 1000001 !important;
}

#legend {
  position: fixed !important;
  top: 80px !important;        /* unter dem Viewer (Viewer ist bei top:20px, plus Höhe) */
  left: 20px !important;
  bottom: auto !important;
  right: auto !important;
  max-width: 280px !important;
  z-index: 1000000 !important;
  background: rgba(0, 0, 0, 0.85) !important;
  border: 1px solid #b8860b !important;
  border-radius: 10px !important;
  padding: 15px 20px !important;
  backdrop-filter: blur(4px) !important;
  box-shadow: 0 0 20px rgba(0,0,0,0.8) !important;
}