
  /* Herní mřížka 5×5 bez mezer */
  .board-container {
    display: grid;
    grid-template-columns: repeat(var(--level), var(--cell));
    grid-template-rows: repeat(var(--level), var(--cell));
    gap: 0;
    width: calc(var(--level) * var(--cell));
    margin: 1rem auto;
  }

  .cell {
    width: var(--cell);
    height: var(--cell);
  }

  /* Zaručí, že SVG vyplní buňku beze ztráty poměru */
  .cell svg {
    width: 100%;
    height: 100%;
  }

  .cell.loop {
    background-color: #ffaaaa;
  }

  .cell.source {
    background: radial-gradient(circle, #1e90ff 0%, #ffffff 70%);
  }

  .game-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50vw;
    height: 50vh;
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.game-overlay.show {
    display: flex;
}

.game-overlay h2 {
    margin-bottom: 20px;
    font-size: 2rem;
    color:#fff;
}

.game-overlay .time {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

#board {max-width: 100%;}

@media (max-width: 600px) {
    .game-overlay {
      inset: 0;          /* top:0; right:0; bottom:0; left:0; */
      width: 100vw;      /* šířka celé viewport šířky  */
      height: 100dvh;    /* 100 % výšky včetně dynamického viewportu */
      transform: none;   /* vycentrování už není potřeba */
    }
    #board {
        transform: scale(0.8);
        transform-origin: top left;
        margin-top: 0;
        margin-left: 0;
    }
  }