/* 🚫 GLOBÁLNÍ SKRYTÍ POSUVNÍKU PRO CELOU STRÁNKU */
html, body {
  scrollbar-width: none;              /* Pro Firefox */
  -webkit-overflow-scrolling: touch; /* Hladké skrolování */
  min-height: 100dvh;                /* 🌟 Dynamická výška zohledňující mobilní adresní řádek */
  box-sizing: border-box;
}

/* Pro Chrome, Edge, Safari a Operu */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none !important;
}

body {
  font-family: Arial, sans-serif;
  background: #f5f5f5;
  margin: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 65px; /* 🌟 PUSH OBSAHU: Jelikož je topbar teď fixed, musíme obsah posunout dolů */
  height: auto;
}

/* 🔒 Zámek scrollování při otevřeném menu */
body.no-scroll {
  overflow: hidden !important;
}

/* ==========================================================================
   CONTAINER
   ========================================================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* ==========================================================================
   TOPBAR & ACTIONS
   ========================================================================== */
.topbar {
  background: linear-gradient(135deg, #3498db, #2ecc71);
  color: white;
  padding: 7px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  
  /* 🌟 ZMĚNA NA FIXED: Fixní pozice drží topbar spolehlivě u viditelného okraje */
  position: fixed;
  left: 0;
  right: 0;
  top: var(--topbar-offset, 0px);
  width: 100%;
  box-sizing: border-box;
  z-index: 1500;
}

.title {
  font-size: 18px;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   KONTEJNER PRO LUPU A VYHLEDÁVÁNÍ
   ========================================================================== */
.search-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-grow: 1;
  max-width: 130px;
  transition: max-width 0.2s ease;
}

@media (min-width: 600px) {
  .search-container.search-active {
    max-width: 220px;
  }
}

.search-container #search::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.search-container #search:focus {
  background: rgba(255, 255, 255, 0.3);
}

.search-container.search-active #toggle-search {
  display: none;
}

.search-container #search {
  display: block;
  width: 0;
  padding: 0;
  opacity: 0;
  transition: width 0.2s ease, padding 0.2s ease, opacity 0.2s ease;
  pointer-events: none;
  font-size: 16px;
  border-radius: 10px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  outline: none;
  box-sizing: border-box;
}

.search-container.search-active #search {
  width: 100%;
  padding: 8px 12px;
  opacity: 1;
  pointer-events: auto;
}

input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  height: 18px;
  width: 18px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'><path d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/></svg>");
  background-size: contain;
  cursor: pointer;
}

/* ==========================================================================
   ZÁKLADNÍ TLAČÍTKA V TOPBARU A BOČNÍM PANELU
   ========================================================================== */
.switch-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .switch-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
  }
}

/* ==========================================================================
   BOČNÍ PANEL (DRAWER) & OVERLAY
   ========================================================================== */
.drawer-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.drawer-overlay.show {
  display: block;
  opacity: 1;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100%;
  background: white;
  z-index: 2000;
  box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  color: #333;
}

.drawer.show {
  transform: translateX(0);
}

.drawer-header {
  background: #f5f5f5;
  padding: 11px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #eee;
}

.drawer-header h3 {
  margin: 0;
  font-size: 16px;
}

.close-btn {
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  color: #888;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .close-btn:hover {
    color: #333;
  }
}

.drawer-body {
  padding: 12px 16px;
  flex-grow: 1;
  overflow-y: auto;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
  padding-bottom: 5px;
  border-bottom: 1px solid #f0f0f0;
}

.setting-label {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer .switch-btn {
  background: #F0F0F0;
  border: none;
  color: #333333;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 6px;
  box-sizing: border-box;
}

@media (hover: hover) {
  .category-btn:hover,
  .drawer .switch-btn:hover {
    background: #e0e0e0 !important;
    color: #000000 !important;
  }
  .category-btn:not(.active):hover,
  .drawer .switch-btn:not(.active):hover {
    background: #e0e0e0;
    color: #000000;
  }
}

.drawer .switch-btn.active,
.category-btn.active {
  background: linear-gradient(135deg, #2CA5AE 0%, #299CA5 100%) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  color: white !important;
  border: none !important;
}

@media (hover: hover) {
  .category-btn.active:hover,
  .drawer .switch-btn.active:hover {
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.15) !important;
    color: white !important;
  }
}

.setting-info {
  background: #f9f9f9;
  padding: 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
  margin-top: 12px;
}
.setting-info h4 { margin: 0 0 4px 0; font-size: 14px; }
.setting-info p { margin: 2px 0; color: #666; }

/* 🎲 TLAČÍTKO PRO NÁHODNÝ ZVUK */
.random-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #28AF8F 0%, #1E9075 100%);
  color: white;
  border: none;
  border-radius: 10px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

@media (hover: hover) {
  .random-btn:hover {
    background-blend-mode: multiply;
    background-color: rgba(0, 0, 0, 0.12); 
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
  }
  .random-btn:hover i {
    animation: rotateDice 0.5s ease-in-out;
  }
}

.random-btn:active,
.random-btn.press-flash {
  transform: translateY(2px);
  background-blend-mode: multiply;
  background-color: rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.2);   
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.random-btn:focus,
.random-btn:focus-visible {
  outline: none !important;
}

@keyframes rotateDice {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ==========================================================================
   🌟 KATEGORIE UVNITŘ BOČNÍHO PANELU
   ========================================================================== */
.setting-category-section {
  margin-bottom: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
  width: 100%; 
  box-sizing: border-box;
}

#categories {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;                                                   
  width: 100%;           
  padding: 0;
  box-sizing: border-box;
}

.category-btn {
  width: 100%;
  margin: 0;
  padding: 8px 2px;       
  font-size: 13px;        
  font-weight: 600;
  border: none;
  border-radius: 10px;
  background: #F0F0F0;
  color: #333333;
  text-align: center;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  transition: transform 0.1s ease, background 0.15s ease;
  min-height: 32px;
  -webkit-tap-highlight-color: transparent;
}

.category-btn:active {
  transform: scale(0.96);
}

/* ==========================================================================
   🛑 PLOVOUCÍ STOP TLAČÍTKO (FAB)
   ========================================================================== */
.stop-fab {
  position: fixed;
  bottom: 25px; 
  right: 25px;    
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #e74c3c;
  color: white;
  border: 2px solid #ffffff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
  z-index: 2100;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.stop-fab.show {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

@media (hover: hover) {
  .stop-fab:hover {
    background: #c0392b;
  }
}

.stop-fab:active {
  transform: scale(0.95);
}

/* ==========================================================================
   🌙 STYLY PRO DARK MODE
   ========================================================================== */
body.dark-mode {
  background: #121212;
  color: #f5f5f5;
}

body.dark-mode .drawer {
  background: #1e1e1e;
  color: #f5f5f5;
}

body.dark-mode .drawer-header {
  background: #252525;
  border-bottom-color: #333;
}

body.dark-mode .close-btn { color: #aaa; }
@media (hover: hover) {
  body.dark-mode .close-btn:hover { color: #fff; }
  body.dark-mode #categories .category-btn:hover,
  body.dark-mode .drawer .switch-btn:hover {
    background: #303030;
    color: #fff;
  }
  body.dark-mode #categories .category-btn.active:hover,
  body.dark-mode .drawer .switch-btn.active:hover {
    background: linear-gradient(135deg, #1F7B82 0%, #1D737A 100%) !important; 
    color: #ffffff !important;
  }
  body.dark-mode .random-btn:hover {
    background-blend-mode: multiply;
    background-color: rgba(0, 0, 0, 0.15) !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3) !important;
  }
}

body.dark-mode .setting-item { border-bottom-color: #2d2d2d; }
body.dark-mode .setting-category-section { border-bottom-color: #2d2d2d; }
body.dark-mode .setting-info { background: #252525; }
body.dark-mode .setting-info p { color: #aaa; }

body.dark-mode #categories .category-btn,
body.dark-mode .drawer .switch-btn {
  background: #252525;
  color: #cbcbcb;
  border: none;
}

body.dark-mode #categories .category-btn.active,
body.dark-mode .drawer .switch-btn.active {
  background: linear-gradient(135deg, #1F7B82 0%, #1D737A 100%) !important; 
  color: #ffffff !important;      
  border: none !important;
  box-shadow: 0 4px 15px rgba(26, 82, 118, 0.4) !important; 
}

body.dark-mode .random-btn {
  background: linear-gradient(135deg, #28AF8F 0%, #1E9075 100%) !important; 
  color: #ffffff !important;      
}

body.dark-mode .random-btn:active,
body.dark-mode .random-btn.pressed,
body.dark-mode .random-btn.press-flash {
  transform: translateY(2px) !important;
  background-blend-mode: multiply !important;
  background-color: rgba(0, 0, 0, 0.35) !important;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4) !important;   
}

body.dark-mode input:checked + .slider { background: #ffffff !important; }
body.dark-mode input:checked + .slider:before { background-color: #121212 !important; }

body.dark-mode .category-title {
  background: rgba(30, 30, 30, 0.75);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .stop-fab { box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5); }

/* ==========================================================================
   GROUPED LAYOUT
   ========================================================================== */
.category-section {
  width: 100%;
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.category-title {
  display: inline-block;
  text-align: center;
  font-size: 16px;
  color: #2d2d2d;
  box-sizing: border-box;
  position: sticky;
  top: 57px;
  z-index: 10;
  background: rgba(245, 245, 245, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 10px;
  padding: 6px 12px;
  margin: 0 0 12px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   GRID LAYOUTY
   ========================================================================== */
.sound-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 125px);
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 0 10px;
}

#board {
  display: grid;
  grid-template-columns: repeat(auto-fill, 125px);
  justify-content: center;
  gap: 12px;
  padding: 10px;
}

/* ==========================================================================
   SOUND BUTTON
   ========================================================================== */
.sound-btn {
  position: relative; 
  height: 65px;
  width: 125px;
  border-radius: 10px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5px;
  box-sizing: border-box;

  -webkit-touch-callout: none;        /* Zakáže nativní iOS kontextové menu (iOS Callout) */
  -webkit-user-select: none;          /* Pro Safari na iOS (klíčové pro iPhone!) */
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .sound-btn:hover {
    box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.12);
  }
}

/* 🌟 Aktivní stav POUZE pro zařízení s myší (PC), aby mobily neblikaly */
@media (hover: hover) {
  .sound-btn:active {
    box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.25), inset 0 2px 6px rgba(0, 0, 0, 0.2);
    transform: translateY(2px) !important;
  }
}

/* 📱 Klikací stav pro mobily (řízený čistě tvým JavaScriptem přes třídu) */
.sound-btn.active,
.sound-btn.touch-pressed {
  box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.25), inset 0 2px 6px rgba(0, 0, 0, 0.2);
  transform: translateY(2px) !important;
}

/* 🌟 Vynucený vizuální "proklik" efekt při otevření kontextového menu (i u velmi rychlého pravého kliku) */
.sound-btn.context-flash {
  box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.25), inset 0 2px 6px rgba(0, 0, 0, 0.2);
  transform: translateY(2px) !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* ==========================================================================
   🔗 SPODNÍ ODKAZY
   ========================================================================== */
.contact-link,
.beer-link {
  color: #2BA4AD !important;
  text-decoration: none;
  font-weight: bold;
  display: inline;
  transition: filter 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .contact-link:hover,
  .beer-link:hover {
    text-decoration: underline;
    filter: brightness(0.85) !important; 
  }
}

.beer-link i {
  display: inline-block;
  margin-right: 2px;
  animation: beerClink 3s infinite ease-in-out;
}

body.dark-mode .contact-link,
body.dark-mode .beer-link {
  color: #3aa6b0 !important;
}

@media (hover: hover) {
  body.dark-mode .contact-link:hover,
  body.dark-mode .beer-link:hover {
    filter: brightness(1.15) !important; 
  }
}

@keyframes beerClink {
  0%, 100% { transform: rotate(0deg); }
  40% { transform: rotate(-10deg); }
  60% { transform: rotate(15deg); }
}

/* ==========================================================================
   AUTOMATICKÝ NAŠEPTÁVAČ
   ========================================================================== */
.search-suggestions {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  z-index: 1000;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

body.dark-mode .search-suggestions {
  background: rgba(44, 62, 80, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.search-suggestions.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.suggestion-tag {
  background: #eef2f3;
  border: none;
  color: #333;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  width: 100%;          
  text-align: center;
  box-sizing: border-box; 
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .suggestion-tag:hover {
    background: #3498db;
    color: white;
  }
  body.dark-mode .suggestion-tag:hover {
    background: #2ecc71;
    color: white;
  }
}

.suggestion-tag:active {
  transform: scale(0.98);
}

body.dark-mode .suggestion-tag {
  background: #34495e;
  color: #ecf0f1;
}

.suggestions-heading {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #7f8c8d;
  padding: 6px 8px 4px 8px;
  text-align: left;      
  width: 100%;
  box-sizing: border-box;
  display: block;
}

body.dark-mode .suggestions-heading { color: #bdc3c7; }

/* ==========================================================================
   📑 VLASTNÍ KONTEXTOVÉ MENU
   ========================================================================== */
.context-menu {
  display: none;
  position: absolute;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 5px;
  min-width: 190px;
  z-index: 3000;
  box-sizing: border-box;
  animation: contextMenuFadeIn 0.15s ease;
}

@keyframes contextMenuFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes contextMenuFadeOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-4px) scale(0.97);
  }
}

.context-menu.closing {
  animation: contextMenuFadeOut 0.18s ease forwards;
}

body.dark-mode .context-menu {
  background: rgba(30, 30, 30, 0.85);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  text-align: left;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.12s, color 0.12s;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body.dark-mode .context-menu-item { color: #f5f5f5; }

@media (hover: hover) {
  .context-menu-item:hover {
    background: #3498db;
    color: white;
  }
  body.dark-mode .context-menu-item:hover {
    background: #ffffff;
    color: #121212;
  }
}

.context-menu-item i {
  font-size: 14px;
  width: 16px;
  text-align: center;
}

.category-btn i { margin-right: 4px; }

#btn-toggle-sort,
#btn-toggle-dark-mode {
  min-height: 32px !important;
  height: 32px !important;
  width: 60px !important;
  min-width: 60px !important;
  max-width: 60px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  font-size: 15px !important;
  border-radius: 8px !important;
  box-sizing: border-box !important;
  -webkit-tap-highlight-color: transparent;
}

body.dark-mode .setting-info p { color: #aaa !important; }
body.dark-mode .setting-info p[style*="border-top"] { border-top-color: rgba(255, 255, 255, 0.08) !important; }

/* ==========================================================================
   🔗 JEDNOTNÝ VZHLED PRO SDÍLENÉ ZVUKOVÉ TLAČÍTKO (SINGLE VIEW)
   ========================================================================== */
#board p + .category-section .sound-btn {
  background: linear-gradient(to left, #32AEAE 0%, #31B59F 100%) !important;
  color: white !important;
  height: 62px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 13px !important;
}

/* 🌟 Jemné pulzování pro sdílené tlačítko, ať přitáhne pozornost jako jediná akce na stránce */
@keyframes sharedSoundPulse {
0% {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 0 rgba(49, 178, 168, 0.6);
  }
70%, 100% {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 10px rgba(49, 178, 168, 0);
  }
}

#board p + .category-section .sound-btn {
  animation: sharedSoundPulse 3s ease-in-out infinite;
}

/* 🌟 Po prvním přehrání zvuku pulzování natrvalo vypneme */
#board p + .category-section .sound-btn.pulse-stopped {
  animation: none !important;
}

@media (hover: hover) {
  #board p + .category-section .sound-btn:hover {
    background-blend-mode: multiply !important;
    background-color: rgba(0, 0, 0, 0.15) !important; 
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2) !important;
    color: white !important;
  }
}

#board p + .category-section .sound-btn:active,
#board p + .category-section .sound-btn.active,
#board p + .category-section .sound-btn.touch-pressed {
  box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.25), inset 0 2px 6px rgba(0, 0, 0, 0.2);
  transform: translateY(2px) !important;
}

/* ==========================================================================
   🔙 TLAČÍTKO NÁVRATU NA CELÝ SOUNDBOARD (u sdíleného zvuku)
   ========================================================================== */
.back-to-board-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin: 30px auto 10px auto;
  padding: 10px 20px;
  background: transparent;
  color: #777;
  border: 1px solid rgba(0, 0, 0, 0.15);
  font-size: 14px;
  font-weight: 600;
  border-radius: 20px;
  box-shadow: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .back-to-board-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #333;
    border-color: rgba(0, 0, 0, 0.25);
  }
}

.back-to-board-btn:active {
  transform: scale(0.97);
}

body.dark-mode .back-to-board-btn {
  color: #aaa;
  border-color: rgba(255, 255, 255, 0.15);
}

@media (hover: hover) {
  body.dark-mode .back-to-board-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
  }
}

/* Vycentrování textu "Někdo ti posílá..." */
#board p {
  text-align: center !important;
  margin: 10px auto 20px auto !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
}

/* Wrapper pro ikonku a bublinu */
.legal-tooltip-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.legal-icon {
  font-size: 13px;
  color: #888;
  transition: color 0.2s ease;
}

/* Zvýraznění ikonky při aktivaci/hoveru */
.legal-icon:hover,
.legal-tooltip-wrapper.active .legal-icon {
  color: #2BA4AD;
}

/* Samotná schovaná bublina s textem */
.legal-tooltip-box {
  position: absolute;
  bottom: 130%;
  left: 55px;
  transform: translateX(-50%) translateY(5px);
  width: 210px;
  background-color: #222;
  color: #fff;
  text-align: center;
  padding: 8px 12px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  font-size: 12px;
  font-weight: normal;
  line-height: 1.4;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 3500; /* Nad bočním panelem */
}

/* 💻 Zobrazení pro PC (najetí myší) */
@media (hover: hover) {
  .legal-tooltip-wrapper:hover .legal-tooltip-box {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }
}

/* 📱 Zobrazení pro mobily (přes JS třídu) */
.legal-tooltip-wrapper.active .legal-tooltip-box {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Vynucení tmavého pozadí bubliny i v Dark Mode, aby text nesplýval */
body.dark-mode .legal-tooltip-box {
  background-color: #000;
  color: #fff;
}