/* ============================================================
   Zpívánky – styly
   ============================================================ */

:root {
  --theme-color: #2e1a3e;
  --theme-color-light: #4a2a5e;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--theme-color);
}

/* ---- LOGO (nahoře uprostřed, 5× tap → menu) ---- */
.logo-container {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  pointer-events: all;
}

.logo {
  width: 90px;
  height: auto;
  display: block;
  cursor: pointer;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
  transition: transform 0.1s ease;
}

.logo:active {
  transform: scale(0.9);
}

/* ---- LEVÝ PRUH – náhledy scén ---- */
.scene-strip {
  position: fixed;
  left: 0;
  top: 0;
  height: 100%;
  width: 129px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3);
  scrollbar-width: none;
  -ms-overflow-style: none;
  touch-action: pan-y;
}

.scene-strip::-webkit-scrollbar {
  display: none;
}

.scene-thumb {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  min-height: 96px;
  padding: 0;
  border: 3px solid transparent;
  border-radius: 12px;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.15s ease, border-color 0.15s ease;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scene-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9px;
  pointer-events: none;
  display: block;
}

.scene-thumb:active {
  transform: scale(0.88);
}

.scene-thumb.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

/* ---- AKČNÍ TLAČÍTKO (vedle stripu nahoře vlevo) ---- */
.action-btn {
  position: fixed;
  top: 16px;
  left: 145px;
  z-index: 50;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  touch-action: manipulation;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.action-btn img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
}

.action-btn:active {
  transform: scale(0.9);
}

/* ---- HERNÍ OBLAST ---- */
.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.scene-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.scene-img.scene-transition {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.scene-img.scene-visible {
  opacity: 1;
}

/* ---- VIDEO OVERLAY (MP4 přes obrázek) ---- */
.scene-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  pointer-events: none;
}

.scene-video.hidden {
  display: none;
}

/* ---- PLAY TLAČÍTKO (vpravo dole) ---- */
.play-btn {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 50;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  touch-action: manipulation;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.play-btn img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
}

.play-btn:active {
  transform: scale(0.9);
}

.play-btn.hidden {
  display: none;
}

/* ---- SETTINGS MODAL ---- */
.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.settings-modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.settings-content {
  background: #2d2d2d;
  border-radius: 20px;
  padding: 30px;
  max-width: 90%;
  width: 440px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

/* ---- SETTINGS TABS ---- */
.settings-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
}

.settings-tab {
  flex: 1;
  padding: 10px 6px;
  border: none;
  border-radius: 8px 8px 0 0;
  background: #444;
  color: #aaa;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.settings-tab.active {
  background: var(--theme-color);
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ---- NASTAVENÍ – formulářové prvky ---- */
.setting-item {
  margin-bottom: 20px;
}

.setting-item label {
  display: block;
  color: #ddd;
  margin-bottom: 8px;
  font-size: 14px;
}

.setting-item input[type="range"] {
  width: 100%;
  accent-color: #6c63ff;
}

.setting-item input[type="number"] {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #555;
  background: #1a1a1a;
  color: #fff;
  font-size: 16px;
}

.range-value {
  display: block;
  text-align: right;
  color: #aaa;
  font-size: 13px;
  margin-top: 4px;
}

.setting-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.setting-toggle label {
  margin-bottom: 0;
}

.toggle-btn {
  padding: 8px 18px;
  border: none;
  border-radius: 8px;
  background: #555;
  color: #aaa;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.toggle-btn.active {
  background: #2e7d32;
  color: #fff;
}

/* ---- TLAČÍTKA ---- */
.settings-btn {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  border: none;
  border-radius: 8px;
  background: var(--theme-color);
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease;
}

.settings-btn:active {
  background: var(--theme-color-light);
}

.settings-btn-secondary {
  background: #444;
}

.settings-btn-secondary:active {
  background: #555;
}

/* ---- ANALYTICS TABULKA ---- */
.analytics-table-wrap {
  overflow-x: auto;
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.analytics-table th,
.analytics-table td {
  padding: 8px 6px;
  text-align: center;
  color: #ddd;
  border-bottom: 1px solid #444;
}

.analytics-table th {
  color: #fff;
  font-size: 12px;
  text-transform: uppercase;
  background: #0a0a1e;
}

.analytics-table td:first-child {
  text-align: left;
  font-size: 13px;
  word-break: break-word;
}

/* ---- SAFE-AREA (notch/iPad) ---- */
@supports (padding-top: env(safe-area-inset-top)) {
  .scene-strip {
    padding-top: max(12px, env(safe-area-inset-top));
    padding-left: max(8px, env(safe-area-inset-left));
    width: calc(129px + env(safe-area-inset-left));
  }
  .action-btn {
    top: max(16px, env(safe-area-inset-top));
    left: calc(129px + env(safe-area-inset-left) + 16px);
  }
  .logo-container {
    top: max(0px, env(safe-area-inset-top));
  }
  .play-btn {
    bottom: max(16px, env(safe-area-inset-bottom));
    right: max(16px, env(safe-area-inset-right));
  }
}
