/* ==============================================================================
   malýBobr - Záznamy: Moderní designový systém
   Barevná identita: Tmavý režim Twitch/Gaming + malýBobr fialová (#632CA0, #9146FF)
   ============================================================================== */

:root {
  --bg-main: #0c0c10;
  --bg-surface: #16161d;
  --bg-card: #1c1c24;
  --bg-card-hover: #23232e;
  --bg-input: #121217;
  
  --color-primary: #632CA0;
  --color-primary-light: #7c3aed;
  --color-primary-accent: #9146FF;
  --color-primary-glow: rgba(145, 70, 255, 0.25);

  --text-main: #f4f4f7;
  --text-muted: #adadb8;
  --text-dim: #71717a;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(145, 70, 255, 0.35);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);

  --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==============================================================================
   Světlý režim (Light Mode) - alternativní motiv
   ============================================================================== */
[data-theme="light"] {
  --bg-main: #f8f9fc;
  --bg-surface: #ffffff;
  --bg-card: #f0f2f8;
  --bg-card-hover: #e5e8f2;
  --bg-input: #ffffff;
  
  --color-primary: #632CA0;
  --color-primary-light: #7c3aed;
  --color-primary-accent: #7027d4;
  --color-primary-glow: rgba(112, 39, 212, 0.18);

  --text-main: #13131a;
  --text-muted: #555566;
  --text-dim: #767688;

  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-accent: rgba(99, 44, 160, 0.38);

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
}

/* Reset & základ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==============================================================================
   Hlavička a Navigace
   ============================================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(22, 22, 29, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1.5rem;
}

.header-container {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  text-decoration: none;
}

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px var(--color-primary-glow));
}

.brand-info {
  display: flex;
  flex-direction: column;
  min-width: 170px;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 30%, #c4b5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Tlačítko přepínače motivu */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  background: var(--bg-card);
  border-color: var(--border-accent);
  color: var(--color-primary-accent);
  transform: scale(1.05);
}

.theme-icon-sun {
  display: block;
}

.theme-icon-moon {
  display: none;
}

[data-theme="light"] .theme-icon-sun {
  display: none;
}

[data-theme="light"] .theme-icon-moon {
  display: block;
}

/* Dropdown pro řazení */
.sorting-dropdown {
  position: relative;
  user-select: none;
}

.sorting-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.sorting-btn:hover {
  background: var(--bg-card);
  border-color: var(--border-accent);
}

.sorting-btn .label {
  color: var(--color-primary-accent);
}

.sorting-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 170px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.35rem;
  display: none;
  flex-direction: column;
  z-index: 101;
  animation: fadeInDown 0.15s ease-out;
}

.sorting-menu.open {
  display: flex;
}

.sorting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.sorting-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.sorting-item.active {
  background: var(--color-primary-glow);
  color: var(--color-primary-accent);
  font-weight: 600;
}

.nav-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  transition: var(--transition);
}

.nav-link-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-accent);
  color: #fff;
}

/* Přizpůsobení vybraných prvků pro světlý režim */
[data-theme="light"] .header {
  background: rgba(255, 255, 255, 0.88);
}

[data-theme="light"] .brand-title {
  background: linear-gradient(135deg, #13131a 30%, #632CA0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .nav-link-btn {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-main);
}

[data-theme="light"] .nav-link-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--color-primary-accent);
}

[data-theme="light"] .collection-overlay {
  background: linear-gradient(to top, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.25) 60%, transparent 100%);
}

[data-theme="light"] .collection-count-badge {
  background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .collection-card:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12), 0 0 16px var(--color-primary-glow);
}

[data-theme="light"] .search-clear-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text-main);
}

[data-theme="light"] .game-autocomplete-dropdown {
  background: var(--bg-surface);
  border-color: var(--color-primary-accent);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.15), 0 0 24px rgba(112, 39, 212, 0.15);
}

[data-theme="light"] .game-autocomplete-item,
[data-theme="light"] .collection-autocomplete-item {
  border-bottom-color: var(--border-subtle);
}

[data-theme="light"] .game-autocomplete-name {
  color: var(--text-main);
}

[data-theme="light"] .collection-autocomplete-thumb {
  border-color: var(--border-subtle);
}

[data-theme="light"] .traffic-stat-box-highlight {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(99, 44, 160, 0.08) 100%);
}

[data-theme="light"] .traffic-badge-human {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.3);
}

/* ==============================================================================
   Hlavní obsah
   ============================================================================== */
.main-content {
  flex: 1;
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1.2em;
  background: linear-gradient(to bottom, var(--color-primary-accent), var(--color-primary));
  border-radius: 2px;
}

.section-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ==============================================================================
   Seznam posledních 7 videí
   ============================================================================== */
.recent-videos-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 3rem;
}

.video-row-card {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 1.25rem;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: var(--transition);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.video-row-card:hover {
  background: var(--bg-card);
  border-color: var(--border-accent);
  transform: translateY(-2px) translateZ(0);
  box-shadow: var(--shadow-md);
}

.video-row-card.is-youtube:hover {
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.2);
}

.video-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-surface);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
  isolation: isolate;
  -webkit-clip-path: inset(0);
  clip-path: inset(0);
}

.video-thumb {
  display: block;
  width: 100%;
  height: calc(100% + 2px);
  margin-bottom: -2px;
  object-fit: cover;
  vertical-align: middle;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: transform;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.video-row-card:hover .video-thumb {
  transform: scale(1.05) translateZ(0);
}

.video-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.video-badge.archive,
.video-badge.twitch {
  background: rgba(145, 70, 255, 0.9);
  box-shadow: 0 0 10px rgba(145, 70, 255, 0.4);
}

.video-badge.highlight,
.video-badge.youtube {
  background: rgba(239, 68, 68, 0.95);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.45);
}

.video-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.video-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.video-game {
  color: var(--color-primary-accent);
  font-weight: 600;
}

.video-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.video-action-btn:hover,
.video-row-card:hover .video-action-btn {
  background: var(--color-primary-accent);
  box-shadow: 0 0 16px var(--color-primary-glow);
  transform: scale(1.02);
}

.video-action-btn.btn-youtube {
  background: #dc2626;
}

.video-action-btn.btn-youtube:hover,
.video-row-card.is-youtube:hover .video-action-btn.btn-youtube {
  background: #ef4444;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.55);
}

/* ==============================================================================
   Mřížka kolekcí & Vyhledávání
   ============================================================================== */
.collection-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.collection-search-wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.collection-count-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.search-input-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 280px;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: var(--transition);
}

.collection-search-input {
  width: 100%;
  padding: 0.55rem 2.25rem 0.55rem 2.35rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-main);
  font-size: 0.875rem;
  outline: none;
  transition: var(--transition);
}

.collection-search-input::placeholder {
  color: var(--text-muted);
  opacity: 0.75;
}

.collection-search-input:hover {
  border-color: var(--border-accent);
}

.collection-search-input:focus {
  border-color: var(--color-primary-accent);
  background: var(--bg-card);
  box-shadow: 0 0 14px var(--color-primary-glow);
}

.search-input-box:focus-within .search-icon {
  color: var(--color-primary-accent);
}

.search-clear-btn {
  position: absolute;
  right: 0.6rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: var(--transition);
  padding: 0;
}

.search-clear-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.collection-no-results {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 3.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
}

.collection-no-results svg {
  opacity: 0.45;
  color: var(--color-primary-accent);
}

.collection-no-results p {
  font-size: 1rem;
  margin: 0;
}

.collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.collection-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  scroll-margin-top: 96px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.collection-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-4px) translateZ(0);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5), 0 0 16px var(--color-primary-glow);
}

@keyframes anchorCardPulse {
  0%, 100% {
    border-color: var(--border-subtle);
    box-shadow: none;
  }
  45%, 60% {
    border-color: var(--color-primary-accent);
    box-shadow: 0 0 0 2px var(--color-primary-accent), 0 0 26px var(--color-primary-glow);
  }
}

.collection-card:target {
  animation: anchorCardPulse 1.15s ease-in-out 0.15s 3;
}

.collection-banner-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-surface);
  overflow: hidden;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
  isolation: isolate;
  -webkit-clip-path: inset(0);
  clip-path: inset(0);
}

.collection-banner {
  display: block;
  width: 100%;
  height: calc(100% + 2px);
  margin-bottom: -2px;
  object-fit: cover;
  vertical-align: middle;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: transform;
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.collection-card:hover .collection-banner {
  transform: scale(1.05) translateZ(0);
}

.collection-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(22, 22, 29, 0.95) 0%, rgba(22, 22, 29, 0.3) 60%, transparent 100%);
  pointer-events: none;
}

.collection-content {
  position: relative;
  z-index: 2;
  margin-top: -1px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  background: inherit;
}

.collection-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.collection-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 0.5rem;
}

.collection-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
}

.collection-last-date {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.collection-date-icon {
  color: var(--color-primary-accent);
  opacity: 0.85;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .collection-date-label {
    display: none;
  }
}

/* ==============================================================================
   Detail kolekce - mřížka videí
   ============================================================================== */
.collection-videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.collection-video-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.collection-video-card:hover {
  background: var(--bg-card);
  border-color: var(--border-accent);
  transform: translateY(-3px) translateZ(0);
  box-shadow: var(--shadow-md);
}

.collection-video-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-surface);
  overflow: hidden;
  cursor: pointer;
  scroll-margin-top: 96px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
  isolation: isolate;
  -webkit-clip-path: inset(0);
  clip-path: inset(0);
}

.collection-video-thumb-wrap .video-thumb {
  display: block;
  width: 100%;
  height: calc(100% + 2px);
  margin-bottom: -2px;
  object-fit: cover;
  vertical-align: middle;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: transform;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.collection-video-card:hover .collection-video-thumb-wrap .video-thumb {
  transform: scale(1.05) translateZ(0);
}

.play-overlay-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
}

.collection-video-card:hover .play-overlay-icon {
  opacity: 1;
}

.play-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.2s ease, background 0.2s ease;
}

.play-icon-circle.play-icon-youtube {
  background: #ef4444;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.5);
}

.collection-video-card:hover .play-icon-circle {
  transform: scale(1);
}

.collection-video-info {
  position: relative;
  z-index: 2;
  margin-top: -1px;
  padding: 0.85rem 0.9rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  background: inherit;
}

.collection-video-title {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
  min-height: 3.65rem;
  max-height: 3.65rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

/* ==============================================================================
   Lightbox Video Modal
   ============================================================================== */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.lightbox-modal.active {
  display: flex;
  opacity: 1;
}

.lightbox-container {
  position: relative;
  width: 100%;
  max-width: 1100px;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), 0 0 32px var(--color-primary-glow);
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

/* YouTube přehrávač – červený rámeček a záře */
.lightbox-container.is-youtube {
  border-color: #ef4444;
  box-shadow: 0 0 38px rgba(239, 68, 68, 0.5), 0 16px 40px rgba(0, 0, 0, 0.85);
}

.lightbox-container.is-youtube .lightbox-close-btn:hover {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
}

/* Twitch přehrávač – fialový rámeček a záře */
.lightbox-container.is-twitch {
  border-color: #9146ff;
  box-shadow: 0 0 38px rgba(145, 70, 255, 0.5), 0 16px 40px rgba(0, 0, 0, 0.85);
}

.lightbox-container.is-twitch .lightbox-close-btn:hover {
  background: #9146ff;
  color: #fff;
  box-shadow: 0 0 12px rgba(145, 70, 255, 0.6);
}

.lightbox-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.lightbox-close-btn {
  position: absolute;
  top: -44px;
  right: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.lightbox-close-btn:hover {
  background: rgba(239, 68, 68, 0.8);
  transform: rotate(90deg);
}

/* ==============================================================================
   Administrace
   ============================================================================== */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.admin-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.admin-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.form-input, .form-select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.875rem;
  transition: var(--transition);
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--color-primary-accent);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}

/* Autocomplete vyhledávání her z Twitch API v administraci */
.autocomplete-wrapper {
  position: relative;
}

.input-with-spinner,
.input-with-clear {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-with-spinner .form-input,
.input-with-clear .form-input {
  width: 100%;
  padding-right: 2.5rem;
}

.input-spinner-icon {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary-accent);
  pointer-events: none;
}

.game-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 1000;
  background: #13131a;
  border: 2px solid var(--color-primary-accent, #9146FF);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.8), 0 0 24px rgba(145, 70, 255, 0.25);
  max-height: 380px;
  overflow-y: auto;
  animation: fadeInDown 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-autocomplete-item,
.collection-autocomplete-item {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 1.15rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: var(--transition);
  box-sizing: border-box;
}

.game-autocomplete-item {
  min-height: 96px;
}

.collection-autocomplete-item {
  min-height: 54px;
  gap: 1rem;
  padding: 0.6rem 0.85rem;
}

.game-autocomplete-item:last-child,
.collection-autocomplete-item:last-child {
  border-bottom: none;
}

.game-autocomplete-item:hover,
.game-autocomplete-item:focus,
.collection-autocomplete-item:hover,
.collection-autocomplete-item:focus {
  background: rgba(145, 70, 255, 0.16);
  outline: none;
}

.game-autocomplete-item:active,
.collection-autocomplete-item:active {
  background: rgba(145, 70, 255, 0.28);
}

.game-autocomplete-thumb {
  width: 60px !important;
  height: 80px !important;
  min-width: 60px !important;
  max-width: 60px !important;
  min-height: 80px !important;
  max-height: 80px !important;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0 !important;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-sm);
  display: block;
}

.collection-autocomplete-thumb {
  width: 72px !important;
  height: 38px !important;
  min-width: 72px !important;
  max-width: 72px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0 !important;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-sm);
  display: block;
}

.game-autocomplete-info {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  flex: 1 1 auto;
  min-width: 0;
}

.game-autocomplete-name {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.35;
  word-break: break-word;
  display: block;
}

.game-autocomplete-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 0.8s linear infinite;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1.25rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary:hover {
  background: var(--color-primary-accent);
  box-shadow: 0 0 16px var(--color-primary-glow);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--border-accent);
}

/* Flash zprávy */
.alert {
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.alert-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

/* Tabulka nezařazených */
.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th, .data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  background: var(--bg-card);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ==============================================================================
   Responzivita
   ============================================================================== */
@media (max-width: 900px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header-container {
    flex-wrap: wrap;
  }
  
  .video-row-card {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .video-thumb-wrap {
    width: 100%;
  }

  .video-action-btn {
    width: 100%;
    justify-content: center;
  }

  .collections-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

@media (max-width: 640px) {
  .collection-section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .collection-search-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .search-input-box {
    width: 100%;
  }
}

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

/* ==============================================================================
   Přehled návštěvnosti v administraci
   ============================================================================== */
.traffic-analytics-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.traffic-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.traffic-badge-human {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 2px 7px;
  border-radius: 4px;
}

.traffic-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.traffic-stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.traffic-stat-box:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.traffic-stat-box-highlight {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(99, 44, 160, 0.12) 100%);
  border-color: var(--border-accent);
}

.traffic-stat-period {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.traffic-stat-main {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.traffic-stat-label {
  font-size: 0.8rem;
  color: var(--color-primary-accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.traffic-stat-views {
  font-size: 0.78rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.4rem;
  margin-top: auto;
}

.traffic-top-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.25rem;
}

.traffic-top-column {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.traffic-top-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.traffic-top-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.traffic-top-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  transition: var(--transition);
}

.traffic-top-item.is-playable {
  cursor: pointer;
  user-select: none;
}

.traffic-top-item.is-playable:hover {
  background: rgba(145, 70, 255, 0.12);
  border-color: var(--color-primary-accent);
  transform: translateX(2px);
}

.traffic-top-play-icon {
  color: var(--color-primary-accent);
  opacity: 0.7;
  flex-shrink: 0;
  transition: transform var(--transition), opacity var(--transition);
}

.traffic-top-item.is-playable:hover .traffic-top-play-icon {
  opacity: 1;
  transform: scale(1.15);
}

.traffic-top-rank {
  font-weight: 700;
  color: var(--color-primary-accent);
  font-size: 0.8rem;
  min-width: 22px;
}

.traffic-top-name {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.traffic-top-name:hover {
  color: var(--color-primary-accent);
}

.traffic-top-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 500;
}

.traffic-top-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 0.5rem 0;
}

/* ==============================================================================
   Chybová stránka 404 (malýBobr Error Experience)
   ============================================================================== */

.error-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 180px);
  padding: 2.5rem 1.25rem;
}

.error-card {
  max-width: 620px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 3rem 2.25rem;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 40px var(--color-primary-glow);
  position: relative;
  overflow: hidden;
}

.error-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(145, 70, 255, 0.12);
  border: 1px solid rgba(145, 70, 255, 0.3);
  color: var(--color-primary-accent);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.5rem;
}

.error-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.error-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  user-select: none;
}

.error-number {
  font-size: clamp(4.5rem, 14vw, 7.5rem);
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, #f4f4f7 0%, var(--color-primary-accent) 50%, var(--color-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.04em;
  filter: drop-shadow(0 6px 16px rgba(145, 70, 255, 0.4));
}

.error-avatar-wrap {
  position: relative;
  width: clamp(70px, 16vw, 105px);
  height: clamp(70px, 16vw, 105px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: bobrFloat 3.5s ease-in-out infinite;
}

.error-avatar {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.45));
}

@keyframes bobrFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(3deg); }
}

.error-title {
  font-size: clamp(1.4rem, 4vw, 1.85rem);
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.85rem;
  line-height: 1.25;
}

.error-description {
  font-size: 0.98rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 500px;
  margin: 0 auto 2rem auto;
}

.error-countdown-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.4rem;
  margin-bottom: 2rem;
  text-align: left;
}

.error-countdown-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  font-size: 0.92rem;
  color: var(--text-main);
}

.error-countdown-header strong {
  color: var(--color-primary-accent);
  font-size: 1.05rem;
}

.error-countdown-icon {
  font-size: 1.2rem;
}

.error-progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.error-progress-bar {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-accent));
  border-radius: var(--radius-full);
  box-shadow: 0 0 10px var(--color-primary-glow);
  transition: width 0.05s linear;
}

.error-actions {
  display: flex;
  justify-content: center;
}

.btn-error-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-accent) 100%);
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.95rem 2rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  box-shadow: 0 8px 24px var(--color-primary-glow);
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.15);
  width: 100%;
  max-width: 380px;
}

.btn-error-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(145, 70, 255, 0.45);
  color: #ffffff;
}

.btn-error-primary:active {
  transform: translateY(0);
}

.btn-arrow-icon {
  transition: transform 0.2s ease;
}

.btn-error-primary:hover .btn-arrow-icon {
  transform: translateX(4px);
}

@media (max-width: 480px) {
  .error-card {
    padding: 2rem 1.25rem;
  }
  .btn-error-primary {
    font-size: 0.95rem;
    padding: 0.85rem 1.25rem;
  }
}


/* ==============================================================================
   Jednotný horní přepínač sekcí (Záznamy | Dohrané hry, veřejný web i admin)
   ============================================================================== */
.header-left-group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.header-nav-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
}

.header-nav-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.95rem;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.header-nav-pill:hover {
  color: var(--text-main);
  background: var(--bg-card-hover);
}

.header-nav-pill.active {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: #ffffff;
  box-shadow: 0 2px 10px var(--color-primary-glow);
}

@media (max-width: 720px) {
  .header-container {
    flex-wrap: wrap;
  }
  .header-left-group {
    width: 100%;
    justify-content: space-between;
    gap: 0.75rem;
  }
}
