
body {
  margin: 0;
  font-family: sans-serif;
}

header {
  background-color: #333;
  color: white;
  padding: 16px;
  text-align: center;
}

nav {
  position: sticky;
  top: 0;
  background-color: #222;
  z-index: 10;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 8px 16px;
  display: flex;
  gap: 16px;
}

nav a {
  color: white;
  text-decoration: none;
}

.gallery {
  padding: 16px;
  /* TODO: dodaj clearfix dla .gallery (::after z clear: both) */
}

.photo-item {
  position: relative;
  float: left;
  width: 30%;
  margin: 1.5%;
}

.photo-item img {
  width: 100%;
  display: block;
  cursor: pointer;
  border-radius: 6px;
  transition: box-shadow 0.2s ease;
}

.photo-item img:hover {
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.25);
}

.photo-item img.bounce {
  animation: miniBounce 0.25s ease;
}

@keyframes miniBounce {
  0% {
    transform: scale(1) rotate(0);
  }

  40% {
    transform: scale(0.96) rotate(-1deg);
  }

  70% {
    transform: scale(1.02) rotate(1deg);
  }

  100% {
    transform: scale(1) rotate(0);
  }
}

.photo-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  margin: 0;
  padding: 6px 0;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  text-align: center;
  box-sizing: border-box;
}

.random-container {
  clear: both;
  display: flex;
  justify-content: center;
  padding: 20px 16px 30px;
}

#randomButton {
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  background: #333;
  color: white;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

#randomButton:hover {
  background: #555;
  transform: translateY(-2px);
}

#randomButton:active {
  transform: scale(0.96);
}

footer {
  background-color: #333;
  color: white;
  text-align: center;
  padding: 12px;
  clear: both;
}

#snakeTrigger {
  display: inline-block;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}

#snakeTrigger:hover {
  color: #b8ff65;
}

#snakeTrigger:focus-visible {
  outline: 2px solid #b8ff65;
  outline-offset: 5px;
}

/* Snake game overlay */
.snake-overlay[hidden] {
  display: none;
}

.snake-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.85);
  overflow-y: auto;
}

.snake-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  padding: 20px;
  border: 1px solid #35444e;
  border-radius: 18px;
  background: #18232c;
  color: white;
  text-align: center;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.5);
}

.snake-panel h2 {
  margin: 0 0 8px;
  color: #b8ff65;
  font-size: 28px;
}

.game-info {
  margin: 8px 0 14px;
  font-size: 18px;
}

#snakeScore {
  color: #b8ff65;
  font-weight: bold;
}

#snakeCanvas {
  display: block;
  width: 100%;
  max-width: 400px;
  height: auto;
  margin: 0 auto;
  border: 2px solid #35444e;
  border-radius: 8px;
  touch-action: none;
}

#snakeMessage {
  min-height: 24px;
  margin: 14px 0;
  color: #d7e1e8;
}

.close-snake {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: #34434e;
  color: white;
  font-size: 18px;
  cursor: pointer;
}

.game-buttons button,
.mobile-controls button {
  border: none;
  border-radius: 9px;
  background: #b8ff65;
  color: #142019;
  font-weight: bold;
  cursor: pointer;
}

.game-buttons button {
  padding: 11px 18px;
}

.game-buttons button:hover,
.mobile-controls button:hover {
  background: #d0ff9b;
}

.mobile-controls {
  display: none;
  margin-top: 16px;
}

.mobile-controls button {
  width: 48px;
  height: 42px;
  margin: 3px;
  font-size: 18px;
}

@media (max-width: 600px) {
  .snake-panel {
    padding: 14px;
  }

  .mobile-controls {
    display: block;
  }
}

/* TODO: dodaj regułę @media dla ekranów do 768px (.photo-item width: 46%) */

/* TODO: dodaj regułę @media dla ekranów do 480px (.photo-item width: 96%, float: none) */
