#hlasovani {
  background-color: #1a1b1f;
  padding: 30px 15px;
  border-radius: 12px;
  max-width: 1000px;
  margin: 20px auto;
}

/* GRID rozložení fotek */
#hlasovaci-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  position: relative; /* kvůli overlayu a vote-message */
}

/* Styl pro jednotlivé fotky */
.foto-box {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background-color: #111;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}

.foto-box:hover {
  transform: scale(1.02);
}

.foto-box img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
  cursor: pointer;
}

/* Počet hlasů */
.vote-count {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: rgba(0,0,0,0.7);
  color: white;
  padding: 5px 10px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 15px;
}

/* Tlačítko hlasování */
.vote-button {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: #ff4d4d;
  color: white;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  font-size: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.vote-button:hover {
  transform: scale(1.2);
}

.vote-button.pulse {
  animation: pulse 0.4s ease;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.5); }
  100% { transform: scale(1); }
}

/* Hláska pod fotkami */
#vote-message {
  position: relative;
  z-index: 1010;
  text-align: center;
  margin-top: 10px;
  font-weight: bold;
  font-size: 16px;
  color: #0f0;
  background: rgba(0, 0, 0, 0.6);
  padding: 10px 15px;
  border-radius: 8px;
  transition: opacity 0.3s ease;
}

/* Styl pro top žebříček */
.top-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 600px;
  margin: auto;
  padding: 20px 10px;
}

.top-item-vertical {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: #111;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
  padding: 10px 15px;
  width: 100%;
  gap: 15px;
  color: white;
}

.top-item-vertical img {
  width: 80px;
  height: auto;
  border-radius: 8px;
  cursor: pointer;
}

.top-number {
  font-size: 22px;
  font-weight: bold;
  color: #fff;
  width: 40px;
  text-align: center;
}

.top-votes {
  font-size: 16px;
  font-weight: bold;
  color: #0f0;
  margin-left: auto;
}

/* Efekt zobrazení */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

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

.nejslabsi {
  border: 3px solid #4caf50;
}

.nejsilnejsi {
  border: 3px solid #f44336;
}

/* Překryv při načítání */
#overlay-loading {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 2em;
  font-weight: bold;
  text-shadow: 1px 1px 2px black;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

#overlay-loading.show {
  opacity: 1;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 4px solid rgba(255, 0, 0, 0.3);
  border-top: 4px solid red;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
.vote-button.hidden {
  display: none;
}